:root {
  --bg: #0f1220;
  --panel: #181c2e;
  --panel2: #20253c;
  --line: #2c3350;
  --text: #e6e8f0;
  --muted: #9aa3c0;
  --accent: #6c8cff;
  --accent2: #ff6c9c;
  --good: #46d39a;
  --bad: #ff6b6b;
  --warn: #ffcc66;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #1c2240, var(--bg));
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); }
h1, h2, h3 { font-weight: 650; }
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.logo .u { color: var(--accent2); }
.tag { color: var(--muted); font-size: 14px; }

.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-game { grid-template-columns: 320px 1fr; }
@media (max-width: 860px) { .cols-2, .cols-game { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.card h2 { margin: 0 0 12px; font-size: 18px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

button {
  cursor: pointer; border: none; border-radius: 10px;
  padding: 11px 16px; font-size: 15px; font-weight: 600;
  background: var(--accent); color: #0b1020;
}
button.secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.full { width: 100%; margin-top: 14px; }

.code-badge {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 34px; letter-spacing: 8px; font-weight: 800;
  background: var(--panel2); border: 1px dashed var(--accent);
  border-radius: 12px; padding: 14px 18px; text-align: center; color: #fff;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.lobby { background: #2c3350; color: var(--muted); }
.pill.describing { background: #243b66; color: #aac4ff; }
.pill.voting { background: #5a2740; color: #ffb0cf; }
.pill.mrwhiteguess { background: #5a4a1e; color: var(--warn); }
.pill.finished { background: #1e4d3a; color: var(--good); }

.players { list-style: none; padding: 0; margin: 0; }
.players li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 10px; margin-bottom: 6px;
  background: var(--panel2); border: 1px solid transparent;
}
.players li.turn { border-color: var(--accent); }
.players li.dead { opacity: .5; text-decoration: line-through; }
.players .who { flex: 1; font-weight: 600; }
.players .kind { font-size: 11px; color: var(--muted); }
.badge-role { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: #33240f; color: var(--warn); }

.chat { display: flex; flex-direction: column; height: 460px; }
.messages { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 8px 11px; border-radius: 10px; background: var(--panel2); max-width: 85%; }
.msg .author { font-size: 12px; color: var(--accent); font-weight: 700; margin-bottom: 2px; }
.msg.mine { align-self: flex-end; background: #2a3566; }
.msg.system { align-self: center; background: transparent; color: var(--muted); font-style: italic; font-size: 13px; max-width: 100%; text-align: center; }
.msg .word-tag { color: var(--accent2); }

.words-list { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.word-chip b { color: var(--accent); }

.banner { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.banner.your-turn { background: #243b66; color: #cfe0ff; border: 1px solid var(--accent); }
.banner.win { background: #16402f; color: var(--good); border: 1px solid var(--good); }
.banner.error { background: #4a1f1f; color: var(--bad); border: 1px solid var(--bad); }

.secret-word { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.composer { display: flex; gap: 8px; margin-top: 10px; }
.composer input { flex: 1; }
.composer button { flex: 0 0 auto; }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bad); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; }
.kbd { font-family: ui-monospace, monospace; background: var(--panel2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }
