/* ============================================================================
   TANK::ARENA — vanilla reproduction of Tank_Arena.dc.html (the Claude Design).
   Deep-space #070A12 + cyan #34E0D2 / magenta #FF5C8A / gold #FFC944, glass HUD
   panels, scanlines, corner brackets, gradient-flow buttons. Fonts: Space Grotesk
   / JetBrains Mono / Press Start 2P / Chakra Petch. Battle view + code + console
   are wired to the REAL backend (renderer3d.js + /api/author) — view-only skin.
   ========================================================================== */

:root {
  --bg: #070A12;
  --ink: #E8ECF4;
  --dim: #9AA3B6;
  --dim2: #8A93A6;
  --muted: #6B7488;
  --faint: #3a4256;

  --cy: #34E0D2;  --cyr: 52,224,210;  --cyb: #7af0e5;
  --mg: #FF5C8A;  --mgr: 255,92,138;  --mgt: #FF7BA1;
  --gold: #FFC944; --goldr: 255,201,68;

  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;

  /* hero theme defaults (overridden by .theme-*) */
  --ac1: #34E0D2; --ac1b: #7af0e5; --ac1r: 52,224,210;
  --ac2: #FF5C8A; --ac2b: #ff9ad6; --ac2r: 255,92,138;
  --ac3: #FFC944; --ac3r: 255,201,68;
  --hud-font: var(--sans); --rad: 14px; --bd: 1px; --scan-op: .1;
  --title-shadow: 0 4px 30px rgba(7,10,18,.92), 0 0 24px rgba(var(--ac1r),.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(var(--cyr), .3); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(var(--cyr), .18); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--cyr), .32); }

