/* ============================================================
   LOBBY, public site pages.

   Shared shell for the pages that sit outside the signed-in app:
   about, how-it-works, contact, terms, privacy, game, and any
   landing page added later.

   Tokens match index.html exactly so navigation between the two
   never changes colour temperature. Light mode is inherited from
   theme.css, which overrides these same variables.
   ============================================================ */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}

:root{
  --bg:#0a0707;--surface:#150f10;--surface2:#1c1415;
  --line:#2b1f20;--line-soft:#1f1718;
  --red:#ff0000;--red2:#ff4d4d;--red-t:rgba(255,0,0,.10);
  /* Filled surfaces use a slightly deeper red. White on pure #ff0000 is
     4.0:1, which fails WCAG AA for button labels; #e60000 measures 4.8:1
     and is visually indistinguishable at a glance. --red2 stays for text
     and icons on dark surfaces. */
  --red-fill:#e60000;
  /* --muted2 is lightened from the app's #6c5a5c: on these public pages it
     carries small labels (crumbs, footer headings, 10-11px text) where the
     original measured 3.1:1 and failed WCAG AA. #95807f measures 5.4:1. */
  --text:#f6eeee;--muted:#9c8689;--muted2:#95807f;
  --green:#3ddc84;
  --display:'Space Grotesk',sans-serif;--body:'Inter',sans-serif;
}

html{scroll-behavior:smooth;scroll-padding-top:64px}
body{
  background:var(--bg);color:var(--text);font-family:var(--body);font-size:14px;
  -webkit-font-smoothing:antialiased;min-height:100vh;max-width:480px;margin:0 auto;
  overflow-x:hidden;
}
button,input,select{font:inherit;color:inherit}
i[data-lucide]{display:inline-flex}
h1,h2,h3{font-family:var(--display);line-height:1.12;letter-spacing:-.02em;text-wrap:balance}
a{color:var(--red2)}
:focus-visible{outline:2px solid var(--red);outline-offset:3px}
::selection{background:var(--red);color:#fff}
.wrap{width:100%;padding:0 16px;margin-inline:auto}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:48px;padding:0 22px;border:0;border-radius:12px;background:var(--red-fill);color:#fff;font-family:var(--display);font-size:14px;font-weight:700;cursor:pointer;text-decoration:none;transition:transform .15s,background .15s}
.btn:hover:not(:disabled){background:#cc0000}
.btn:active:not(:disabled){transform:scale(.95)}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn.ghost{background:var(--surface2);border:0;color:var(--text);box-shadow:0 0 0 1px rgba(255,255,255,.04)}
.btn.ghost:hover:not(:disabled){background:var(--surface2)}
.btn.full{width:100%;margin-top:8px}
.btn.sm{min-height:40px;padding:0 16px;font-size:13px}

/* Header */
header{
  position:sticky;top:0;z-index:50;padding-top:env(safe-area-inset-top,0);
  background:rgba(10,7,7,.95);backdrop-filter:blur(16px) saturate(140%);
  -webkit-backdrop-filter:blur(16px) saturate(140%);
  box-shadow:0 1px 0 rgba(255,255,255,.06),0 8px 24px rgba(0,0,0,.35);
}
.bar{display:flex;align-items:center;gap:12px;min-height:52px}
.brand{display:flex;align-items:center;gap:8px;font-family:var(--display);font-size:17px;font-weight:800;letter-spacing:-.02em;color:var(--text);text-decoration:none;background:none;border:0;cursor:pointer}
.logo{width:28px;height:28px;color:var(--red)}
header .btn{min-height:34px;height:34px;padding:0 17px;font-size:12px;margin-left:auto}

/* Page hero */
.page-hero{padding-top:26px;padding-bottom:8px}
.crumbs{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted2);margin-bottom:14px}
.crumbs a{color:var(--muted2);text-decoration:none}
.crumbs a:hover{color:var(--red2)}
.crumbs svg{width:12px;height:12px;opacity:.6}
.page-hero h1{font-size:31px;font-weight:800}
.page-hero h1 em{font-style:normal;color:var(--red2)}
.page-hero .lead{font-size:13.5px;line-height:1.65;color:var(--muted);max-width:440px;margin:12px 0 0;text-align:justify}
.updated{margin-top:12px;font-size:13px;color:var(--muted2)}

/* Sections */
section.block{padding:24px 0;scroll-margin-top:64px}
.head{max-width:620px;margin-bottom:14px}
.head h2{font-size:21px;font-weight:800;letter-spacing:-.01em}
.head p{color:var(--muted);margin-top:4px;font-size:12.5px;line-height:1.6;text-align:justify}

/* Long-form prose */
.prose{max-width:460px}
.prose h2{font-size:19px;font-weight:800;margin:26px 0 8px}
.prose h2:first-child{margin-top:0}
.prose h3{font-size:14.5px;font-weight:700;margin:18px 0 6px}
.prose p{color:var(--muted);font-size:13.5px;line-height:1.72;margin:0 0 12px;text-align:justify}
.prose ul,.prose ol{color:var(--muted);font-size:13.5px;line-height:1.7;margin:0 0 14px;padding-left:20px}
.prose li{margin-bottom:7px}
.prose li::marker{color:var(--red2)}
.prose strong{color:var(--text);font-weight:600}
.prose a{color:var(--red2);text-decoration:none;border-bottom:1px solid rgba(255,77,77,.35)}
.prose a:hover{border-bottom-color:var(--red2)}

/* Card blocks reused from the landing page */
.bento{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.tile{background:var(--surface);border:0;border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:6px;box-shadow:0 2px 16px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.04)}
.tile h3{font-size:14px;font-weight:700}
.tile p{color:var(--muted);font-size:13px;line-height:1.55}
.tile .ic{width:38px;height:38px;border-radius:12px;background:var(--red-t);color:var(--red2);display:grid;place-items:center;margin-bottom:8px}
.tile.span2{grid-column:span 2}

.why{display:grid;grid-template-columns:1fr;gap:12px}
.why div{background:var(--surface);border:0;border-radius:16px;padding:14px;box-shadow:0 2px 16px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.04)}
.why h3{font-size:13.5px;margin:10px 0 4px}
.why p{color:var(--muted);font-size:12.5px;line-height:1.55}
.why svg{color:var(--red2);width:20px;height:20px}

