:root {
  --ink: #15110d; --ink2: #221c16; --line: #3a3128; --paper: #ede8dd; --cream: #f6f2ea;
  --muted: #cfc6b6; --fine: #8a8173; --yellow: #f5d547; --red: #a3232b; --green: #2f6b3a; --ink4: #2a221a;
  --sans: 'Poppins', 'Prompt', system-ui, sans-serif; --marker: 'Permanent Marker', 'Prompt', cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--cream); font-family: var(--sans); }
body { min-height: 100dvh; -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; }
.wrap { max-width: 520px; margin: 0 auto; padding: 20px 18px 40px; }
.brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.brand b { font-size: 22px; letter-spacing: .5px; color: var(--yellow); }
.brand span { color: var(--fine); font-size: 14px; }
.card { background: var(--ink2); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 14px; }
h1 { font-size: 26px; margin: 0 0 6px; line-height: 1.3; }
h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); } .fine { color: var(--fine); font-size: 14px; }
label { display: block; color: var(--muted); font-size: 14px; margin: 0 0 6px; }
input, textarea {
  width: 100%; background: var(--ink); color: var(--cream); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; font-size: 18px; outline: none;
}
input:focus, textarea:focus { border-color: var(--yellow); }
input.big { font-size: 40px; text-align: center; font-weight: 700; letter-spacing: 1px; }
.btn {
  display: block; width: 100%; margin-top: 12px; padding: 15px; border: 0; border-radius: 12px;
  background: var(--yellow); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
.btn.red { background: var(--red); color: #fff; }
.err { color: #ff8a8f; min-height: 1.4em; margin-top: 8px; font-size: 15px; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.pill { border-radius: 4px; text-transform: uppercase; letter-spacing: .5px; }
.pill.wrong { background: var(--red); color: var(--cream); }
.pill.winner { background: var(--green); color: var(--cream); transform: rotate(-3deg); }
.pill.late { background: var(--ink4); color: var(--muted); }
.pill.none { background: var(--ink4); color: var(--muted); }
.prompt { font-size: 24px; font-weight: 600; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.qno { color: var(--yellow); font-weight: 700; font-size: 15px; letter-spacing: 1px; }
.center { text-align: center; }
.huge { font-size: 64px; font-weight: 800; color: var(--yellow); line-height: 1.1; }
.win { background: var(--ink); border: 2.5px solid var(--yellow); border-radius: 16px; padding: 20px; text-align: center; }
.win .t { font-size: 15px; color: var(--yellow); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.win .n { font-size: 30px; font-weight: 800; margin: 4px 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); margin-right: 6px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th { text-align: left; color: var(--fine); font-weight: 500; font-size: 14px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.mono, .mono { font-variant-numeric: tabular-nums; }
#boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--fine); }
[hidden] { display: none !important; }

/* หน้าสตาฟ — กว้างกว่า ใช้บนแล็ปท็อป/ทีวีได้ */
.host .wrap { max-width: 1180px; }
.grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.qr { background: #fff; border-radius: 12px; padding: 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.code { font-size: 44px; font-weight: 800; letter-spacing: 6px; color: var(--yellow); text-align: center; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--yellow); color: var(--ink); border-color: var(--yellow); font-weight: 700; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.names { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow: auto; }
.names span { background: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.count { font-size: 56px; font-weight: 800; color: var(--yellow); line-height: 1; }
.past { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.link { color: var(--yellow); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font-size: 14px; }
