/* ============ CUBECADE — arcade cabinet styling ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #07090d; --panel: #0c1118; --panel2: #101722; --line: #1c2634;
  --cyan: #2ee6ff; --pink: #ff3d81; --amber: #ffc233; --green: #2ee66b;
  --text: #c9d6e3; --dim: #5f7086;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --disp: 'Press Start 2P', monospace;
  --ui: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--ui); overflow-x: hidden; }
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 480px at 18% -8%, rgba(46,230,255,.055), transparent 60%),
    radial-gradient(820px 520px at 92% 112%, rgba(255,61,129,.05), transparent 60%);
}
.cabinet { max-width: 1520px; margin: 0 auto; padding: 16px 22px 14px; position: relative; z-index: 1; }

/* ---------- marquee ---------- */
.marquee { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 4px 16px; flex-wrap: wrap; }
.logo { font-family: var(--disp); font-size: 22px; letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 12px rgba(46,230,255,.65), 0 0 34px rgba(46,230,255,.22); }
.logo span { color: var(--pink); text-shadow: 0 0 12px rgba(255,61,129,.65), 0 0 34px rgba(255,61,129,.22); }
.marquee-tag { display: flex; gap: 8px; }
.pill { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; color: var(--cyan);
  border: 1px solid rgba(46,230,255,.4); padding: 6px 10px; border-radius: 3px;
  background: rgba(46,230,255,.05); cursor: pointer; user-select: none; transition: all .15s; }
.pill:hover { box-shadow: 0 0 12px rgba(46,230,255,.35); }
.pill.alt { color: var(--pink); border-color: rgba(255,61,129,.4); background: rgba(255,61,129,.05); cursor: default; }
.pill.alt2 { color: var(--amber); border-color: rgba(255,194,51,.35); background: rgba(255,194,51,.05); cursor: default; }
.pill.blink { animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- layout ---------- */
.playfield { display: grid; grid-template-columns: minmax(0,1fr) 392px; gap: 18px; align-items: stretch; }

/* ---------- stage ---------- */
.stage { position: relative; min-height: 660px; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #0b1018 0%, #07090d 70%); }
.stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  box-shadow: inset 0 0 130px rgba(0,0,0,.6); border-radius: 10px; }
#canvas-wrap { position: absolute; inset: 0; z-index: 1; }
#canvas-wrap canvas { display: block; }
.stage-hud { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between;
  padding: 16px 20px; pointer-events: none; z-index: 3; }
.stat label { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 2.5px; color: var(--dim); margin-bottom: 5px; }
.stat span { font-family: var(--mono); font-size: 21px; font-weight: 600; color: #fff; text-shadow: 0 0 10px rgba(46,230,255,.4); }
.hud-right .stat { text-align: right; }
.hud-right .stat span { text-shadow: 0 0 10px rgba(255,61,129,.35); }
.stage-foot { position: absolute; bottom: 11px; left: 0; right: 0; text-align: center; z-index: 3;
  font-family: var(--mono); font-size: 10px; letter-spacing: .5px; color: var(--dim); pointer-events: none; }
.scanlines { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: .5; mix-blend-mode: overlay;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 3px); }

/* ---------- solved flash ---------- */
.solved-flash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; pointer-events: none; z-index: 5;
  opacity: 0; transform: scale(.92); transition: opacity .25s ease, transform .25s ease; }
.solved-flash.show { opacity: 1; transform: scale(1); }
.solved-word { font-family: var(--disp); font-size: 42px; color: var(--green);
  text-shadow: 0 0 18px rgba(46,230,107,.8), 0 0 60px rgba(46,230,107,.35); }
.solved-sub { font-family: var(--mono); font-size: 13px; color: var(--text); letter-spacing: 1px; }

