/* ---------- Tokens ---------- */
:root {
  --ink: #0B1B3A;
  --ink-2: #14295A;
  --cobalt: #1B3FA6;
  --cobalt-d: #17338A;
  --sky: #E8EEFB;
  --sky-2: #F2F5FC;
  --turq: #0E8F80;
  --turq-bright: #12A594;
  --turq-soft: #DDF3EF;
  --tomato: #D8402A;
  --tomato-soft: #FCE9E5;
  --amber-soft: #FFF3D6;
  --amber: #8A5A00;
  --paper: #F5F7FB;
  --card: #fff;
  --line: #DCE3F1;
  --text: #14203B;
  --muted: #55627F;
  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(11,27,58,.06), 0 8px 24px -12px rgba(11,27,58,.18);
  --display: 'Amiri', 'Times New Roman', serif;
  --body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 var(--body); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0 0 .5em; color: var(--ink); font-weight: 700; letter-spacing: -.005em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--cobalt); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--turq-bright); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.hide { display: none !important; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* ---------- Buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--cobalt); color: #fff; padding: 11px 20px; border-radius: 999px; font-weight: 600; transition: background .15s, transform .15s; }
.btn:hover { background: var(--cobalt-d); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.turq { background: var(--turq); } .btn.turq:hover { background: #0B7568; }
.btn.red { background: var(--tomato); } .btn.red:hover { background: #b9321f; }
.btn.ghost { background: transparent; color: var(--cobalt); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--sky); }
.btn.light { background: #fff; color: var(--ink); } .btn.light:hover { background: var(--sky); }

.btn { white-space: nowrap; }
.btn.sm { padding: 6px 14px; font-size: .875rem; }
.btn.lg { padding: 15px 28px; font-size: 1.05rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 11px 14px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-sm); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(27,63,166,.15); }
input[type=checkbox], input[type=radio] { accent-color: var(--cobalt); width: 18px; height: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 3px; flex: none; }

/* ---------- Cards, chips, tables ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: .35em; }
.chip { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--sky); color: var(--cobalt); white-space: nowrap; }
.chip.green { background: var(--turq-soft); color: #08665b; }
.chip.red { background: var(--tomato-soft); color: #a52d1b; }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.grey { background: #ECEFF5; color: var(--muted); }
.notice { border-radius: var(--r-sm); padding: 12px 16px; background: var(--sky); border-left: 4px solid var(--cobalt); font-size: .95rem; }
.notice.warn { background: var(--amber-soft); border-color: #E0A100; }
.notice.bad { background: var(--tomato-soft); border-color: var(--tomato); }
.notice.good { background: var(--turq-soft); border-color: var(--turq); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; background: var(--sky-2); }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.plus { color: var(--turq); font-weight: 600; } .minus { color: var(--tomato); font-weight: 600; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h4 { color: var(--ink); }
.progress { height: 8px; background: var(--sky); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--turq-bright); border-radius: 99px; transition: width .4s; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { background: none; border: 0; padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab[aria-selected=true] { color: var(--cobalt); border-color: var(--cobalt); }
.tab .count { background: var(--tomato); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .75rem; margin-left: 6px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-sm); box-shadow: var(--shadow); animation: pop .2s ease-out; }
.toast.bad { background: var(--tomato); } .toast.good { background: var(--turq); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink) url('/img/tile.svg'); color: #D6DEF2; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { width: 34px; height: 34px; }
.brand b { font: 700 1.6rem/1 var(--display); color: #fff; letter-spacing: .01em; }
.side .brand { padding: 4px 10px 22px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #C5D0EA; text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a[aria-current=page] { background: #fff; color: var(--ink); font-weight: 600; }
.nav svg { width: 20px; height: 20px; flex: none; }
.nav .badge { margin-left: auto; background: var(--tomato); color: #fff; border-radius: 99px; padding: 0 8px; font-size: .75rem; font-weight: 700; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.12); }
.side .me img, .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cobalt); object-fit: cover; flex: none; }
.side .me div { min-width: 0; flex: 1; line-height: 1.25; }
.side .me strong { display: block; color: #fff; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me button { background: none; border: 0; color: #9FB0D8; cursor: pointer; font-size: .85rem; padding: 0; text-decoration: underline; }
.main { padding: 32px clamp(16px, 4vw, 48px) 80px; max-width: 1180px; width: 100%; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .15em; }
.bal { display: flex; flex-direction: column; gap: 2px; }
.bal .v { font: 700 2rem/1.1 var(--display); color: var(--ink); }
.bal .l { font-weight: 600; font-size: .9rem; color: var(--muted); }
.bal.pts .v { color: var(--turq); }
.bal.usd .v { color: var(--cobalt); }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 60; inset: auto 0 0 0; top: auto; height: auto; flex-direction: row; padding: 6px; gap: 0; background: var(--ink); border-top: 1px solid rgba(255,255,255,.15); }
  .side .brand, .side .me { display: none; }
  .nav { display: flex; width: 100%; justify-content: space-around; overflow-x: auto; }
  .nav a { flex-direction: column; gap: 2px; font-size: .7rem; padding: 6px 8px; min-width: 58px; text-align: center; }
  .main { padding-top: 16px; padding-bottom: 110px; }
  .mobile-top { display: flex !important; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--ink); }
.mobile-top .brand b { font-size: 1.35rem; }
.mobile-top button { background: none; border: 0; color: #C5D0EA; text-decoration: underline; cursor: pointer; }

/* ---------- Landing ---------- */
.site-top { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 5vw, 64px); position: absolute; inset: 0 0 auto 0; z-index: 5; }
.site-top .brand b { color: #fff; }
.site-top nav { display: flex; gap: 22px; align-items: center; }
.site-top nav a { color: #D6DEF2; text-decoration: none; font-weight: 500; }
.site-top nav a:hover { color: #fff; }
@media (max-width: 700px) { .site-top nav a.hide-sm { display: none; } }
.hero { position: relative; background: var(--ink) url('/img/tile.svg'); color: #fff; overflow: hidden; padding: clamp(110px, 16vh, 160px) clamp(16px, 5vw, 64px) clamp(60px, 9vh, 100px); }
.hero-in { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; }
.hero h1 { color: #fff; margin-bottom: .3em; }
.hero h1 em { font-style: normal; color: #7FE3D5; }
.hero .lede { font-size: 1.2rem; color: #C5D0EA; max-width: 34em; margin-bottom: 1.6em; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero .fine { margin-top: 18px; color: #93A3CD; font-size: .9rem; }
.rosette-wrap { position: relative; aspect-ratio: 1; width: min(100%, 520px); justify-self: center; }
.rosette-wrap > img { width: 100%; height: 100%; animation: spin 140s linear infinite; filter: drop-shadow(0 30px 60px rgba(0,0,0,.35)); }
@keyframes spin { to { transform: rotate(360deg); } }
.rosette-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 21%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center; color: var(--ink); line-height: 1.05; font-family: var(--display); }
.rosette-card b { display: block; font-size: clamp(1.4rem, 3.4vw, 2.2rem); color: var(--turq); }
.rosette-card span { font-family: var(--body); font-size: clamp(.55rem, 1.2vw, .8rem); font-weight: 600; color: var(--muted); }
.ticker { position: absolute; background: #fff; color: var(--ink); border-radius: 12px; padding: 8px 14px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); }
.ticker i { font-style: normal; color: var(--turq); }
.ticker.a { left: -2%; top: 14%; animation: bob 7s ease-in-out infinite; }
.ticker.b { right: -2%; bottom: 16%; animation: bob 7s ease-in-out -3.5s infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; } .rosette-wrap { width: min(80%, 380px); } .ticker { display: none; } }
@media (prefers-reduced-motion: reduce) { .rosette-wrap > img, .ticker { animation: none !important; } html { scroll-behavior: auto; } }

.section { padding: clamp(56px, 9vw, 104px) clamp(16px, 5vw, 64px); }
.section.alt { background: #fff; }
.section.dark { background: var(--ink-2); color: #D6DEF2; }
.section.dark h2, .section.dark h3 { color: #fff; }
.wrap { max-width: 1120px; margin: 0 auto; }
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); font: 700 2.4rem/1 var(--display); color: var(--cobalt); }
.steps h3 { margin-bottom: .2em; }
.steps p { margin: 0; color: var(--muted); }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .rules { grid-template-columns: 1fr; } }
.rules ul { margin: 0; padding-left: 1.2em; } .rules li { margin: .45em 0; }
.rules .yes { border-top: 5px solid var(--turq-bright); } .rules .no { border-top: 5px solid var(--tomato); }
.split-bar { display: flex; height: 44px; border-radius: 12px; overflow: hidden; font-weight: 700; font-size: .85rem; color: #fff; }
.split-bar span { display: grid; place-items: center; white-space: nowrap; padding: 0 6px; }
.legend { display: grid; gap: 10px; margin-top: 18px; }
.legend div { display: flex; gap: 10px; align-items: baseline; } .legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; transform: translateY(1px); }
details { border-top: 1px solid var(--line); padding: 16px 0; } details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; } details p { margin: .7em 0 0; color: var(--muted); max-width: 46em; }
.footer { background: var(--ink); color: #93A3CD; padding: 36px clamp(16px, 5vw, 64px); }
.footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer a { color: #C5D0EA; }

/* ---------- Sign-in modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(11,27,58,.6); display: grid; place-items: center; z-index: 150; padding: 16px; }
.modal { background: #fff; border-radius: 18px; padding: 32px; width: min(440px, 100%); position: relative; }
.modal .x { position: absolute; right: 12px; top: 10px; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.modal h2 { font-size: 2rem; }

/* ---------- Watch ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .watch { grid-template-columns: 1fr; } }
.player { aspect-ratio: 16/9; background: #000; border-radius: var(--r); overflow: hidden; position: relative; }
.player iframe, .player > div { width: 100%; height: 100%; display: block; }
.ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: conic-gradient(var(--turq-bright) calc(var(--p) * 1%), var(--sky) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.ring b { position: relative; font: 700 2.2rem/1 var(--display); color: var(--ink); text-align: center; }
.ring small { display: block; font: 500 .75rem var(--body); color: var(--muted); margin-top: 2px; }
.reward-pop { font: 700 2.6rem/1 var(--display); color: var(--turq); animation: pop .4s ease-out; text-align: center; }
.vid-thumb { width: 96px; aspect-ratio: 16/9; border-radius: 6px; object-fit: cover; background: var(--sky); flex: none; }

/* ---------- Misc ---------- */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.radio-card { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer; display: block; font-weight: 400; margin: 0; background: #fff; }
.radio-card:has(input:checked) { border-color: var(--cobalt); background: var(--sky-2); box-shadow: 0 0 0 3px rgba(27,63,166,.12); }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card b { display: block; font-size: 1.05rem; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.quick button { background: var(--sky); border: 0; border-radius: 99px; padding: 4px 14px; cursor: pointer; font-weight: 600; color: var(--cobalt); }
.quick button:hover { background: #d6e0f7; }
.copybox { display: flex; gap: 8px; } .copybox input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.kv { display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 6px 20px; font-size: .95rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; }
.video-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.video-row:first-child { border-top: 0; }
.video-row img { width: 112px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--sky); }
.video-row h4 { margin: 0 0 4px; font-family: var(--body); font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 700px) { .video-row { grid-template-columns: 80px 1fr; } .video-row > :last-child { grid-column: 1 / -1; } .video-row img { width: 80px; } }
.preview-frame { aspect-ratio: 16/9; width: 100%; border: 0; border-radius: 10px; margin-top: 12px; background: #000; }
code { background: var(--sky); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
