:root {
  --night: #0B0F22; --navy: #151A38; --navy2: #1d2350; --navy3: #262e66;
  --yellow: #F6C453; --terra: #D97757; --terra2: #ff8a5c; --teal: #2FB5A6; --ivory: #F3EEE6;
  --muted: rgba(243, 238, 230, .64); --faint: rgba(243, 238, 230, .38); --line: rgba(243, 238, 230, .10);
  --glass: rgba(17, 21, 48, .78); --glass2: rgba(26, 32, 72, .9);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --display: 'Space Grotesk', system-ui, sans-serif; --ui: 'DM Sans', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--ivory); font-family: var(--ui); overflow: hidden; overscroll-behavior: none; }
body { height: 100dvh; -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
a { color: inherit; }
[hidden] { display: none !important; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; touch-action: none; }

/* ── top */
#top { position: fixed; top: calc(var(--st) + 10px); left: calc(var(--sl) + 14px); right: calc(var(--sr) + 14px); display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 10; pointer-events: none; }
#top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.glyph { width: 30px; height: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; border-radius: 9px; background: var(--navy); box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(0,0,0,.35); }
.glyph i { border-radius: 2px; background: var(--navy3); }
.glyph i:nth-child(1) { background: var(--yellow); box-shadow: 0 0 10px rgba(246,196,83,.8); animation: flick 6s infinite; }
.glyph i:nth-child(4) { background: var(--terra); box-shadow: 0 0 8px rgba(217,119,87,.7); }
@keyframes flick { 0%, 92%, 100% { opacity: 1 } 93% { opacity: .2 } 95% { opacity: 1 } 96% { opacity: .4 } }
.brand-t b { display: block; font-family: var(--display); font-size: 17px; letter-spacing: .08em; line-height: 1; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.brand-t small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); letter-spacing: .02em; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.top-r { display: flex; align-items: center; gap: 8px; }
.snd-wrap { position: relative; }
.pill.snd { width: 40px; padding: 0; justify-content: center; font-size: 15px; -webkit-touch-callout: none; }
.pill.snd.off { opacity: .7; }
.snd-pop { position: absolute; right: 0; top: 40px; width: 210px; padding: 6px; border-radius: 16px; background: var(--glass2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line), 0 14px 40px rgba(0,0,0,.5); animation: up .2s; }
.sw-row { display: flex; align-items: center; justify-content: space-between; height: 46px; padding: 0 10px; border-radius: 11px; font-size: 14px; cursor: pointer; }
.sw-row input { position: absolute; opacity: 0; pointer-events: none; }
.sw-row i { position: relative; width: 40px; height: 24px; border-radius: 24px; background: rgba(255,255,255,.15); transition: background .2s; }
.sw-row i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ivory); transition: transform .2s; }
.sw-row input:checked + i { background: var(--teal); }
.sw-row input:checked + i::after { transform: translateX(16px); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; color: var(--muted); }
.pill b { font-family: var(--mono); color: var(--ivory); font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4FE3A0; box-shadow: 0 0 8px #4FE3A0; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35 } }

#hud { position: fixed; top: calc(var(--st) + 52px); left: calc(var(--sl) + 12px); right: calc(var(--sr) + 12px); z-index: 9; display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.power { display: block; width: 100%; text-align: left; padding: 8px 12px 9px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line); }
.pw-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pw-l b { font-family: var(--mono); font-size: 14px; color: var(--yellow); }
.pw-r { font-family: var(--mono); font-size: 11px; }
.pw-bar { position: relative; height: 7px; border-radius: 9px; background: rgba(0,0,0,.35); overflow: hidden; }
.pw-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.pw-bar .res { background: rgba(246,196,83,.18); }
.pw-bar .lit { background: linear-gradient(90deg, #f0a548, var(--yellow)); box-shadow: 0 0 12px rgba(246,196,83,.7); }
.pw-bar .ticks i { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; border-radius: 0; background: rgba(243,238,230,.35); }
.pw-bar .ticks i.hit { background: #fff; }
.power.blackout .pw-bar .lit { background: linear-gradient(90deg, #8a3cff, #ff5e9a); box-shadow: 0 0 12px rgba(255,94,154,.7); }
.ticker { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px 0 6px; border-radius: 10px; background: rgba(11,15,34,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow: hidden; text-align: left; width: 100%; }
.tk-live { flex: none; font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; color: #ff8a8a; padding: 2px 5px; border-radius: 5px; background: rgba(255,94,94,.14); }
.tk-text { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ivory); }
.tk-text.in { animation: tkin .5s cubic-bezier(.2,.8,.2,1); }
@keyframes tkin { from { transform: translateY(14px); opacity: 0 } }

/* ── event bar: one event at a time, compact line, tap to expand */
.rail { position: fixed; top: calc(var(--st) + 138px); left: calc(var(--sl) + 12px); right: calc(var(--sr) + 12px); z-index: 8; max-width: 460px; }
.ev { border-radius: 14px; background: var(--glass2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line), 0 10px 30px rgba(0,0,0,.3); cursor: pointer; }
.ev.fresh { animation: evin .35s cubic-bezier(.2,.8,.2,1); }
@keyframes evin { from { opacity: 0; transform: translateY(-6px) } }
.ev-line { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 8px 0 11px; }
.ev-ic { flex: none; font-size: 15px; }
.ev-k { flex: none; font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ev-x { flex: 1; min-width: 0; font-family: var(--display); font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .cd { flex: none; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.ev-act { flex: none; height: 28px; padding: 0 10px; border-radius: 9px; font-size: 12px; font-weight: 700; color: #1b1203; background: linear-gradient(180deg, #ffd978, var(--yellow)); box-shadow: 0 0 14px rgba(246,196,83,.4); }
.ev-tag { flex: none; height: 24px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 8px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.08); color: var(--muted); }
.ev-tag.hot { background: rgba(217,119,87,.25); color: #ffc2ab; }
.ev-chip { flex: none; height: 26px; display: inline-flex; align-items: center; gap: 3px; padding: 0 8px; border-radius: 99px; font-family: var(--mono); font-size: 10.5px; color: var(--ivory); background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px var(--line); }
.ev-chip b { font-size: 14px; line-height: 1; margin-top: -1px; }
@media (max-width: 899px) { .ev-line .cd { display: none; } }
.ev-caret { flex: none; width: 14px; text-align: center; font-size: 10px; color: var(--faint); }
.ev-body { padding: 0 12px 12px; }
.ev-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.ev-t { margin-top: 4px; font-family: var(--display); font-size: 15px; font-weight: 700; line-height: 1.25; }
.ev-t.sm2 { font-size: 14px; }
.ev-left { font-family: var(--mono); font-size: 11px; font-weight: 500; color: #9FE7FF; }
.ev-s { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.ev.blackout { background: linear-gradient(135deg, rgba(48,10,44,.94), rgba(18,12,42,.94)); box-shadow: inset 0 0 0 1px rgba(255,94,154,.45), 0 0 26px rgba(255,94,154,.18); }
.ev.blackout .ev-k { color: #ff8ab8; }
.ev.win { box-shadow: inset 0 0 0 1px rgba(246,196,83,.55); }
.ev.treasure { background: linear-gradient(135deg, rgba(18,40,60,.93), rgba(20,22,58,.93)); box-shadow: inset 0 0 0 1px rgba(159,231,255,.3); }
.ev.treasure .ev-k { color: #9FE7FF; }
.ev.poll .ev-k { color: #ffb194; }
.ev.clue .ev-k { color: var(--yellow); }
.bar2 { margin-top: 8px; height: 6px; border-radius: 6px; background: rgba(0,0,0,.35); overflow: hidden; }
.bar2 i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ff5e9a, var(--yellow)); transition: width .6s; }
.btn-relight { margin-top: 10px; width: 100%; height: 48px; border-radius: 12px; font-family: var(--display); font-weight: 700; font-size: 15px; color: #1a0f05; background: linear-gradient(180deg, #ffd978, var(--yellow)); box-shadow: 0 0 24px rgba(246,196,83,.45); }
.vote { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.vote button { position: relative; overflow: hidden; min-height: 46px; padding: 6px 10px; border-radius: 11px; text-align: left; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 500; line-height: 1.2; }
.vote button i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(217,119,87,.28); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.vote button span { position: relative; display: block; }
.vote button em { position: relative; display: block; font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.vote button.mine { box-shadow: inset 0 0 0 2px var(--terra); }

/* ── fabs */
#fabs { position: fixed; right: calc(var(--sr) + 12px); bottom: calc(var(--dock-h, 150px) + 14px); z-index: 9; display: flex; flex-direction: column; gap: 9px; transition: bottom .35s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.fab { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line), 0 6px 20px rgba(0,0,0,.35); font-size: 19px; }
.fab svg { width: 21px; height: 21px; fill: none; stroke: var(--ivory); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fab b { font-family: var(--display); font-size: 20px; }
.fab:active { transform: scale(.94); }
body.sheet-open #fabs { opacity: 0; pointer-events: none; }
@media (max-width: 899px) { body.card-open #fabs { opacity: 0; pointer-events: none; } }
body.ob-open #top, body.ob-open #hud, body.ob-open .rail, body.ob-open .dock, body.ob-open #fabs, body.ob-open #labels, body.ob-open .edge-you { opacity: 0; pointer-events: none; transition: opacity .3s; }

/* ── dock (bottom, state dependent) */
.dock { position: fixed; left: calc(var(--sl) + 10px); right: calc(var(--sr) + 10px); bottom: calc(var(--sb) + 10px); z-index: 11; max-width: 520px; margin: 0 auto; border-radius: 22px; padding: 14px 14px 14px; background: var(--glass2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--line), 0 18px 50px rgba(0,0,0,.5); transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s; }
body.card-open .dock, body.sheet-open .dock { transform: translateY(130%); opacity: 0; pointer-events: none; }
.dock h2 { margin: 0; font-family: var(--display); font-size: 20px; line-height: 1.15; letter-spacing: -.01em; }
.dock p { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.row { display: flex; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 18px; border-radius: 14px; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .01em; transition: transform .12s, filter .12s; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #e88a69, var(--terra)); color: #fff; box-shadow: 0 8px 24px rgba(217,119,87,.45), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.gold { background: linear-gradient(180deg, #ffd978, var(--yellow)); color: #1b1203; box-shadow: 0 8px 24px rgba(246,196,83,.35); }
.btn.ghost { background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px var(--line); }
.btn.teal { background: linear-gradient(180deg, #3cc8b8, var(--teal)); color: #04211d; }
.btn.wide { width: 100%; }
.btn.sm { height: 40px; font-size: 14px; padding: 0 14px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.dock .cta { margin-top: 12px; }
.dock .cta .btn.primary { flex: 1; }
.dock .note { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.me { display: flex; gap: 12px; align-items: center; }
.me img.thumb { width: 54px; height: 72px; border-radius: 8px; flex: none; box-shadow: 0 0 0 1px var(--line), 0 6px 20px rgba(0,0,0,.4); }
.me .who { min-width: 0; flex: 1; }
.me .h { font-family: var(--display); font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .s { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.me .s b { font-family: var(--mono); color: var(--ivory); font-weight: 500; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: rgba(255,255,255,.08); color: var(--ivory); }
.tag.lit { background: rgba(246,196,83,.16); color: var(--yellow); }
.tag.off { background: rgba(255,255,255,.07); color: var(--muted); }
.tag.res { background: rgba(246,196,83,.1); color: #f3d38a; }
.tag.fire { background: rgba(255,111,145,.14); color: #ff9ab4; }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 12px; }
.act { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 58px; border-radius: 14px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line); font-size: 11.5px; font-weight: 500; color: var(--muted); }
.act .ic { font-size: 20px; line-height: 1; filter: saturate(1.1); }
.act.hot { background: linear-gradient(180deg, rgba(246,196,83,.22), rgba(246,196,83,.08)); box-shadow: inset 0 0 0 1px rgba(246,196,83,.5); color: var(--ivory); }
.act .badge { position: absolute; top: 6px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--terra2); box-shadow: 0 0 8px var(--terra2); animation: pulse 1.4s infinite; }
.act:active { transform: scale(.96); }
.wait { display: flex; align-items: center; gap: 10px; }
.radar { position: relative; width: 38px; height: 38px; flex: none; border-radius: 50%; background: rgba(217,119,87,.15); }
.radar::before, .radar::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--terra); animation: ping 1.8s infinite; }
.radar::after { animation-delay: .9s; }
.radar i { position: absolute; inset: 12px; border-radius: 50%; background: var(--terra); }
@keyframes ping { from { transform: scale(.5); opacity: 1 } to { transform: scale(1.5); opacity: 0 } }

/* ── window card */
.wincard { position: fixed; left: calc(var(--sl) + 10px); right: calc(var(--sr) + 10px); bottom: calc(var(--sb) + 10px); z-index: 12; max-width: 520px; margin: 0 auto; border-radius: 22px; padding: 14px; background: var(--glass2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--line), 0 18px 50px rgba(0,0,0,.5); animation: up .35s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
.wincard .x, .sheet .x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.07); font-size: 16px; color: var(--muted); }
.wincard .me { padding-right: 40px; }
.wincard .cta { display: flex; gap: 8px; margin-top: 12px; }
.wincard .cta .btn { flex: 1; }
.switch { display: block; margin: 10px auto 0; font-size: 12px; color: var(--faint); text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.spark-btn { background: linear-gradient(180deg, rgba(255,210,74,.25), rgba(255,122,184,.18)); box-shadow: inset 0 0 0 1px rgba(255,210,74,.5); }
.spark-btn.cool { opacity: .55; }

/* ── sheet */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(5,7,18,.45); animation: fade .25s; }
@keyframes fade { from { opacity: 0 } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 560px; margin: 0 auto; max-height: calc(100dvh - var(--st) - 40px); display: flex; flex-direction: column; border-radius: 26px 26px 0 0; background: linear-gradient(180deg, #1b2150, #131838); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 -20px 60px rgba(0,0,0,.5); padding-bottom: var(--sb); animation: sheetup .38s cubic-bezier(.2,.8,.2,1); }
.sheet.closing { transform: translateY(105%); transition: transform .25s ease-in; }
@keyframes sheetup { from { transform: translateY(100%) } }
.sheet .grab { flex: none; width: 40px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.2); margin: 9px auto 0; }
.sheet-body { position: relative; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 18px 20px; overscroll-behavior: contain; }
.sheet h3 { margin: 4px 44px 4px 0; font-family: var(--display); font-size: 24px; letter-spacing: -.01em; line-height: 1.15; }
.sheet .sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.sheet .x { top: 8px; right: 14px; }
.kicker { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--terra2); text-transform: uppercase; }

/* claim steps */
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); }
.step .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 14px; background: rgba(255,255,255,.08); color: var(--muted); }
.step.done .n { background: var(--teal); color: #04211d; }
.step.now { background: rgba(217,119,87,.10); box-shadow: inset 0 0 0 1.5px rgba(217,119,87,.6); }
.step.now .n { background: var(--terra); color: #fff; }
.step.warn { background: rgba(246,196,83,.08); box-shadow: inset 0 0 0 1.5px rgba(246,196,83,.6); }
.step.warn .n { background: var(--yellow); color: #1b1203; }
.step b.t { display: block; font-family: var(--display); font-size: 16px; margin: 5px 0 4px; }
.step p { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.step p:last-child { margin-bottom: 0; }
.code { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 10px; margin: 2px 0 10px; border-radius: 14px; background: #0b0f22; box-shadow: inset 0 0 0 1px rgba(246,196,83,.35), 0 0 30px rgba(246,196,83,.08); font-family: var(--mono); font-weight: 700; font-size: 30px; letter-spacing: .08em; color: var(--yellow); text-shadow: 0 0 18px rgba(246,196,83,.5); -webkit-user-select: all; user-select: all; }
.code small { font-size: 30px; color: var(--ivory); text-shadow: none; }
.exp { font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: center; margin-top: 8px; }

/* clue */
.cluecard { position: relative; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #2a2257, #1a1f4a); box-shadow: inset 0 0 0 1px rgba(246,196,83,.3); overflow: hidden; }
.cluecard::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(246,196,83,.25), transparent 70%); }
.cluecard .hint { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.3; margin: 6px 0 12px; }
.wordin { display: flex; gap: 8px; margin-top: 14px; }
.wordin input { flex: 1; min-width: 0; height: 56px; border-radius: 14px; border: 0; padding: 0 16px; background: #0b0f22; box-shadow: inset 0 0 0 1.5px rgba(243,238,230,.18); font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: .12em; text-transform: uppercase; outline: none; }
.wordin input:focus { box-shadow: inset 0 0 0 2px var(--yellow); }
.wordin input::placeholder { color: rgba(243,238,230,.25); letter-spacing: .06em; font-weight: 500; }
.wordin .btn { height: 56px; }
.dock .wordin.redeem { margin-top: 10px; }
.dock .wordin.redeem input, .dock .wordin.redeem .btn { height: 48px; font-size: 17px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px) } 40%, 80% { transform: translateX(7px) } }
.err { min-height: 18px; margin-top: 8px; font-size: 13px; color: #ffb08a; }
.found { display: flex; gap: 12px; align-items: center; padding: 14px; margin-top: 12px; border-radius: 16px; background: rgba(47,181,166,.12); box-shadow: inset 0 0 0 1px rgba(47,181,166,.4); font-size: 14px; }
.found b { font-family: var(--display); }

/* customize */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.25); margin: 4px 0 14px; }
.tabs button { flex: 1; height: 38px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tabs button.on { background: rgba(255,255,255,.1); color: var(--ivory); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 9px; }
.opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 92px; border-radius: 16px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); font-size: 11.5px; color: var(--muted); }
.opt.on { background: rgba(217,119,87,.14); box-shadow: inset 0 0 0 2px var(--terra2); color: var(--ivory); }
.opt.lock .sw, .opt.lock img, .opt.lock .nm { opacity: .5; }
.opt.lock::after { content: '🔒'; position: absolute; top: 6px; right: 7px; font-size: 11px; }
.opt .sw { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 18px currentColor, inset 0 -3px 6px rgba(0,0,0,.25); }
.opt img { width: 40px; height: 40px; }
.opt img.win { width: 34px; height: 46px; border-radius: 4px; }
.opt .how { display: block; max-width: 100%; padding: 0 4px; text-align: center; font-size: 9.5px; font-weight: 700; line-height: 1.15; color: rgba(243,238,230,.72); }
.opt .how.streak { color: #ff9ab4; }
.opt.lock .how { opacity: 1; }

.prevrow { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.prevrow img { width: 66px; height: 88px; border-radius: 8px; box-shadow: 0 0 30px rgba(246,196,83,.25); }
.perk { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.05); margin-bottom: 8px; }
.perk .pi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: rgba(255,255,255,.07); }
.perk.got .pi { background: rgba(255,111,145,.18); box-shadow: 0 0 18px rgba(255,111,145,.3); }
.perk b { display: block; font-family: var(--display); font-size: 15px; }
.perk small { color: var(--muted); font-size: 12px; }
.perk .pv { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.perk.got .pv { color: #ff9ab4; }
.hintbox { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(246,196,83,.07); box-shadow: inset 0 0 0 1px rgba(246,196,83,.2); font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* lists (search, towers, feed) */
.search { position: relative; margin: 6px 0 12px; }
.search input { width: 100%; height: 54px; border: 0; border-radius: 16px; padding: 0 16px 0 46px; background: #0b0f22; box-shadow: inset 0 0 0 1.5px rgba(243,238,230,.16); font-size: 17px; outline: none; }
.search input:focus { box-shadow: inset 0 0 0 2px var(--teal); }
.search svg { position: absolute; left: 15px; top: 16px; width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.list { display: flex; flex-direction: column; gap: 6px; }
.li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.04); text-align: left; min-height: 60px; }
.li:active { background: rgba(255,255,255,.08); }
.li img { width: 30px; height: 40px; border-radius: 4px; flex: none; }
.li .m { flex: 1; min-width: 0; }
.li .m b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .m small { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.li.mine { box-shadow: inset 0 0 0 1.5px var(--terra2); background: rgba(217,119,87,.1); }
.rank { width: 26px; text-align: center; font-family: var(--mono); font-weight: 700; color: var(--muted); }
.li .tb { height: 5px; border-radius: 5px; margin-top: 6px; background: rgba(0,0,0,.35); overflow: hidden; }
.li .tb i { display: block; height: 100%; background: linear-gradient(90deg, #f0a548, var(--yellow)); border-radius: 5px; }
.li .num { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--yellow); text-align: right; }
.li .num small { display: block; font-size: 10px; color: var(--faint); font-weight: 500; }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.empty b { color: var(--ivory); font-family: var(--display); font-size: 17px; display: block; margin-bottom: 4px; }
.feed .li { min-height: 0; align-items: flex-start; }
.feed .li .m b { white-space: normal; font-weight: 500; font-size: 14px; line-height: 1.4; }

/* invite + share */
.keybox { text-align: center; padding: 18px 12px; border-radius: 18px; background: #0b0f22; box-shadow: inset 0 0 0 1px rgba(47,181,166,.4); }
.keybox .k { font-family: var(--mono); font-weight: 700; font-size: 34px; letter-spacing: .16em; color: #4FE3D0; text-shadow: 0 0 20px rgba(79,227,208,.4); -webkit-user-select: all; user-select: all; }
.keybox .u { margin-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; -webkit-user-select: all; user-select: all; }
.keys { display: flex; justify-content: center; gap: 6px; margin: 14px 0 4px; font-size: 22px; }
.keys .used { opacity: .2; filter: grayscale(1); }
.share-prev { display: block; width: min(62%, 260px); margin: 4px auto 14px; aspect-ratio: 9 / 16; border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 0 1px var(--line); background: #0b0f22 center / cover; object-fit: cover; -webkit-user-select: auto; user-select: auto; -webkit-touch-callout: default; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--yellow); animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg) } }
.btns { display: flex; flex-direction: column; gap: 8px; }
.btns .row .btn { flex: 1; }

/* labels */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); white-space: nowrap; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: rgba(11,15,34,.72); color: var(--ivory); box-shadow: 0 2px 10px rgba(0,0,0,.4); will-change: transform; }
.lbl.near { font-weight: 500; font-size: 10px; padding: 2px 5px; background: rgba(11,15,34,.6); color: rgba(243,238,230,.85); transform: translate(-50%, 0); }
.lbl.near.r { color: #f3d38a; }
.lbl.sel { background: var(--ivory); color: var(--night); }
.lbl.you { background: var(--terra); color: #fff; font-family: var(--mono); letter-spacing: .04em; }
.lbl.you::after, .lbl.sel::after { content: ''; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: inherit; }
.lbl.you::after { border-top-color: var(--terra); }
.lbl.sel::after { border-top-color: var(--ivory); }
.floaty { position: absolute; left: 0; top: 0; font-size: 13px; font-weight: 700; color: #ffe08a; text-shadow: 0 0 12px rgba(255,200,80,.8), 0 1px 3px #000; animation: floaty 1.6s ease-out forwards; white-space: nowrap; }
@keyframes floaty { from { opacity: 0; translate: -50% 0 } 15% { opacity: 1 } to { opacity: 0; translate: -50% -60px } }
.edge-you { position: fixed; z-index: 9; display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 11px 0 9px; border-radius: 99px; background: var(--terra); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.4); transform: translate(-50%, -50%); }
.edge-you .arr { display: inline-block; font-size: 13px; }

/* toasts */
#toasts { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(var(--top-b, 180px) + 8px); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: min(92vw, 420px); }
.toast { padding: 10px 14px; border-radius: 14px; background: rgba(243,238,230,.95); color: var(--night); font-size: 13.5px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toastin .35s cubic-bezier(.2,.8,.2,1); text-align: center; line-height: 1.35; }
.toast.dark { background: rgba(26,32,72,.95); color: var(--ivory); box-shadow: inset 0 0 0 1px var(--line), 0 10px 30px rgba(0,0,0,.4); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .3s; }
@keyframes toastin { from { opacity: 0; transform: translateY(-10px) scale(.96) } }
body.sheet-open #toasts { top: calc(var(--st) + 8px); }
@media (max-width: 899px) { body.sheet-open #hud, body.sheet-open .rail { opacity: 0; pointer-events: none; transition: opacity .25s; } }
.sheet[data-kind='custom'] { max-height: min(60dvh, 560px); }
.sheet[data-kind='custom'] .grid { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 7px; }
.sheet[data-kind='custom'] .opt { height: auto; min-height: 76px; padding: 8px 2px 7px; border-radius: 14px; gap: 3px; }
.sheet[data-kind='custom'] .opt img { width: 32px; height: 32px; }
.sheet[data-kind='custom'] .opt img.win { width: 26px; height: 36px; }
.sheet[data-kind='custom'] .opt .sw { width: 28px; height: 28px; }
.sheet[data-kind='custom'] .prevrow img { width: 48px; height: 64px; }
.sheet[data-kind='custom'] h3 { font-size: 20px; }
.conn { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--dock-h, 150px) + 20px); transform: translateX(-50%); padding: 7px 12px; border-radius: 99px; background: rgba(255,94,94,.9); color: #fff; font-size: 12px; font-weight: 700; }

/* reveal */
.reveal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 42%, rgba(44,34,92,.9), rgba(5,7,18,.96) 70%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .3s; }
.rv { position: relative; width: min(100%, 340px); text-align: center; }
.rays { position: absolute; left: 50%; top: 92px; width: 420px; height: 420px; margin: -210px 0 0 -210px; background: repeating-conic-gradient(from 0deg, rgba(246,196,83,.16) 0 10deg, transparent 10deg 20deg); border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); animation: rot 14s linear infinite; pointer-events: none; }
@keyframes rot { to { transform: rotate(360deg) } }
.rv .prize { position: relative; width: 150px; height: 184px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 24px; background: linear-gradient(160deg, #2c3270, #171c45); box-shadow: 0 0 0 1px rgba(246,196,83,.45), 0 0 60px rgba(246,196,83,.35); animation: pop .7s cubic-bezier(.2,1.6,.4,1); }
.rv .prize img { width: 92px; height: 92px; }
.rv .prize img.win { width: 96px; height: 128px; border-radius: 8px; }
.rv .prize .sw { width: 86px; height: 86px; border-radius: 50%; box-shadow: 0 0 50px currentColor; }
@keyframes pop { from { transform: scale(.3) rotate(-12deg); opacity: 0 } }
.rv .kicker { color: var(--yellow); }
.rv h2 { margin: 6px 0 6px; font-family: var(--display); font-size: 28px; line-height: 1.1; }
.rv p { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.rv .btns .btn { width: 100%; }

/* onboarding */
.onboard { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(5,7,18,.1), rgba(5,7,18,.55) 35%, rgba(5,7,18,.94) 62%); animation: fade .4s; padding: calc(var(--st) + 14px) 0 calc(var(--sb) + 16px); }
.ob-skip { align-self: flex-end; margin-right: 16px; height: 36px; padding: 0 14px; border-radius: 99px; background: rgba(255,255,255,.1); font-size: 13px; font-weight: 700; color: var(--muted); }
.ob-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; align-items: flex-end; }
.ob-track::-webkit-scrollbar { display: none; }
.ob-card { flex: none; width: 100%; scroll-snap-align: center; padding: 0 22px; display: flex; flex-direction: column; justify-content: flex-end; }
.ob-art { height: 210px; margin-bottom: 18px; display: grid; place-items: center; }
.ob-card .kicker { margin-bottom: 8px; }
.ob-card h2 { margin: 0 0 10px; font-family: var(--display); font-size: 32px; line-height: 1.05; letter-spacing: -.02em; max-width: 440px; }
.ob-card p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; max-width: 440px; }
.ob-card p b { color: var(--ivory); }
.ob-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 22px 0; max-width: 560px; width: 100%; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots i { width: 7px; height: 7px; border-radius: 7px; background: rgba(255,255,255,.25); transition: .3s; }
.ob-dots i.on { width: 22px; background: var(--yellow); }
.ob-foot .btn { min-width: 140px; }
.mini-city { display: flex; align-items: flex-end; gap: 8px; }
.mini-city .tw { display: grid; grid-template-columns: repeat(3, 14px); gap: 5px; padding: 8px; border-radius: 6px 6px 0 0; background: #1d2350; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.mini-city .tw i { width: 14px; height: 18px; border-radius: 2px; background: #0f1330; }
.mini-city .tw i.l { background: #FFC66B; box-shadow: 0 0 12px rgba(255,198,107,.8); }
.mini-city .tw i.p { background: #FF7AB8; box-shadow: 0 0 12px rgba(255,122,184,.8); }
.mini-city .tw i.t { background: #4FE3D0; box-shadow: 0 0 12px rgba(79,227,208,.8); }
.mini-city .tw i.r { background: #0f1330; box-shadow: inset 0 0 0 1.5px rgba(246,196,83,.5); }
.mini-city.race .tw:nth-child(3) { box-shadow: 0 0 0 2px var(--yellow), 0 0 30px rgba(246,196,83,.35); position: relative; }
.mini-city.race .tw:nth-child(3)::before { content: '👑'; position: absolute; top: -30px; left: 50%; transform: translateX(-50%); font-size: 22px; }
.ob-dm { width: 230px; padding: 14px; border-radius: 20px; background: #1d2350; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.ob-dm .bub { margin-left: auto; width: fit-content; padding: 10px 14px; border-radius: 18px 18px 4px 18px; background: linear-gradient(135deg, #7b5cff, #d9488f); font-family: var(--mono); font-weight: 700; font-size: 16px; }
.ob-dm .bub2 { margin-top: 8px; width: fit-content; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: #2c336e; font-size: 13px; line-height: 1.35; }
.ob-streak { display: flex; gap: 10px; }
.ob-streak div { width: 74px; padding: 12px 6px; border-radius: 16px; text-align: center; background: #1d2350; font-size: 11px; color: var(--muted); }
.ob-streak div b { display: block; font-size: 26px; margin-bottom: 4px; }
.ob-streak div em { display: block; font-style: normal; font-family: var(--mono); font-weight: 700; color: var(--yellow); font-size: 13px; }

/* loader */
.loader { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--night); transition: opacity .8s; }
.loader.done { opacity: 0; pointer-events: none; }
.ld-glyph { width: 56px; height: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 7px; border-radius: 15px; background: var(--navy); }
.ld-glyph i { border-radius: 3px; background: var(--navy3); animation: ldon 1.6s infinite; }
.ld-glyph i:nth-child(2) { animation-delay: .2s } .ld-glyph i:nth-child(4) { animation-delay: .4s } .ld-glyph i:nth-child(3) { animation-delay: .6s }
@keyframes ldon { 30%, 60% { background: var(--yellow); box-shadow: 0 0 14px rgba(246,196,83,.8) } }
.loader b { font-family: var(--display); letter-spacing: .14em; font-size: 20px; }
.loader small { color: var(--muted); font-size: 13px; }

@media (min-width: 900px) {
  #hud { right: auto; width: 440px; }
  .rail { top: calc(var(--st) + 14px); left: 50%; right: auto; transform: translateX(-50%); width: 480px; }
  #toasts { top: calc(var(--top-b, 70px) + 10px); }
  body.sheet-open #toasts { top: calc(var(--top-b, 70px) + 10px); left: calc(50% - 220px); }
  .dock, .wincard { left: 24px; right: auto; bottom: 24px; width: 420px; margin: 0; }
  #fabs { bottom: 24px !important; right: 24px; }
  .sheet { left: auto; right: 24px; bottom: 24px; top: 24px; max-height: none; border-radius: 26px; width: 440px; }
  .sheet .grab { display: none; }
  @keyframes sheetup { from { transform: translateX(110%) } }
  .sheet.closing { transform: translateX(110%); }
  .onboard { align-items: center; }
  .ob-track { width: 100%; max-width: 560px; }
}
@media (max-height: 700px) and (max-width: 899px) {
  .acts .act { height: 50px; } .ob-art { height: 150px; } .ob-card h2 { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── ⚡ watts: level colors (candle → supernova) */
.lv0 { --lc: #FFB65C; --lc2: rgba(255,182,92,.35); } .lv1 { --lc: #FF7A4D; --lc2: rgba(255,122,77,.35); }
.lv2 { --lc: #FFD66B; --lc2: rgba(255,214,107,.38); } .lv3 { --lc: #FF6FB8; --lc2: rgba(255,111,184,.4); }
.lv4 { --lc: #EAF4FF; --lc2: rgba(234,244,255,.38); } .lv5 { --lc: #9FE7FF; --lc2: rgba(159,231,255,.42); }
.lv6 { --lc: #B49BFF; --lc2: rgba(180,155,255,.45); } .lv7 { --lc: #FFE27A; --lc2: rgba(255,226,122,.55); }

/* HUD chip, next to the city power bar */
.hud-row { display: flex; gap: 6px; align-items: stretch; }
.hud-row .power { flex: 1; min-width: 0; width: auto; }
.pw-row { gap: 8px; }
.pw-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-r { flex: none; }
.wchip { position: relative; flex: none; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 84px; padding: 7px 11px 8px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lc, #F6C453) 38%, transparent), 0 0 18px -6px var(--lc2, rgba(246,196,83,.4)); transition: transform .15s; }
.wchip:active { transform: scale(.95); }
.wc-top { display: flex; align-items: center; gap: 5px; line-height: 1; }
.wc-ic { font-size: 15px; filter: drop-shadow(0 0 6px var(--lc2)); }
.wc-top b { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--ivory); font-variant-numeric: tabular-nums; }
.wc-top i { font-style: normal; font-size: 11px; color: var(--yellow); margin-left: -2px; }
.wc-bar { display: block; height: 4px; border-radius: 4px; background: rgba(0,0,0,.4); overflow: hidden; }
.wc-bar i { display: block; height: 100%; border-radius: 4px; background: var(--lc, var(--yellow)); box-shadow: 0 0 8px var(--lc); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.wchip.bump { animation: wbump .9s cubic-bezier(.2,1.4,.4,1); }
@keyframes wbump { 0% { transform: scale(1) } 18% { transform: scale(1.1); box-shadow: inset 0 0 0 1.5px var(--lc), 0 0 30px var(--lc2) } 100% { transform: scale(1) } }
.wc-plus { position: absolute; right: 8px; top: 2px; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--yellow); text-shadow: 0 0 10px rgba(246,196,83,.9), 0 1px 3px #000; pointer-events: none; animation: wplus 1.25s ease-out forwards; }
@keyframes wplus { from { opacity: 0; transform: translateY(6px) } 15% { opacity: 1 } to { opacity: 0; transform: translateY(-26px) } }

/* toasts */
.toast.watts { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 8px; background: linear-gradient(135deg, rgba(42,34,87,.97), rgba(26,32,72,.97)); color: var(--ivory); box-shadow: inset 0 0 0 1px rgba(246,196,83,.45), 0 0 26px rgba(246,196,83,.18), 0 10px 30px rgba(0,0,0,.45); }
.toast.watts b { font-family: var(--mono); font-size: 15px; color: var(--yellow); text-shadow: 0 0 12px rgba(246,196,83,.6); font-variant-numeric: tabular-nums; }
.toast.watts small { flex-basis: 100%; font-size: 11.5px; color: #cfe9ff; }
.toast.watts.story { box-shadow: inset 0 0 0 1px rgba(234,244,255,.55), 0 0 30px rgba(159,231,255,.25), 0 10px 30px rgba(0,0,0,.45); }
.toast.watts.pop b { animation: wpop .45s cubic-bezier(.2,1.6,.4,1); display: inline-block; }
@keyframes wpop { from { transform: scale(1.35) } }

/* level badges */
.tag.lvl { background: color-mix(in srgb, var(--lc) 15%, transparent); color: var(--lc); }
.beamline { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 11px; border-radius: 12px; font-size: 12.5px; color: #dff2ff; background: linear-gradient(100deg, rgba(159,231,255,.16), rgba(159,231,255,.03)); box-shadow: inset 0 0 0 1px rgba(159,231,255,.28); }
.beamline b { color: #fff; }

/* watts sheet: header */
.wh { display: flex; gap: 14px; align-items: center; margin: 2px 0 12px; }
.wh-bulb { position: relative; flex: none; width: 70px; height: 70px; border-radius: 20px; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--lc) 30%, #1d2350), #121637 72%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lc) 50%, transparent), 0 0 34px -4px var(--lc2); }
.wh-bulb span { font-size: 36px; filter: drop-shadow(0 0 12px var(--lc)); animation: bulb 3.2s ease-in-out infinite; }
@keyframes bulb { 50% { filter: drop-shadow(0 0 20px var(--lc)); transform: scale(1.04) } }
.wh-m { min-width: 0; }
.wh-m .kicker { color: var(--lc); }
.sheet .wh h3 { margin: 3px 0 2px; }
.wh-n { font-size: 13px; color: var(--muted); }
.wh-n b { font-family: var(--mono); font-size: 17px; color: var(--yellow); font-variant-numeric: tabular-nums; }
.wprog { margin-bottom: 12px; }
.wbar { height: 9px; border-radius: 9px; background: rgba(0,0,0,.4); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.wbar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, color-mix(in srgb, var(--lc) 55%, #f0a548), var(--lc)); box-shadow: 0 0 14px var(--lc2); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.wprog-l { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.wprog-l b { font-family: var(--mono); color: var(--ivory); }
.wranks b { color: var(--yellow); }
.ladder { display: flex; justify-content: space-between; margin-top: 10px; padding: 7px 8px; border-radius: 12px; background: rgba(0,0,0,.22); }
.ladder span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-size: 16px; opacity: .28; filter: grayscale(1); }
.ladder span.got { opacity: .85; filter: none; }
.ladder span.now { opacity: 1; filter: drop-shadow(0 0 8px var(--lc)); background: color-mix(in srgb, var(--lc) 18%, transparent); box-shadow: inset 0 0 0 1.5px var(--lc); }

/* watts sheet: earn */
.earn { position: relative; overflow: hidden; padding: 14px; border-radius: 18px; margin-bottom: 10px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); }
.earn > * { position: relative; }
.earn.story { background: linear-gradient(160deg, #22295e, #161a40 70%); box-shadow: inset 0 0 0 1px rgba(234,244,255,.22); }
.earn.story .beamfx { position: absolute; right: 18px; bottom: -10px; width: 120px; height: 200px; transform-origin: 50% 100%; background: linear-gradient(0deg, rgba(234,244,255,.28), rgba(234,244,255,0) 85%); clip-path: polygon(46% 100%, 54% 100%, 100% 0, 0 0); filter: blur(2px); animation: sweep 7s ease-in-out infinite; pointer-events: none; opacity: .55; }
.earn.story.on .beamfx { opacity: 1; }
@keyframes sweep { 0%, 100% { transform: rotate(-16deg) } 50% { transform: rotate(14deg) } }
.earn.ref { background: linear-gradient(160deg, rgba(47,181,166,.16), rgba(22,26,64,.6) 70%); box-shadow: inset 0 0 0 1px rgba(79,227,208,.28); }
.eh { display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; }
.ei { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: rgba(255,255,255,.07); flex: none; }
.et { min-width: 0; }
.et b { display: block; font-family: var(--display); font-size: 15px; line-height: 1.2; }
.et small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.ew { flex: none; font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--yellow); white-space: nowrap; }
.earn.big .ew { padding: 5px 9px; border-radius: 99px; background: rgba(246,196,83,.14); font-size: 14px; }
.howto { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 7px; }
.howto li { counter-increment: s; display: flex; gap: 9px; align-items: baseline; font-size: 13px; color: var(--muted); line-height: 1.4; }
.howto li::before { content: counter(s); flex: none; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--night); background: #EAF4FF; transform: translateY(-1px); }
.howto b { color: var(--ivory); }
.beam-on { display: flex; justify-content: space-between; gap: 8px; margin-top: 11px; padding: 8px 11px; border-radius: 11px; font-size: 12.5px; font-weight: 700; color: #fff; background: rgba(159,231,255,.14); box-shadow: inset 0 0 0 1px rgba(159,231,255,.4); }
.beam-on .cd { font-family: var(--mono); font-weight: 500; color: #9FE7FF; }
.earn .row { margin-top: 12px; }
.earn .row .btn { height: 46px; font-size: 15px; }
.earn .row .btn:first-child { flex: 1; }
.earn .row .btn.grow { flex: 1; }
.reflink { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #0b0f22; box-shadow: inset 0 0 0 1px rgba(79,227,208,.3); font-family: var(--mono); font-size: 13px; color: #4FE3D0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-user-select: all; user-select: all; }
.refs { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.refs .dots { display: flex; gap: 4px; }
.refs .dots i { width: 11px; height: 14px; border-radius: 2px; background: #0f1330; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.refs .dots i.on { background: #4FE3D0; box-shadow: 0 0 9px rgba(79,227,208,.8); }
.earn-list { display: flex; flex-direction: column; gap: 4px; }
.erow { display: grid; grid-template-columns: 34px 1fr auto; gap: 11px; align-items: center; padding: 8px 10px 8px 8px; border-radius: 13px; background: rgba(255,255,255,.035); }
.erow .ei { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
.erow .et b { font-family: var(--ui); font-weight: 700; font-size: 13.5px; }

/* watts sheet: ranks + recent */
.seg { display: flex; gap: 6px; margin: 0 0 12px; }
.seg button { flex: 1; height: 34px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); }
.seg button.on { color: var(--night); background: var(--yellow); box-shadow: 0 0 16px rgba(246,196,83,.35); }
.li.lb { min-height: 56px; }
.rank.medal { font-size: 19px; }
.you-tag { margin-left: 7px; padding: 1px 6px; border-radius: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; color: #fff; background: var(--terra); vertical-align: 2px; }
.lb-gap { text-align: center; color: var(--faint); letter-spacing: .3em; line-height: 1; padding: 2px 0; }
.lb-foot { margin: 12px 2px 0; font-size: 12px; color: var(--faint); line-height: 1.4; text-align: center; }
.li.wr { min-height: 52px; }
.li.wr .ei { width: 34px; height: 34px; font-size: 16px; }
.lb-jump { display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; padding: 0 14px; margin: -2px 0 12px; border-radius: 14px; text-align: left; background: linear-gradient(100deg, rgba(246,196,83,.16), rgba(246,196,83,.04)); box-shadow: inset 0 0 0 1px rgba(246,196,83,.35); }
.lb-jump b { font-family: var(--display); font-size: 15px; }
.lb-jump small { flex: 1; font-size: 12px; color: var(--muted); }
.lb-jump i { font-style: normal; font-size: 20px; color: var(--yellow); }

/* claim: invited by */
.invited { display: flex; gap: 11px; align-items: center; margin: -4px 0 12px; padding: 10px 12px; border-radius: 14px; background: rgba(47,181,166,.12); box-shadow: inset 0 0 0 1px rgba(79,227,208,.35); font-size: 14px; }
.invited .iv-ic { font-size: 22px; }
.invited b { color: #4FE3D0; }
.invited small { display: block; margin-top: 1px; font-size: 12px; color: var(--muted); }

/* level-up reveal */
.rv.levelup .rays { background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--lc) 26%, transparent) 0 10deg, transparent 10deg 20deg); animation-duration: 9s; }
.rv.levelup .prize { box-shadow: 0 0 0 1.5px var(--lc), 0 0 80px var(--lc2); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--lc) 34%, #2c3270), #171c45 75%); }
.rv.levelup .kicker { color: var(--lc); }
.lvl-prize span { display: block; font-size: 92px; line-height: 1; filter: drop-shadow(0 0 24px var(--lc)); animation: lvlin 1s cubic-bezier(.2,1.5,.4,1) both .15s; }
.rv-up { display: flex; align-items: center; gap: 12px; width: 100%; margin: -4px 0 16px; padding: 10px 12px; border-radius: 16px; text-align: left; background: linear-gradient(100deg, color-mix(in srgb, var(--lc) 22%, transparent), rgba(255,255,255,.04)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--lc) 60%, transparent), 0 0 30px -6px var(--lc2); animation: upin .6s cubic-bezier(.2,1.4,.4,1) both; }
.rv-up .ic { font-size: 32px; filter: drop-shadow(0 0 12px var(--lc)); }
.rv-up .t { flex: 1; min-width: 0; }
.rv-up small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--lc); }
.rv-up b { display: block; font-family: var(--display); font-size: 17px; margin-top: 2px; }
.rv-up i { font-style: normal; font-size: 22px; color: var(--lc); }
@keyframes upin { from { opacity: 0; transform: translateY(10px) scale(.94) } }
@keyframes lvlin { from { transform: scale(.2) rotate(-25deg); opacity: 0 } }

/* ── reel capture mode (?capture=1): clean frame, visible taps */
body.capture #toasts, body.capture #conn { display: none !important; }
.tap-ripple { position: fixed; z-index: 100; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; pointer-events: none; background: rgba(243,238,230,.35); box-shadow: 0 0 0 2px rgba(243,238,230,.85), 0 0 24px rgba(255,255,255,.35); animation: ripple .6s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes ripple { 0% { transform: scale(.4); opacity: 1 } 60% { opacity: .9 } 100% { transform: scale(1.5); opacity: 0 } }
