/* Studle content pages (Home, Contact). Same tokens and top bar as the game page. */
:root {
  --bg: #E6EBF7;
  --stage-hi: #F8FAFF;
  --surface: #FFFFFF;
  --ink: #1B2033;
  --muted: #5B6383;
  --line: #CBD3EB;
  --accent: #3B7BF0;
  --accent-deep: #2858B8;
  --accent-ink: #FFFFFF;
  --good: #1C9F62;
  --bad: #E0393E;
  --plate: #2E9A52;
  --plate-stud: #3CB262;
  --plate-edge: #237A40;
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121624; --stage-hi: #222941; --surface: #1C2134; --ink: #EDF0FA; --muted: #9EA7C6;
    --line: #2E3653; --accent: #6394FF; --accent-deep: #3A63C4; --accent-ink: #0D1120;
    --good: #3CCB89; --bad: #FF6A6E;
    --plate: #278647; --plate-stud: #339E58; --plate-edge: #1B6234;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.55; }
img { max-width: 100%; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1.5px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brick-mark { position: relative; width: 26px; height: 16px; border-radius: 4px; background: #E5484D; margin-top: 5px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); flex: 0 0 auto; }
.brick-mark::before, .brick-mark::after { content: ""; position: absolute; top: -5px; width: 8px; height: 5px; border-radius: 2px 2px 0 0; background: #E5484D; }
.brick-mark::before { left: 3px; } .brick-mark::after { right: 3px; }
.logo { font-family: var(--display); font-size: 28px; letter-spacing: .5px; line-height: 1; }
.site-nav { display: flex; gap: 2px; margin-left: 8px; }
.site-nav a { padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 15px; color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); background: var(--bg); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--bg); box-shadow: inset 0 -2px 0 var(--accent); }
.top .cta { margin-left: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 700 16px var(--body); text-decoration: none; cursor: pointer; box-shadow: 0 3px 0 var(--line);
  transition: transform .08s, box-shadow .08s; white-space: nowrap;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-deep); box-shadow: 0 3px 0 var(--accent-deep); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:active { box-shadow: 0 1px 0 var(--accent-deep); }
.btn.big { min-height: 56px; padding: 0 26px; font-size: 19px; }
.btn[disabled] { opacity: .6; cursor: default; }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(40px, 7vw, 68px); }
h2 { font-size: clamp(30px, 4.5vw, 42px); }
h3 { font-size: 22px; }
p { margin: 0; }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 34ch; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.prose { max-width: 65ch; color: var(--muted); }
.prose b, .prose strong { color: var(--ink); }

/* Sections */
section { padding-block: clamp(48px, 8vw, 88px); }
.section-head { display: grid; gap: 10px; margin-bottom: 32px; max-width: 640px; }
.band { background: var(--surface); border-block: 1.5px solid var(--line); }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 80px); background: radial-gradient(110% 90% at 75% 40%, var(--stage-hi), var(--bg) 70%); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero-copy { display: grid; gap: 20px; justify-items: start; min-width: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; font-weight: 700; color: var(--muted); }
.hero-meta span::before { content: "✓ "; color: var(--good); }
.hero-art { display: grid; place-items: center; }

/* Baseplate illustrations */
.board { display: grid; gap: var(--gap, 8px); padding: var(--gap, 8px); padding-bottom: calc(var(--gap, 8px) + 6px); background: var(--plate); border-radius: 16px; box-shadow: inset 0 -6px 0 var(--plate-edge), 0 14px 40px rgba(20, 40, 30, .2); }
.board.big { width: min(380px, 100%); grid-template-columns: repeat(5, 1fr); --gap: 8px; transform: rotate(-3deg); }
.board.mini { width: 132px; grid-template-columns: repeat(3, 1fr); --gap: 5px; border-radius: 10px; box-shadow: inset 0 -4px 0 var(--plate-edge), 0 4px 12px rgba(20, 40, 30, .15); padding-bottom: 9px; }
.cell { position: relative; aspect-ratio: 1; border-radius: 6px; }
.mini .cell { border-radius: 4px; }
.cell::after { content: ""; position: absolute; left: 50%; top: 50%; width: 52%; height: 52%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--plate-stud); box-shadow: 0 3px 0 var(--plate-edge); }
.mini .cell::after { box-shadow: 0 2px 0 var(--plate-edge); }
.cell.b { background: var(--c); box-shadow: inset 0 -5px 0 rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.25); }
.mini .cell.b { box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.cell.b::after { background: var(--c); box-shadow: 0 3px 0 rgba(0,0,0,.22), inset 0 2px 0 rgba(255,255,255,.35); }
.r { --c: #E5484D; } .o { --c: #FF8A3D; } .y { --c: #F7C531; } .bl { --c: #3B7BF0; } .p { --c: #8E5CF0; } .w { --c: #F3F1EA; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 22px; display: grid; gap: 12px; align-content: start; counter-increment: step; box-shadow: 0 4px 0 var(--line); min-width: 0; }
.step-pic { height: 170px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; }
.step h3::before { content: counter(step) ". "; color: var(--accent); }
.step p { color: var(--muted); }

/* Features */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.feature { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; min-width: 0; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--c); box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); position: relative; }
.feature-icon::after { content: ""; position: absolute; left: 50%; top: 44%; width: 18px; height: 18px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--c); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 0 0 1.5px rgba(255,255,255,.35); }
.feature h3 { margin-bottom: 4px; }
.feature p { color: var(--muted); }

/* Difficulty table */
.table-wrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 760px; }
.faq details { background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 0 20px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 800; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--display); font-size: 24px; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 18px; color: var(--muted); max-width: 65ch; }

