/* Iron Maze — wooden theme, matching the app palette */
:root {
  --board-top: #d39c5e;
  --board-bot: #9e6b38;
  --panel:     #754d24;
  --frame:     #4c2e12;
  --ink:       #3d240d;
  --cream:     #f7ebd4;
  --gold:      #ebb347;
  --grain:     #8c5726;
  --lava-top:  #ffc733;
  --lava-bot:  #d92910;
  --good:      #4099ff;
  --bad:       #f23340;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(30, 16, 4, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--cream);
  background:
    repeating-linear-gradient(0deg, rgba(140,87,38,.10) 0 2px, transparent 2px 34px),
    linear-gradient(160deg, var(--board-top), var(--board-bot) 60%, var(--panel));
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 620px; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(61, 36, 13, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(235, 179, 71, .25);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.2rem; color: var(--cream); text-decoration: none; }
.brand-mark { color: var(--gold); display: inline-flex; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--cream); text-decoration: none; font-weight: 700; font-size: .95rem; opacity: .9; }
.nav-links a:hover { opacity: 1; color: var(--gold); }

/* BUTTONS */
.btn {
  display: inline-block; cursor: pointer; border: none;
  background: var(--gold); color: var(--ink);
  font-family: inherit; font-weight: 800; font-size: 1rem;
  padding: 12px 22px; border-radius: 12px; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-lg { padding: 15px 28px; font-size: 1.08rem; }
.btn-ghost { background: transparent; color: var(--cream); box-shadow: none; border: 2px solid rgba(247,235,212,.4); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* HERO */
.hero { padding: 64px 0 40px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -.5px; text-shadow: 0 3px 8px rgba(30,16,4,.4); }
.lede { margin: 18px 0 26px; font-size: 1.12rem; color: rgba(247,235,212,.92); max-width: 34ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-facts { list-style: none; display: flex; gap: 26px; margin-top: 28px; }
.hero-facts li { font-size: .95rem; opacity: .85; }
.hero-facts strong { display: block; font-size: 1.5rem; color: var(--gold); }

/* HERO ART — mini board */
.hero-art { display: flex; justify-content: center; perspective: 900px; }
.board {
  position: relative; width: 260px; height: 260px; border-radius: 20px;
  background: repeating-linear-gradient(0deg, rgba(76,46,18,.18) 0 3px, transparent 3px 22px),
              linear-gradient(160deg, var(--board-top), var(--board-bot));
  border: 6px solid var(--frame); box-shadow: var(--shadow), inset 0 0 30px rgba(30,16,4,.3);
  /* Gentle 3D sway, as if strapped to a moving wrist (its own timing, so nothing looks locked). */
  transform-style: preserve-3d;
  animation: sway 9s ease-in-out infinite;
}
@keyframes sway {
  0%   { transform: rotateX(7deg)  rotateY(-8deg) rotateZ(-1deg); }
  20%  { transform: rotateX(-3deg) rotateY(6deg)  rotateZ(1.5deg); }
  45%  { transform: rotateX(8deg)  rotateY(7deg)  rotateZ(-1deg); }
  68%  { transform: rotateX(-6deg) rotateY(-4deg) rotateZ(1deg); }
  100% { transform: rotateX(7deg)  rotateY(-8deg) rotateZ(-1deg); }
}
.board .wall { position: absolute; height: 12px; border-radius: 6px;
  background: linear-gradient(var(--panel), var(--frame)); box-shadow: 0 2px 3px rgba(0,0,0,.35); }
.board .w1 { top: 28%; left: 0; width: 62%; }
.board .w2 { top: 55%; right: 0; width: 62%; }
.board .w3 { top: 80%; left: 0; width: 50%; }
.board .start { position: absolute; top: 10%; left: 12%; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #4ce072, #0f8c4c); box-shadow: 0 0 8px rgba(30,224,114,.5); }
.board .hole { position: absolute; bottom: 8%; right: 12%; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #000, #201205); border: 2px solid rgba(30,16,4,.7); }
.board .ball { position: absolute; top: 8%; left: 12%; width: 14px; height: 14px; border-radius: 50%;
  z-index: 3;   /* ride above the hole so it's visible resting in it before it sinks */
  background: radial-gradient(circle at 35% 30%, #fff, #6b6b6b); box-shadow: 0 2px 4px rgba(0,0,0,.5);
  animation: roll 9s infinite; }
/* Weaves through the wall gaps with gravity-like momentum: it accelerates into
   drops, carries speed through the corners (no dead stops), then bounces once and
   settles into the hole. Per-segment easing = the difference between "on rails"
   and "rolling on a tilting tray". */
@keyframes roll {
  0%   { top: 8%;  left: 12%; transform: scale(1); animation-timing-function: cubic-bezier(.45,.02,.75,.6); }  /* eases into a roll */
  11%  { top: 13%; left: 73%; animation-timing-function: cubic-bezier(.5,0,.9,.35); }   /* gravity — speeds up into the drop */
  22%  { top: 34%; left: 80%; animation-timing-function: cubic-bezier(.3,.5,.6,1); }    /* rolls left, keeping momentum */
  40%  { top: 42%; left: 16%; animation-timing-function: cubic-bezier(.5,0,.9,.35); }   /* gravity drop */
  52%  { top: 61%; left: 12%; animation-timing-function: cubic-bezier(.3,.5,.6,1); }    /* rolls right */
  64%  { top: 67%; left: 73%; animation-timing-function: cubic-bezier(.55,0,.95,.28); } /* the long fall toward the hole */
  73%  { top: 88%; left: 80%; transform: scale(1); animation-timing-function: cubic-bezier(.2,.75,.45,1); }  /* drops just past the hole, decelerating */
  79%  { top: 81%; left: 80%; transform: scale(1); animation-timing-function: cubic-bezier(.45,0,.8,.5); }   /* one small bounce up */
  86%  { top: 84%; left: 80%; transform: scale(1); animation-timing-function: cubic-bezier(.25,.9,.3,1); }   /* settles onto the hole and STOPS */
  93%  { top: 84%; left: 80%; transform: scale(1); animation-timing-function: ease-in; }                     /* rests in the hole (held still) */
  98%  { top: 84%; left: 80%; transform: scale(0); }   /* sinks in */
  100% { top: 84%; left: 80%; transform: scale(0); }   /* stays gone until the loop restarts */
}

/* FEATURE STRIP */
.strip { padding: 20px 0 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: rgba(76,46,18,.45); border: 1px solid rgba(235,179,71,.22); border-radius: var(--radius); padding: 22px; }
.feature h3 { font-size: 1.15rem; margin-bottom: 6px; }
.feature p { color: rgba(247,235,212,.85); font-size: .98rem; }

/* SECTIONS */
.section { padding: 56px 0; }
.section.alt { background: rgba(61,36,13,.35); }
.section h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); text-align: center; }
.section-sub { text-align: center; color: rgba(247,235,212,.8); max-width: 52ch; margin: 10px auto 28px; }

/* CARD */
.card {
  background: rgba(76,46,18,.55); border: 1.5px solid var(--frame);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  margin: 0 auto 20px; max-width: 720px;
}

/* LEADERBOARD TABLE */
.board-table { width: 100%; border-collapse: collapse; }
.board-table th, .board-table td { text-align: left; padding: 11px 12px; }
.board-table thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); border-bottom: 2px solid rgba(235,179,71,.3); }
.board-table tbody tr { border-bottom: 1px solid rgba(247,235,212,.12); }
.board-table tbody tr:nth-child(-n+3) td:first-child { color: var(--gold); font-weight: 900; }
.board-table td:nth-child(3) { font-variant-numeric: tabular-nums; font-weight: 800; }
.badge { font-size: .74rem; padding: 2px 8px; border-radius: 999px; font-weight: 800; }
.badge.classic { background: rgba(64,153,255,.18); color: #9cc8ff; }
.badge.lava { background: rgba(217,41,16,.2); color: #ff9576; }

/* FORMS */
.form h3 { margin-bottom: 14px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 14px; color: rgba(247,235,212,.9); }
.form input, .form select, .form textarea {
  width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 10px;
  border: 1.5px solid rgba(247,235,212,.25); background: rgba(30,16,4,.28);
  color: var(--cream); font-family: inherit; font-size: 1rem;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--gold); }
.form select option { color: #000; }
.form textarea { resize: vertical; }
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.form .check input { width: auto; margin: 0; }
.form-note { margin-top: 12px; font-size: .9rem; min-height: 1.2em; }
.form-note.ok { color: #8ee6a0; }
.form-note.err { color: #ffb0a6; }

/* FOOTER */
.footer { background: rgba(61,36,13,.7); padding: 34px 0 18px; margin-top: 40px; border-top: 1px solid rgba(235,179,71,.2); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--cream); text-decoration: none; font-weight: 700; opacity: .85; }
.footer-links a:hover { color: var(--gold); }
.muted { color: rgba(247,235,212,.65); font-size: .92rem; }
.copyright { text-align: center; color: rgba(247,235,212,.5); font-size: .82rem; margin-top: 22px; }

/* RESPONSIVE */
@media (max-width: 800px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 2; }
  .hero-art { order: 1; }
  .lede, .hero-cta { margin-left: auto; margin-right: auto; }
  .hero-facts { justify-content: center; }
  .grid-3 { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 520px) {
  .form .row { grid-template-columns: 1fr; }
  .board-table th:nth-child(4), .board-table td:nth-child(4) { display: none; }
}
