:root {
  --bg: #120d2b; --bg2: #1b1440; --bg3: #251c57; --panel: rgba(20, 14, 48, 0.92); --line: #3b2f7a; --line2: #5a4bb0;
  --text: #efeaff; --muted: #a99fd6; --green: #5be38a; --green2: #1f8a4c; --green3: #0b3d20; --red: #ff5d6c; --violet: #b48cff; --blue: #59b8ff;
  --gold: #ffd25a; --gold3: #6b4f10; --orange: #ffa63c;
  --pix: 'Press Start 2P', monospace; --sans: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-tap-highlight-color: transparent; }
body { overflow-x: hidden; }
body.ingame { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
a { color: var(--green); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.g { color: var(--green); } .r { color: var(--red); } .v { color: var(--violet); } .b { color: var(--blue); } .y { color: var(--gold); } .o { color: var(--orange); }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line2); border-bottom-width: 3px; border-radius: 4px; background: var(--bg2); font: 800 12px var(--sans); color: var(--text); text-align: center; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; image-rendering: pixelated; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- loading ---------- */
.loading { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--bg); transition: opacity .5s; }
.loading.out { opacity: 0; pointer-events: none; }
.loading div { text-align: center; }
.loading img { width: 84px; height: 84px; image-rendering: pixelated; }
.loading b { display: block; font: 22px var(--pix); color: var(--green); margin: 14px 0 10px; text-shadow: 0 4px 0 var(--green3); }
.loading span { color: var(--muted); }

