:root {
  --bg: #0b0e14;
  --panel: #121722;
  --panel-2: #1a2130;
  --line: #243044;
  --text: #e6ecf5;
  --muted: #7f8ca3;
  --accent: #35e0ff;
  --acid: #78ffa0;
  --gold: #ffd166;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { background: radial-gradient(ellipse at 30% 20%, #161230 0%, var(--bg) 60%); }
#app { display: flex; height: 100%; }

#stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px; min-width: 0; }
#c { width: 100%; max-width: calc((100vh - 24px) * 16 / 9); aspect-ratio: 16 / 9; height: auto; background: #0a0b16; border-radius: 10px; cursor: default; touch-action: none; display: block;
     box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0,0,0,0.55), 0 0 80px rgba(120,255,160,0.05); }

#side { width: 320px; flex: none; overflow-y: auto; padding: 14px; border-left: 1px solid var(--line); background: linear-gradient(180deg, #131927 0%, var(--panel) 100%); display: flex; flex-direction: column; gap: 12px; }
header .back { display: inline-block; margin-bottom: 8px; font: 700 12px/1 "Rajdhani", system-ui, sans-serif; letter-spacing: 0.18em; color: var(--muted); text-decoration: none; }
header .back:hover { color: var(--accent); }
header h1 { margin: 0; font: 700 28px/1 "Rajdhani", system-ui, sans-serif; letter-spacing: 0.12em; text-shadow: 0 0 24px rgba(232,226,214,0.2); }
header h1 span { color: var(--acid); text-shadow: 0 0 18px rgba(120,255,160,0.5); }
#status { font-size: 12px; }
.muted { color: var(--muted); }
.card { background: linear-gradient(180deg, #1c2434 0%, var(--panel-2) 100%); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.card h2 { margin: 0 0 8px; font: 700 13px/1 "Rajdhani", system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pill { background: var(--line); color: var(--text); border-radius: 999px; padding: 0 8px; font-size: 11px; }
.row { display: flex; gap: 8px; margin-top: 10px; }
input { flex: 1; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; }
input:focus { outline: none; border-color: var(--accent); }
button { background: var(--line); color: var(--text); border: 0; border-radius: 6px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
button.primary { background: linear-gradient(180deg, #5ee8ff, #22cdf0); color: #04121a; box-shadow: 0 4px 14px rgba(53,224,255,0.25); }
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: default; filter: none; }
#you-msg { font-size: 13px; }

.kv div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.kv div:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv b { color: var(--gold); }

.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.list li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.list li .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li .d { color: var(--muted); white-space: nowrap; font-size: 12px; }
.list li.legend .n::before { content: "★ "; color: var(--gold); }
.help p { margin: 6px 0; font-size: 13px; }
.note { margin-top: 8px; font-size: 12px; color: #ff4d5e; }
.note[hidden] { display: none; }

@media (max-width: 900px) {
  #app { flex-direction: column; }
  #side { width: auto; border-left: 0; border-top: 1px solid var(--line); }
  #c { max-width: 100%; }
}
