:root {
  color-scheme: dark;
  --background: #181719;
  --panel: #222124;
  --edge: #403b3e;
  --text: #fcf1e4;
  --muted: #c6b7b0;
  --accent: #ff825d;
  --button-text: #241512;
  font: 16px/1.5 "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--background); color: var(--text); }
h1, h2, h3, p, ul { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, label:has(input:focus-visible) { outline: 2px solid #ffbc9b; outline-offset: 3px; }
.frame { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 78px; border-bottom: 1px solid var(--edge); }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; font-weight: 720; }
.brand-icon { position: relative; width: 25px; height: 19px; border: 2px solid var(--accent); border-radius: 3px; }
.brand-icon::before, .brand-icon::after { content: ""; position: absolute; width: 2px; height: 100%; background: var(--accent); top: 0; }
.brand-icon::before { left: 3px; }
.brand-icon::after { right: 3px; }
.header-mode { color: var(--muted); font-size: .875rem; }
main { flex: 1; padding-block: 36px 12px; }
.setup-layout, .room-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.room-layout { grid-template-columns: minmax(0, 2fr) minmax(255px, 1fr); }
.room-layout.guest { display: block; max-width: 720px; margin-inline: auto; }
.panel, .intro { border: 1px solid var(--edge); border-radius: 15px; background: var(--panel); padding: clamp(20px, 4vw, 36px); }
.intro {
  align-self: stretch;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 100% 0%, #a34a37 0%, transparent 62%),
    radial-gradient(ellipse at 75% 46%, #5e342e 0%, transparent 72%),
    #251d20;
}
.film-strip { position: absolute; top: -50px; right: 64px; z-index: -1; width: 100px; height: 460px; opacity: .21; transform: rotate(28deg); background: repeating-linear-gradient(#100b0b 0 5px, transparent 5px 58px, #100b0b 58px 64px); border-inline: 8px dashed #130d0e; }
.intro h1 { font-family: "Barlow Condensed", "Segoe UI", sans-serif; font-size: clamp(3rem, 7vw, 6.4rem); line-height: .96; letter-spacing: -.075em; font-weight: 800; }
.intro em { color: #ff9a76; font-style: normal; }
.intro > p { max-width: 29ch; font-size: 1.13rem; }
.intro .catalog-count { font-size: .875rem; color: var(--muted); }
.setup-card h2, .invite h2 { font-size: 1.45rem; line-height: 1.2; margin-bottom: 7px; }
.muted { color: var(--muted); }
.setup-duration { margin-bottom: 12px; }
.mode-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 16px; }
.mode-picker legend { margin-bottom: 6px; font-weight: 650; }
.countdown { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 700; margin-bottom: 16px; }
.previous { margin-bottom: 12px; color: var(--muted); }
.previous summary { cursor: pointer; }
.fields, .chosen, .tally { padding: 0; list-style: none; }
.fields { display: grid; gap: 9px; margin-block: 24px 18px; }
.field-row, .option { border: 1px solid var(--edge); border-radius: 9px; background: #282629; }
.field-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; min-height: 60px; }
.field-label { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.field-label small, .option small { display: block; font-size: .875rem; color: var(--muted); }
input[type="radio"], input[type="checkbox"] { margin: 0; width: 19px; height: 19px; accent-color: var(--accent); flex: 0 0 19px; }
.reorder { display: flex; gap: 5px; }
.icon-button { min-width: 32px; min-height: 34px; padding: 0; color: var(--text); border: 1px solid var(--edge); background: var(--background); border-radius: 6px; cursor: pointer; }
.sequence { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.pill { background: #352b30; border: 1px solid #57434a; color: #f9d5c6; border-radius: 6px; padding: 5px 8px; font-size: .875rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 680; cursor: pointer; text-decoration: none; text-align: center; }
.button.primary { background: var(--accent); color: var(--button-text); }
.button.primary:hover { background: #ff9b7d; }
.button.secondary { background: #282629; border-color: #655b5f; color: var(--text); }
.button.secondary:hover, .icon-button:hover { background: #3c3539; }
.button:disabled, .icon-button:disabled { opacity: .45; cursor: default; }
.button.wide { width: 100%; }
.round-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.round-kicker { color: #ff9a76; font-size: .875rem; font-weight: 700; }
.vote-count { color: var(--muted); white-space: nowrap; font-size: .875rem; }
.round-panel h1, .unavailable h1 { font-size: clamp(1.95rem, 4vw, 3.2rem); line-height: 1.1; letter-spacing: -.044em; margin-bottom: 18px; overflow-wrap: anywhere; }
fieldset { margin: 0; padding: 0; border: none; min-width: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.option { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; cursor: pointer; overflow-wrap: anywhere; }
.option:has(input:checked) { border-color: var(--accent); background: #38292b; }
.search-label { display: grid; gap: 6px; font-size: .875rem; margin-bottom: 12px; }
input[type="search"], input[type="text"] { width: 100%; min-height: 43px; padding: 8px 10px; background: var(--background); color: var(--text); border-radius: 7px; border: 1px solid #675b5e; }
.vote-action, .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 20px; }
.more { margin-top: 12px; }
.controls { border-top: 1px solid var(--edge); padding-top: 16px; }
.vote-locked { padding: 14px 16px; border: 1px solid #63806b; background: #27302a; border-radius: 9px; }
.vote-locked strong { color: #c7e9c9; }
.invite { text-align: center; }
.qr { display: block; object-fit: contain; width: min(100%, 220px); height: auto; margin: 20px auto 16px; background: white; border-radius: 8px; }
.invite input { margin-bottom: 9px; }
.lan-note { margin-top: 10px; color: var(--muted); font-size: .875rem; }
.result-caption { color: #ff9a76; }
.winning-film { font-size: clamp(1.7rem, 3.8vw, 2.85rem); line-height: 1.1; margin-block: 5px; }
.tally { display: grid; gap: 12px; margin-top: 16px; }
.tally li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
progress { grid-column: 1 / -1; accent-color: var(--accent); width: 100%; height: 8px; }
.draw-list li + li { margin-top: 8px; }
.notice { min-height: 48px; color: #d3ebd5; font-size: .95rem; padding-block: 10px; }
.notice.error { color: #ffb5a2; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding-block: 20px; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--edge); }
.unavailable p { margin-bottom: 16px; }
@media (max-width: 760px) {
  .frame { width: calc(100% - 36px); }
  .setup-layout, .room-layout { grid-template-columns: minmax(0, 1fr); }
  .intro { min-height: 260px; }
  main { padding-top: 22px; }
}
@media (max-width: 380px) {
  .header-mode { font-size: .75rem; }
  .panel, .intro { padding: 16px; }
  .frame { width: calc(100% - 24px); }
}
