:root {
  color-scheme: dark;
  --bg: #171c19; --surface: #242b25; --line: #50594c; --text: #f0efe4;
  --muted: #b6beae; --gold: #f3c368;
  font: 16px/1.45 "Barlow", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0 }
.mast, main { width: min(960px, 92%); margin: auto }
.mast { padding: 24px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line) }
.mast strong, code, #count, #room-code { font-family: "IBM Plex Mono", ui-monospace, monospace }
.mast strong { font-size: .95rem }
.mast strong span, .plain { color: var(--gold) }
#connection { color: var(--muted); font-size: .88rem }
#connection::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #8e8e83; margin-right: 8px }
#connection.online::before { background: #b9d58c }
main { padding: clamp(24px, 6vw, 68px) 0 }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; margin: 0 0 28px; letter-spacing: -.045em }
h2 { font-size: 1.1rem; margin: 0 }
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start }
.map, .panel, #match { background: var(--surface); border: 1px solid var(--line); border-radius: 4px }
.map { overflow: hidden }
.map img { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover }
.map-info, .spread, .row, .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px }
.map-info { padding: 16px 22px; border-top: 1px solid var(--line) }
small, label { display: block; color: var(--muted); font-size: .85rem; font-weight: 600 }
.map-info strong, #room-code { display: block; font-size: 1.5rem }
code, #count { color: var(--muted); font-size: .85rem }
.panel, #match { padding: clamp(18px, 3vw, 30px) }
input, button { font: inherit; border-radius: 3px; padding: 10px 14px }
input { width: 100%; min-width: 0; margin: 6px 0; background: #181d19; color: var(--text); border: 1px solid var(--line) }
button { cursor: pointer; border: 1px solid #77806c; background: #384236; color: var(--text); font-weight: 650; white-space: nowrap }
button:hover:enabled { filter: brightness(1.12) }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px }
button:disabled { opacity: .48; cursor: default }
.primary { background: var(--gold); border-color: var(--gold); color: #252219 }
.plain { background: none; border: 0; padding: 6px 0; font-weight: 550 }
.play-modes { display: grid; gap: 8px; margin: 10px 0 24px }
#installation { margin-top: 20px; padding: 17px 22px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface) }
#download-progress { display: block; width: 100%; height: 8px; margin: 12px 0 8px; accent-color: var(--gold) }
#download-status, #download-size { color: var(--muted); font-size: .85rem }
#download-size, #download-percent { white-space: nowrap; font-variant-numeric: tabular-nums }
#download-percent { color: var(--gold) }
#join-form, .members-title { border-top: 1px solid var(--line); padding-top: 20px }
#code, #room-code { text-transform: uppercase; letter-spacing: .08em }
#members { list-style: none; margin: 0; padding: 0 }
#members li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); gap: 10px; overflow-wrap: anywhere }
#members li span:last-child { color: var(--muted); font-size: .86rem }
#members li .is-ready { color: #c8dd9f !important }
.members-title, .actions { margin-top: 18px }
.actions button { flex: 1 }
#leave { margin-top: 10px }
#notice, #setup-message { color: var(--gold) }
#notice:empty { display: none }
#match { margin-top: 20px }
#screen iframe { display: block; width: 100%; aspect-ratio: 16/10; border: 0; background: #10130f; margin-top: 12px }
#screen:fullscreen { background: #10130f }
#screen:fullscreen iframe { height: 100%; margin: 0 }
.controls { margin: 12px 0 0; color: var(--muted); font-size: .85rem }
@media (max-width: 650px) {
  .layout { grid-template-columns: 1fr }
  .map { display: flex; height: 94px }
  .map img { width: 124px }
  .map-info { flex: 1; padding: 10px 16px; border: 0; flex-wrap: wrap }
  .mast { padding: 16px 0 }
}
