:root {
  --bg: #0b0e14;
  --panel: #121722;
  --panel-2: #1a2130;
  --line: #243044;
  --text: #e6ecf5;
  --muted: #7f8ca3;
  --accent: #35e0ff;
  --danger: #ff4d5e;
  --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%, #121826 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) * 4 / 3); aspect-ratio: 4 / 3; height: auto; background: #0a0d13; border-radius: 10px; cursor: crosshair; 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(53,224,255,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(53,224,255,0.25); }
header h1 span { color: var(--danger); font-size: 16px; letter-spacing: 0.04em; text-shadow: 0 0 18px rgba(255,77,94,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 12px; 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[hidden] { display: none; }
#you-msg b { color: var(--accent); }
#you.hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 30px rgba(53,224,255,0.15); }

.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.me .n { color: var(--accent); }
.list li.legend .n::before { content: "★ "; color: var(--gold); }
.list li.slayer .n::before { content: "⚔ "; color: var(--danger); }
.help p { margin: 6px 0; font-size: 13px; }
.note { margin-top: 8px; font-size: 12px; color: var(--danger); }

.chat-list { margin: 0; padding: 0 2px 0 0; list-style: none; height: 190px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; font-size: 13px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.chat-list li { display: flex; gap: 6px; align-items: baseline; line-height: 1.3; overflow-wrap: anywhere; }
.chat-list li .n { flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--muted); }
.chat-list li .n::after { content: ":"; }
.chat-list li.me .n { color: var(--accent); }
.chat-list li.hot .n { color: var(--gold); }
.chat-list li .m { flex: 1; min-width: 0; }
.chat-list li .rep { flex: none; padding: 0 4px; background: none; font-size: 11px; font-weight: 600; color: var(--muted); opacity: 0; transition: opacity .12s; }
.chat-list li:hover .rep, .chat-list li .rep:focus-visible, .chat-list li .rep.arm { opacity: 1; }
.chat-list li .rep.arm { color: var(--danger); }
.chat-list li.sys, .chat-list li.hidden { color: var(--muted); font-style: italic; }
.chat-row { margin-top: 8px; }
@media (hover: none) { .chat-list li .rep { opacity: 0.55; } }

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