/* ---------- panel ---------- */
.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.section-title { font-family: var(--mono); font-size: 10px; letter-spacing: 2.5px; color: var(--cyan);
  margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.mcp-badge { font-size: 9px; color: var(--pink); border: 1px solid rgba(255,61,129,.4); padding: 2px 7px; border-radius: 3px; letter-spacing: 1px; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.arc-btn { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; color: var(--text);
  background: var(--panel2); border: 1px solid #273448; border-radius: 6px; padding: 11px 8px;
  cursor: pointer; transition: all .12s; text-transform: uppercase; }
.arc-btn:hover { border-color: var(--cyan); color: #fff; box-shadow: 0 0 12px rgba(46,230,255,.22); }
.arc-btn:active { transform: translateY(1px); }
.arc-btn.primary { border-color: rgba(46,230,255,.55); color: var(--cyan); }
.arc-btn.accent { border-color: rgba(255,61,129,.55); color: var(--pink); }
.arc-btn.face { padding: 9px 0; }
.arc-btn.face:hover { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 12px rgba(255,194,51,.2); }
.arc-btn.prime { color: var(--dim); }
.arc-btn.prime.on { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 10px rgba(255,194,51,.3); }
.movepad { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.prime-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.speed-row { display: flex; gap: 8px; align-items: center; }
.speed-row label { font-family: var(--mono); font-size: 9px; letter-spacing: 2px; color: var(--dim); }
.speed-row select { flex: 1; min-width: 0; background: var(--panel2); color: var(--text);
  border: 1px solid #273448; border-radius: 6px; font-family: var(--mono); font-size: 11px; padding: 8px; outline: none; }
.arc-btn.sound { flex: 0 0 auto; padding: 8px 12px; }
.arc-btn.sound.muted { color: var(--pink); border-color: rgba(255,61,129,.5); }

/* ---------- console ---------- */
.console-log { height: 246px; overflow-y: auto; font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  background: #080c12; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.console-log::-webkit-scrollbar { width: 8px; }
.console-log::-webkit-scrollbar-thumb { background: #1e2a3a; border-radius: 4px; }
.log-line { margin-bottom: 5px; word-break: break-word; }
.log-line .js { color: #8fa3b8; }
.log-line b { font-weight: 600; }
.log-call { color: var(--cyan); }
.log-call b { color: #8df0ff; }
.log-result { color: var(--green); }
.log-result b { color: #7dffb0; }
.log-error { color: var(--pink); }
.log-agent { color: #e8eef6; }
.log-agent .who { color: var(--pink); font-weight: 600; }
.log-sys { color: var(--dim); white-space: pre-wrap; }
.console-input { display: flex; gap: 8px; margin-top: 8px; }
.console-input .prompt { color: var(--cyan); font-family: var(--mono); font-size: 14px; align-self: center; }
.console-input input { flex: 1; min-width: 0; background: #080c12; border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-family: var(--mono); font-size: 12px; padding: 9px 10px; outline: none; }
.console-input input:focus { border-color: var(--cyan); box-shadow: 0 0 10px rgba(46,230,255,.18); }
.arc-btn.send { padding: 9px 16px; }

/* ---------- tools doc ---------- */
.tools-doc { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool-chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px;
  cursor: pointer; transition: all .12s; }
.tool-chip:hover { border-color: var(--cyan); transform: translateY(-1px); }
.tool-chip .tn { font-family: var(--mono); font-size: 10.5px; color: var(--cyan); font-weight: 600; }
.tool-chip .td { font-size: 10px; color: var(--dim); margin-top: 3px; line-height: 1.4; }

/* ---------- confetti ---------- */
.confetti { position: absolute; top: -14px; z-index: 6; border-radius: 2px; pointer-events: none;
  animation-name: cfall; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes cfall { to { transform: translateY(780px) rotate(680deg); opacity: .65; } }

.cdn-error { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  color: var(--pink); font-family: var(--mono); font-size: 13px; padding: 30px; text-align: center; line-height: 1.8; }
.cabinet-foot { margin-top: 14px; text-align: center; font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.5px; color: #3d4a5c; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .playfield { grid-template-columns: 1fr; }
  .stage { min-height: 56vh; }
  .logo { font-size: 16px; }
  .solved-word { font-size: 28px; }
}
