:root { --panel: #3a1417; --line: #a75b493e; }
body { background-attachment: fixed; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
button:disabled { cursor: default; opacity: .45; }
.full-game { max-width: 1060px; padding-top: max(18px, env(safe-area-inset-top)); padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right)); overflow: visible; }
.wordmark { text-decoration: none; font-size: 15px; letter-spacing: -.3px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { display: inline-grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 14px; background: #3e171960; color: var(--cream); font-size: 23px; }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quiet-link { font-size: 14px; color: #dfb1a3; text-decoration: none; padding: 12px 6px; }
.eyebrow { font-size: 12px; letter-spacing: 2px; }
.setup-view { padding-top: 24px; }
.setup-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 0 25px; }
.setup-heading h1 { font-size: clamp(34px, 5vw, 50px); letter-spacing: -1.7px; line-height: 1.12; }
.setup-heading .eyebrow { margin-bottom: 8px; }
.setup-potato { font-size: 64px; line-height: 1; transform: rotate(-18deg); margin-right: 8px; }
.setup-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.setup-panel { background: linear-gradient(140deg, #59202470, #2d0f1370); border: 1px solid var(--line); border-radius: 24px; padding: 23px; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
h2 { font-size: 21px; letter-spacing: -.6px; margin: 0; line-height: 1.2; }
.section-note { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 12px 0 18px; }
.life-pill, .count-pill { font-size: 12px; border: 1px solid #ffbd6730; color: var(--yellow); background: #ffbd670a; border-radius: 20px; padding: 6px 10px; white-space: nowrap; }
.life-pill { font-size: 14px; color: #ffbe9a; }
.players-editor { display: flex; flex-direction: column; gap: 10px; }
.player-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 36px; align-items: center; gap: 9px; }
.avatar-button { width: 48px; height: 48px; background: #7d3b3038; border: 1px solid #bf7f6345; border-radius: 15px; font-size: 29px; padding: 0; }
.player-row input { min-width: 0; width: 100%; height: 48px; border: 1px solid #a75b4945; border-radius: 13px; background: #18090b66; color: var(--cream); font-size: 16px; padding: 0 12px; }
.player-row input::placeholder { color: #b8897e; }
.remove-player { background: transparent; border: none; color: #d6a396; padding: 0; font-size: 25px; min-height: 44px; }
.add-button { width: 100%; min-height: 49px; border: 1px dashed #bd74634d; border-radius: 14px; background: transparent; color: #f4c6a5; text-align: left; padding: 10px 13px; margin-top: 13px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.add-button .muted { margin-left: auto; font-size: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.rules-strip { margin: 23px 0 0; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: flex-start; gap: 11px; }
.rules-strip > span { font-size: 23px; }
.rules-strip p { color: #d6aaa0; font-size: 14px; line-height: 1.55; margin: 0; }
.rules-strip strong { color: var(--cream); }
.pools-editor { display: flex; flex-direction: column; gap: 9px; }
.pool-choice { position: relative; display: grid; grid-template-columns: 33px minmax(0, 1fr) 19px; gap: 11px; align-items: center; padding: 12px 13px; border: 1px solid #a75b4938; border-radius: 15px; cursor: pointer; background: #1c090c40; transition: border-color .15s, background .15s; }
.pool-choice:has(input:checked) { border-color: #ffce6770; background: #b1661d10; }
.pool-choice:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 3px; }
.pool-choice input { appearance: none; width: 19px; height: 19px; border: 1.5px solid #b8897e; border-radius: 6px; margin: 0; display: grid; place-items: center; background: transparent; }
.pool-choice input:checked { background: var(--yellow); border-color: var(--yellow); }
.pool-choice input:checked::after { content: "✓"; color: #32170b; font-size: 14px; font-weight: 900; }
.pool-icon { font-size: 27px; text-align: center; }
.pool-title { display: flex; align-items: baseline; gap: 8px; color: var(--cream); font-size: 16px; font-weight: 750; flex-wrap: wrap; }
.pool-count { font-size: 12px; color: #d2a999; font-weight: 500; }
.pool-description { display: block; font-size: 13px; line-height: 1.4; color: #cfa496; margin-top: 4px; }
.adult-badge { font-size: 12px; padding: 2px 5px; background: #ff66331a; color: #ff9c78; border: 1px solid #ff66334a; border-radius: 5px; }
.pool-adult:has(input:checked) { background: #bf423126; border-color: #f27656; }
.premium-button { width: 100%; margin-top: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px; color: #f7d1b7; text-align: left; border: 1px solid #bd74634d; border-radius: 15px; background: #1c090c40; }
.premium-button > span:first-child { font-size: 22px; }
.premium-button strong, .premium-button small { display: block; }
.premium-button strong { font-size: 14px; }
.premium-button small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.premium-button > span:last-child { color: var(--yellow); font-size: 24px; }
.premium-button:hover { border-color: #ffd579aa; background: #80362625; }
.text-button { color: #dbb0a2; background: none; border: none; min-height: 44px; padding: 12px 5px; font-size: 14px; }
.text-button:hover, .quiet-link:hover { color: var(--yellow); }
.setup-footer { text-align: center; padding: 27px 0 12px; }
.setup-start { max-width: 405px; margin-inline: auto; }
.full-game .audio-note { font-size: 13px; margin-top: 19px; }
.setup-footer .error { margin: 0 0 22px; }
.match-view { padding-top: 24px; flex: 1; display: flex; flex-direction: column; }
.match-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.match-bar .eyebrow { margin: 0; }
.match-bar .count-pill { min-width: 0; max-width: 70%; white-space: normal; text-align: left; line-height: 1.35; }
.match-details { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.match-details .muted { font-size: 12px; }
.scoreboard { display: flex; gap: 9px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: thin; scrollbar-color: #713b31 transparent; }
.score-chip { min-width: 112px; max-width: 180px; display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 8px; align-items: center; background: #321013; border: 1px solid var(--line); border-radius: 15px; padding: 11px 12px; flex-shrink: 0; }
.score-avatar { font-size: 27px; grid-row: span 2; }
.score-name { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 114px; }
.score-lives { font-size: 12px; color: #f4bd9b; margin-top: 4px; }
.score-lives b { color: #ffb982; font-weight: 500; }
.score-chip.out { opacity: .48; }
.score-chip.affected { border-color: #ff8969; }
.round-view { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 36px; flex: 1; padding: 32px 15px 18px; }
/* Reserve three lines even for a short question. Longer text can still grow
   naturally instead of being clipped or covering the controls. */
.question { font-size: clamp(29px, 4.4vw, 48px); line-height: 1.14; min-height: 3.42em; display: grid; align-content: center; letter-spacing: -1.5px; overflow-wrap: anywhere; text-wrap: balance; }
.question:focus { outline: none; }
.secondary-button { display: flex; justify-content: center; align-items: center; gap: 9px; padding: 13px 19px; min-height: 48px; border: 1px solid #ba766057; border-radius: 15px; background: #3b171944; color: #f7d1b7; font-size: 15px; }
.secondary-button:hover { background: #80362640; border-color: #e6a27580; }
.draw-button { margin-top: 22px; }
.draw-button > span { font-size: 24px; line-height: 1; }
.timer-side { display: flex; flex-direction: column; align-items: center; }
.timer-side .dial { width: min(31vw, 310px); height: min(31vw, 310px); margin: 0 0 25px; }
.timer-side .potato { font-size: 140px; }
.round-button { font-size: 21px; max-width: 340px; min-height: 70px; }
body[data-state="running"] .round-button { background: #3e1719; border-color: #8d4941; color: #ffdbc9; box-shadow: 0 5px 0 #140609; }
.resolution-view { max-width: 670px; width: 100%; margin: auto; padding: 28px 0 35px; text-align: center; }
.resolution-icon { display: block; font-size: 64px; margin-bottom: 14px; }
.resolution-view h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -1.4px; line-height: 1.1; overflow-wrap: anywhere; }
.resolution-view h1:focus { outline: none; }
.resolution-note { font-size: 16px; line-height: 1.6; color: #e2b7a6; margin: 16px 0 24px; }
.loss-players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; text-align: left; margin: 24px 0 29px; }
.loss-player { background: #40181c80; border: 1px solid #b274594f; border-radius: 20px; padding: 17px 10px; color: var(--cream); display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.loss-player[aria-pressed="true"] { background: #bf6a2526; border: 2px solid var(--yellow); padding: 16px 9px; }
.loss-avatar { font-size: 39px; }
.loss-name { font-size: 16px; max-width: 100%; overflow-wrap: anywhere; font-weight: 700; }
.loss-lives { font-size: 13px; color: #d5aa96; }
.resolution-view .start-button { max-width: 395px; margin: 0 auto 17px; font-size: 19px; }
.resolution-view .secondary-button { max-width: 395px; margin: 0 auto 8px; width: 100%; }
.result-avatar { font-size: 95px; display: block; margin-bottom: 24px; line-height: 1.2; }
.result-hearts { color: #ff9b70; display: flex; justify-content: center; gap: 7px; margin-bottom: 32px; font-size: 23px; }
.result-hearts .lost { color: #77463d; }
.winner-mark > span:first-child { display: block; font-size: 47px; transform: rotate(-14deg); margin-bottom: -8px; }
.winner-view .eyebrow, .winner-view h1 { color: var(--yellow); }
.error { text-align: center; }
dialog { color: var(--cream); background: #301115; border: 1px solid #a45a416b; border-radius: 24px; padding: 25px; max-width: 480px; width: calc(100% - 32px); max-height: calc(100dvh - 50px); box-shadow: 0 30px 90px #0009; }
dialog::backdrop { background: #140609cf; backdrop-filter: blur(5px); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.dialog-top h2 { font-size: 24px; }
dialog p { font-size: 16px; color: #e0b7aa; line-height: 1.6; }
dialog .start-button { font-size: 17px; min-height: 60px; margin-top: 22px; }
dialog .text-button { display: block; margin: 13px auto 0; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.avatar-option { border: 1px solid #a45a414a; background: #5a2425; border-radius: 16px; height: 64px; font-size: 36px; }
.avatar-option[aria-pressed="true"] { border: 2px solid var(--yellow); background: #76522a; }
.help-list { margin: 0; padding-left: 24px; color: #e2b7aa; }
.help-list li { font-size: 16px; line-height: 1.55; padding-left: 4px; margin: 16px 0; }
.help-list strong { color: var(--cream); }
dialog .help-tip { font-size: 14px; background: #57252466; padding: 15px; border-radius: 13px; }
.toast { position: fixed; bottom: max(23px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #ffe0a6; color: #32170b; font-size: 15px; line-height: 1.4; padding: 14px 19px; border-radius: 15px; max-width: 480px; width: max-content; max-width: min(480px, calc(100% - 34px)); box-shadow: 0 9px 40px #0005; z-index: 10; pointer-events: none; }
.blast-overlay { z-index: 9; }
/* In portrait, cards scroll to the screen edges, not to the content gutter.
   Inner padding keeps the first/last card readable without a mask or blur. */
@media (orientation: portrait) and (max-width: 720px) {
  .scoreboard {
    --player-edge: 20px;
    --player-edge-left: max(var(--player-edge), env(safe-area-inset-left));
    --player-edge-right: max(var(--player-edge), env(safe-area-inset-right));
    margin-left: calc(0px - var(--player-edge-left));
    margin-right: calc(0px - var(--player-edge-right));
    padding-left: calc(2px + var(--player-edge-left));
    padding-right: calc(2px + var(--player-edge-right));
    min-width: 0;
  }
}
@media (orientation: portrait) and (max-width: 370px) {
  .scoreboard { --player-edge: 14px; }
}
@media (hover: hover) { .avatar-button:hover, .avatar-option:hover, .loss-player:hover { border-color: #ffd579aa; } }
@media (max-width: 720px) {
  .full-game { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .setup-view { padding-top: 18px; }
  .setup-heading { padding-bottom: 19px; }
  .setup-heading h1 { font-size: 35px; }
  .setup-potato { font-size: 55px; }
  .setup-columns { grid-template-columns: 1fr; gap: 15px; }
  .setup-panel { padding: 19px; border-radius: 21px; }
  .section-note { margin: 9px 0 14px; }
  .rules-strip { margin-top: 16px; padding-top: 14px; }
  .pool-choice { padding: 11px 12px; }
  .setup-footer { padding-top: 21px; }
  .match-view { padding-top: 12px; }
  /* Equal extra padding preserves the centered Start position, while reserving
     room above long questions so their upward offset cannot cover players. */
  .round-view { grid-template-columns: 1fr; gap: 0; padding: 50px 0 42px; align-content: center; }
  .question-side { text-align: center; position: relative; top: -36px; }
  .question { font-size: clamp(28px, 7.6vw, 37px); line-height: 1.15; min-height: 3.45em; letter-spacing: -1px; position: relative; top: -12px; }
  .draw-button { margin: 18px auto 0; min-height: 44px; padding-block: 9px; }
  /* Keep the same total height above Start: grow the dial by 16px and
     balance its margins around the raised question controls. */
  .timer-side .dial { width: calc(clamp(170px, 23dvh, 220px) + 16px); height: calc(clamp(170px, 23dvh, 220px) + 16px); margin: -12px 0 24px; }
  .timer-side .potato { font-size: clamp(96px, 13dvh, 124px); }
  .timer-side .dial-face { inset: 21px; }
  .timer-side .orbit-inner { inset: 10px; }
  .timer-side .dial-label { bottom: 29px; font-size: 12px; letter-spacing: 0; }
  .round-button { min-height: 65px; max-width: 400px; font-size: 20px; }
  .full-game .timer-side .audio-note { margin-top: 16px; }
  .loss-players { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .resolution-view { padding-top: 22px; }
  .resolution-icon { font-size: 55px; }
}
@media (max-width: 370px) {
  .full-game { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .top-actions { gap: 5px; }
  .wordmark { font-size: 13px; }
  .quiet-link { font-size: 13px; padding-inline: 3px; }
  .setup-panel { padding: 15px; }
  .section-heading h2 { font-size: 19px; }
  .life-pill { font-size: 12px; padding: 6px 8px; }
}
@media (max-height: 800px) and (max-width: 720px) {
  .round-view { padding: 10px 0 6px; }
  .question-side { top: -12px; }
  .question { top: 0; }
  .timer-side .dial { width: 178px; height: 178px; margin: -3px 0 9px; }
  .timer-side .potato { font-size: 94px; }
  .timer-side .dial-label { display: none; }
  .draw-button { margin-top: 14px; }
}
@media (max-height: 560px) and (min-width: 600px) {
  .round-view { grid-template-columns: 1.2fr 1fr; gap: 25px; padding: 10px 0; }
  .question-side { top: 0; }
  .question { top: 0; }
  .question { font-size: 28px; }
  .timer-side .dial { width: 158px; height: 158px; margin: 0 0 12px; }
  .timer-side .potato { font-size: 80px; }
  .timer-side .dial-label { display: none; }
  .draw-button { margin-top: 14px; }
  .round-button { min-height: 55px; font-size: 17px; }
}