/* Numbered steps */
.steps{display:flex;flex-direction:column;gap:10px;counter-reset:step}
.step{position:relative;background:var(--surface);border-radius:16px;padding:14px 14px 14px 54px;box-shadow:0 2px 16px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.04)}
.step::before{counter-increment:step;content:counter(step);position:absolute;left:14px;top:14px;width:26px;height:26px;border-radius:9px;background:var(--red-t);color:var(--red2);font-family:var(--display);font-size:12.5px;font-weight:700;display:grid;place-items:center}
.step h3{font-size:13.5px;font-weight:700;margin-bottom:4px}
.step p{color:var(--muted);font-size:12.5px;line-height:1.6}

/* Key and value rows */
.kv{background:var(--surface);border-radius:16px;padding:4px 14px;box-shadow:0 2px 16px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.04)}
.kv div{display:flex;justify-content:space-between;gap:14px;padding:11px 0;font-size:12.5px;position:relative}
.kv div+div::before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.09),transparent)}
.kv dt{color:var(--muted2);font-family:var(--display);font-weight:600}
.kv dd{color:var(--text);text-align:right}

/* Inline notice */
.note{display:flex;gap:10px;align-items:flex-start;background:rgba(255,0,0,.06);border-radius:14px;padding:12px 14px;font-size:12.5px;line-height:1.6;color:var(--muted);margin:14px 0}
.note svg{color:var(--red2);width:17px;height:17px;flex-shrink:0;margin-top:1px}
.note strong{color:var(--text)}
.note.calm{background:var(--surface)}

