:root {
  --bg: #0f1115; --panel: #181b22; --line: #262b36; --text: #e8eaf0; --muted: #8a92a3;
  --on-gold: #1a1405; --bar: #12141a; --raise: #232837; --hero1: #1d2230; --hero2: #161922; --gold: #f5b83d; --good: #3ecf8e; --bad: #ef5b5b; --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
input, select, textarea { font-size: 16px; }  /* below 16px, iPhones zoom in whenever a field is tapped */
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: env(safe-area-inset-bottom); }
main { max-width: 980px; margin: 0 auto; padding: 16px; }
a { color: var(--gold); }
h1 { font-size: 1.7rem; margin: .2em 0; }
h2 { font-size: 1.1rem; margin: 1.6em 0 .6em; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--muted); }
.error { background: #3a1d1d; border: 1px solid var(--bad); padding: 10px 12px; border-radius: 10px; }

.top { display: flex; gap: 14px; align-items: center; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); display: inline-block; margin-right: 6px; }
.brand .dot { margin: 0; }
nav { display: flex; gap: 4px; margin-right: auto; }
nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
nav a.on { color: var(--text); background: var(--panel); }
.pill { font-size: .75rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--good); border-color: #1f4d39; }
.pill.warn { color: var(--gold); border-color: #5b4513; }
button { font: inherit; color: inherit; cursor: pointer; }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: .85rem; text-transform: none; letter-spacing: 0; }
.primary { background: var(--gold); color: var(--on-gold); border: 0; padding: 12px 18px; border-radius: 10px; font-weight: 700; }
.btn { display: inline-block; text-decoration: none; }

.auth { max-width: 360px; margin: 10vh auto 0; }
.auth form { display: grid; gap: 12px; margin: 18px 0; }
label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
input, select { background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 12px; border-radius: 10px; font: inherit; width: 100%; }

.hero { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; background: linear-gradient(135deg, var(--hero1), var(--hero2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.eyebrow { color: var(--gold); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; margin: 0; }
.workon { color: var(--gold); }
.kpis { display: flex; gap: 22px; align-items: center; }
.kpis div { display: grid; text-align: center; }
.kpis b { font-size: 1.6rem; }
.kpis span { color: var(--muted); font-size: .75rem; text-transform: uppercase; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 14px; }
.card h3 { margin: .2em 0; font-size: 1rem; min-height: 2.4em; }
.card .big { font-size: 2.2rem; font-weight: 800; margin: 0; color: var(--gold); }
.card .big small { font-size: 1rem; }
.cat { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; margin: 0; }
.bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; grid-column: 1 / -1; }
.bar i { display: block; height: 100%; background: var(--good); }
.bad .bar i { background: var(--bad); }

.flow { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: s; }
.flow li { background: var(--panel); border: 1px solid var(--line); padding: 10px 14px; border-radius: 10px; display: grid; }
.flow li::before { counter-increment: s; content: counter(s); color: var(--gold); font-weight: 700; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }
.row { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; padding: 8px 0; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }

.empty { text-align: center; padding: 14vh 0; }

/* Logger */
.bar-top { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.tab { background: var(--panel); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; white-space: nowrap; color: var(--muted); }
.tab.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); font-weight: 700; }
.techs { display: grid; gap: 8px; }
.tech { display: grid; grid-template-columns: 1fr 64px 64px; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; }
.tech small { display: block; color: var(--muted); }
.hit, .miss { height: 52px; border-radius: 10px; border: 1px solid var(--line); font-size: 1.5rem; background: transparent; transition: transform .1s, background .1s; }
.hit { color: var(--good); } .miss { color: var(--bad); }
.hit:active, .hit.flash { background: var(--good); color: #06150d; transform: scale(.95); }
.miss:active, .miss.flash { background: var(--bad); color: #1c0606; transform: scale(.95); }
.custom { margin-top: 18px; color: var(--muted); }
.custom form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; margin-top: 10px; }
@media (max-width: 700px) { .custom form { grid-template-columns: 1fr 1fr; } }
.recent { list-style: none; padding: 0; margin: 8px 0 80px; display: grid; gap: 4px; }
.recent .ok { color: var(--good); } .recent .no { color: var(--bad); }

/* ===== Stage 1: bottom bar, panels, charts ===== */
[hidden] { display: none !important; }
main.has-tabs { padding-bottom: 96px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }
.panel h2 { margin-top: 0; }
.panel.notice { display: grid; gap: 2px; }
.sep { border: 0; border-top: 3px solid var(--line); margin: 18px 0; border-radius: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .panel { margin: 0; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } .grid2 .panel { margin-bottom: 12px; } }
.stack { display: grid; gap: 12px; }
.ghost { background: transparent; border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; background: var(--bar); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tab-i { display: grid; justify-items: center; gap: 2px; color: var(--muted); text-decoration: none; background: none; border: 0; padding: 4px 0; font-size: .62rem; }
.tab-i svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-i.on { color: var(--gold); }
.tab-i.plus { align-self: center; justify-self: center; width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(245,184,61,.35); margin-top: -18px; }
.tab-i.plus svg { width: 28px; height: 28px; stroke-width: 2.6; }
.tab-i.plus.on { outline: 3px solid #fff3; }

#scrim { position: fixed; inset: 0; background: #0009; z-index: 30; }
#drawer { position: fixed; left: 0; bottom: 0; top: 0; width: min(300px, 82vw); background: var(--panel); border-right: 1px solid var(--line); z-index: 40; padding: calc(20px + env(safe-area-inset-top)) 18px 20px; display: grid; align-content: start; gap: 4px; overflow-y: auto; }
#drawer a { color: var(--text); text-decoration: none; padding: 12px 8px; border-radius: 8px; }
#drawer a:hover { background: #ffffff0d; }
#drawer hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 8px 0; }
#drawer .who { margin: 0 0 10px; }

.top5 { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.top5 li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; }
.top5 .rank { color: var(--gold); font-weight: 800; }
.top5 .nm { display: grid; line-height: 1.2; }
.top5 small { color: var(--muted); }
.top5 b { color: var(--good); }

.radar { width: 100%; height: auto; max-height: 360px; }
.radar .ring { fill: none; stroke: var(--line); }
.radar .grid, .lc .grid { stroke: var(--line); stroke-width: 1; }
.radar .shape { fill: rgba(245,184,61,.22); stroke: var(--gold); stroke-width: 2; }
.radar .pt { fill: var(--gold); }
.rlabel { fill: var(--text); font-size: 11px; }
.rsub { fill: var(--muted); font-size: 10px; }
.lc { width: 100%; height: auto; display: block; }
.lc .tick { fill: var(--muted); font-size: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; flex-direction: row; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--text); font-size: .85rem; }
.chip input { width: auto; padding: 0; }

.chart { padding: 12px; }
.range-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 10px; padding: 3px; }
.range-tabs button { flex: 1; background: none; border: 0; padding: 7px 0; border-radius: 8px; color: var(--muted); font-size: .85rem; }
.range-tabs button.on { background: var(--panel); color: var(--text); font-weight: 700; box-shadow: 0 0 0 1px var(--line); }
.cat-row { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; text-align: center; margin-top: 8px; }
.cat-row .step { background: none; border: 0; color: var(--gold); font-size: 1.6rem; line-height: 1; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 2px 0 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--gold); }
.plot { touch-action: pan-y; min-height: 120px; user-select: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; align-items: center; }
.legend .g { color: var(--good); } .legend .r { color: var(--bad); } .legend .m { color: var(--gold); }
.legend label { display: flex; flex-direction: row; gap: 6px; align-items: center; color: var(--muted); }
.legend input { width: auto; }
.totals { margin: 6px 0 0; font-size: .8rem; }

.prog { margin: 0 0 14px; }
.prog-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: .9rem; }
.prog.streak .bar i { background: var(--gold); }
.bar { height: 8px; }
.hero2 h3 { margin: .2em 0; font-size: 1.4rem; }

