/* Dark by default: this spends most of its life on a projector in a lit room,
   where a white background is a wall of glare. */
:root {
  --bg: #0e1116;
  --panel: #171b23;
  --panel-2: #1f2531;
  --line: #2b3342;
  --ink: #eef2f8;
  --ink-dim: #97a3b6;
  --accent: #4d9dff;
  --accent-ink: #04101f;
  --good: #3ddc97;
  --warn: #ffb454;
  --bad: #ff6b6b;
  --window: #4d9dff;
  --meh: #ff8f6b;
  --radius: 14px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; line-height: 1.5; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 24px; }
.wrap-narrow { max-width: 460px; margin: 0 auto; padding: 24px; }

.muted { color: var(--ink-dim); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.hidden { display: none !important; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* ---- controls ---- */
input[type="text"], select {
  width: 100%;
  padding: 14px 14px;
  font: inherit;
  font-size: 16px; /* anything smaller and iOS zooms the whole page on focus */
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
input[type="text"]:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input::placeholder { color: #5f6b7e; }

button {
  font: inherit;
  font-weight: 600;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  transition: background .12s ease, transform .06s ease;
}
button:hover:not(:disabled) { background: #29313f; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }

button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.primary:hover:not(:disabled) { background: #6bb0ff; }
button.danger { color: var(--bad); }
button.tiny { padding: 7px 10px; font-size: 13px; font-weight: 500; }
button.block { width: 100%; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 6px;
}

/* ---- status strip ---- */
.notice { padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.notice.err { background: rgba(255,107,107,.13); color: #ffa8a8; }
.notice.ok  { background: rgba(61,220,151,.13); color: var(--good); }

.conn {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 8px; text-align: center; font-size: 13px; font-weight: 600;
  background: var(--warn); color: #2a1a00; z-index: 50;
}

/* ---- room code ---- */
.code {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: .22em;
  text-indent: .22em; /* letter-spacing pads the right edge; re-centre it */
}
/* Sized to fit the code panel, not the viewport: four mono glyphs plus
   letter-spacing run about 3.3em wide, so this has to stay well under it. */
.code-hero { font-size: clamp(44px, 6.6vw, 104px); color: var(--accent); line-height: 1; }

/* ---- seat map ---- */
.map { display: grid; gap: 6px; }
.cell { aspect-ratio: 1; border-radius: 8px; }
.cell.empty { background: rgba(255,255,255,.02); border: 1px dashed rgba(255,255,255,.06); }

.desk {
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  font-size: 12px; font-weight: 600;
  overflow: hidden; padding: 2px; text-align: center;
}
.desk .perk { font-size: 9px; font-weight: 700; color: var(--ink-dim); letter-spacing: .08em; }
.desk[data-perk="window"] { border-color: var(--window); box-shadow: inset 0 0 0 1px rgba(77,157,255,.25); }
.desk[data-perk="meh"]    { border-color: var(--meh); }
.desk[data-perk="corner"], .desk[data-perk="quiet"], .desk[data-perk="social"] { border-color: #6b7a92; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-dim); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

/* ---- roster ---- */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-weight: 600;
  animation: pop .28s cubic-bezier(.2,1.3,.4,1);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.chip.off .dot { background: #5a6478; }
.chip.off { color: var(--ink-dim); }
.chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
