:root {
  --bg: #f6f5f2;
  --card: #fff;
  --ink: #16150f;
  --muted: #7a776c;
  --line: #e2dfd6;
  --accent: #1f6f4a;
  --accent-ink: #fff;
  --warn: #a1341f;
  --match: #e8f3ec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14150f;
    --card: #1e201a;
    --ink: #f0eee6;
    --muted: #948f82;
    --line: #2e3128;
    --accent: #4fae7e;
    --accent-ink: #0d1710;
    --warn: #e08a72;
    --match: #1f3227;
  }
}
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
  margin: 0;
  padding: 2rem 1rem 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 34rem; margin: 0 auto; }

header { margin-bottom: 1.5rem; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; letter-spacing: -.02em; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
     color: var(--muted); margin: 0 0 .75rem; font-weight: 600; }
.sub, .hint { color: var(--muted); font-size: .875rem; margin: .25rem 0 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .9rem; }
input, select {
  display: block; width: 100%; margin-top: .35rem;
  padding: .6rem .7rem; font-size: 1rem; font-family: inherit;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.code-input { text-transform: uppercase; letter-spacing: .2em; font-family: ui-monospace, monospace; }

button {
  font: inherit; cursor: pointer; border-radius: 8px;
  padding: .6rem 1rem; border: 1px solid transparent;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; width: 100%; }
.ghost { background: none; border-color: var(--line); color: var(--muted); padding: .35rem .7rem; font-size: .8rem; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.code { font-family: ui-monospace, monospace; font-size: 1.1rem; letter-spacing: .18em; }
.label { font-size: .8rem; color: var(--muted); margin: 0; }
.waiting { margin: .2rem 0 0; }
.error { color: var(--warn); font-size: .875rem; margin: .6rem 0 0; }
.dead { color: var(--muted); margin: .75rem 0 0; }

/* Not `.won`: Alpine writes the status onto the outer card, so a `.won` rule
   would land on the card itself and clobber its padding. */
.win-panel { text-align: center; padding: .5rem 0 .25rem; }
.winner { font-size: 2.25rem; font-weight: 700; margin: .3rem 0; letter-spacing: -.02em; }
.win-panel .primary { margin-top: 1.1rem; }

.seats .seat { display: flex; align-items: center; gap: .55rem; padding: .3rem 0; }
.seat .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.seat.done .dot { background: var(--accent); }
.seat.empty .name { color: var(--muted); font-style: italic; }
.seat.you .name { font-weight: 600; }
.seat .tag { font-size: .65rem; text-transform: uppercase; letter-spacing: .06em;
             color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; }
.seat .tick { margin-left: auto; font-size: .75rem; color: var(--accent); }

.locked { margin: 0; color: var(--muted); }
.locked strong { color: var(--ink); }

table { width: 100%; border-collapse: collapse; }
tr { border-top: 1px solid var(--line); }
tr:first-child { border-top: none; }
tr.matched { background: var(--match); }
td { padding: .5rem .25rem; vertical-align: top; }
td.num { width: 2rem; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
.word { display: inline-flex; flex-direction: column; margin-right: 1.1rem; }
.word em { font-style: normal; font-size: .7rem; color: var(--muted); }
.word b { font-weight: 600; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