.goal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.goal-form .primary { grid-column: 1 / -1; }
.goal.done .bar i { background: var(--gold); }
.goal .link { margin-top: 6px; }

.timer .timer-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.manual { display: flex; gap: 8px; }
.manual input { width: 90px; }
#timer-run { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.clock { font-variant-numeric: tabular-nums; font-size: 1.4rem; font-weight: 800; color: var(--gold); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); background: var(--raise); border: 1px solid var(--gold); padding: 10px 16px; border-radius: 12px; z-index: 50; max-width: 90vw; text-align: center; }

.soon, .legal { max-width: 560px; }
.soon ul { line-height: 1.9; }

/* ===== Quick log: one-hand, between-rounds ===== */
.logger { padding-bottom: 150px; }
.logger h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .75rem; }
.favs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.fav-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: grid; gap: 8px; }
.fav-name { font-weight: 700; line-height: 1.15; min-height: 2.5em; }
.fav-name small { display: block; color: var(--muted); font-weight: 400; font-size: .72rem; margin-top: 2px; }
.fav-name .g { color: var(--good); } .fav-name .r { color: var(--bad); }
.fav-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fav-btns .hit, .fav-btns .miss { height: 68px; font-size: 2rem; border-radius: 14px; }
.tech { grid-template-columns: 1fr 70px 70px; }
.tech .hit, .tech .miss { height: 60px; }
.more-mat { margin-top: 4px; }
.more-mat summary { cursor: pointer; color: var(--muted); }