@keyframes flow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes pulseGlow { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes caret { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes rise { 0% { opacity: 0; transform: translateY(16px); } 100% { opacity: 1; transform: none; } }
@keyframes sheen { 0% { transform: translateX(-130%); } 55%,100% { transform: translateX(240%); } }
@keyframes scanband { 0% { transform: translateY(-30%); } 100% { transform: translateY(560%); } }
@keyframes crtFlicker { 0%,100% { opacity: .05; } 50% { opacity: .09; } }
@keyframes glitchSkew { 0%,90%,100% { opacity: 0; transform: none; } 91% { opacity: .5; transform: translateX(-4px) skewX(-7deg); } 94% { opacity: .35; transform: translateX(4px); } 97% { opacity: .4; transform: translateX(-2px) skewX(5deg); } }
@keyframes hazardMove { 0% { background-position: 0 0; } 100% { background-position: 40px 0; } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes lineIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- utilities */
.mono { font-family: var(--mono); }
.cy { color: var(--cy); } .mg { color: var(--mg); } .gold { color: var(--gold); }
.muted { color: var(--muted); } .ink { color: var(--ink); }
.hidden { display: none !important; }
.glow-cy { text-shadow: 0 0 26px rgba(var(--cyr), .6); }
.glow-mg { text-shadow: 0 0 26px rgba(var(--mgr), .55); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; }

/* frame container: drives container-query responsiveness (real mobile + preview) */
#frame { container-type: inline-size; container-name: frame; position: relative; min-height: 100vh; }
body {
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(var(--cyr), .10), transparent 60%),
    radial-gradient(1000px 680px at 6% 12%, rgba(var(--mgr), .085), transparent 58%),
    linear-gradient(180deg, #070A12 0%, #080b14 42%, #0C1018 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* --------------------------------------------------------------- buttons */
.btn-flow {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 11px; padding: 10px 18px; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: #06121a;
  background: linear-gradient(90deg, #34E0D2, #7af0e5, #FFC944, #34E0D2);
  background-size: 200% 100%; animation: flow 5s linear infinite;
  box-shadow: 0 0 22px rgba(var(--cyr), .4);
}
.btn-flow:hover { filter: brightness(1.05); }
.btn-flow.big { padding: 15px; font-size: 16px; border-radius: 13px; width: 100%; box-shadow: 0 0 28px rgba(var(--cyr), .45); }
.btn-flow:disabled { opacity: .55; cursor: progress; animation-play-state: paused; filter: saturate(.6); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: var(--ink);
  border-radius: 11px; padding: 10px 18px; cursor: pointer; font-weight: 500; font-size: 13.5px;
}
.btn-ghost:hover { border-color: var(--cy); color: #fff; background: rgba(var(--cyr), .08); }
.btn-ghost.sm { padding: 0 15px; font-size: 13px; border-radius: 10px; }

/* --------------------------------------------------------------- top nav (desktop) */
.topnav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 26px; height: 64px; padding: 0 34px;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(8,11,20,.82), rgba(8,11,20,.42));
  border-bottom: 1px solid rgba(var(--cyr), .1);
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; position: relative; flex: none;
  background: conic-gradient(from 140deg, #34E0D2, #FF5C8A, #FFC944, #34E0D2);
  box-shadow: 0 0 18px rgba(var(--cyr), .55);
}
.brand-logo.sm { width: 26px; height: 26px; border-radius: 7px; box-shadow: none; }
.brand-logo b {
  position: absolute; inset: 5px; background: var(--bg); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--cy);
}
.brand-logo.sm b { inset: 4px; font-size: 11px; border-radius: 3px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.brand-name.sm { font-size: 14px; letter-spacing: .4px; }
.nav-links { display: flex; gap: 3px; margin-left: 6px; }
.nav-link {
  color: var(--dim); font-size: 13.5px; font-weight: 500; padding: 8px 13px; border-radius: 9px;
  cursor: pointer; transition: all .18s;
}
.nav-link:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.nav-link.active { color: var(--cy); background: rgba(var(--cyr), .1); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.star-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px;
  background: rgba(var(--goldr), .08); border: 1px solid rgba(var(--goldr), .22);
}
.star-chip .s { color: var(--gold); font-size: 13px; }
.star-chip .mono { font-size: 13px; color: var(--gold); font-weight: 500; }
.star-chip.sm { padding: 5px 10px; gap: 5px; }
.star-chip.sm .s, .star-chip.sm .mono { font-size: 12px; }
.star-chip.lg { padding: 10px 15px; } .star-chip.lg .s, .star-chip.lg .mono { font-size: 15px; font-weight: 600; }
.bell {
  position: relative; width: 38px; height: 38px; border-radius: 10px; color: var(--dim2);
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.bell .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--mg); box-shadow: 0 0 8px var(--mg); }
.avatar {
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; position: relative; flex: none;
  background: linear-gradient(135deg, #34E0D2, #149b91); box-shadow: 0 0 14px -2px #34E0D2;
}
.avatar::after { content: ""; position: absolute; inset: 9px; border-radius: 5px; background: rgba(7,10,18,.5); }
.vp-toggle { display: flex; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 3px; gap: 2px; }
.vp-toggle button { background: transparent; border: none; border-radius: 7px; padding: 6px 9px; cursor: pointer; color: var(--muted); display: flex; }
.vp-toggle button.active { background: rgba(var(--cyr), .16); color: var(--cy); }
.nav-cta { padding: 10px 18px; }

/* --------------------------------------------------------------- top bar (mobile) */
.topbar-mob {
  display: none; position: sticky; top: 0; z-index: 60;
  align-items: center; justify-content: space-between; padding: 12px 16px;
  backdrop-filter: blur(16px); background: rgba(8,11,20,.86); border-bottom: 1px solid rgba(var(--cyr), .12);
}
.topbar-mob .tb-right { display: flex; align-items: center; gap: 11px; }
.topbar-mob .bell { width: auto; height: auto; background: none; border: none; }

/* --------------------------------------------------------------- pages */
.page { display: none; }
.page.active { display: block; animation: fade .25s ease; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 30px 28px 60px; }
.wrap-wide { max-width: 1360px; padding: 30px 28px 40px; }
.wrap-mid { max-width: 1120px; padding: 30px 28px 60px; }
.page-kicker { font-size: 11px; letter-spacing: 2px; margin-bottom: 9px; }
.page-h1 { font-size: 34px; font-weight: 700; letter-spacing: -.6px; }
.page-note { color: var(--dim2); font-size: 12px; margin-top: 14px; }

/* =================================================================== HOME HERO */
/* hero theme variable sets (drive accent + HUD font + scanline + title glow) */
.theme-arcade {
  --ac1: #00E5FF; --ac1b: #7af0ff; --ac1r: 0,229,255;
  --ac2: #FF45B5; --ac2b: #ff9ad6; --ac2r: 255,69,181;
  --ac3: #FFD23F; --ac3r: 255,210,63;
  --hud-font: 'Press Start 2P', monospace; --rad: 8px; --bd: 2px; --scan-op: .4;
  --title-shadow: 0 0 1px #fff, 0 0 10px var(--ac1), 0 0 24px rgba(var(--ac1r), .7), 3px 3px 0 rgba(var(--ac2r), .6);
}
.theme-cyber {
  --ac1: #5CFF7A; --ac1b: #a6ffb8; --ac1r: 92,255,122;
  --ac2: #FF2E55; --ac2b: #ff8aa0; --ac2r: 255,46,85;
  --ac3: #E8FF59; --ac3r: 232,255,89;
  --hud-font: 'Chakra Petch', sans-serif; --rad: 3px; --bd: 1px; --scan-op: .24;
  --title-shadow: 2px 0 var(--ac2), -2px 0 var(--ac1), 0 0 18px rgba(var(--ac1r), .45);
}
.theme-broadcast {
  --ac1: #3D8BFF; --ac1b: #8fc0ff; --ac1r: 61,139,255;
  --ac2: #FF4D6D; --ac2b: #ffb0bf; --ac2r: 255,77,109;
  --ac3: #FFC944; --ac3r: 255,201,68;
  --hud-font: var(--sans); --rad: 14px; --bd: 1px; --scan-op: .06;
  --title-shadow: 0 4px 30px rgba(7,10,18,.92), 0 0 24px rgba(var(--ac1r), .22);
}
.hero {
  position: relative; margin-top: -64px; height: 100vh; min-height: 780px; overflow: hidden;
  font-family: var(--sans);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.16) 3px); opacity: var(--scan-op); }
.hero-vignette-v { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(7,10,18,.72) 0%, transparent 15%, transparent 70%, rgba(6,9,15,.96) 100%); }
.hero-vignette-h { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(7,10,18,.7), transparent 40%, transparent 62%, rgba(7,10,18,.5)); }

/* theme FX layers (toggled per theme) */
.fx { display: none; position: absolute; inset: 0; pointer-events: none; }
.theme-arcade .fx-arcade { display: block; box-shadow: inset 0 0 150px 55px rgba(0,0,0,.62), inset 0 0 70px rgba(var(--ac1r), .07); }
.theme-arcade .fx-arcade::after { content: ""; position: absolute; left: 0; right: 0; height: 16%; background: linear-gradient(180deg, transparent, rgba(var(--ac1r), .08), transparent); animation: scanband 6.5s linear infinite; }
.theme-cyber .fx-cyber-noise { display: block; opacity: .11; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.theme-cyber .fx-cyber-hazard { display: block; top: 0; height: 5px; bottom: auto; background: repeating-linear-gradient(45deg, rgba(var(--ac3r), .55) 0 10px, rgba(7,10,18,.55) 10px 20px); animation: hazardMove 1.3s linear infinite; }
.theme-cyber .fx-cyber-glitch { display: block; mix-blend-mode: screen; background: linear-gradient(180deg, transparent 30%, rgba(var(--ac2r), .08) 50%, transparent 70%); animation: glitchSkew 3.6s steps(1) infinite; }

/* style switcher chips */
.style-chips {
  position: absolute; top: 74px; left: 50%; transform: translateX(-50%); z-index: 8;
  display: flex; gap: 5px; padding: 5px; border-radius: var(--rad);
  background: rgba(7,10,18,.62); border: 1px solid rgba(var(--ac1r), .32);
  backdrop-filter: blur(12px); box-shadow: 0 10px 34px -10px rgba(0,0,0,.7);
}
.sc-label { display: flex; align-items: center; padding: 0 8px 0 6px; font-size: 9px; letter-spacing: 1.5px; color: var(--muted); }
.style-chip { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03); color: var(--dim); border-radius: var(--rad); padding: 7px 13px; cursor: pointer; transition: all .18s; }
.style-chip .k { font-family: var(--hud-font); font-size: 11px; font-weight: 700; line-height: 1; }
.style-chip .l { font-size: 12.5px; font-weight: 600; line-height: 1; }
.style-chip.active { border-color: var(--ac1); background: rgba(var(--ac1r), .18); color: var(--ac1); }

/* corner brackets */
.hb { position: absolute; width: 24px; height: 24px; pointer-events: none; }
.hb.tl { top: 80px; left: 36px; border-left: 2px solid rgba(var(--ac1r), .5); border-top: 2px solid rgba(var(--ac1r), .5); }
.hb.tr { top: 80px; right: 36px; border-right: 2px solid rgba(var(--ac1r), .5); border-top: 2px solid rgba(var(--ac1r), .5); }
.hb.bl { bottom: 78px; left: 36px; border-left: 2px solid rgba(var(--ac2r), .42); border-bottom: 2px solid rgba(var(--ac2r), .42); }
.hb.br { bottom: 78px; right: 36px; border-right: 2px solid rgba(var(--ac2r), .42); border-bottom: 2px solid rgba(var(--ac2r), .42); }
.feed-l, .feed-r { position: absolute; top: 82px; font-size: 11px; letter-spacing: 1.5px; color: var(--muted); pointer-events: none; }
.feed-l { left: 52px; } .feed-r { right: 52px; }
.feed-l .cy, .feed-r .cy { color: var(--ac1); } .feed-r .gold { color: var(--ac3); }

/* left column: title + terminal */
.hero-left { position: absolute; left: 0; top: 0; bottom: 60px; width: min(640px, 53vw); padding: 124px 0 0 52px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 30px; font-family: var(--hud-font); background: rgba(var(--ac2r), .1); border: var(--bd) solid rgba(var(--ac2r), .3); font-size: 11.5px; color: var(--ac2); font-weight: 600; letter-spacing: 1px; margin-bottom: 20px; backdrop-filter: blur(6px); }
.hero-badge .pd { width: 6px; height: 6px; border-radius: 50%; background: var(--ac2); box-shadow: 0 0 9px var(--ac2); animation: pulseGlow 1.4s infinite; }
.hero-left h1 { font-size: 52px; line-height: 1.04; font-weight: 700; margin: 0 0 18px; letter-spacing: -1.4px; text-shadow: var(--title-shadow); }
.hero-left h1 .cy { color: var(--ac1); } .hero-left h1 .mg { color: var(--ac2); }
.hero-left p { font-size: 16px; line-height: 1.55; color: #aeb6c6; margin: 0; max-width: 420px; text-shadow: 0 2px 16px rgba(7,10,18,.95); }
.intent-term { pointer-events: auto; width: min(540px, 48vw); border-radius: var(--rad); overflow: hidden; background: linear-gradient(180deg, rgba(13,18,28,.84), rgba(8,11,18,.88)); backdrop-filter: blur(16px); border: var(--bd) solid rgba(var(--ac1r), .32); box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 24px 60px -20px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.06); }
.term-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 11px; color: var(--dim2); }
.term-head .th-left { display: flex; align-items: center; gap: 9px; }
.term-head .dots { display: flex; gap: 5px; }
.term-head .dots i { width: 8px; height: 8px; border-radius: 50%; }
.term-head .dots i:nth-child(1) { background: var(--ac2); } .term-head .dots i:nth-child(2) { background: var(--ac3); } .term-head .dots i:nth-child(3) { background: var(--ac1); }
.term-head .th-rec { font-size: 10px; color: var(--ac2); }
.term-body { padding: 16px 16px 0; }
.term-line { font-size: 15px; line-height: 1.5; color: var(--ink); min-height: 46px; }
.term-line .caret { display: inline-block; width: 8px; height: 17px; background: var(--ac1); margin-left: 2px; vertical-align: -3px; animation: caret 1s steps(1) infinite; box-shadow: 0 0 8px var(--ac1); }
.term-presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.term-presets span { font-size: 11.5px; color: var(--dim); padding: 4px 9px; border-radius: 7px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.term-foot { display: flex; gap: 10px; align-items: center; padding: 0 16px 16px; }
.term-foot .btn-flow { padding: 13px 22px; font-size: 15px; box-shadow: 0 0 26px rgba(var(--ac1r), .5); }
.term-foot .btn-ghost { padding: 13px 18px; font-size: 15px; }

/* right column: spine DSL */
.hero-spine { position: absolute; right: 40px; top: 108px; bottom: 86px; width: 358px; border-radius: var(--rad); overflow: hidden; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(13,18,28,.82), rgba(8,11,18,.86)); backdrop-filter: blur(16px); border: var(--bd) solid rgba(var(--ac2r), .26); box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 24px 60px -20px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.05); }
.spine-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 12px; color: var(--ink); }
.spine-head .pd { width: 7px; height: 7px; border-radius: 50%; background: var(--ac2); box-shadow: 0 0 8px var(--ac2); animation: pulseGlow 1.2s infinite; display: inline-block; margin-right: 6px; vertical-align: middle; }
.spine-head .muted { font-size: 10.5px; }
.spine-code { flex: 1; overflow: hidden; padding: 14px 15px; font-size: 12.5px; line-height: 1.85; }
.spine-code .ln { display: flex; gap: 11px; margin: 0 -8px; padding: 1px 8px; border-left: 2px solid transparent; border-radius: 0 4px 4px 0; transition: background .25s; }
.spine-code .ln.on { background: rgba(var(--ac1r), .13); border-left-color: var(--ac1); }
.spine-code .ln .n { color: var(--faint); user-select: none; width: 18px; text-align: right; }
.spine-code .ln .t { white-space: pre; }
.spine-foot { padding: 10px 15px; border-top: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.spine-foot .cy { color: var(--ac1); } .spine-foot .gold { color: var(--ac3); }

/* bottom HUD bar */
.hero-hud { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; display: flex; align-items: center; gap: 24px; padding: 0 52px; background: linear-gradient(180deg, transparent, rgba(6,9,15,.94)); border-top: 1px solid rgba(var(--ac1r), .12); backdrop-filter: blur(8px); }
.hud-bar { display: flex; align-items: center; gap: 10px; }
.hud-bar .nm { font-size: 11px; color: #cfe9e6; } .hud-bar .nm.mgt { color: #f6cdd9; }
.hud-bar .bar { width: 72px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; display: inline-block; }
.hud-bar .cy-fill { display: block; height: 100%; background: var(--ac1); box-shadow: 0 0 8px var(--ac1); }
.hud-bar .mg-fill { display: block; height: 100%; background: var(--ac2); box-shadow: 0 0 8px var(--ac2); }
.hud-bar .cy { color: var(--ac1); font-size: 11px; } .hud-bar .mg { color: var(--ac2); font-size: 11px; }
.hero-hud .hud-narr { flex: 1; text-align: center; font-size: 11.5px; color: var(--dim); text-shadow: 0 0 10px rgba(0,0,0,.6); }
.hero-hud .gold { color: var(--ac3); font-size: 11px; } .hero-hud .muted { font-size: 11px; }

/* =================================================================== CREATE */
.create-grid { display: grid; grid-template-columns: 1fr 1.06fr; gap: 22px; align-items: start; }
.create-panel { border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); border: 1px solid rgba(var(--cyr), .18); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); padding: 24px; display: flex; flex-direction: column; gap: 22px; }
.cp-block { display: flex; flex-direction: column; }
.cp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.cp-head .lbl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); font-weight: 500; }
.cp-head .pd { width: 7px; height: 7px; border-radius: 50%; background: var(--mg); box-shadow: 0 0 8px var(--mg); animation: pulseGlow 1.5s infinite; }
.cp-sub { font-size: 12px; color: var(--dim2); margin-bottom: 9px; }
.cp-hint { font-size: 11.5px; color: var(--muted); margin-top: 7px; }
#createNl { width: 100%; resize: none; border-radius: 13px; background: rgba(7,10,18,.6); border: 1px solid rgba(var(--cyr), .28); padding: 15px 16px; font-family: var(--mono); font-size: 15px; line-height: 1.6; color: var(--ink); outline: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3), 0 0 22px -6px rgba(var(--cyr), .4); }
.cp-grid2 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; }
.cp-input { width: 100%; border-radius: 11px; background: rgba(7,10,18,.6); border: 1px solid rgba(255,255,255,.1); padding: 11px 13px; font-size: 13.5px; color: var(--ink); outline: none; }
.cp-input.mono { font-family: var(--mono); font-size: 14px; }
.cp-select { width: 100%; border-radius: 11px; background: rgba(7,10,18,.6); border: 1px solid rgba(255,255,255,.1); padding: 11px 13px; font-size: 13px; color: var(--ink); outline: none; font-family: var(--mono); }
.cp-select:focus, .cp-input:focus, #createNl:focus { border-color: var(--cy); }
.skill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.skill-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 13px 6px 10px; border-radius: 12px; cursor: pointer; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.08); transition: all .18s; color: var(--muted); }
.skill-tile .ico { display: flex; }
.skill-tile .nm { font-size: 12px; font-weight: 500; color: var(--dim); }
.skill-tile .cd { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.skill-tile.sel { background: rgba(var(--cyr), .08); border-color: var(--cy); color: var(--cy); }
.skill-tile.sel .nm { color: var(--ink); }

.create-result { min-height: 460px; }
.create-empty { border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); border: 1px solid rgba(var(--mgr), .26); min-height: 460px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px; text-align: center; }
.ce-icon { width: 46px; height: 46px; border-radius: 13px; background: rgba(var(--cyr), .1); border: 1px solid rgba(var(--cyr), .25); display: flex; align-items: center; justify-content: center; color: var(--cy); }
.ce-text { font-size: 14px; color: var(--dim); max-width: 260px; line-height: 1.6; }