/* 404 */
.notfound { padding-block: clamp(64px, 12vw, 140px); }

/* Play banner */
.play-banner { text-align: center; display: grid; gap: 18px; justify-items: center; }

/* Contact */
.contact { padding-block: clamp(40px, 7vw, 72px); }
.contact .wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.contact-copy { display: grid; gap: 16px; min-width: 0; }
.form { background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; padding: 28px; display: grid; gap: 18px; box-shadow: 0 6px 0 var(--line); min-width: 0; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 800; font-size: 15px; }
.field .hint { font-weight: 600; color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea {
  width: 100%; font: 500 16px var(--body); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field .err { color: var(--bad); font-size: 14px; font-weight: 700; }
.field.invalid input, .field.invalid textarea { border-color: var(--bad); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { border-radius: 12px; padding: 14px 16px; font-weight: 700; }
.form-status.ok { background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good); }
.form-status.fail { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); }
.form-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.form-foot small { color: var(--muted); font-weight: 600; }

/* Footer */
.foot { border-top: 1.5px solid var(--line); background: var(--surface); padding-block: 28px; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 15px; }
.foot nav { display: flex; gap: 18px; }
.foot a { color: var(--muted); font-weight: 700; text-decoration: none; }
.foot a:hover { color: var(--ink); }


/* Header: account link and phone menu */
.top-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.account-pill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 99px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px;
  text-decoration: none; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-pill:hover { background: var(--bg); }
.account-pill.signed-in::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: 0 0 auto; }
.menu { position: relative; display: none; }
.menu summary { list-style: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; background: var(--surface); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: grid; min-width: 200px; padding: 6px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 0 14px 36px rgba(0,0,0,.2); }
.menu-pop a { padding: 11px 12px; border-radius: 9px; font-weight: 700; color: var(--ink); text-decoration: none; }
.menu-pop a:hover, .menu-pop a[aria-current="page"] { background: var(--bg); }
.menu-pop a.signed-in { color: var(--good); }
@media (max-width: 760px) {
  .site-nav, .top-end .account-pill { display: none; }
  .menu { display: block; }
  .logo { display: inline; }
}

/* Shared bits */
.muted { color: var(--muted); }
.small { font-size: 14px; }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--accent); font: 700 15px var(--body); cursor: pointer; justify-self: center; }
.link-btn:hover { text-decoration: underline; }
.tabs { display: inline-flex; gap: 2px; padding: 4px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.tabs button { border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; font: 700 15px var(--body); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.tabs.wide { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }

/* Leaderboard page */
.board-page { padding-block: clamp(32px, 6vw, 64px); }
.board-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.board-meta { color: var(--muted); font-weight: 600; margin-bottom: 18px; font-variant-numeric: tabular-nums; }
.lb td { vertical-align: middle; }
.lb .num { text-align: right; font-family: var(--display); font-size: 20px; }
.lb th.num { font-family: var(--body); font-size: 13px; }
.lb .when { color: var(--muted); font-size: 14px; text-align: right; }
.lb .player { font-weight: 700; white-space: normal; word-break: break-word; }
.lb tr.you td { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.lb tr.gap td { text-align: center; color: var(--muted); padding: 6px; }
.lb .lb-empty td { text-align: center; color: var(--muted); padding: 36px 18px; white-space: normal; }
.you-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; vertical-align: 2px; }
.rank { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 8px; font-family: var(--display); font-size: 17px; background: var(--bg); color: var(--ink); }
.rank-1 { background: #F7C531; color: #3A2A00; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.rank-2 { background: #E3E6EE; color: #2A2F40; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.rank-3 { background: #FF8A3D; color: #3A1600; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.board-cta { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 20px; border-radius: 16px; border: 1.5px dashed var(--line); background: var(--surface); }
.board-cta p { color: var(--muted); }
.board-cta b { color: var(--ink); }
@media (max-width: 600px) {
  .lb .when { display: none; }
  .lb th, .lb td { padding: 12px 12px; }
  .tabs button { padding: 8px 10px; font-size: 14px; }
}

/* Account page */
.account-page { padding-block: clamp(32px, 6vw, 64px); }
.account-card { max-width: 440px; margin: 0 auto; background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: 0 6px 0 var(--line); display: grid; gap: 18px; }
.stack { display: grid; gap: 16px; }
.account-card section > .tabs { margin-bottom: 18px; }
.card-title { font-size: 32px; }
.wide-btn { width: 100%; }
.form-error { color: var(--bad); font-weight: 700; font-size: 15px; }
.notice { border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 15px; }
.notice.ok { background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good); }
.notice.info { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.standings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.standings div { display: grid; gap: 2px; justify-items: center; padding: 12px 6px; border-radius: 12px; background: var(--bg); }
.standings b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.standings span { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.btn-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.danger { border-top: 1.5px solid var(--line); padding-top: 14px; }
.danger summary { cursor: pointer; color: var(--bad); font-weight: 700; font-size: 15px; }
.danger form { margin-top: 14px; }
.danger-btn { background: var(--bad); color: #fff; border-color: var(--bad); box-shadow: 0 3px 0 color-mix(in srgb, var(--bad) 60%, #000); }

@media (max-width: 860px) {
  .hero .wrap, .contact .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .board.big { width: min(300px, 100%); }
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .logo { display: none; }
  .site-nav { margin-left: 2px; }
  .site-nav a { padding: 7px 8px; font-size: 14px; }
  .top .cta { min-height: 40px; padding: 0 12px; font-size: 14px; }
  .form { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