.round-bar { position: fixed; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 15; padding: 0 12px; pointer-events: none; }
.round-bar > div { pointer-events: auto; }
.round-btn { width: 100%; min-height: 66px; font-size: 1.25rem; font-weight: 800; border-radius: 18px; border: 0; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.round-btn.start { background: var(--gold); color: var(--on-gold); }
.round-btn.end { background: #2a1517; color: #ff8f8f; border: 2px solid var(--bad); }
.round-btn:active { transform: scale(.98); }
.round-run { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; background: var(--bar); border: 1px solid var(--line); border-radius: 20px; padding: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.round-info { display: grid; padding: 0 10px; line-height: 1.1; }
.round-info .clock { font-size: 1.8rem; }
.toast { display: flex; gap: 14px; align-items: center; bottom: calc(176px + env(safe-area-inset-bottom)); }
.toast .link { color: var(--gold); font-size: 1rem; font-weight: 700; }

.tab-i span { white-space: nowrap; font-size: .58rem; }

/* ===== Gamification: level, badges, dice, celebration ===== */
.level-card .lv-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.lv-num { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: var(--on-gold); background: var(--gold); box-shadow: 0 0 0 4px #f5b83d33; }
.lv-title { font-size: 1.3rem; }
.lv-next { margin: 6px 0 0; font-size: .8rem; }
h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .75rem; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.badge { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; gap: 4px; justify-items: center; text-align: center; --tier: #3a4050; }
.badge .b-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; border: 3px solid var(--tier); background: var(--bg); }
.badge .b-name { font-weight: 700; line-height: 1.15; }
.badge .b-tier { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--tier); font-weight: 700; }
.badge .bar { width: 100%; margin-top: 2px; }
.badge .bar i { background: var(--tier); }
.badge small { color: var(--muted); font-size: .72rem; }
.badge .b-desc { opacity: .7; }
.badge.t0 { opacity: .75; }
.badge.t0 .b-ico { filter: grayscale(1); }
.badge.t1 { --tier: #cd7f32; }
.badge.t2 { --tier: #c3ccd8; }
.badge.t3 { --tier: #f5b83d; }
.badge.t4 { --tier: #7fd6ff; box-shadow: 0 0 18px #7fd6ff33; }
.how { margin: 8px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }

.dice-opts { display: grid; gap: 10px; }
.die-card { display: grid; gap: 8px; }
.die-head { display: flex; gap: 12px; align-items: center; }
.die-head small { display: block; }
.die { font-size: 2.2rem; display: inline-block; line-height: 1; }
.die.rolling { animation: tumble .5s linear infinite; }
@keyframes tumble { to { transform: rotate(360deg); } }
.die-tech { margin: 0; font-size: 1.6rem; color: var(--gold); line-height: 1.15; }
.die-tech small { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }
.reveal { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.die-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.roll-btn { min-height: 56px; font-size: 1.1rem; }
.bar.gold i { background: var(--gold); }
.history { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; }
.history .done span { color: var(--good); } .history .expired span { color: var(--bad); }

.cele { position: fixed; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top)); z-index: 60; background: linear-gradient(135deg, #2b2410, #1c1a12); border: 1px solid var(--gold); border-radius: 16px; padding: 12px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.6); display: grid; gap: 4px; max-width: 92vw; animation: drop .4s ease-out; }
.cele b { color: var(--gold); }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Light theme: dark orange on white ---------- */
html[data-theme="light"] {
  --bg: #ffffff; --panel: #f7f3ee; --line: #e6dfd6; --text: #1f1a16; --muted: #6d645a;
  --gold: #c2570c; --good: #168a5c; --bad: #cc3636; --on-gold: #ffffff;
  --bar: #ffffff; --raise: #fff4ea; --hero1: #fff1e3; --hero2: #fbe6d2;
}
html[data-theme="light"] .error { background: #fdeaea; }
html[data-theme="light"] .pill.ok { border-color: #a6dcc4; }
html[data-theme="light"] .pill.warn { border-color: #f0c9a6; }
html[data-theme="light"] #drawer { background: #fff; }
html[data-theme="light"] #drawer a:hover { background: #0000000a; }
html[data-theme="light"] .round-btn.end { background: #fdeaea; color: var(--bad); }
html[data-theme="light"] .cele { background: linear-gradient(135deg, #fff4ea, #ffe9d6); color: var(--text); }
html[data-theme="light"] .badge { --tier: #d9d2c8; }
html[data-theme="light"] .badge.t2 { --tier: #8d99a8; }
html[data-theme="light"] .badge.t4 { --tier: #2f9bd1; box-shadow: 0 0 14px #2f9bd133; }
html[data-theme="light"] #scrim { background: #0006; }
html[data-theme="light"] .tabbar { box-shadow: 0 -2px 10px #0000000d; }

/* ---------- Header ---------- */
.top .grow { flex: 1; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: none; padding: 0; font-size: .72rem; font-weight: 700; }
.lang span { padding: 4px 9px; color: var(--muted); }
html[lang="en"] .lang [data-l="en"], html[lang="es"] .lang [data-l="es"] { background: var(--gold); color: var(--on-gold); }
.hdr-me { display: grid; justify-items: center; gap: 3px; text-decoration: none; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--raise) center/cover no-repeat; border: 2px solid var(--line); color: var(--gold); font-weight: 800; flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: .9rem; }
.avatar.lg { width: 96px; height: 96px; font-size: 2.4rem; }
.beltbar { display: block; width: 28px; height: 6px; border-radius: 2px; background: var(--belt, #f2f2f2); box-shadow: 0 0 0 1px #0004; position: relative; }
.beltbar { width: 34px; height: 8px; }
.beltbar .tab { position: absolute; right: 3px; top: 0; bottom: 0; width: 15px; background: #111; display: flex; align-items: stretch; justify-content: center; gap: 1px; padding: 0 1px; overflow: hidden; }
.beltbar .tab u { flex: 0 0 1.6px; background: #fff; }
.belt-black .beltbar .tab { background: #c62828; }
.belt-white { --belt: #f4f4f4; } .belt-blue { --belt: #1f6fe0; } .belt-purple { --belt: #8a3fd0; }
.belt-brown { --belt: #7a4a22; } .belt-black { --belt: #1a1a1a; }
html[data-theme="light"] .belt-white .beltbar { box-shadow: 0 0 0 1px #0006; }

.tab-i.lb span { font-size: .5rem; letter-spacing: -.02em; }

/* ---------- Leaderboards ---------- */
.league-card { display: grid; gap: 10px; }
.lg-head { display: flex; gap: 14px; align-items: center; }
.lg-name { font-size: 1.8rem; line-height: 1.1; }
.emblem { width: 72px; height: 72px; flex: none; display: grid; place-items: center; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--c) 45%, transparent)); }
.emblem.sm { width: 32px; height: 32px; filter: none; }
.shield { width: 100%; height: 100%; }
.ladder { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ladder li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.ladder li small { margin-left: auto; }
.ladder li.todo { opacity: .7; }
.ladder li.view { outline: 2px solid var(--gold); }
.ladder li.tap { cursor: pointer; }
.ladder li.now { border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.ladder li em { font-style: normal; font-size: .7rem; color: var(--on-gold); background: var(--c); border-radius: 999px; padding: 2px 8px; }
.board-row { display: flex; align-items: center; gap: 10px; padding: 6px 0 12px; }
.board-row .who { flex: 1; display: grid; }
.flag { font-size: 1.1rem; }
h3.sub { margin: 1.4em 0 .4em; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Style page ---------- */
.mixrow { display: grid; grid-template-columns: 96px 1fr 40px; gap: 4px 10px; align-items: center; padding: 6px 0; }
.mixrow small { grid-column: 2 / 4; margin-top: -4px; }
.mixname::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.top5.weak .rank { color: var(--bad); }
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; }
.mcol { display: grid; justify-items: center; gap: 2px; text-align: center; }
.mcol small { font-size: .62rem; color: var(--muted); min-height: 2.4em; line-height: 1.15; }
.mcol span { font-size: .72rem; color: var(--muted); }
.mstack { height: 110px; width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; justify-content: flex-start; background: var(--line); border-radius: 6px; overflow: hidden; }
.mstack i { display: block; width: 100%; }
.legend.wrap { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: .75rem; color: var(--muted); }
.legend .sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

/* ---------- Profile / settings ---------- */
.stack { display: grid; gap: 12px; }
.prof-top { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.avatar-pick { display: grid; justify-items: center; gap: 6px; cursor: pointer; }
.lbl { margin: 0 0 6px; font-size: .85rem; color: var(--muted); }
.belts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.beltpick { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 10px 4px; display: grid; justify-items: center; gap: 6px; font-size: .72rem; }
.beltpick.on { border-color: var(--gold); }
.beltpick .beltbar { width: 36px; height: 8px; }
.beltpick .beltbar .tab { width: 12px; }
.ghost { background: none; border: 1px solid var(--line); color: var(--text); padding: 11px 16px; border-radius: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 10px 22px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--gold); color: var(--on-gold); }
.notice-ok { background: #123222; border: 1px solid var(--good); padding: 10px 12px; border-radius: 10px; }
html[data-theme="light"] .notice-ok { background: #e6f6ee; }

.prof-top { display: grid; justify-items: center; padding: 10px 0 2px; }
button.avatar { cursor: pointer; padding: 0; }
.avatar.lg { width: 120px; height: 120px; font-size: 3rem; border-color: var(--gold); }
.avatar.xl { width: min(80vw, 420px); height: min(80vw, 420px); border-radius: 50%; background-size: cover; background-position: center; border: 3px solid var(--gold); display: block; }
.sheet { position: fixed; inset: 0; z-index: 50; background: #0008; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet[hidden], .lightbox[hidden] { display: none; }
.sheet button { background: var(--raise); border: 1px solid var(--line); border-radius: 14px; padding: 15px; font-size: 1rem; color: var(--text); max-width: 520px; width: 100%; margin: 0 auto; }
.sheet .danger { color: var(--bad); }
.sheet .cancel { font-weight: 700; margin-top: 4px; }
.lightbox { position: fixed; inset: 0; z-index: 55; background: #000d; display: grid; place-items: center; cursor: zoom-out; }

/* ---------- iPhone-style switches ---------- */
.switch { position: relative; flex: none; border: 0; padding: 0; border-radius: 999px; background: var(--line); transition: background .2s; cursor: pointer; }
.switch .knob { position: absolute; top: 3px; left: 3px; border-radius: 999px; background: #fff; box-shadow: 0 2px 6px #0004; transition: transform .22s cubic-bezier(.3, .7, .3, 1); display: grid; place-items: center; font-style: normal; color: #222; font-weight: 800; }
.switch[aria-checked="true"] { background: var(--gold); }
.lang-sw { width: 66px; height: 30px; background: var(--panel); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; align-items: center; text-align: center; font-size: .7rem; color: var(--muted); }
.lang-sw[aria-checked="true"] { background: var(--panel); }
.lang-sw b { font-weight: 700; position: relative; z-index: 0; }
.lang-sw .knob { top: 2px; left: 2px; width: 31px; height: 24px; background: var(--gold); color: var(--on-gold); font-size: .7rem; z-index: 1; }
.lang-sw .knob::after { content: "EN"; }
html[lang="es"] .lang-sw .knob { transform: translateX(29px); }
html[lang="es"] .lang-sw .knob::after { content: "ES"; }
.switch-row { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.theme-sw { width: 62px; height: 34px; }
.theme-sw .knob { width: 28px; height: 28px; font-size: 1rem; }
.theme-sw .knob::after { content: "☀️"; }
.theme-sw[aria-checked="true"] .knob { transform: translateX(28px); }
.theme-sw[aria-checked="true"] .knob::after { content: "🌙"; }
.theme-sw[aria-checked="false"] { background: #d9cfc3; }

/* Privacy switch: lock closed (private) / open (public) instead of sun and moon */
.lock-sw .knob::after { content: "🔒"; }
.lock-sw[aria-checked="true"] .knob::after { content: "🔓"; }
.lock-sw[aria-checked="true"] { background: var(--gold); }
.lock-sw[aria-checked="false"] { background: #5a6272; }
.flow { margin-bottom: 16px; }

.radar .shape.worst { fill: rgba(239,91,91,.18); stroke: var(--bad); stroke-width: 2; }
.radar .pt.worst { fill: var(--bad); }
.radar .rworst { fill: var(--bad); }
.radar-legend { display: flex; justify-content: center; gap: 16px; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.radar-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

/* ---------- A game visual ---------- */
.agame-card { overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, var(--hero1), var(--bg)); }
.ag-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ag-title { margin: .1em 0 0; font-size: 1.15rem; color: var(--text); text-transform: none; letter-spacing: 0; display: block; }
.ag-score { text-align: right; display: grid; }
.ag-score b { font-size: 1.8rem; color: var(--gold); line-height: 1; }
.ag-score small { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.agame { width: 100%; height: auto; display: block; }
.ag-star { fill: var(--muted); opacity: .25; }
.ag-track { fill: none; stroke: var(--line); stroke-width: 10; stroke-linecap: round; }
.ag-path { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ag-draw 2.2s ease-out forwards; filter: drop-shadow(0 0 5px #ffffff55); }
.ag-ring-bg { fill: none; stroke: var(--line); stroke-width: 5; }
.ag-ring { fill: none; stroke: var(--c); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0 var(--len); animation: ag-fill 1.1s var(--d) ease-out forwards; filter: drop-shadow(0 0 6px var(--c)); }
.ag-core { fill: var(--bg); stroke: var(--c); stroke-width: 1.5; }
.ag-node { opacity: 0; animation: ag-pop .5s var(--d) ease-out forwards; transform-box: fill-box; transform-origin: center; }
.ag-pct { fill: var(--text); font-weight: 800; font-size: 13px; }
.ag-cat { fill: var(--c); font-size: 9px; letter-spacing: .12em; font-weight: 700; }
.ag-name { fill: var(--text); font-size: 14px; font-weight: 700; }
.ag-sub { fill: var(--muted); font-size: 10.5px; }
@keyframes ag-draw { to { stroke-dashoffset: 0; } }
@keyframes ag-fill { to { stroke-dasharray: var(--fill) var(--len); } }
@keyframes ag-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ag-path, .ag-ring, .ag-node { animation-duration: .01s; animation-delay: 0s; } }

.belt-big { display: flex; justify-content: center; padding: 6px 0 10px; }
.belt-big .beltbar { width: 220px; height: 30px; border-radius: 4px; }
.belt-big .beltbar .tab { width: 70px; right: 14px; gap: 4px; padding: 0 6px; }
.belt-big .beltbar .tab u { flex: 0 0 7px; }
.stripes { display: flex; gap: 8px; flex-wrap: wrap; }
.stripe-pick { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); font-weight: 700; }
.stripe-pick.on { border-color: var(--gold); background: var(--gold); color: var(--on-gold); }

/* ---------- Boards ---------- */
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; padding: 10px 6px; }
.board { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.board li { display: grid; grid-template-columns: 30px 1fr auto 12px; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.board li.empty { display: block; border: 0; background: none; }
.board li.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.board .pos { font-weight: 800; color: var(--muted); text-align: center; }
.board li.top1 .pos { color: #f5c542; } .board li.top2 .pos { color: #c3ccd8; } .board li.top3 .pos { color: #cd7f32; }
.board .nm { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; flex-wrap: wrap; }
.board .xpv { font-weight: 700; text-align: right; } .board .xpv small { color: var(--muted); font-weight: 400; }
.board .dotl { width: 10px; height: 10px; border-radius: 50%; }
.board .beltbar { width: 30px; height: 7px; }
.board .beltbar .tab { width: 13px; }
.join { background: var(--raise); border: 1px dashed var(--gold); border-radius: 12px; padding: 12px; margin: 10px 0; }
.small { font-size: .75rem; }
.switch-row.between { justify-content: space-between; color: var(--text); }
.switch-row small.block { display: block; }

.accolades { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.acc { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.acc b { font-size: .98rem; }
.acc span { color: var(--muted); font-size: .82rem; }
.acc.hot { border-color: var(--gold); background: linear-gradient(135deg, var(--hero1), var(--hero2)); }
.acc.hot b { color: var(--gold); }
.acc.big { border-color: var(--gold); }

[hidden] { display: none !important; }

/* ---------- Leaderboards hub ---------- */
.hub-card { width: 100%; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.hub-card .lg-head { align-items: center; }
.hub-card .chev { margin-left: auto; font-size: 2rem; color: var(--muted); }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.mini-card { display: grid; gap: 4px; justify-items: start; text-align: left; cursor: pointer; color: inherit; font: inherit; padding: 14px; margin: 0; }
.mini-card .mi { font-size: 1.8rem; line-height: 1; }
.mini-card b { font-size: 1rem; }
.mini-card small { font-size: .75rem; }
.back { background: none; border: 0; color: var(--gold); font: inherit; font-weight: 700; padding: 6px 0; cursor: pointer; }
.board li.promo { border-left: 3px solid #3fbf7a; }
.board li.promo .dotl { color: #3fbf7a; width: auto; height: auto; background: none; font-size: .8rem; }

.lang3 { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); flex: none; }
.lang3 button { background: none; border: 0; padding: 6px 9px; font-size: .7rem; font-weight: 800; color: var(--muted); cursor: pointer; }
.lang3 button[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }

/* ---------- Round timer ---------- */
.t-clock { font-size: 4.2rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.1; color: var(--gold); }
.t-clock.rest { color: var(--good); }
.t-phase { text-align: center; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; }
.t-btns { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.t-btns .primary { min-width: 120px; }
.t-cfg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.t-cfg label { display: grid; gap: 4px; font-size: .75rem; color: var(--muted); }
.timer-pill { position: fixed; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 30; background: var(--gold); color: var(--on-gold); font-weight: 800; padding: 8px 14px; border-radius: 999px; box-shadow: 0 4px 14px #0006; text-decoration: none; font-variant-numeric: tabular-nums; }
.timer-pill.rest { background: var(--good); }
.timer-pill[hidden] { display: none; }

/* ---------- Style tab ---------- */
.arch-cards { display: grid; gap: 10px; margin-top: 12px; }
.arch-card { border: 1px solid var(--line); border-left: 4px solid var(--c, var(--gold)); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.arch-card.first { background: linear-gradient(135deg, var(--hero1), var(--hero2)); }
.arch-card p { margin: 6px 0 0; }
.arch-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.arch-head .match { color: var(--c, var(--gold)); font-weight: 800; font-size: .85rem; white-space: nowrap; }
#reps-cats { margin: 10px 0; }
#reps-cats .chip { cursor: pointer; border: 1px solid var(--line); background: none; color: var(--muted); font: inherit; }
#reps-cats .chip.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }

.chart.is-progress .legend, .chart.is-progress .totals { display: none; }
.chart:not(.is-progress) .prog-list { display: none; }
.prog-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.prog-list li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.prog-list li.hd { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.prog-list .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.prog-list span { margin-left: auto; }
.prog-list em { font-style: normal; font-weight: 800; min-width: 62px; text-align: right; }
.prog-list em.up { color: var(--good); } .prog-list em.down { color: var(--bad); }
.pad { padding: 30px 0; text-align: center; }

/* ---------- Log screen: date, scrolling category tabs, two bottom buttons ---------- */
.logdate { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.logdate b { color: var(--gold); }
.sticky-tabs { background: var(--bg); margin: 0 -16px; padding: 10px 16px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.sticky-tabs .tab { scroll-snap-align: center; flex: none; font-weight: 700; }
.rb-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.rb-row .round-btn { min-height: 62px; font-size: 1.05rem; line-height: 1.15; padding: 0 10px; }
.rb-row .round-btn small { display: block; font-size: .7rem; font-weight: 700; opacity: .8; }
.rb-row .round-btn[hidden] { display: none; }
.round-btn.cls { background: var(--gold); color: var(--on-gold); border: 0; }
.round-btn.cls.on { background: var(--bar); border: 2px solid var(--gold); color: var(--gold); }

.board li.gapsep { display: block; text-align: center; border: 0; background: none; color: var(--muted); padding: 0; line-height: 1; letter-spacing: .3em; }

/* ---------- A game node chart ---------- */
.ag-stage { margin: 6px -6px 0; border-radius: 16px; background: radial-gradient(circle at 50% 40%, var(--hero1), var(--hero2)); border: 1px solid var(--line); overflow: hidden; }
.ag-graph { width: 100%; height: auto; display: block; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.ag-graph:active { cursor: grabbing; }
.ag-edge { fill: none; stroke-linecap: round; transition: opacity .25s; }
.ag-node { cursor: pointer; transition: opacity .2s; }
.ag-node .ring { fill: var(--panel); stroke-width: 3; }
.ag-node .core { opacity: 1; }
.ag-node { filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
.ag-node.dim { filter: saturate(.3) opacity(.55); }
.ag-node .lbl { fill: var(--text); font-size: 10.5px; font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.ag-tools { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.ag-tools .ghost { padding: 6px 12px; font-size: .8rem; }
.ag-series { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ag-series li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--bg); }
.ag-series li.on { border-color: var(--g, var(--gold)); box-shadow: 0 0 0 1px var(--g, var(--gold)) inset; }
.ag-series .n { font-weight: 800; color: #0d1016; background: var(--g, var(--gold)); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; }
.ag-shadow { fill: #000; pointer-events: none; }
.ag-series .chain small { flex-basis: 100%; font-size: .68rem; }
.ag-series .chain { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.ag-series .chip { font-size: .7rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.ag-series .arr { color: var(--muted); font-style: normal; }
.ag-series .pct { font-size: 1.05rem; text-align: right; } .ag-series .pct small { display: block; font-size: .65rem; color: var(--muted); font-weight: 500; }
.ag-title { font-size: 1.05rem; line-height: 1.25; }

/* ---------- flags and athlete pop-up ---------- */
.flag { display: inline-flex; align-items: center; margin-right: 8px; flex: none; }
.flag svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.18); display: block; }
.board li.tap { cursor: pointer; }
.board li.tap:active { background: var(--raise); }
.athlete-dlg { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); width: min(440px, 92vw); max-height: 86vh; padding: 18px; }
.athlete-dlg::backdrop { background: rgba(0,0,0,.6); }
.ath-x { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.ath-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.ath-head .avatar { width: 52px; height: 52px; font-size: 1.3rem; }
.ath-name { display: flex; align-items: center; font-size: 1.15rem; }
.athlete-dlg h4 { margin: 14px 0 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ath-arch { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ath-arch li { display: flex; justify-content: space-between; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.ath-arch b { color: var(--gold); }
.ath-ach { display: flex; flex-wrap: wrap; gap: 6px; }
.ath-ach span { font-size: .78rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); }
.ath-ach .t4 { border-color: #7fd6ff; } .ath-ach .t3 { border-color: #f5b83d; } .ath-ach .t2 { border-color: #c3ccd8; } .ath-ach .t1 { border-color: #cd7f32; }
.ath-lock { text-align: center; padding: 26px 0 14px; } .ath-lock span { font-size: 2.6rem; } .ath-lock p { margin: 6px 0 0; font-weight: 700; }
.athlete-dlg .ag-series li { grid-template-columns: 24px 1fr auto; }

/* A-game node chart: futuristic dark stage, glowing links, neon grid floor */
.ag-stage { background: radial-gradient(ellipse at 50% 35%, #12264a 0%, #070b18 70%); border: 1px solid #2a4a8a; box-shadow: 0 0 24px #2b6cff22 inset, 0 0 18px #2b6cff22; position: relative; }
.ag-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(120,170,255,.05) 0 1px, transparent 1px 4px); }
.ag-grid line { stroke: #4f86ff; stroke-width: 1; opacity: .28; }
.ag-edge { stroke-linecap: round; }
.ag-edge.glow { filter: blur(3px); }
.ag-node { filter: drop-shadow(0 0 6px rgba(120,180,255,.55)); }
.ag-node .ring { fill: #0a1226; stroke-width: 2.5; }
.ag-node .halo { opacity: .18; }
.ag-node .lbl { fill: #e8f0ff; stroke: #050914; }
.ag-shadow { fill: #4f86ff; }

/* cartoon nodes: flat fill, thick dark outline, one highlight dot */
.ag-node { filter: none; }
.ag-node .ring { fill: #060a16; stroke: #060a16; stroke-width: 3.5; }
.ag-node .core { stroke: #fff; stroke-width: 1.6; }
.ag-node .shine { fill: #fff; opacity: .7; pointer-events: none; }
.ag-node .lbl { font-size: 9.5px; stroke-width: 2.5px; }

.ag-node .hit { fill: transparent; stroke: none; pointer-events: all; }
.ag-node { touch-action: none; }

/* network look: small plain white nodes, hair-thin links */
.ag-stage { background: radial-gradient(ellipse at 50% 40%, #1d1f26 0%, #121318 75%); border-color: #2c2f3a; box-shadow: none; }
.ag-stage::after { display: none; }
.ag-grid line { opacity: .08; }
.ag-node .core { fill: #fff; stroke: none; }
.ag-node .ring, .ag-node .shine { display: none; }
.ag-node { filter: none; }
.ag-node .lbl { font-size: 8.5px; font-weight: 600; fill: #e6e9f2; stroke: #121318; stroke-width: 2.2px; }
.ag-best { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; }
.ag-best div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; gap: 2px; }
.ag-best small { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
.ag-best span { font-size: .85rem; font-weight: 600; }
.ag-best span b { color: var(--text); }

.ag-series li { cursor: default; }
.ag-series li.on { box-shadow: none; border-color: var(--line); }
.ag-series li { border-color: var(--g); }

.ag-series li.on { border-color: var(--g); box-shadow: 0 0 0 1px var(--g) inset; }
.ag-series li { box-shadow: 0 0 0 1px var(--g) inset; }

/* splash */
.splash { max-width: 420px; margin: 6vh auto 0; text-align: center; padding: 0 4px; }
.splash-mark { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(145deg, var(--hero1), var(--hero2)); border: 1px solid var(--line); }
.splash-mark .dot { width: 26px; height: 26px; }
.splash h1 { font-size: 2.3rem; margin: 0; letter-spacing: -.02em; }
.splash-tag { color: var(--muted); margin: 6px 0 22px; font-size: 1.05rem; }
.splash-points { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; text-align: left; }
.splash-points li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.splash-points span { color: var(--muted); font-size: .88rem; }
.splash-cta { display: grid; gap: 10px; }
.splash-cta .btn { display: block; padding: 14px; border-radius: 14px; font-weight: 700; text-align: center; text-decoration: none; }
.splash-cta .btn.primary { background: var(--gold); color: #1a1300; }
.splash-cta .btn.ghost { border: 1px solid var(--line); color: var(--text); }
.splash-foot { margin-top: 18px; }

.danger-zone { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.danger-zone summary { cursor: pointer; color: #ef5b5b; font-weight: 600; }
.danger-zone form { display: grid; gap: 10px; margin: 10px 0; }
button.danger { background: #ef5b5b; color: #fff; border: 0; padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.ok-tag { color: var(--green, #3ecf8e); font-size: .75rem; }

/* A game is a still picture: no grid floor, no shadows, never captures touches */
.ag-grid, .ag-shadow { display: none; }
.ag-graph { touch-action: auto; cursor: default; pointer-events: none; }
.ag-stage { pointer-events: none; }

/* favorite stars */
.fav-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.fav-top .fav-name { flex: 1; }
button.star { background: transparent; border: 0; color: var(--muted); font-size: 1.5rem; line-height: 1; padding: 6px; min-width: 40px; min-height: 40px; cursor: pointer; }
button.star.on { color: #f5b83d; }
.tech { grid-template-columns: 40px 1fr 70px 70px; padding-left: 4px; }

/* zoom is back: pinch or the buttons; one finger still scrolls the page */
.ag-graph { pointer-events: auto; touch-action: pan-y; }
.ag-stage { pointer-events: auto; }

/* ===== Social ===== */
.soc-cards { display: grid; gap: 12px; margin: 14px 0; }
.soc-card { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; cursor: pointer; color: inherit; font: inherit; position: relative; }
.soc-card .mi { font-size: 1.8rem; }
.soc-card b { font-size: 1.1rem; display: block; }
.soc-card small { display: block; }
.soc-card .chev { margin-left: auto; font-size: 2rem; color: var(--muted); }
em.badge { background: #ef5b5b; color: #fff; font-style: normal; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.row-form { display: flex; gap: 8px; margin: 8px 0; }
.row-form input { flex: 1; min-width: 0; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; align-items: center; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plist > li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.plist .grow { flex: 1; }
.plist li.thread { cursor: pointer; }
.plist .last { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-t { color: #ef5b5b; }
.qr-box { text-align: center; margin-top: 10px; }
.qr-card { display: inline-block; background: #fff; padding: 8px; border-radius: 14px; }
.chat-log { display: flex; flex-direction: column; gap: 6px; height: calc(100vh - 330px); min-height: 220px; overflow-y: auto; padding: 8px 2px; }
.bub { max-width: 80%; padding: 8px 12px; border-radius: 18px; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.bub small { display: block; font-size: .65rem; opacity: .65; margin-top: 2px; }
.bub.me { align-self: flex-end; background: var(--gold); color: #1a1300; border-bottom-right-radius: 4px; }
.bub.them { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 8px; position: sticky; bottom: 84px; background: var(--bg); padding: 8px 0; }
.chat-form input { flex: 1; min-width: 0; }
.col-form { display: grid; gap: 10px; }
.col-form label { display: grid; gap: 4px; }
.col-form textarea { width: 100%; resize: vertical; }
.col-form details { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; gap: 8px; }
.col-form label.check { display: flex; gap: 8px; align-items: center; }
.cbar { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 8px; align-items: center; margin: 6px 0; font-size: .85rem; }
.cbar i { display: block; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.cbar i b { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.cbar em { font-style: normal; font-weight: 700; text-align: right; }
.notes .note { display: grid; gap: 6px; }
.notes .note.dismissed { opacity: .5; }
.notes .note p { margin: 4px 0; }
.goalline { color: var(--gold); font-weight: 600; }
#scan-video { width: 100%; border-radius: 12px; background: #000; max-height: 50vh; }
textarea, .col-form select, .col-form input[type=number] { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }
.plist .ghost, .plist .primary { padding: 6px 12px; font-size: .8rem; }

/* ===== Brand mark: replaces the old gold dot everywhere ===== */
.dot { width: 26px; height: 26px; border-radius: 0; background: url(/static/icons/mark.svg) center / contain no-repeat; margin-right: 8px; }
.brand .dot { width: 26px; height: 25px; }
.auth h1 .dot { width: 30px; height: 29px; vertical-align: -4px; }

/* ===== Landing page ===== */
.sp { max-width: 560px; margin: 0 auto; padding-bottom: 40px; }
.sp .eyebrow { margin: 0; }
.sp h2 { font-size: 1.6rem; line-height: 1.15; margin: .2em 0 .4em; text-transform: none; letter-spacing: -.01em; color: var(--text); }
.sp-hero { position: relative; text-align: center; padding: 34px 6px 26px; overflow: hidden; }
.sp-glow { position: absolute; inset: -40px -20px auto; height: 380px; background: radial-gradient(ellipse at 50% 30%, rgba(245,184,61,.28), rgba(47,123,255,.12) 45%, transparent 70%); pointer-events: none; animation: sp-pulse 6s ease-in-out infinite; }
@keyframes sp-pulse { 50% { opacity: .65; transform: scale(1.05); } }
.sp-mark { position: relative; width: 96px; height: auto; margin: 0 auto 6px; display: block; filter: drop-shadow(0 8px 24px rgba(245,184,61,.35)); animation: sp-float 5s ease-in-out infinite; }
@keyframes sp-float { 50% { transform: translateY(-6px); } }
.sp-title { position: relative; margin: 0; font-size: 3.2rem; font-weight: 900; letter-spacing: -.04em; line-height: .95; text-transform: none; color: var(--text); }
.sp-title em { font-style: normal; background: linear-gradient(90deg, #ffd36b, #f5b83d 60%, #ef9d2b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sp-head { position: relative; font-size: 1.5rem; margin: 18px 0 8px; font-weight: 600; }
.sp-head b { color: var(--gold); }
.sp-sub { position: relative; color: var(--muted); max-width: 440px; margin: 0 auto 22px; line-height: 1.5; }
.sp-cta { position: relative; display: grid; gap: 10px; max-width: 340px; margin: 0 auto; }
.sp-cta .btn { display: block; padding: 15px; border-radius: 14px; font-weight: 800; text-align: center; text-decoration: none; font-size: 1.02rem; }
.sp-cta .btn.primary { background: linear-gradient(180deg, #ffc94f, #f5b83d); color: #1a1300; box-shadow: 0 10px 30px rgba(245,184,61,.3); }
.sp-cta .btn.ghost { border: 1px solid var(--line); color: var(--text); }
.sp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 30px; text-align: center; }
.sp-stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 6px; }
.sp-stats b { display: block; font-size: 1.7rem; font-weight: 900; color: var(--gold); line-height: 1.1; }
.sp-stats span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.sp-sec, .sp-final { margin: 34px 0; opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.sp-sec.in, .sp-final.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .sp-sec, .sp-final { opacity: 1; transform: none; transition: none; } .sp-glow, .sp-mark { animation: none; } }
.sp-phone.favs { margin: 12px 0 0; pointer-events: none; }
.sp-phone .star { font-size: 1.4rem; padding: 6px; }
.sp-phone .star.on { color: #f5b83d; }
.sp-chat { display: grid; gap: 8px; margin-top: 12px; }
.sp-chat .bub { max-width: 82%; }
.sp-note { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 14px; padding: 12px; display: grid; gap: 6px; }
.sp-note span { color: var(--gold); font-weight: 700; }
.sp-note .primary { justify-self: start; padding: 6px 14px; font-size: .8rem; pointer-events: none; }
.sp-final { text-align: center; background: radial-gradient(ellipse at 50% 0, rgba(245,184,61,.16), transparent 70%), var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 28px 16px; }
.sp .legend { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: .8rem; margin: 4px 0 10px; }
.sp .legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
@media (min-width: 900px) { .sp { max-width: 720px; } .sp-title { font-size: 4.4rem; } }
.sp-head b { display: block; font-size: 1.9rem; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

.pwmeter { margin: -4px 0 12px; font-size: .8rem; color: var(--muted); }
.pwbar { height: 6px; border-radius: 3px; background: var(--border, #2c3446); overflow: hidden; margin-bottom: 6px; }
.pwbar i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.bill-price { font-size: 1.6rem; margin: 4px 0 10px; }
.bill-list { padding-left: 18px; line-height: 1.7; }

/* Menu: the round timer sits in its own box under everything else */
#drawer .drawer-tools { display: grid; gap: 8px; margin: 16px 4px 6px; }
#drawer .drawer-timer { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 14px; background: linear-gradient(135deg, #ffd36b, #f5b83d 60%, #ef9d2b); color: #1a1300; font-weight: 800; text-decoration: none; box-shadow: 0 6px 18px #f5b83d33; }
#drawer .drawer-timer span { font-size: 1.2rem; }
#drawer .drawer-timer { font-size: .92rem; }
#drawer .drawer-timer.alt { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--gold); }
#drawer .drawer-timer small { display: block; font-weight: 600; opacity: .75; }
.cat-row[hidden], .dots[hidden] { display: none; }

.codebox { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
.mfa-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.codes { background: var(--bg); padding: 10px; border-radius: 10px; line-height: 1.7; user-select: all; }

/* developer crown, sits between flag and name */
.crown { display: inline-flex; align-items: center; margin-right: 6px; flex: none; vertical-align: middle; }
.crown svg { display: block; filter: drop-shadow(0 0 2px rgba(245,184,61,.5)); }
/* photo cropper */
.ph-hint { text-align: center; margin: 6px 0 0; }
.crop-modal { position: fixed; inset: 0; z-index: 60; background: #000c; display: grid; place-items: center; padding: 16px; overflow: auto; }
.crop-modal[hidden] { display: none; }
.crop-card { background: var(--panel, #161a20); border: 1px solid var(--line); border-radius: 16px; padding: 16px; width: min(100%, 340px); display: grid; gap: 10px; justify-items: center; text-align: center; }
.crop-card h2 { margin: 0; font-size: 1.1rem; }
.crop-stage { position: relative; width: 280px; height: 280px; overflow: hidden; background: #000; border-radius: 12px; touch-action: none; cursor: grab; user-select: none; }
.crop-stage img { position: absolute; max-width: none; pointer-events: none; }
.crop-ring { position: absolute; left: 10px; top: 10px; width: 260px; height: 260px; border-radius: 50%; box-shadow: 0 0 0 400px rgba(0,0,0,.62); border: 2px solid #fff; pointer-events: none; }
.crop-zoom { display: flex; gap: 8px; align-items: center; width: 100%; }
.crop-zoom input { flex: 1; }
.crop-prev { display: flex; gap: 10px; align-items: center; }
.crop-prev canvas { border-radius: 50%; border: 2px solid var(--line); }
.crop-btns { display: flex; gap: 10px; width: 100%; }
.crop-btns button { flex: 1; }

.who .whoname { display: inline-flex; align-items: center; flex-wrap: nowrap; }
.who .whoname .flag { margin-right: 6px; }
.ath-name { display: inline-flex; align-items: center; }

/* pull to refresh */
html, body { overscroll-behavior-y: contain; }
#ptr { position: fixed; top: env(safe-area-inset-top, 0px); left: 50%; z-index: 80; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--raise, #1b2029); color: var(--muted, #9aa4b2); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.35); opacity: 0; transform: translate(-50%, -40px); pointer-events: none; transition: opacity .15s; }
#ptr.ready { color: var(--gold, #f5b83d); border-color: var(--gold, #f5b83d); }
#ptr.spin svg { animation: ptrspin .8s linear infinite; }
@keyframes ptrspin { to { transform: rotate(360deg); } }

/* Undo: big and easy to hit */
.toast { padding: 12px 16px 16px; gap: 16px; font-size: 1.05rem; box-shadow: 0 8px 28px rgba(0,0,0,.5); overflow: hidden; }
.undo-btn { background: var(--gold); color: #1a1405; border: 0; border-radius: 999px; padding: 10px 20px; font-size: 1.05rem; font-weight: 800; cursor: pointer; min-height: 44px; }
.undo-btn:active { transform: scale(.97); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--gold); transform-origin: left; }
.toast.run .toast-bar { animation: toastbar var(--ms, 8s) linear forwards; }
@keyframes toastbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.undo-big { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin: 4px 0 10px; border-radius: 14px; border: 2px solid var(--gold); background: transparent; color: var(--gold); font-size: 1.1rem; font-weight: 800; cursor: pointer; }
.undo-big[hidden] { display: none; }
.undo-big:active { background: var(--gold); color: #1a1405; }
.toast { width: min(92vw, 440px); justify-content: space-between; }
.toast #toast-msg { flex: 1; text-align: left; }
.undo-btn { white-space: nowrap; flex: none; }

.perk { width: 20px; height: 20px; object-fit: contain; margin-right: 5px; vertical-align: middle; flex: none; }
.pn-squirrel { color: #a855f7; font-weight: 800; text-shadow: 0 0 8px rgba(168,85,247,.35); }

.legal h2 { font-size: 1.05rem; margin: 22px 0 4px; }
.legal textarea, .legal input:not([type=checkbox]) { width: 100%; box-sizing: border-box; }

.notes-dlg { max-width: min(92vw, 460px); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.notes-dlg::backdrop { background: rgba(0,0,0,.6); }
.notes-dlg h3 { margin: 4px 0 8px; } .notes-dlg ul, #notes-list ul { padding-left: 18px; margin: 6px 0 12px; } .notes-dlg li, #notes-list li { margin: 4px 0; }

.top { min-width: 0; }
.top .brand { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top > * { flex-shrink: 0; }
.top .brand { flex-shrink: 1; }
@media (max-width: 460px) {
  .top { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .lang3 button { padding: 6px 7px; }
  .top .pill { padding: 3px 7px; }
}
@media (max-width: 380px) { .top .brand { font-size: .95rem; } }
