:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #f4f1e8;
  background: #101a18;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --panel: #1b2925;
  --panel-edge: #34473f;
  --accent: #d8b96e;
  --muted: #bdc8bd;
  --danger: #ffb3a8;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 50% -15%, #345044 0, #101a18 58rem); }
button, input { font: inherit; }
.page { width: min(100% - 28px, 680px); margin: 0 auto; padding: 38px 0 28px; }
.hero { padding: 8px 4px 22px; }
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 8vw, 3.3rem); line-height: 1.04; letter-spacing: -.045em; }
h1 span { color: var(--accent); }
.intro { max-width: 56ch; margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.card { margin: 13px 0; padding: 20px; border: 1px solid var(--panel-edge); border-radius: 18px; background: color-mix(in srgb, var(--panel) 94%, transparent); box-shadow: 0 14px 34px #0002; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.section-heading .eyebrow { margin-bottom: 5px; }
h2 { margin-bottom: 0; font-size: 1.22rem; }
.badge { padding: 7px 11px; border: 1px solid #68776e; border-radius: 999px; color: #d4dbd4; font-size: .78rem; white-space: nowrap; }
.badge[data-state="online"] { border-color: #7fc99a; color: #a9efbd; }
.badge[data-state="connecting"] { border-color: var(--accent); color: #f5d990; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.button { min-height: 46px; padding: 11px 16px; border: 1px solid transparent; border-radius: 12px; font-weight: 750; cursor: pointer; transition: transform .12s ease, filter .12s ease; }
.button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, .text-button:focus-visible { outline: 3px solid #f5df9c; outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.primary { color: #17201a; background: var(--accent); }
.secondary { color: #f4f1e8; border-color: #627269; background: #293a33; }
.quiet { color: #d5ddd6; border-color: #46584f; background: transparent; }
.full { width: 100%; }
.divider { display: flex; align-items: center; gap: 12px; margin: 17px 0; color: #aeb9b0; font-size: .82rem; }
.divider::before, .divider::after { height: 1px; flex: 1; background: #3a4a42; content: ""; }
.join-form { display: grid; gap: 9px; }
label { margin-top: 3px; color: #d3dbd4; font-size: .85rem; font-weight: 650; }
input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #53645b; border-radius: 10px; color: #fff; background: #101a17; }
input::placeholder { color: #89978e; }
.join-form .button { margin-top: 5px; }
.room-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.room-details div { padding: 12px; border-radius: 12px; background: #111c18; }
dt { color: #aeb9b0; font-size: .76rem; }
dd { margin: 5px 0 0; font-weight: 750; overflow-wrap: anywhere; }
.help { margin: 12px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.error { margin: 14px 0 0; padding: 11px 12px; border: 1px solid #945b52; border-radius: 10px; color: var(--danger); background: #402522; line-height: 1.5; }
.player-list, .event-log { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.player-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #35483f; border-radius: 11px; background: #14201b; }
.player-name { overflow: hidden; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.player-state { color: var(--muted); font-size: .79rem; white-space: nowrap; }
.empty-row { color: #aab5ac; font-size: .84rem; }
.dice-stage { display: grid; justify-items: center; gap: 10px; padding: 5px 0 18px; }
.die-face { display: grid; width: 96px; aspect-ratio: 1; place-items: center; border: 2px solid #e9d99d; border-radius: 22px; color: #19221d; background: #f2ead1; box-shadow: 0 8px 24px #0003; font-size: 3.2rem; font-weight: 850; }
.turn-label { margin: 0; color: var(--muted); text-align: center; font-size: .9rem; }
.event-log { max-height: 210px; overflow: auto; }
.event-row { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; padding: 9px 10px; border-radius: 9px; background: #14201b; font-size: .8rem; }
.event-time { color: #aab5ac; font-variant-numeric: tabular-nums; }
.event-copy { line-height: 1.45; }
.event-meta { grid-column: 2; color: #8fa096; font-size: .72rem; }
.text-button { padding: 7px 4px; border: 0; color: #d9c98e; background: transparent; cursor: pointer; }
.notice { margin: 18px 4px; padding: 15px 16px; border-left: 3px solid var(--accent); color: #e0e5df; background: #1b2925aa; }
.notice strong { color: #f2d998; }
.notice p { margin: 7px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }
footer { padding: 12px 4px; color: #92a096; font-size: .75rem; text-align: center; }
[hidden] { display: none !important; }
@media (max-width: 420px) { .card { padding: 16px; } .room-details { grid-template-columns: 1fr 1fr; } .button-row > .button { flex: 1 1 auto; } }
