:root {
  --ink: #e9f1ff;
  --muted: #9fb0cc;
  --panel: rgba(9, 13, 26, 0.86);
  --line: rgba(134, 217, 255, 0.28);
  --cy: #86d9ff;
  --pink: #ff7ab6;
  --good: #6dffa6;
  --bad: #ff5d7c;
  --gold: #ffe28a;
  --head: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --body: "Exo 2", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #03050b; color: var(--ink); font-family: var(--body); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.ui, .hud, .dock, .pausebtn, .toast, .spinpanel, .callhint, .netbanner, .emotes { z-index: 2; }
.ui { z-index: 5; }
.spinpanel { z-index: 6; }

/* ---------- overlay screens */
.ui { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow-y: auto; background: radial-gradient(ellipse at center, rgba(3,5,11,0.3), rgba(3,5,11,0.78)); }
.ui[hidden] { display: none; }
.panel { width: min(560px, 100%); max-height: 100%; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; box-shadow: 0 20px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: rise 0.3s ease-out; }
.panel.wide { width: min(880px, 100%); }
.panel.small { width: min(440px, 100%); text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.kicker { font: 700 12px/1.2 var(--head); letter-spacing: 0.18em; color: var(--cy); margin-bottom: 6px; }
.kicker.good { color: var(--good); } .kicker.bad { color: var(--bad); }
h1, h2, h3, h4 { font-family: var(--head); margin: 0 0 12px; letter-spacing: 0.03em; }
h2 { font-size: clamp(21px, 4vw, 28px); }
h2.big { font-size: clamp(30px, 6.5vw, 46px); color: var(--gold); }
h3 { font-size: 13px; color: var(--cy); margin-top: 16px; letter-spacing: 0.08em; }
p { line-height: 1.5; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.good { color: var(--good); } .bad { color: var(--bad); }

/* title */
.title { text-align: center; width: min(470px, 100%); }
.logo { font-size: clamp(38px, 9vw, 60px); line-height: 0.95; margin: 4px 0 12px; font-weight: 900; display: flex; flex-direction: column; align-items: center; position: relative; }
.logo span:not(.moon) { background: linear-gradient(180deg, #ffffff, #bfe6ff 55%, #5ab4ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(80,180,255,0.4)); }
.logo .b { background: linear-gradient(180deg, #fff6d6, #ffe28a 55%, #f0a92c) !important; -webkit-background-clip: text !important; background-clip: text !important; letter-spacing: 0.3em; margin-left: 0.3em; filter: drop-shadow(0 0 16px rgba(255,200,90,0.4)) !important; }
.logo .moon { width: 44px; height: 44px; border-radius: 50%; margin-bottom: 8px; background: radial-gradient(circle at 35% 35%, #fff 0, #e8ecf4 30%, #9aa6b8 70%, #5a6577 100%); box-shadow: 0 0 30px rgba(220,235,255,0.45), inset -8px -6px 0 rgba(0,0,0,0.18); position: relative; }
.logo .moon::after { content: "8"; position: absolute; inset: 11px; border-radius: 50%; background: #fff; color: #111; font: 800 15px/22px var(--body); text-align: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.tag { color: var(--muted); margin-bottom: 16px; }
.note { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* buttons */
.menu { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.menu .menu { margin-top: 0; }
.menu.row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.menu.row button { flex: 1 1 140px; }
.menu.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.menu.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }
button { font: 600 16px var(--body); color: var(--ink); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 11px 14px; cursor: pointer; transition: transform 0.08s, background 0.15s, border-color 0.15s; min-height: 46px; }
button:hover:not([disabled]) { background: rgba(134,217,255,0.12); border-color: rgba(134,217,255,0.5); }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button:active:not([disabled]) { transform: scale(0.98); }
button.primary { background: linear-gradient(180deg, #4cc3ff, #1f7fd6); border-color: #7fd6ff; color: #fff; font-weight: 700; box-shadow: 0 6px 22px rgba(40,150,255,0.35); }
button.primary:hover { background: linear-gradient(180deg, #6fd0ff, #2b8fe6); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); min-height: 38px; }
button.danger { border-color: rgba(255,93,124,0.5); color: #ffb3c2; }
button[disabled] { opacity: 0.45; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; min-height: 0; color: var(--cy); text-decoration: underline; font-size: inherit; }
.tog.sel { border-color: var(--gold); background: rgba(255,226,138,0.1); }
.chip { display: inline-block; font: 700 10px/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 6px; border-radius: 6px; vertical-align: middle; margin-left: 6px; }
.chip.house { background: rgba(255,226,138,0.16); color: var(--gold); border: 1px solid rgba(255,226,138,0.35); }

/* levels */
.levels { display: grid; gap: 8px; margin-top: 8px; }
.levels button { display: grid; grid-template-columns: 1fr auto; text-align: left; align-items: center; padding: 12px 16px; }
.levels button b { font: 700 17px var(--head); letter-spacing: 0.04em; }
.levels button small { grid-column: 1; color: var(--muted); font-size: 13px; }
.levels button i { grid-column: 2; grid-row: 1 / span 2; font-style: normal; font-size: 12px; color: var(--good); }
.levels button.sel { border-color: var(--gold); }

/* forms */
.pname { margin: 14px 0 6px; text-align: left; }
.pname label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
input { font: 600 16px var(--body); color: var(--ink); background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; padding: 10px 12px; min-width: 0; flex: 1; -webkit-user-select: text; user-select: text; }
input:focus { outline: 2px solid var(--cy); border-color: transparent; }
.nmsg { min-height: 1.3em; margin: 6px 0 0; color: var(--muted); }
.nmsg.bad { color: var(--bad); } .nmsg.good { color: var(--good); }
.slider { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 6px 0 10px; color: var(--muted); }
.slider input { flex: 0 1 220px; padding: 0; }

/* VS card */
.vs { width: min(560px, 100%); text-align: center; }
.vsrow { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0; }
.vcard { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.vcard b { font: 700 18px var(--head); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard small { color: var(--cy); }
.vsx { font: 900 26px var(--head); color: var(--gold); text-shadow: 0 0 18px rgba(255,200,90,0.5); }

/* results */
.over .score { font-size: 30px; color: var(--ink); margin: 6px 0; }
.over .score small { font-size: 14px; color: var(--muted); }
.newbest { color: var(--gold); font-weight: 700; }
table.bd { width: 100%; max-width: 300px; margin: 6px auto 10px; border-collapse: collapse; font-size: 14px; }
table.bd td { padding: 3px 4px; color: var(--muted); text-align: left; }
table.bd td:last-child { text-align: right; color: var(--ink); }
table.bd .tot td { border-top: 1px solid rgba(255,255,255,0.15); color: var(--gold); font-weight: 700; }
.statrow { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 8px 0; }
.statrow b { color: var(--ink); font-size: 16px; }
.ranks { font-size: 16px; margin: 6px 0; }
.coins { color: var(--gold); font-weight: 700; margin: 8px 0 0; }
.coins small { color: var(--muted); font-weight: 400; }
h2 .coins { float: right; font-size: 15px; font-family: var(--body); }

/* lobby */
.plist { display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.prow { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,0.04); font-size: 14px; }
.prow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5a6577; display: inline-block; }
.dot.online { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.away { background: var(--gold); }
.roomcode { font: 900 44px var(--head); letter-spacing: 0.25em; color: var(--gold); margin: 6px 0 4px; text-shadow: 0 0 20px rgba(255,200,90,0.35); }
.search .radar { position: relative; width: 120px; height: 120px; margin: 10px auto 14px; border-radius: 50%; border: 2px solid rgba(134,217,255,0.4); display: grid; place-items: center; }
.search .radar i { position: absolute; inset: -2px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(134,217,255,0.45), transparent 30%); animation: sweep 1.4s linear infinite; }
.search .radar b { font-size: 40px; }
@keyframes sweep { to { transform: rotate(360deg); } }

/* tables */
.tabs { display: flex; gap: 6px; margin: 8px 0 12px; flex-wrap: wrap; }
.tabs button { flex: 1; padding: 8px 6px; min-height: 38px; font-size: 14px; }
.tabs button.sel { border-color: var(--gold); background: rgba(255,226,138,0.1); }
table.scores { width: 100%; border-collapse: collapse; font-size: 14px; }
table.scores th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid rgba(255,255,255,0.12); }
table.scores td { padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,0.05); }
table.scores td:nth-child(2) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.scores tr.me td { color: var(--gold); font-weight: 700; }
table.scores tr.gap td { text-align: center; color: var(--muted); }

/* profile */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.stats div { background: rgba(255,255,255,0.05); border-radius: 10px; padding: 8px 10px; }
.stats small { display: block; color: var(--muted); font-size: 12px; }
.stats b { font-size: 17px; }
.recent { display: grid; gap: 4px; }
.rrow { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 8px; align-items: center; font-size: 14px; padding: 5px 8px; background: rgba(255,255,255,0.03); border-radius: 8px; }
.code { letter-spacing: 0.1em; }

/* locker */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; }
.item.sel { border-color: var(--gold); background: rgba(255,226,138,0.08); }
.item small { color: var(--muted); }
.swatch { width: 100%; height: 54px; border-radius: 8px; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--f) 80%, white), var(--f)); border: 6px solid var(--r); box-shadow: inset 0 0 0 1px var(--t); }
.cueprev { width: 100%; height: 14px; border-radius: 7px; margin: 20px 0; background: linear-gradient(90deg, #3a7bd5 0 3%, #f4f4f0 3% 6%, var(--s) 6% 55%, var(--r) 55% 57%, var(--b) 57% 96%, #111 96%); box-shadow: 0 3px 8px rgba(0,0,0,0.4); }

/* how to */
.how .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 680px) { .how .cols { grid-template-columns: 1fr; } }
.how p { font-size: 15px; }
.how .guidelink { text-align: center; margin: 4px 0 0; }
.how .guidelink a { color: var(--cy); }

/* moon cup */
.bracket { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0; }
.bcol { display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.bcol h4 { font-size: 11px; color: var(--cy); letter-spacing: 0.12em; margin: 0 0 4px; }
.bm { background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; font-size: 13px; }
.bm div { padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm div + div { border-top: 1px solid rgba(255,255,255,0.06); }
.bm .me { color: var(--cy); font-weight: 700; }
.bm .w { background: rgba(109,255,166,0.1); }
.bm .l { opacity: 0.45; text-decoration: line-through; }
.bm .chip { display: none; }

/* ---------- in-game HUD */
.hud { position: absolute; top: 0; left: 0; right: 0; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: max(6px, env(safe-area-inset-top)) max(66px, calc(env(safe-area-inset-right) + 56px)) 0 max(10px, env(safe-area-inset-left)); pointer-events: none; }
.hud[hidden], .dock[hidden] { display: none; }
.pcard { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 0; max-width: 340px; padding: 5px 10px 5px 5px; border-radius: 30px; background: rgba(8,12,24,0.72); border: 1px solid rgba(255,255,255,0.1); transition: border-color .2s, box-shadow .2s; }
.pcard.r { flex-direction: row-reverse; padding: 5px 5px 5px 10px; text-align: right; }
.pcard.turn { border-color: rgba(255,226,138,0.7); box-shadow: 0 0 18px rgba(255,226,138,0.25); }
.av { --c: #86d9ff; --t: 0; position: relative; width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, white), var(--c) 60%, color-mix(in srgb, var(--c) 60%, black)); color: #08101e; font: 800 18px var(--head); }
.av.big { width: 72px; height: 72px; font-size: 30px; }
.av.timed::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--t) * 360deg), rgba(255,255,255,0.1) 0); -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.av.hurry::before { background: conic-gradient(var(--bad) calc(var(--t) * 360deg), rgba(255,255,255,0.1) 0); }
.pinfo { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.pn { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn .chip { font-size: 9px; padding: 2px 4px; }
.ps { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pballs { display: flex; gap: 1px; align-items: center; height: 20px; margin-top: 1px; }
.pcard.r .pballs { justify-content: flex-end; }
.pballs img { width: 18px; height: 18px; }
.pballs img.gone { opacity: 0.18; filter: grayscale(1); }
.pballs .open, .pballs .on8 { font-size: 11px; color: var(--muted); }
.pballs .on8 { color: var(--gold); margin: 0 4px; font-weight: 700; }
.mid { flex: 0 1 auto; text-align: center; min-width: 0; }
.mtitle { font: 700 11px var(--head); letter-spacing: 0.1em; color: var(--muted); white-space: nowrap; }
.bubble { position: absolute; top: 54px; left: 10px; padding: 6px 10px; border-radius: 12px; background: #fff; color: #111; font-weight: 700; font-size: 14px; white-space: nowrap; opacity: 0; transform: translateY(-6px); transition: .2s; pointer-events: none; }
.pcard.r .bubble { left: auto; right: 10px; }
.bubble.show { opacity: 1; transform: none; }
.pausebtn { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; font: 800 15px var(--head); background: rgba(8,12,24,0.78); }

/* dock: power + spin + fine aim. Landscape: left and right columns; portrait: a row at the bottom */
.dock { position: absolute; inset: 0; pointer-events: none; }
.dock > * { pointer-events: auto; }
.power { position: absolute; left: max(10px, env(safe-area-inset-left)); top: 74px; bottom: 14px; width: 54px; border-radius: 27px; background: rgba(8,12,24,0.75); border: 1px solid rgba(255,255,255,0.14); overflow: hidden; touch-action: none; cursor: grab; }
.power .pfill { --p: 0; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--p) * 100%); background: linear-gradient(180deg, #6dffa6, #ffe28a 55%, #ff5d7c); opacity: 0.85; }
.power .pcue { position: absolute; left: 50%; width: 10px; margin-left: -5px; top: 8px; bottom: 8px; border-radius: 5px; background: linear-gradient(180deg, #3a7bd5 0 3%, #f4f4f0 3% 6%, #e9d3a5 6% 60%, #1b1b20 60%); opacity: 0.55; }
.power .plabel { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font: 800 11px var(--head); letter-spacing: 0.08em; color: var(--ink); text-shadow: 0 1px 3px #000; }
.power.active { border-color: var(--gold); }
.side { position: absolute; right: max(10px, env(safe-area-inset-right)); top: 74px; bottom: 14px; width: 54px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.spinbtn { position: relative; width: 54px; height: 54px; min-height: 0; padding: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #e8e4da 55%, #9b978f); border: 2px solid rgba(255,255,255,0.35); flex: none; }
.spinbtn .dot, .spinball .sdot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; left: 50%; top: 50%; border-radius: 50%; background: #e0302a; box-shadow: 0 0 0 2px rgba(255,255,255,0.8); }
.fine { flex: 1; width: 44px; border-radius: 22px; background: repeating-linear-gradient(180deg, rgba(255,255,255,0.16) 0 2px, transparent 2px 9px), rgba(8,12,24,0.75); border: 1px solid rgba(255,255,255,0.14); touch-action: none; cursor: ns-resize; }
.fine.active { border-color: var(--cy); }
.emotebtn { width: 50px; height: 50px; min-height: 0; padding: 0; border-radius: 50%; font-size: 22px; flex: none; }
.dock.idle .power, .dock.idle .fine, .dock.idle .spinbtn { opacity: 0.35; pointer-events: none; }
body.lefty:not(.portrait) .power { left: auto; right: max(10px, env(safe-area-inset-right)); }
body.lefty:not(.portrait) .side { right: auto; left: max(10px, env(safe-area-inset-left)); }

body.portrait .hud { height: 70px; padding-right: max(60px, calc(env(safe-area-inset-right) + 54px)); }
body.portrait .mid { display: none; }
body.portrait .pcard { padding-right: 8px; }
body.portrait .power { top: auto; left: max(10px, env(safe-area-inset-left)); right: 148px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; height: 56px; }
body.portrait .power .pfill { top: 0; bottom: 0; height: auto; width: calc(var(--p) * 100%); background: linear-gradient(90deg, #6dffa6, #ffe28a 55%, #ff5d7c); }
body.portrait .power .pcue { left: 8px; right: 8px; top: 50%; bottom: auto; width: auto; height: 10px; margin: -5px 0 0; background: linear-gradient(90deg, #1b1b20 40%, #e9d3a5 40% 94%, #f4f4f0 94% 97%, #3a7bd5 97%); }
body.portrait .power .plabel { bottom: auto; top: 50%; transform: translateY(-50%); }
body.portrait .side { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); right: max(10px, env(safe-area-inset-right)); width: 128px; height: 112px; flex-direction: row; flex-wrap: wrap; align-content: flex-end; justify-content: flex-end; }
body.portrait .fine { order: -1; flex: none; width: 100vw; max-width: calc(100vw - 20px); height: 40px; position: fixed; left: 10px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 66px); background: repeating-linear-gradient(90deg, rgba(255,255,255,0.16) 0 2px, transparent 2px 9px), rgba(8,12,24,0.75); cursor: ew-resize; }
body.portrait .spinbtn { width: 56px; height: 56px; }
body.portrait .emotebtn { width: 56px; height: 56px; }

.callhint { position: absolute; left: 50%; top: 74px; transform: translateX(-50%); padding: 6px 14px; border-radius: 20px; background: rgba(255,226,138,0.15); border: 1px solid rgba(255,226,138,0.5); color: var(--gold); font-weight: 700; font-size: 14px; pointer-events: none; white-space: nowrap; }
.netbanner { position: absolute; left: 50%; top: 110px; transform: translateX(-50%); padding: 8px 16px; border-radius: 20px; background: rgba(255,93,124,0.2); border: 1px solid var(--bad); font-weight: 700; }
.emotes { position: absolute; right: 74px; top: 74px; display: grid; gap: 6px; padding: 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.emotes button { min-height: 38px; font-size: 14px; text-align: left; }
body.portrait .emotes { right: 10px; top: auto; bottom: 200px; }
.emotes[hidden], .callhint[hidden], .netbanner[hidden], .spinpanel[hidden] { display: none; }

/* toast */
.toast { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(0.95); max-width: min(90vw, 460px); padding: 12px 20px; border-radius: 14px; background: rgba(8,12,24,0.9); border: 1px solid var(--line); text-align: center; font-size: 17px; line-height: 1.35; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast small { color: var(--muted); font-size: 14px; }
.toast.bad { border-color: var(--bad); } .toast.bad b { color: var(--bad); }
.toast.gold { border-color: var(--gold); color: var(--gold); }
.toast.good { border-color: var(--good); color: var(--good); font: 800 20px var(--head); }
.toast.cy { border-color: var(--cy); }

/* spin picker */
.spinpanel { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(3,5,11,0.55); }
.spinbox { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; text-align: center; width: min(320px, 92vw); }
.spinball { position: relative; width: 200px; height: 200px; margin: 6px auto 10px; border-radius: 50%; background: radial-gradient(circle at 36% 30%, #fff, #ece8de 50%, #a29d93 100%); box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(0,0,0,0.1); touch-action: none; cursor: crosshair; }
.spinball::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; border: 1px dashed rgba(0,0,0,0.25); }
.spinball::after { content: ""; position: absolute; left: 50%; top: 10%; bottom: 10%; border-left: 1px solid rgba(0,0,0,0.12); }
.spinball .sdot { width: 20px; height: 20px; margin: -10px 0 0 -10px; }

/* ?poster: the share image */
.posterbox { position: absolute; left: 70px; top: 58px; z-index: 3; padding: 18px 26px 16px; border-radius: 22px; background: rgba(6,10,22,0.78); border: 1px solid rgba(134,217,255,0.35); box-shadow: 0 20px 50px rgba(0,0,0,0.5); text-align: center; }
.posterbox .logo { font-size: 50px; margin: 0 0 6px; }
.posterbox p { margin: 0; color: #e9f1ff; font: 700 17px var(--body); letter-spacing: 0.02em; }
body.poster .ca-home { display: none; }
.pinfo { overflow: hidden; }
body.portrait .pballs img { width: 13px; height: 13px; }
body.portrait .pn { font-size: 13px; }
@media (max-width: 360px) { body.portrait .av { width: 34px; height: 34px; font-size: 15px; } }
.bm .tbd { color: var(--muted); opacity: 0.6; }

/* controls card (start of a game, pause menu › Controls) */
.keyscard { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: rgba(3,5,11,0.6); overflow-y: auto; }
.keyscard[hidden] { display: none; }
.keys { text-align: left; }
.kcols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
@media (max-width: 700px) { .kcols { grid-template-columns: 1fr; } }
.kcol h3 { margin: 8px 0 6px; }
.keys dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; font-size: 14px; line-height: 1.45; }
.keys dt { color: var(--ink); font-weight: 700; white-space: nowrap; }
.keys dd { margin: 0; color: var(--muted); }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3); border-bottom-width: 3px; background: rgba(255,255,255,0.08); color: var(--ink); font: 700 12px/1.5 var(--body); text-align: center; }
.kcheck { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; color: var(--muted); cursor: pointer; }
.kcheck input { width: 18px; height: 18px; flex: none; accent-color: var(--cy); }
.keys .gold { color: var(--gold); margin: 10px 0 0; }
body.keys-open .ca-home { display: none; }
.kmore { margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 8px; }
.kmore summary { cursor: pointer; font: 700 13px var(--head); letter-spacing: 0.08em; color: var(--cy); padding: 6px 0; list-style-position: inside; }
.kmore[open] summary { margin-bottom: 6px; }