/* glass panel base (shared by station panels) */
.panel { border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); border: 1px solid rgba(255,255,255,.08); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.panel-head .ph-left { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink); }
.panel-head .ph-right { font-size: 11.5px; color: var(--muted); }
.panel-foot { padding: 11px 16px; border-top: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mg); box-shadow: 0 0 9px var(--mg); animation: pulseGlow 1.5s infinite; }
.mg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mg); box-shadow: 0 0 8px var(--mg); }
.pill { font-size: 10px; color: var(--cy); background: rgba(var(--cyr), .1); padding: 3px 8px; border-radius: 6px; }

/* =================================================================== ARENA */
.arena-config { display: flex; gap: 22px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.ac-selectors { display: flex; gap: 28px; align-items: flex-end; flex-wrap: wrap; }
.ac-group { display: flex; flex-direction: column; }
.ac-label { font-size: 10.5px; letter-spacing: 2px; color: var(--muted); margin-bottom: 9px; }
.chip-sel { display: flex; gap: 8px; flex-wrap: wrap; }
.opp-chip { display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 11px; padding: 9px 13px; cursor: pointer; transition: all .18s; }
.opp-chip .sw { width: 9px; height: 9px; border-radius: 2px; box-shadow: 0 0 8px currentColor; }
.opp-chip .txt { text-align: left; }
.opp-chip .nm { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--ink); font-weight: 500; }
.opp-chip .rk { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.opp-chip.sel { background: rgba(var(--mgr), .12); }
.map-chip { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 11px; padding: 8px 15px; cursor: pointer; color: var(--dim); transition: all .18s; text-align: left; }
.map-chip .nm { display: block; font-size: 13.5px; font-weight: 500; }
.map-chip .sub { display: block; font-family: var(--mono); font-size: 9px; color: var(--muted); letter-spacing: 1px; margin-top: 1px; }
.map-chip.sel { background: rgba(var(--cyr), .12); border-color: rgba(var(--cyr), .4); color: var(--cy); }
.ac-intent { display: flex; flex-direction: column; flex: 1; min-width: 260px; }
.ac-nl { width: 100%; border-radius: 11px; background: rgba(7,10,18,.6); border: 1px solid rgba(var(--cyr), .28); padding: 12px 14px; font-size: 14px; color: var(--ink); outline: none; }
.ac-nl:focus { border-color: var(--cy); }
#arenaGen { padding: 13px 26px; font-size: 15px; border-radius: 12px; }
.arena-presets { margin: 0 0 18px; }
.arena-stage { min-height: 200px; }

/* preset chips */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.preset-chip { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 8px 15px; cursor: pointer; color: var(--dim); font-size: 13.5px; font-weight: 500; transition: all .18s; }
.preset-chip:hover { border-color: var(--cy); color: var(--cy); background: rgba(var(--cyr), .06); }

/* =================================================================== BATTLE STATION */
.bstation { display: grid; gap: 16px; }
/* arena mode: battle+console left, code sticky right */
.bstation { grid-template-columns: 1.56fr 1fr; grid-template-areas: "battle code" "console code"; align-items: start; }
.b-battle { grid-area: battle; }
.b-code { grid-area: code; position: sticky; top: 84px; }
.b-console { grid-area: console; }
/* create mode: code on top, battle below, no console */
.bstation.mode-create { grid-template-columns: 1fr; grid-template-areas: "code" "battle"; }
.bstation.mode-create .b-console { display: none; }
.bstation.mode-create .b-code { position: static; }

.b-battle { border: 1px solid rgba(var(--cyr), .24); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 0 0 1px rgba(0,0,0,.4), 0 40px 80px -34px rgba(var(--cyr), .36); }
.b-battle .panel-head { background: rgba(7,10,18,.5); }
.b-code { border: 1px solid rgba(var(--mgr), .26); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 1px rgba(0,0,0,.35), 0 30px 60px -30px rgba(var(--mgr), .3); }

.canvas-wrap { position: relative; width: 100%; overflow: hidden; background: #05080e; }
#arena { display: block; width: 100%; background: #05080e; }
.cv-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.14) 3px); opacity: .5; }
.cv-corner { position: absolute; width: 20px; height: 20px; pointer-events: none; }
.cv-corner.tl { top: 14px; left: 14px; border-left: 2px solid rgba(var(--cyr), .45); border-top: 2px solid rgba(var(--cyr), .45); }
.cv-corner.tr { top: 14px; right: 14px; border-right: 2px solid rgba(var(--cyr), .45); border-top: 2px solid rgba(var(--cyr), .45); }
.scanlabel { position: absolute; top: 12px; left: 40px; font-size: 10.5px; letter-spacing: 1.5px; color: var(--cy); text-shadow: 0 0 10px rgba(var(--cyr), .5); opacity: .8; pointer-events: none; }
.cv-tanks { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 16px; }
.cv-tanks span { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.cv-tanks .ct-a { color: #cfe9e6; } .cv-tanks .ct-b { color: #f6cdd9; }
.cv-tanks i { width: 10px; height: 10px; border-radius: 2px; }
.cv-tanks .ct-a i { background: var(--cy); box-shadow: 0 0 10px var(--cy); }
.cv-tanks .ct-b i { background: var(--mg); box-shadow: 0 0 10px var(--mg); }
.cv-tanks .state.dead { color: var(--mg); font-weight: 700; }
.cv-stars { position: absolute; right: 16px; top: 12px; font-size: 10.5px; color: var(--gold); background: rgba(var(--goldr), .1); border: 1px solid rgba(var(--goldr), .25); padding: 4px 9px; border-radius: 7px; }
.cv-note { position: absolute; left: 14px; bottom: 44px; display: flex; align-items: center; gap: 9px; background: rgba(7,10,18,.82); border: 1px solid rgba(var(--goldr), .35); border-radius: 9px; padding: 7px 12px; backdrop-filter: blur(6px); font-family: var(--mono); font-size: 11px; color: var(--ink); max-width: 78%; }
.cv-note.fallback { border-color: rgba(var(--mgr), .4); }
.cv-note .wr { color: var(--gold); }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; letter-spacing: 2px; background: radial-gradient(closest-side, rgba(5,8,14,.25), rgba(5,8,14,.7)); text-shadow: 0 2px 20px rgba(0,0,0,.7); text-transform: uppercase; }

/* playback bar */
.playback { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07); background: rgba(7,10,18,.55); }
.pb-play { width: 40px; height: 40px; border-radius: 11px; border: none; cursor: pointer; background: linear-gradient(135deg, #34E0D2, #1fb4a8); color: #06121a; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 16px rgba(var(--cyr), .5); }
.pb-mini { width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: var(--dim); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pb-mini:hover { border-color: var(--cy); color: #fff; }
.pb-scrub { position: relative; flex: 1; height: 20px; display: flex; align-items: center; }
.pb-track { position: absolute; left: 0; right: 0; height: 8px; border-radius: 5px; background: rgba(255,255,255,.08); overflow: hidden; }
.pb-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #34E0D2, #7af0e5); box-shadow: 0 0 10px rgba(var(--cyr), .6); }
.pb-range { position: absolute; left: 0; right: 0; width: 100%; margin: 0; height: 20px; opacity: 0; cursor: pointer; }
.pb-count { font-size: 11.5px; color: var(--muted); min-width: 64px; text-align: right; }
.pb-speeds { display: flex; gap: 3px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 9px; padding: 3px; }
.pb-speeds button { border: none; border-radius: 6px; padding: 5px 9px; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--dim); background: transparent; }
.pb-speeds button.active { color: #06121a; background: var(--cy); }

/* code panel */
.code-list { list-style: none; margin: 0; padding: 16px; counter-reset: prio; font-family: var(--mono); font-size: 13px; line-height: 2; max-height: 520px; overflow-y: auto; }
.code-list li { position: relative; display: flex; gap: 12px; margin: 0 -8px; padding: 1px 8px 1px 34px; border-left: 2px solid transparent; border-radius: 0 4px 4px 0; color: var(--dim); white-space: pre-wrap; word-break: break-word; transition: background .25s; counter-increment: prio; }
.code-list li::before { content: counter(prio, decimal-leading-zero); position: absolute; left: 6px; top: 1px; color: var(--faint); font-size: 12px; width: 20px; text-align: right; }
.code-list li.reveal { animation: lineIn .3s ease both; }
.code-list li.fallback { color: var(--muted); font-style: italic; }
.code-list li .kw { color: var(--cy); }
.code-list li .fn { color: var(--mg); }
.code-list li.active { background: rgba(var(--cyr), .13); border-left-color: var(--cy); color: #eafcf9; }
.code-list li.active::before { color: var(--cy); }

/* console panel */
.b-console .panel-head { padding: 11px 16px; }
.console { list-style: none; margin: 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-height: 150px; max-height: 260px; overflow-y: auto; font-family: var(--mono); font-size: 12px; }
.console li { display: flex; align-items: center; gap: 11px; padding: 5px 10px; border-radius: 7px; border-left: 2px solid transparent; color: var(--dim); }
.console li .f { color: var(--muted); width: 44px; flex: none; }
.console li.a-line { border-left-color: var(--cy); } .console li.a-line .f { color: var(--cy); }
.console li.b-line { border-left-color: var(--mg); } .console li.b-line .f { color: var(--mg); }
.console li.event { color: var(--gold); border-left-color: rgba(var(--goldr), .5); }
.console li.crash { color: var(--mg); font-weight: 600; }
.console li.now { background: rgba(var(--cyr), .07); }

/* mobile segmented tabs — hidden on desktop and in create mode */
.seg { display: none; grid-column: 1 / -1; gap: 6px; padding: 4px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 11px; order: -1; }
.bstation.mode-create .seg { display: none !important; }
.seg button { flex: 1; border: none; border-radius: 8px; padding: 9px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--dim2); background: transparent; }
.seg button.active { color: var(--cy); background: rgba(var(--cyr), .14); }

/* =================================================================== LEADERBOARD */
.lb-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.pill-tabs { display: flex; gap: 4px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 4px; }
.pill-tabs button { border: none; border-radius: 9px; padding: 9px 18px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--dim2); background: transparent; }
.pill-tabs button.active { color: var(--cy); background: rgba(var(--cyr), .14); }
.lb-table { border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)); border: 1px solid rgba(255,255,255,.08); }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,.05); }
.lb-colhead { padding: 11px 18px; font-size: 10.5px; letter-spacing: 1px; color: var(--muted); }
.lb-colhead .c-rank { width: 30px; } .lb-colhead .c-name { flex: 1; } .lb-colhead .c-win { width: 120px; }
.lb-row.you { background: rgba(var(--cyr), .06); border-left: 2px solid rgba(var(--cyr), .4); }
.lb-rankbadge { min-width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.lb-skin { width: 40px; height: 40px; border-radius: 11px; position: relative; flex: none; }
.lb-skin::after { content: ""; position: absolute; inset: 10px; border-radius: 6px; background: rgba(7,10,18,.55); }
.lb-info { flex: 1; min-width: 0; }
.lb-info .top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.lb-info .nm { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ink); }
.lb-info .tier { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.06); }
.lb-info .ver { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.lb-info .owner { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.lb-skills { display: flex; gap: 6px; }
.lb-skills i { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: var(--dim2); }
.lb-win { width: 120px; display: flex; align-items: center; gap: 9px; }
.lb-win .bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.lb-win .bar i { display: block; height: 100%; }
.lb-win .pct { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.lb-chal { flex: none; border: 1px solid rgba(var(--cyr), .3); background: rgba(var(--cyr), .08); color: var(--cy); border-radius: 9px; padding: 8px 14px; cursor: pointer; font-size: 12.5px; font-weight: 500; }

/* =================================================================== STORE */
.store-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.store-bal { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.redeem { display: flex; gap: 6px; }
.redeem input { width: 130px; border-radius: 10px; background: rgba(7,10,18,.6); border: 1px solid rgba(255,255,255,.12); padding: 10px 13px; font-size: 13px; color: var(--ink); outline: none; }
.store-sub { font-size: 13px; color: var(--dim2); margin: 0 0 14px; }
.fn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.fn-card { position: relative; overflow: hidden; border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); padding: 22px; }
.fn-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--fc), transparent); }
.fn-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fn-ico { width: 46px; height: 46px; border-radius: 13px; background: rgba(255,255,255,.05); border: 1px solid var(--fc); display: flex; align-items: center; justify-content: center; color: var(--fc); font-size: 20px; }
.fn-rar { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--fc); border: 1px solid var(--fc); border-radius: 6px; padding: 3px 8px; }
.fn-name { font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.fn-desc { font-size: 13px; color: var(--dim2); line-height: 1.55; margin-bottom: 18px; }
.fn-buy { width: 100%; border: none; border-radius: 11px; padding: 12px; cursor: pointer; font-family: var(--mono); font-size: 14px; font-weight: 600; color: #06121a; background: var(--fc); }
.bullet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.bullet-card { border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); padding: 18px; text-align: center; }
.bullet-orb { height: 60px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.bullet-orb i { width: 14px; height: 14px; border-radius: 50%; }
.bullet-name { font-size: 13.5px; color: var(--ink); margin-bottom: 9px; }
.bullet-price { font-family: var(--mono); font-size: 13px; color: var(--gold); }

/* =================================================================== toast */
.status { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; background: rgba(13,18,28,.92); border: 1px solid rgba(var(--cyr), .28); backdrop-filter: blur(12px); padding: 11px 20px; border-radius: 10px; color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.55); font-size: 13.5px; max-width: 92vw; }
.status.err { border-color: var(--mg); color: #ffb3c6; }
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--muted); border-top-color: var(--cy); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px; }