/* FAQ */
.faq{max-width:460px}
.faq details{border:0;position:relative;padding-bottom:2px}
.faq details::after{content:"";display:block;height:1px;margin-top:2px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.09),transparent)}
.faq details:last-child::after{display:none}
summary{list-style:none;cursor:pointer;display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 0;font-family:var(--display);font-size:13.5px;font-weight:700;min-height:48px}
summary::-webkit-details-marker{display:none}
summary::after{content:"+";font-size:20px;color:var(--red2);transition:transform .2s;flex-shrink:0}
details[open] summary::after{transform:rotate(45deg)}
details p{color:var(--muted);font-size:13px;line-height:1.65;text-align:justify;padding:0 0 16px;max-width:440px}

/* Bottom CTA */
.final{margin:28px 0 40px;padding:28px 20px;border-radius:18px;background:var(--red-fill);color:#fff;text-align:center}
.final h2{font-size:22px;font-weight:800}
.final p{font-size:13px;margin:8px 0 20px}
.final .btn{background:#fff;color:#cc0000}
.final .btn:hover{background:#f3eaea}

/* Footer */
footer{padding:8px 0 calc(32px + env(safe-area-inset-bottom,0));color:var(--muted);font-size:11.5px}
.foot{position:relative;padding-top:16px}
.foot::before{content:"";display:block;height:1px;margin-bottom:20px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.09),transparent)}
.foot-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px 16px;margin-bottom:20px}
.foot-brand{grid-column:span 2}
.foot-logo{display:flex;align-items:center;gap:8px;font-family:var(--display);font-size:16px;font-weight:800;letter-spacing:-.02em;color:var(--text);margin-bottom:8px}
.foot-logo svg{width:24px;height:24px;color:var(--red2)}
.foot-tag{font-size:12.5px;line-height:1.6;color:var(--muted)}
.foot-h{font-family:var(--display);font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted2);margin-bottom:10px}
.foot-links{list-style:none;display:flex;flex-direction:column;gap:2px}
.foot-links a{display:inline-flex;align-items:center;min-height:36px;color:var(--muted);text-decoration:none;font-size:12.5px;transition:color .15s}
.foot-links a:hover,.foot-links a:active{color:var(--red2)}
.foot-contact{font-size:12.5px;line-height:2;color:var(--muted)}
.foot-contact a{color:var(--red2);text-decoration:none}
.foot-base{padding-top:14px;position:relative;display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;color:var(--muted2);font-size:11px}
.foot-base::before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.09),transparent)}

/* Back link, matches the app's goBack pattern */
.back{display:inline-flex;align-items:center;gap:6px;background:none;border:0;color:var(--muted);font-family:var(--display);font-size:13px;font-weight:600;cursor:pointer;padding:8px 0;min-height:44px;text-decoration:none}
.back:hover{color:var(--text)}
.back svg{width:18px;height:18px}

/* ============================================================
   Game page
   ============================================================ */
.wheel-shell{position:relative;display:grid;place-items:center;padding:8px 0 20px}
.wheel-holder{position:relative;width:260px;height:260px}
#wheelCanvas{width:260px;height:260px;display:block;border-radius:50%;box-shadow:0 0 0 6px var(--surface2),0 0 0 7px rgba(255,255,255,.06),0 18px 40px rgba(0,0,0,.55)}
.wheel-pointer{position:absolute;top:-14px;left:50%;transform:translateX(-50%);width:0;height:0;border-left:11px solid transparent;border-right:11px solid transparent;border-top:20px solid var(--red2);filter:drop-shadow(0 3px 6px rgba(0,0,0,.6));z-index:2}
.wheel-hub{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:54px;height:54px;border-radius:50%;background:var(--surface);box-shadow:0 0 0 4px rgba(0,0,0,.45),0 4px 14px rgba(0,0,0,.5);display:grid;place-items:center;color:var(--red2);z-index:2}
.wheel-hub svg{width:22px;height:22px}
.spin-result{min-height:26px;text-align:center;font-family:var(--display);font-size:14px;font-weight:700;color:var(--text);margin-bottom:12px}
.spin-result span{color:var(--red2)}

