  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #111;
    color: #fff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-user-select: none;
    user-select: none;
    overflow: hidden;
  }

  /* ── HEADER ── */
  .header {
    padding: 12px 16px;
    background: #1a1a1a;
    border-bottom: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .team-name {
    font-size: 1.1rem;
    font-weight: 700;
  }
  .team-score-display {
    font-size: 1.8rem;
    font-weight: 900;
    color: #FFD700;
  }

  /* ── MAIN AREA ── */
  .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 20px;
    position: relative;
  }

  /* ── TEAM SELECT ── */
  .team-select {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 350px;
  }
  .team-select.visible { display: flex; }
  .team-select h2 {
    font-size: 1.5rem;
    color: #FFD700;
  }
  .team-select-btn {
    width: 100%;
    padding: 20px;
    border: 3px solid #333;
    border-radius: 16px;
    background: #1a1a1a;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .team-select-btn:active { transform: scale(0.97); }
  .team-select-btn .sub { font-size: 0.8rem; color: #888; margin-top: 4px; }

  /* ── STATUS MESSAGE ── */
  .status-message {
    font-size: 1.2rem;
    color: #888;
    text-align: center;
    line-height: 1.5;
  }

  /* ── QUESTION DISPLAY ── */
  .question-display {
    display: none;
    text-align: center;
    padding: 0 10px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .question-display.visible { display: flex; }
  .qd-category {
    font-size: 0.8rem;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 2px;
  }
  .qd-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #FFD700;
  }
  .qd-text {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #ccc;
    max-width: 500px;
  }

  /* ── BUZZER ── */
  .buzzer-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .buzzer-container.visible { display: flex; }

  .buzzer-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 6px solid #fff;
    background: radial-gradient(circle at 35% 35%, #FF6666 0%, #CC0000 50%, #880000 100%);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.1s;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 8px 30px rgba(204, 0, 0, 0.4), inset 0 -4px 8px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .buzzer-btn:active {
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.4), inset 0 -2px 4px rgba(0,0,0,0.3);
  }
  .buzzer-btn.disabled {
    background: radial-gradient(circle at 35% 35%, #555 0%, #333 50%, #222 100%);
    border-color: #444;
    box-shadow: none;
    pointer-events: none;
  }

  .buzzer-hint {
    font-size: 0.8rem;
    color: #888;
  }

  .buzzer-timer {
    font-size: 2.5rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: #fff;
  }
  .buzzer-timer.warning { color: #FF9800; }
  .buzzer-timer.critical { color: #F44336; animation: pulse-t 0.5s infinite; }
  @keyframes pulse-t {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
  }

  /* ── BUZZED RESULT ── */
  .buzzed-result {
    display: none;
    text-align: center;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .buzzed-result.visible { display: flex; }
  .buzzed-result .who {
    font-size: 1.8rem;
    font-weight: 900;
    padding: 10px 30px;
    border-radius: 12px;
  }
  .buzzed-result .waiting {
    font-size: 0.9rem;
    color: #888;
  }
  .buzzed-result.you-buzzed .who {
    animation: pulse 1s infinite;
  }

  @keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
  }

  /* ── ANSWER REVEAL ── */
  .answer-display {
    display: none;
    text-align: center;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .answer-display.visible { display: flex; }
  .answer-display .label { font-size: 0.8rem; color: #888; text-transform: uppercase; }
  .answer-display .ans { font-size: 1.4rem; font-weight: 700; color: #4CAF50; }
  .answer-display .exp { font-size: 0.85rem; color: #777; max-width: 400px; line-height: 1.4; }

  /* ── CORRECT/INCORRECT FLASH ── */
  .result-flash {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 900;
  }
  .result-flash.correct {
    display: flex;
    background: rgba(76, 175, 80, 0.4);
    color: #4CAF50;
    animation: flash-out 1s forwards;
  }
  .result-flash.incorrect {
    display: flex;
    background: rgba(244, 67, 54, 0.4);
    color: #F44336;
    animation: flash-out 1s forwards;
  }

  @keyframes flash-out {
    0% { opacity: 1; }
    100% { opacity: 0; }
  }

  /* ── FOOTER SCORE ── */
  .footer {
    padding: 10px 16px;
    background: #1a1a1a;
    border-top: 2px solid #333;
    display: flex;
    justify-content: space-around;
    font-size: 0.75rem;
    color: #888;
  }
  .footer .all-score {
    text-align: center;
  }
  .footer .all-score .val {
    font-size: 1rem;
    font-weight: 700;
  }

  /* ── DAILY DOUBLE WAGER ── */
  .dd-wager {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 360px;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #FFD700 0%, #FF9800 100%);
    color: #060638;
    text-align: center;
  }
  .dd-wager.visible { display: flex; }
  .dd-title {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 3px;
  }
  .dd-sub {
    font-size: 0.9rem;
    font-weight: 700;
  }
  .dd-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .dd-buttons button {
    padding: 16px;
    border: 3px solid #060638;
    border-radius: 12px;
    background: #060638;
    color: #FFD700;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .dd-buttons button:active { transform: scale(0.97); }

  /* ── FINAL JEOPARDY ── */
  .final-wager {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 360px;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1a1a8c 0%, #060638 100%);
    border: 3px solid #FFD700;
    color: #FFD700;
    text-align: center;
  }
  .final-wager.visible { display: flex; }
  .final-wager input {
    width: 100%;
    padding: 14px;
    background: #060638;
    border: 2px solid #FFD700;
    border-radius: 10px;
    color: #FFD700;
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    -moz-appearance: textfield;
  }
  .final-wager input::-webkit-outer-spin-button,
  .final-wager input::-webkit-inner-spin-button {
    -webkit-appearance: none;
  }
  .fj-submit-btn {
    width: 100%;
    padding: 14px;
    background: #FFD700;
    color: #060638;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
  }
  .fj-submit-btn:active { transform: scale(0.97); }
  .fj-submit-btn:disabled {
    background: #444;
    color: #888;
  }

  /* ── END SCREEN ── */
  .end-display {
    display: none;
    text-align: center;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .end-display.visible { display: flex; }
  .end-display h2 { font-size: 2rem; color: #FFD700; }
  .end-display .rank-msg { font-size: 1.2rem; }

[hidden] { display: none !important; }
#header { background: var(--room-color, #151515); flex-wrap: wrap; gap: .5rem; }
#player-room { font-size: .75rem; }
#leave-game { border: 1px solid #aaa; border-radius: .5rem; padding: .35rem .55rem; background: #222; color: white; }
.room-form { width: min(100%, 30rem); display: grid; gap: .65rem; padding: 1rem; background: #191919; border: 1px solid #444; border-radius: .75rem; }
.room-form h2 { color: #FFD700; }
.room-form input, .room-form button { font: inherit; padding: .55rem; border: 1px solid #555; border-radius: .45rem; background: #252525; color: white; }
.room-form button[type="submit"] { background: #FFD700; color: #111; font-weight: 700; }
#team-buttons, #new-team { display: grid; gap: .45rem; }
.team-name-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.team-name-row input { flex: 1; min-width: 0; }
#player-feedback { color: #ffd2a6; }
#round-timer { font-size: 1.6rem; color: #FFD700; font-weight: 800; }
.wager-form { display: grid; gap: .5rem; justify-items: center; }
.wager-form input { width: 9rem; background: #222; color: white; border: 1px solid #aaa; border-radius: .5rem; padding: .5rem; font: inherit; }
#qd-text, #ans-text { white-space: pre-line; }
#all-scores { display: flex; gap: .8rem; overflow-x: auto; }
#all-scores > div { flex-shrink: 0; }

.guide-link { color: #ffdf64; text-underline-offset: .18em; }
#team-picker-tip { color: #d5d8ea; }

.picture-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.picture-choices button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .35rem;
  min-height: 5.5rem;
  padding: .5rem .25rem;
  border: 1px solid #ba8a34;
  border-radius: .6rem;
  background: #27223a;
  color: #fff1c7;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.picture-choices button:focus-visible { outline: 2px solid #ffd564; outline-offset: 2px; }
.picture-choices button:disabled { opacity: .45; cursor: default; }
.choice-picture { font-size: clamp(1.5rem, 7vw, 2.3rem); line-height: 1.1; }