/* =================================================================== tab bar (mobile) */
.tabbar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70; justify-content: space-around; padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px)); backdrop-filter: blur(18px); background: rgba(8,11,20,.92); border-top: 1px solid rgba(var(--cyr), .14); }
.tab-link { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 12px; min-width: 56px; color: var(--muted); font-size: 10px; font-weight: 500; }
.tab-link .ti { display: flex; }
.tab-link.active { color: var(--cy); }

/* =================================================================== responsive (container query on #frame) */
@container frame (max-width: 900px) {
  .bstation { grid-template-columns: 1fr; grid-template-areas: "battle" "code" "console"; }
  .b-code { position: static; }
  .create-grid { grid-template-columns: 1fr; }
}

@container frame (max-width: 640px) {
  .topnav { display: none; }
  .topbar-mob { display: flex; }
  .wrap, .wrap-wide, .wrap-mid { padding: 16px 14px 96px; }
  .page-h1 { font-size: 25px; }

  /* hero → mobile stacked */
  .hero { margin-top: 0; height: auto; min-height: 0; }
  .hero-canvas { position: relative; height: 56vh; min-height: 400px; }
  .hero-scan, .hero-vignette-v, .fx { height: 56vh; min-height: 400px; bottom: auto; }
  .style-chips { position: static; transform: none; margin: 12px 14px 4px; overflow-x: auto; justify-content: flex-start; }
  .hb, .feed-l, .feed-r, .hero-vignette-h { display: none; }
  .hero-left { position: static; width: auto; padding: 16px 14px 0; pointer-events: auto; }
  .hero-left h1 { font-size: 29px; letter-spacing: -.8px; }
  .hero-left p { max-width: none; margin-top: 12px; }
  .intent-term { width: auto; margin-top: 16px; }
  .term-foot .btn-flow, .term-foot .btn-ghost { flex: 1; }
  .hero-spine { position: static; width: auto; margin: 14px 14px 0; height: auto; }
  .spine-code { max-height: 260px; }
  .hero-hud { position: static; height: auto; flex-wrap: wrap; padding: 12px 14px; gap: 12px; }
  .hero-hud .hud-narr { order: 5; flex-basis: 100%; text-align: left; }

  /* create / arena stacks */
  .create-grid { grid-template-columns: 1fr; }
  .create-panel { padding: 16px; gap: 18px; }
  .cp-grid2 { grid-template-columns: 1fr 1fr; }
  .arena-config { gap: 12px; }
  .ac-selectors { gap: 14px; overflow-x: auto; }
  .ac-intent { min-width: 100%; order: -1; }
  #arenaGen { width: 100%; }

  /* station: battle first, segmented code/console */
  .bstation { grid-template-columns: 1fr; grid-template-areas: "battle" "rail"; }
  .b-code, .b-console { grid-area: rail; }
  .b-code { position: static; }
  .seg { display: flex; }
  .bstation:not(.show-code) .b-code { display: none; }
  .bstation:not(.show-console) .b-console { display: none; }
  .bstation.show-code .b-console { display: none; }
  /* create mode on mobile: code always shown, no console, no seg */
  .bstation.mode-create .b-code { display: block; }
  .bstation.mode-create .b-console { display: none; }
  .playback { flex-wrap: wrap; gap: 10px; }
  .pb-scrub { flex-basis: 100%; order: 5; }
  .pb-play { width: 44px; height: 44px; } .pb-mini { width: 42px; height: 42px; }

  .fn-grid { grid-template-columns: 1fr; }
  .bullet-grid { grid-template-columns: repeat(2, 1fr); }
  .lb-skills { display: none; }
  .lb-win { width: auto; } .lb-win .bar { display: none; }

  .tabbar { display: flex; }
  .app { padding-bottom: 4px; }
}

