:root {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #f3ecd5;
  background: #111713;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(193, 145, 50, .12), transparent 35rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    #111713;
  background-size: auto, 100% 4px, auto;
}
main { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 72px; }
header, .toolbar, .room-heading, .login-row, .actions, .room-actions, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header { margin-bottom: 28px; }
h1, h2, p { margin: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2rem, 7vw, 4rem); letter-spacing: -.04em; }
h2 { font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow { color: #c9a85f; letter-spacing: .22em; font-size: .72rem; margin-bottom: 8px; }
.live { color: #8dd894; font-size: .75rem; letter-spacing: .15em; }
.live span { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #62da72; box-shadow: 0 0 14px #62da72; }
.panel, .stats article {
  border: 1px solid #3c463e;
  background: rgba(25, 33, 27, .9);
  box-shadow: 0 16px 40px rgba(0,0,0,.2);
}
.login { max-width: 560px; padding: 28px; }
.login > p { color: #aab3aa; margin: 10px 0 24px; line-height: 1.5; }
label { display: block; color: #c9a85f; font-size: .72rem; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .1em; }
input, button {
  min-height: 44px;
  border-radius: 4px;
  border: 1px solid #526056;
  font: inherit;
}
input { flex: 1; min-width: 0; padding: 0 14px; background: #0c110e; color: #fff; }
button { cursor: pointer; padding: 0 18px; color: #10130f; background: #d4b667; font-weight: 700; }
button:hover { filter: brightness(1.1); }
.secondary { color: #e8e2cf; background: transparent; }
.danger { min-height: 36px; color: #ffb0a8; border-color: #733f3a; background: transparent; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 30px; }
.stats article { padding: 18px; }
.stats span { display: block; color: #99a39b; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.stats strong { display: block; margin-top: 8px; font-size: 1.5rem; color: #f1d68a; }
.toolbar { margin-bottom: 14px; }
.toolbar p, .room-meta { margin-top: 5px; color: #8e9a91; font-size: .75rem; }
.tabs { display: flex; gap: 6px; }
.tab { color: #9fa9a1; background: transparent; border-color: transparent; }
.tab.selected { color: #f4d98e; border-color: #6e6244; background: #1d211a; }
.tab span { display: inline-grid; place-items: center; min-width: 22px; min-height: 22px; margin-left: 4px; border-radius: 50%; color: #d1c6aa; background: #30372f; font-size: .68rem; }
.rooms { display: grid; gap: 12px; }
.room { padding: 20px; }
.room-heading > div { display: flex; align-items: center; gap: 10px; }
.room-actions { flex-wrap: wrap; justify-content: flex-end; }
.leaderboard-room { min-height: 36px; }
.code { font-size: 1.35rem; letter-spacing: .16em; color: #f4d98e; }
.status { border: 1px solid #66746a; color: #b9c4ba; padding: 4px 7px; font-size: .64rem; text-transform: uppercase; }
.status.racing { border-color: #877340; color: #f1d68a; }
.status.finished { border-color: #3f7850; color: #8de3a4; }
.leaderboard { display: grid; gap: 7px; margin-top: 18px; }
.player { display: grid; grid-template-columns: 34px minmax(100px, 1fr) 92px 1.5fr 70px; align-items: center; gap: 12px; padding: 10px 12px; background: #0f1511; border-left: 2px solid #566359; }
.player.offline { opacity: .55; }
.rank { color: #c9a85f; font-weight: 700; }
.player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host { color: #c9a85f; font-size: .68rem; }
.stage, .time { color: #b4beb6; font-size: .75rem; }
.progress { height: 6px; background: #273029; overflow: hidden; }
.progress span { display: block; height: 100%; background: #c9a85f; }
.empty { text-align: center; padding: 60px 20px; color: #98a199; }
.empty span { font-size: 2.5rem; color: #576159; }
.empty h2 { color: #e7dfca; margin: 12px 0 8px; }
.error { min-height: 1.2em; margin-top: 12px; color: #ff8f85; font-size: .78rem; }
dialog { width: min(760px, calc(100% - 24px)); border: 1px solid #59645b; padding: 24px; color: #f3ecd5; background: #182019; box-shadow: 0 28px 90px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(5, 8, 6, .82); backdrop-filter: blur(3px); }
.dialog-heading h2 { font-family: Georgia, serif; font-size: 2rem; letter-spacing: -.02em; text-transform: none; }
.dialog-meta { margin-top: 10px; color: #9da69f; font-size: .75rem; }
.icon-button { min-width: 44px; padding: 0; font-size: 1.6rem; }
[hidden] { display: none !important; }
@media (max-width: 680px) {
  main { width: min(100% - 20px, 1080px); padding-top: 24px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .login-row { align-items: stretch; flex-direction: column; }
  .toolbar, .room-heading { align-items: stretch; flex-direction: column; }
  .actions, .room-actions { justify-content: flex-start; }
  .player { grid-template-columns: 28px 1fr 70px; }
  .stage { display: none; }
  .progress { grid-column: 2 / -1; }
}