/* ---------- landing ---------- */
#landing { position: relative; z-index: 1; min-height: 100vh; background: linear-gradient(180deg, rgba(18,13,43,.05) 0%, rgba(18,13,43,.5) 60vh, var(--bg) 100vh); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(14,10,34,.85); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font: 13px var(--pix); white-space: nowrap; }
.brand img { width: 30px; height: 30px; image-rendering: pixelated; }
.brand b { color: var(--green); font-weight: 400; }
.ticker { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); min-width: 0; }
.ticker-in { display: flex; gap: 28px; width: max-content; animation: tick 50s linear infinite; font: 800 12px var(--sans); letter-spacing: 1px; color: var(--muted); }
.ticker-in b { color: var(--text); margin-left: 6px; }
@keyframes tick { to { transform: translateX(-50%); } }
.pill { display: flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 4px; background: var(--bg2); border: 2px solid var(--line); font: 800 13px var(--sans); white-space: nowrap; }
.pill b { color: var(--green); }
.icon-btn { width: 36px; height: 36px; border-radius: 4px; border: 2px solid var(--line); background: var(--bg2); display: grid; place-items: center; }
.icon-btn.off { opacity: .45; }
.page { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: start; padding: 42px 0 26px; min-height: calc(100vh - 60px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 800 12px var(--sans); letter-spacing: 1.5px; color: var(--green); background: rgba(14,10,34,.75); padding: 6px 12px; border-radius: 4px; border: 2px solid rgba(91,227,138,.35); margin: 0; }
.dot { width: 8px; height: 8px; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.title { margin: 26px 0 14px; font: 400 clamp(34px, 6.4vw, 76px)/1.05 var(--pix); letter-spacing: 1px; display: flex; flex-wrap: wrap; gap: 0 .25em; }
.title .t1 { color: #f6f1ff; text-shadow: 0 5px 0 #5a4bb0, 0 10px 0 #2a1f66, 0 16px 34px rgba(0,0,0,.6); }
.title .t2 { color: var(--green); text-shadow: 0 5px 0 var(--green2), 0 10px 0 var(--green3), 0 16px 34px rgba(0,0,0,.6); }
.tag { font: 900 clamp(18px, 2.2vw, 24px) var(--sans); margin: 18px 0 12px; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.tag em { color: var(--violet); font-style: normal; }
.lede { max-width: 620px; color: #d9d2f7; text-shadow: 0 1px 8px rgba(0,0,0,.9); margin: 0 0 22px; font-size: 16px; }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 640px; }
.statrow div { background: var(--panel); border: 2px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.statrow span { display: block; font: 800 10px var(--sans); letter-spacing: 1.2px; color: var(--muted); }
.statrow b { font: 15px var(--pix); display: block; margin-top: 6px; }
.earn { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 640px; margin-top: 10px; }
.earn div { background: linear-gradient(180deg, rgba(91,227,138,.12), rgba(20,14,48,.92)); border: 2px solid rgba(91,227,138,.35); border-radius: 4px; padding: 12px; }
.earn i { font-style: normal; font-size: 22px; }
.earn b { display: block; font: 15px var(--pix); color: var(--green); margin: 6px 0 4px; }
.earn small { color: var(--muted); font-weight: 700; line-height: 1.35; display: block; }

.play { background: var(--panel); border: 2px solid var(--line2); border-radius: 6px; padding: 20px; box-shadow: 0 8px 0 #0b0820, 0 24px 60px rgba(0,0,0,.5); position: sticky; top: 76px; }
.lbl { font: 800 11px var(--sans); letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; margin: 0 0 8px; }
.row { display: flex; gap: 8px; }
input { font: 700 15px var(--sans); color: var(--text); background: var(--bg); border: 2px solid var(--line); border-radius: 4px; padding: 11px 12px; outline: none; min-width: 0; flex: 1; }
input:focus { border-color: var(--green); }
.btn { border: 2px solid var(--line2); background: var(--bg3); border-radius: 4px; padding: 10px 16px; font-weight: 900; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.phantom { width: 100%; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #ab9ff2; border-color: #ab9ff2; color: #1c1640; }
.btn.phantom svg { width: 20px; height: 20px; }
.err { color: #ff8b9d; min-height: 0; margin: 8px 0 0; font-weight: 700; }
.err:empty { display: none; }
.err a { color: #ffcf5a; }
.login { margin-bottom: 16px; }
.who { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 2px solid var(--line); border-radius: 4px; padding: 8px 10px; margin-bottom: 16px; }
.ava { width: 30px; height: 30px; border-radius: 4px; display: grid; place-items: center; font-weight: 900; color: #1c1640; }
.who-t { flex: 1; }
.who-t em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }
.link { background: none; border: 0; color: var(--green); font-weight: 800; text-decoration: underline; }
.faces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.face { background: var(--bg); border: 3px solid var(--line); border-radius: 4px; padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.face canvas { width: 72px; height: 72px; border-radius: 2px; image-rendering: pixelated; }
.face small { font: 9px var(--pix); color: var(--muted); }
.face.on { border-color: var(--green); background: rgba(91,227,138,.1); }
.face.on small { color: var(--green); }
.rankline { margin: 10px 0 0; font-weight: 800; color: var(--muted); font-size: 13px; min-height: 20px; }
.rankline b { color: var(--gold); }
.enter-btn { margin-top: 16px; width: 100%; border: 0; border-radius: 4px; padding: 16px 12px 12px; background: var(--green); color: var(--green3); box-shadow: 0 6px 0 var(--green2), 0 10px 0 var(--green3); display: flex; flex-direction: column; align-items: center; transition: transform .08s, box-shadow .08s; }
.enter-btn span { font: 16px var(--pix); }
.enter-btn small { font-weight: 900; margin-top: 6px; opacity: .8; }
.enter-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--green2), 0 4px 0 var(--green3); }
.enter-btn.sm { margin-top: 10px; padding: 12px; }
.enter-btn.sm span { font-size: 12px; }
.joinhint { text-align: center; color: var(--muted); font-weight: 700; font-size: 13px; margin: 18px 0 0; min-height: 18px; }
.bank { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin-top: 12px; background: var(--bg); border: 2px solid var(--line); border-radius: 4px; padding: 10px; }
.bank span { display: block; font: 800 10px var(--sans); letter-spacing: 1.2px; color: var(--muted); }
.bank b { font: 12px var(--pix); }
.fine { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }

.band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 10px 0 30px; }
.col { background: var(--panel); border: 2px solid var(--line); border-radius: 6px; padding: 16px; }
h2 { font: 13px var(--pix); margin: 0 0 14px; color: var(--text); line-height: 1.5; }
h2 span { background: var(--red); color: #fff; font-size: 9px; padding: 3px 6px; border-radius: 2px; vertical-align: 2px; margin-right: 6px; }
.feed, .board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed li, .board li { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 4px; padding: 7px 9px; font-size: 13.5px; }
.feed .t, .board .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.feed .ago { color: var(--muted); font-size: 12px; }
.board li canvas { width: 24px; height: 24px; border-radius: 2px; image-rendering: pixelated; }
.board .c { font-weight: 900; color: var(--green); }
.board { counter-reset: n; }
.board li::before { counter-increment: n; content: counter(n); font: 9px var(--pix); color: var(--muted); width: 16px; }
.board li.muted::before { content: none; }

.towers-sec, .enemies-sec, .how, .controls { margin: 0 0 30px; }
.tower-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tower-grid > div { background: var(--panel); border: 2px solid var(--line); border-top: 4px solid var(--tc); border-radius: 6px; padding: 14px; }
.tower-grid i { font-style: normal; font-size: 26px; }
.tower-grid b { display: block; font: 10px/1.5 var(--pix); margin: 8px 0 6px; }
.tower-grid em { font-style: normal; color: var(--gold); font-weight: 900; font-size: 13px; }
.tower-grid p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.enemy-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.enemy-grid span { background: var(--panel); border: 2px solid var(--line); border-radius: 4px; padding: 7px 11px; font-weight: 800; font-size: 13.5px; }
.enemy-grid span.boss { border-color: var(--violet); color: var(--violet); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.steps > div { background: var(--panel); border: 2px solid var(--line); border-radius: 6px; padding: 16px; }
.steps > div > b { font: 12px var(--pix); color: var(--green); }
.steps h3 { margin: 8px 0 6px; font: 900 18px var(--sans); }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }
.ctl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ctl > div { background: var(--panel); border: 2px solid var(--line); border-radius: 4px; padding: 10px 12px; font-weight: 700; color: var(--muted); }
.foot { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 30px 0 10px; border-top: 2px solid var(--line); font-weight: 700; }
.foot-icon { width: 40px; height: 40px; image-rendering: pixelated; }
.foot .muted { font-size: 12.5px; max-width: 640px; }

/* ---------- modals + toasts ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(6,4,18,.7); padding: 16px; }
.modal-card { position: relative; width: min(460px, 100%); max-height: 90vh; overflow: auto; background: var(--bg2); border: 2px solid var(--line2); border-radius: 6px; padding: 22px; box-shadow: 0 8px 0 #0b0820; }
.modal-card h3 { font: 14px/1.5 var(--pix); margin: 0 0 14px; }
.x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 4px; border: 2px solid var(--line); background: var(--bg); }
.w-bal { background: var(--bg); border-radius: 4px; padding: 12px; margin-bottom: 10px; }
.w-bal span { display: block; font: 800 11px var(--sans); color: var(--muted); letter-spacing: 1px; }
.w-bal b { font: 20px var(--pix); color: var(--green); display: block; margin: 6px 0; }
#w-form input { width: 100%; }
#toasts { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; pointer-events: none; width: min(420px, calc(100% - 32px)); }
.toast { background: var(--bg2); border: 2px solid var(--line2); border-radius: 4px; padding: 10px 14px; font-weight: 800; box-shadow: 0 6px 20px rgba(0,0,0,.4); transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.end-card { text-align: center; width: min(480px, 100%); }
.end-card h3 { font-size: 20px; color: var(--green); text-shadow: 0 4px 0 var(--green3); }
.end-card.lost h3 { color: var(--red); text-shadow: 0 4px 0 #5a1020; }
.end-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
.end-stats div { background: var(--bg); border-radius: 4px; padding: 10px; }
.end-stats span { display: block; font: 800 10px var(--sans); color: var(--muted); letter-spacing: 1px; }
.end-stats b { font: 14px var(--pix); display: block; margin-top: 6px; }
.end-btns { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; align-items: end; }

/* ---------- in-game HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud .labels, #hud .bigmsg, #hud .notes, #hud .hint { pointer-events: none; }
.hudbox, .rocketbox, .wavebox, .mapbox, .purse, .tpanel { background: var(--panel); border: 2px solid var(--line2); border-radius: 4px; box-shadow: 0 4px 0 #0b0820; }
.rocketbox { position: absolute; left: 12px; top: 12px; width: 230px; padding: 10px; }
.rb-h { font: 9px var(--pix); display: flex; justify-content: space-between; align-items: center; }
.rb-h b { font: 12px var(--pix); color: var(--green); }
.rb-bar { height: 14px; background: #0b0820; border: 2px solid #0b0820; margin-top: 8px; position: relative; }
.rb-bar i { position: absolute; inset: 0; width: 100%; background: repeating-linear-gradient(90deg, var(--green) 0 8px, #49c975 8px 10px); transition: width .25s; }
.rb-bar.low i { background: repeating-linear-gradient(90deg, var(--red) 0 8px, #d84a58 8px 10px); }
.rocketbox.hit { animation: hitflash .35s; }
@keyframes hitflash { 30% { border-color: var(--red); transform: translateX(3px); } 60% { transform: translateX(-3px); } }
.team { display: grid; gap: 4px; margin-top: 10px; }
.team div { display: grid; grid-template-columns: 20px 1fr 54px; gap: 6px; align-items: center; font: 800 12px var(--sans); }
.team canvas { width: 20px; height: 20px; image-rendering: pixelated; }
.team .hb { height: 6px; background: #0b0820; position: relative; }
.team .hb i { position: absolute; inset: 0; background: var(--green); }
.team div.dead { opacity: .45; }
.team .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team .nm small { color: var(--muted); }
.team .rd { color: var(--green); font-size: 10px; }
.wavebox { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 10px 18px; text-align: center; min-width: 210px; }
.wb-w { font: 11px var(--pix); color: var(--muted); }
.wb-w b { font: 22px var(--pix); color: var(--text); margin: 0 6px; }
.wb-w span i { font-style: normal; }
.wb-s { font: 800 13px var(--sans); margin-top: 4px; color: var(--muted); }
.wb-s b { color: var(--gold); }
.wavebox.boss .wb-w b { color: var(--violet); }
.ready-btn { margin-top: 8px; border: 0; border-radius: 4px; background: var(--green); color: var(--green3); font: 10px var(--pix); padding: 9px 12px; box-shadow: 0 4px 0 var(--green2); }
.ready-btn.on { background: var(--gold); box-shadow: 0 4px 0 var(--gold3); }
.ready-btn kbd { font-size: 10px; padding: 0 4px; margin-left: 4px; background: rgba(0,0,0,.15); border-color: rgba(0,0,0,.25); color: inherit; }
.mapbox { position: absolute; right: 12px; top: 12px; padding: 6px; }
#minimap { width: 160px; height: 160px; display: block; image-rendering: pixelated; }
.purse { position: absolute; right: 12px; top: 192px; width: 172px; padding: 8px 10px; display: grid; gap: 4px; }
.purse div { display: flex; justify-content: space-between; align-items: baseline; }
.purse span { font: 800 10px var(--sans); letter-spacing: 1px; color: var(--muted); }
.purse b { font: 10px var(--pix); }
.purse .gold b { font-size: 15px; color: var(--gold); }
.purse .gold.bump b { animation: bump .25s; }
@keyframes bump { 50% { transform: scale(1.25); } }
.buildbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; }
.tcard { position: relative; width: 82px; padding: 8px 4px 6px; border-radius: 4px; border: 2px solid var(--line2); background: var(--panel); box-shadow: 0 4px 0 #0b0820; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tcard i { font-style: normal; font-size: 24px; line-height: 1.1; }
.tcard b { font: 800 11px/1.2 var(--sans); text-align: center; }
.tcard em { font-style: normal; font: 9px var(--pix); color: var(--gold); margin-top: 2px; }
.tcard kbd { position: absolute; top: -8px; left: -6px; font-size: 10px; padding: 0 5px; }
.tcard.poor { opacity: .5; }
.tcard.poor em { color: var(--red); }
.tcard.on { border-color: var(--green); background: #1f3a3a; transform: translateY(-4px); }
.slam-btn { position: absolute; right: 16px; bottom: 16px; width: 92px; height: 92px; border-radius: 50%; border: 3px solid #0b0820; background: var(--orange); color: #3a1a00; box-shadow: 0 5px 0 #8a4a10; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.slam-btn b { font: 12px var(--pix); position: relative; z-index: 1; }
.slam-btn small { font-weight: 900; position: relative; z-index: 1; }
.slam-btn i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.45); }
.tpanel { position: absolute; right: 12px; bottom: 124px; width: 270px; padding: 12px; }
.tp-h { display: flex; gap: 10px; align-items: center; }
.tp-ic { font-size: 30px; }
.tp-h b { display: block; font: 10px/1.5 var(--pix); }
.tp-h small { color: var(--muted); font-weight: 800; }
.tp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 10px 0; font-weight: 800; font-size: 13px; }
.tp-stats span { color: var(--muted); }
.tp-stats .up { color: var(--green); }
.tp-btns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.tp-up, .tp-sell { border: 0; border-radius: 4px; padding: 9px 6px; font: 9px var(--pix); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tp-up { background: var(--green); color: var(--green3); box-shadow: 0 3px 0 var(--green2); }
.tp-sell { background: var(--bg3); border: 2px solid var(--line2); }
.tp-up small, .tp-sell small { font: 900 12px var(--sans); }
.tpanel .x { top: 6px; right: 6px; width: 26px; height: 26px; font-size: 12px; }
.side-btns { position: absolute; right: 12px; top: 300px; display: grid; gap: 6px; }
.side-btns button { width: 40px; height: 40px; border-radius: 4px; border: 2px solid var(--line2); background: var(--panel); font-size: 17px; }
.side-btns button.off { opacity: .5; }
.hint { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); font: 800 13px var(--sans); background: rgba(10,7,26,.8); padding: 6px 12px; border-radius: 4px; white-space: nowrap; }
.hint:empty { display: none; }
.labels { position: absolute; inset: 0; overflow: hidden; }
.lab { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); white-space: nowrap; font: 800 12px var(--sans); text-shadow: 0 1px 2px #000, 0 0 4px #000; text-align: center; will-change: transform; }
.lab.me { color: var(--green); }
.lab .bub { display: block; background: #fff; color: #222; text-shadow: none; padding: 4px 8px; border-radius: 4px; margin-bottom: 3px; max-width: 220px; white-space: normal; font-size: 12px; }
.pop { position: absolute; left: 0; top: 0; font: 10px var(--pix); color: var(--gold); text-shadow: 0 2px 0 #000; pointer-events: none; animation: popup 1s ease-out forwards; }
.pop.hurt { color: var(--red); }
@keyframes popup { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -40px; } }
.bigmsg { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%) scale(.8); text-align: center; opacity: 0; transition: opacity .3s, transform .3s; font: clamp(20px, 4vw, 40px)/1.3 var(--pix); text-shadow: 0 5px 0 #0b0820; white-space: nowrap; }
.bigmsg.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.bigmsg small { display: block; font: 900 clamp(14px, 2vw, 20px) var(--sans); color: var(--muted); margin-top: 10px; text-shadow: 0 2px 6px #000; }
.bigmsg.g { color: var(--green); } .bigmsg.r { color: var(--red); } .bigmsg.v { color: var(--violet); } .bigmsg.y { color: var(--gold); }
.notes { position: absolute; left: 50%; top: 104px; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; width: min(560px, 90vw); }
.note { background: rgba(10,7,26,.85); border: 2px solid var(--line2); border-radius: 4px; padding: 6px 12px; font-weight: 800; font-size: 14px; transition: opacity .5s; text-align: center; }
.note.out { opacity: 0; }
.note.gold { border-color: var(--gold); color: var(--gold); } .note.green { border-color: var(--green); color: var(--green); } .note.red { border-color: var(--red); color: #ff9aa5; } .note.boss { border-color: var(--violet); color: var(--violet); font-size: 16px; }
.chat { position: absolute; left: 12px; bottom: 14px; width: min(330px, 34vw); }
.chat-log { display: grid; gap: 2px; max-height: 160px; overflow: hidden; align-content: end; }
.chat-log div { font: 700 13px var(--sans); text-shadow: 0 1px 3px #000; background: rgba(10,7,26,.45); padding: 2px 6px; border-radius: 2px; }
.chat-log b { color: var(--green); }
.chat-log .sys b { color: var(--violet); }
.chat-form input { width: 100%; margin-top: 6px; padding: 8px 10px; font-size: 14px; }
.chat-btn { position: absolute; left: 12px; bottom: 200px; width: 42px; height: 42px; border-radius: 4px; border: 2px solid var(--line2); background: var(--panel); }
.touch-only { display: none; }
.joy { position: absolute; left: 22px; bottom: 26px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.08); border: 3px solid rgba(255,255,255,.18); }
.joy i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255,255,255,.3); }
.dead { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(rgba(90,10,30,.25), rgba(40,0,10,.55)); pointer-events: none !important; }
.dead-card { text-align: center; }
.dead-card h2 { font: 30px var(--pix); color: var(--red); text-shadow: 0 5px 0 #3a0a14; margin: 0; }
.dead-card p { font-weight: 800; }
.dead-card .big { font: 40px var(--pix); margin: 4px 0; }

/* ---------- phones ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 22px; min-height: 0; }
  .play { position: static; }
  .band, .steps { grid-template-columns: 1fr; }
  .tower-grid { grid-template-columns: repeat(2, 1fr); }
  .ctl { grid-template-columns: 1fr 1fr; }
  .statrow { grid-template-columns: repeat(2, 1fr); }
  .ticker { display: none; }
  .topbar { justify-content: space-between; }
}
@media (max-width: 520px) {
  .earn { grid-template-columns: 1fr; }
  .tower-grid { grid-template-columns: 1fr; }
  .ctl { grid-template-columns: 1fr; }
  .brand span { font-size: 11px; }
}
body.touch .touch-only { display: block; }
body.touch .rocketbox { width: 168px; padding: 7px; left: 8px; top: 8px; }
body.touch .team { display: none; }
body.touch .wavebox { top: 8px; padding: 6px 10px; min-width: 0; }
body.touch .wb-w b { font-size: 16px; }
body.touch .mapbox { right: 8px; top: 8px; padding: 4px; }
body.touch #minimap { width: 96px; height: 96px; }
body.touch .purse { right: 8px; top: 118px; width: 130px; padding: 6px 8px; }
body.touch .side-btns { right: 8px; top: 206px; }
body.touch .buildbar { left: auto; right: 116px; transform: none; bottom: 10px; flex-wrap: wrap; justify-content: flex-end; width: min(260px, calc(100vw - 290px)); gap: 4px; }
body.touch .tcard { width: 50px; padding: 5px 2px 4px; }
body.touch .tcard b, body.touch .tcard kbd { display: none; }
body.touch .tcard i { font-size: 20px; }
body.touch .slam-btn { width: 84px; height: 84px; right: 14px; bottom: 18px; }
body.touch .slam-btn small { display: none; }
body.touch .chat { bottom: auto; top: 96px; left: 8px; width: 46vw; }
body.touch .chat-log { max-height: 70px; }
body.touch .chat-btn { left: 8px; bottom: 170px; }
body.touch .tpanel { bottom: auto; top: 96px; right: 60px; width: min(250px, 70vw); padding: 8px; }
body.touch .tp-stats { margin: 6px 0; font-size: 12px; }
body.touch .hint { bottom: 170px; font-size: 12px; }
body.touch .notes { top: 70px; }
@media (max-width: 520px) { body.touch .buildbar { width: calc(100vw - 280px); min-width: 108px; } }
.tp-keys { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }
body.touch .tp-keys { display: none; }
body.touch .rocketbox { width: 116px; }
body.touch .rb-h { font-size: 7px; }
body.touch .rb-h b { font-size: 9px; }
body.touch .wavebox { max-width: 140px; }
body.touch .wb-w { font-size: 8px; }
body.touch .wb-s { font-size: 11px; line-height: 1.3; }
body.touch .ready-btn { padding: 7px 10px; font-size: 9px; }
@media (max-width: 700px) { .bigmsg { white-space: normal; width: 92vw; font-size: 18px; } .bigmsg small { font-size: 13px; } }
.x-btn { color: #fff; background: #000; border-color: #333; }
.x-btn svg, .x-side svg { width: 16px; height: 16px; }
.x-follow { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 4px; background: #000; border: 2px solid #333; color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; }
.x-follow svg { width: 16px; height: 16px; flex: none; }
.x-follow b { color: var(--green); }
.side-btns .x-side { width: 40px; height: 40px; border-radius: 4px; border: 2px solid #333; background: #000; color: #fff; display: grid; place-items: center; }
.buy-btn { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 4px; background: var(--green); color: var(--green3); font: 900 13px var(--sans); text-decoration: none; white-space: nowrap; box-shadow: 0 3px 0 var(--green2); }
.buy-btn svg, .buy-card svg { width: 18px; height: 18px; flex: none; }
.buy-btn:hover, .buy-card:hover { filter: brightness(1.08); }
.buy-card { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; padding: 11px 12px; border-radius: 4px; background: var(--green); color: var(--green3); text-decoration: none; font: 800 15px var(--sans); box-shadow: 0 4px 0 var(--green2); }
.buy-card b { font-weight: 900; }
.ca-copy { width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: 4px; background: var(--bg); border: 2px dashed var(--line2); font-size: 13px; color: var(--text); }
.ca-copy .ca-l { font: 900 11px var(--sans); color: var(--green); letter-spacing: 1px; }
.ca-copy .ca-v { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.ca-copy .ca-c { color: var(--gold); font-size: 12px; font-weight: 800; border: 1px solid var(--gold); border-radius: 3px; padding: 1px 8px; }
.ca-copy:hover { border-color: var(--green); }
.ca-inline { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; text-decoration: underline dotted; word-break: break-all; }
@media (max-width: 560px) { .buy-btn span { display: none; } .buy-btn { padding: 0 9px; } }