/* forced mobile-preview frame (nav toggle) */
body.force-mobile #frame { max-width: 440px; margin: 0 auto; box-shadow: 0 0 0 1px rgba(var(--cyr), .12); min-height: 100vh; }
body.force-mobile .tabbar { display: flex; left: 50%; right: auto; transform: translateX(-50%); width: 440px; max-width: 100%; }

/* ============================================================ M3c — platform shell */
.modal-mask { position: fixed; inset: 0; z-index: 200; background: rgba(4,6,12,.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; }
.modal-mask.hidden { display: none; }
.modal-card { width: min(420px, calc(100vw - 32px)); padding: 22px 22px 18px; border-radius: 16px; }
.modal-card .btn-flow.big { width: 100%; margin-top: 6px; }
.modal-card .btn-ghost.sm { width: 100%; }

.notif-panel { position: fixed; top: 64px; right: 18px; z-index: 190; width: min(380px, calc(100vw - 24px));
  border-radius: 14px; padding: 10px 12px; }
.notif-panel.hidden { display: none; }
.notif-panel li { cursor: default; }
.notif-panel li a { color: var(--cy); }
.notif-panel li.unread { border-left: 2px solid var(--cy); padding-left: 8px; }

.tank-card { text-align: left; cursor: pointer; }
.tank-card .skin { height: 92px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.tank-card .skin svg { max-height: 88px; max-width: 100%; filter: drop-shadow(0 0 14px rgba(52,224,210,.35)); }
.tank-card .fn-desc { min-height: 0; }

.lb-bot-badge { font-size: 10px; letter-spacing: .1em; padding: 1px 6px; border-radius: 6px;
  background: rgba(155,108,255,.16); color: #b795ff; border: 1px solid rgba(155,108,255,.4); margin-left: 6px; }
.lb-skin svg { width: 34px; height: 34px; }

.detail-tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.detail-tabs button { padding: 7px 14px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04); color: var(--ink); cursor: pointer; font-size: 13px; }
.detail-tabs button.active { border-color: var(--cy); color: var(--cy); box-shadow: 0 0 14px -6px var(--cy); }
.detail-pane { border-radius: 14px; padding: 16px 18px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.badge-chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255,201,68,.5);
  color: var(--gold); background: rgba(255,201,68,.08); }
.code-view { font-family: var(--mono-f, monospace); font-size: 12px; line-height: 1.55; white-space: pre-wrap;
  background: rgba(4,6,12,.6); border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 14px;
  max-height: 420px; overflow: auto; color: #cfe9e6; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.kv-grid .kv { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  padding: 10px 12px; }
.kv-grid .kv .k { font-size: 11px; color: #7d889c; letter-spacing: .08em; }
.kv-grid .kv .v { font-size: 16px; margin-top: 3px; }

.hist-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.06);
  cursor: pointer; }
.hist-row:hover { background: rgba(255,255,255,.04); }
.hist-row .res { width: 44px; font-weight: 700; }
.hist-row .res.win { color: var(--cy); } .hist-row .res.loss { color: var(--mg); } .hist-row .res.draw { color: #9aa3b6; }
.hist-row .delta.pos { color: var(--cy); } .hist-row .delta.neg { color: var(--mg); }
.wall-post { border-bottom: 1px solid rgba(255,255,255,.07); padding: 10px 2px; }
.wall-post .who { color: var(--cy); font-size: 12px; }
.wall-post .body { margin-top: 3px; }
.wall-post .reply { margin: 6px 0 0 18px; border-left: 2px solid rgba(255,255,255,.12); padding-left: 10px; }
.guide-doc { line-height: 1.7; }
.guide-doc h2 { color: var(--cy); margin: 26px 0 8px; font-size: 20px; }
.guide-doc code, .guide-doc pre { font-family: monospace; background: rgba(4,6,12,.6); border-radius: 6px; }
.guide-doc code { padding: 1px 6px; }
.guide-doc pre { padding: 12px 14px; overflow-x: auto; border: 1px solid rgba(255,255,255,.09); }
.guide-doc table { border-collapse: collapse; width: 100%; font-size: 13px; }
.guide-doc td, .guide-doc th { border: 1px solid rgba(255,255,255,.12); padding: 6px 10px; text-align: left; }
@media (max-width: 640px) {
  .notif-panel { top: 54px; right: 8px; }
  .detail-pane { padding: 12px; }
}

/* =================================================================== STORY GAPS (G2/G3/G4/G6/G10) */
/* G10: the modal title must never wrap vertically, whatever the flex context does */
.modal-card .panel-head { border-bottom: none; padding: 0 0 4px; }
.modal-card .ph-left { white-space: nowrap; flex: 1 1 auto; min-width: 0; writing-mode: horizontal-tb; }
.modal-card .ph-left #loginTitle { font-size: 16px; font-weight: 600; letter-spacing: .04em; }
.modal-card .btn-ghost.sm#loginClose { width: auto; flex: 0 0 auto; }

/* G6: "WITH ☀ CLAUDE" author badge */
.with-badge { font-size: 10px; letter-spacing: .08em; padding: 1px 7px; border-radius: 6px; margin-left: 6px;
  background: rgba(255,201,68,.12); color: var(--gold); border: 1px solid rgba(255,201,68,.4); }

/* G4: gold achievement toasts (stacked, bottom-right) */
#toasts { position: fixed; right: 18px; bottom: 74px; z-index: 240; display: flex; flex-direction: column; gap: 10px; }
.gold-toast { padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255,201,68,.55);
  box-shadow: 0 0 26px -6px rgba(255,201,68,.55); font-size: 13.5px; max-width: 340px;
  opacity: 0; transform: translateX(16px); transition: all .35s ease-out; }
.gold-toast.in { opacity: 1; transform: none; }
.gold-toast a { color: var(--cy); }

/* G2: RANK PROMOTED celebration */
.promo-card { text-align: center; border: 1px solid rgba(255,201,68,.5); box-shadow: 0 0 60px -12px rgba(255,201,68,.6); }
.promo-kicker { color: var(--gold); letter-spacing: 4px; font-size: 13px; margin-bottom: 14px; animation: pulseGlow 1.6s infinite; }
.promo-tiers { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0 14px; }
.promo-shield { --tc: #9AA3B6; display: inline-flex; align-items: center; justify-content: center;
  min-width: 84px; padding: 14px 12px; clip-path: polygon(50% 0, 100% 18%, 100% 72%, 50% 100%, 0 72%, 0 18%);
  background: color-mix(in srgb, var(--tc) 18%, transparent); border: 1px solid var(--tc);
  color: var(--tc); font-weight: 700; font-size: 15px; }
.promo-shield.up { box-shadow: 0 0 30px -4px var(--tc); transform: scale(1.12); }
.promo-arrow { color: var(--gold); font-size: 18px; }
.promo-name { font-size: 16px; margin-bottom: 6px; }
.promo-sub { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.promo-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.promo-btns .btn-ghost.sm { width: auto; }

/* G3: achievements wall */
.ach-card.lit { border: 1px solid rgba(255,201,68,.6); box-shadow: 0 0 26px -8px rgba(255,201,68,.6); }
.ach-card.lit .fn-name { color: var(--gold); }
.ach-card.locked { opacity: .55; filter: saturate(.5); }
.ach-prog { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ach-prog .bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.ach-prog .bar i { display: block; height: 100%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.ach-prog .mono { font-size: 11px; color: var(--muted); }
