:root {
  --bg: #f3f0eb;
  --ink: #171717;
  --muted: #625f59;
  --panel: #fffdfa;
  --line: #d9d1c5;
  --red: #b4332b;
  --red-dark: #7f211d;
  --gold: #cc9a38;
  --green: #247a61;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1060px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 44px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 850; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; background: var(--red-dark); color: #fff; font-size: .78rem; }
.intro { max-width: 680px; padding: 44px 0 30px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1; }
h2 { margin-bottom: 14px; font-size: 1.35rem; }
p { color: var(--muted); line-height: 1.65; }
.game-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(340px, 1.2fr); gap: 18px; }
.room-panel, .turn-panel { border: 1px solid var(--line); border-radius: 8px; padding: 24px; background: var(--panel); }
.turn-panel { min-height: 420px; }
.room-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.room-heading div { display: grid; gap: 4px; }
.room-heading span, .role { color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; }
.room-heading strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.3rem; }
.status, .role { display: inline-flex; width: fit-content; border-radius: 8px; padding: 8px 10px; background: #f5dfad; color: #3b3020; }
.role { margin-bottom: 26px; background: #f5dedb; color: var(--red-dark); }
.players { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.players li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; }
.players li > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #eee5d8; font-size: .78rem; font-weight: 800; }
.players small { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
button, select { min-height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fff; color: var(--ink); font-weight: 750; }
button { cursor: pointer; }
button:not(.secondary) { border-color: var(--red-dark); background: var(--red-dark); color: #fff; }
button.danger { border-color: var(--red); background: var(--red); }
button.secondary { background: transparent; }
button:hover { transform: translateY(-1px); }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(180, 51, 43, .24); outline-offset: 2px; }
form { display: grid; gap: 12px; }
label { font-size: .85rem; font-weight: 800; }
select { width: 100%; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.result-stats div { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.result-stats dt { color: var(--muted); font-size: .78rem; }
.result-stats dd { margin: 6px 0 0; font-size: 1.35rem; font-weight: 850; }
footer { padding-top: 26px; }
footer a { color: var(--red-dark); font-weight: 750; }
[hidden] { display: none !important; }
@media (max-width: 760px) { .game-grid { grid-template-columns: 1fr; } .turn-panel { min-height: 360px; } }
@media (max-width: 440px) { .topbar { align-items: flex-start; flex-direction: column; } .result-stats { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { button:hover { transform: none; } }