.game-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.game-card{background:var(--surface);border:0;border-radius:16px;padding:0;overflow:hidden;text-align:left;cursor:pointer;box-shadow:0 2px 16px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.04);display:flex;flex-direction:column;transition:transform .15s}
.game-card:hover:not(:disabled){transform:translateY(-2px)}
.game-card:disabled{cursor:not-allowed;opacity:.55}
.game-thumb{aspect-ratio:16/10;display:grid;place-items:center;background:linear-gradient(135deg,var(--surface2),#120c0d);color:var(--red2)}
.game-thumb svg{width:26px;height:26px}
.game-body{padding:11px 12px 13px}
.game-body h3{font-size:13px;font-weight:700}
.game-body p{color:var(--muted);font-size:12.5px;line-height:1.5;margin-top:3px}
.game-tag{display:inline-block;margin-top:8px;font-family:var(--display);font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--red2);background:var(--red-t);padding:3px 7px;border-radius:6px}
.game-tag.off{color:var(--muted2);background:rgba(255,255,255,.04)}

/* Overlay + player sheet */
.overlay{position:fixed;inset:0;z-index:90;display:none;background:rgba(0,0,0,.52);backdrop-filter:blur(6px) brightness(.8);-webkit-backdrop-filter:blur(6px) brightness(.8)}
.overlay.show{display:grid;place-items:center;padding:16px}
.player{width:100%;max-width:448px;background:var(--surface);border-radius:18px;overflow:hidden;box-shadow:0 24px 60px rgba(0,0,0,.6),0 0 0 1px rgba(255,255,255,.06);display:flex;flex-direction:column;max-height:88vh}
.player-top{display:flex;align-items:center;gap:10px;padding:10px 12px}
.player-top h2{font-size:13.5px;font-weight:700;flex:1;font-family:var(--display)}
.player-close{width:36px;height:36px;border-radius:10px;border:0;background:var(--surface2);color:var(--text);display:grid;place-items:center;cursor:pointer}
.player-frame{position:relative;width:100%;aspect-ratio:4/3;background:#000}
.player-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.player-foot{padding:10px 12px;font-size:12.5px;color:var(--muted2);text-align:center}

/* Light mode */
:root[data-theme="light"] header{background:rgba(245,241,238,.9)!important;box-shadow:0 1px 0 rgba(0,0,0,.07),0 8px 24px rgba(0,0,0,.10)!important}
:root[data-theme="light"] .tile,
:root[data-theme="light"] .why div,
:root[data-theme="light"] .step,
:root[data-theme="light"] .kv,
:root[data-theme="light"] .game-card,
:root[data-theme="light"] .player{box-shadow:0 2px 16px rgba(0,0,0,.10),0 0 0 1px rgba(0,0,0,.05)!important}
:root[data-theme="light"] .foot::before,
:root[data-theme="light"] .foot-base::before,
:root[data-theme="light"] .faq details::after{background:linear-gradient(90deg,transparent,rgba(0,0,0,.1),transparent)}
:root[data-theme="light"] .kv div+div::before{background:linear-gradient(90deg,transparent,rgba(0,0,0,.09),transparent)}
:root[data-theme="light"] .game-thumb{background:linear-gradient(135deg,var(--surface2),#f0e7e2)}
:root[data-theme="light"] .wheel-hub{box-shadow:0 0 0 4px rgba(0,0,0,.08),0 4px 14px rgba(0,0,0,.14)}
:root[data-theme="light"] #wheelCanvas{box-shadow:0 0 0 6px var(--surface2),0 0 0 7px rgba(0,0,0,.06),0 18px 40px rgba(0,0,0,.14)}
