/* Compact the mirrored phone viewport automatically when rotated; keep pinch zoom. */
@media (orientation: landscape) and (max-width: 1000px) and (max-height: 540px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .app {
    --display-safe-top: env(safe-area-inset-top, 0px);
    --display-safe-right: env(safe-area-inset-right, 0px);
    --display-safe-bottom: env(safe-area-inset-bottom, 0px);
    --display-safe-left: env(safe-area-inset-left, 0px);
  }

  .app .site-header { display: flex; flex-wrap: wrap; gap: 8px; height: auto; min-height: 50px; padding: max(2px, var(--display-safe-top)) max(12px, var(--display-safe-right)) 2px max(12px, var(--display-safe-left)); }
  .app .brand, .app .brand img { width: 74px; height: 44px; }
  .app .main-nav { flex: 1; width: auto; gap: 14px; margin: 0; }
  .app .main-nav a { font-size: 12px; min-height: 44px; padding: 8px 0; align-content: center; }
  .app .main-nav a.active::after { bottom: 3px; }
  .app .header-actions { gap: 8px; margin-inline-start: auto; }
  .app .header-actions button, .app .account-button { min-height: 44px; }
  .app .wallet { font-size: 12px; gap: 5px; padding-inline-start: 8px; }
  .app .wallet > svg, .app .screen-button > svg { font-size: 22px; }
  .app .site-footer { padding-bottom: max(12px, var(--display-safe-bottom)); }
  .app .game-toolbar { gap: 8px; margin-bottom: 6px; font-size: 12px; }
  .app .game-toolbar .text-button { min-height: 44px; font-size: 12px; }

  .app .home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 190px; align-items: start; gap: 14px; padding: 12px max(12px, var(--display-safe-right)) 0 max(12px, var(--display-safe-left)); }
  .app .category-workspace > h1 { font-size: 25px; line-height: 1.4; }
  .app .category-toolbar { display: block; margin: 4px 0 10px; }
  .app .category-toolbar > p { font-size: 13px; line-height: 1.5; margin: 0 0 4px; }
  .app .filters { width: 100%; max-width: 100%; gap: 2px; padding: 2px; overflow-x: auto; }
  .app .filters button { flex: 1; min-width: 44px; min-height: 44px; padding: 3px 6px; font-size: 12px; }
  .app .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .app .category-image { aspect-ratio: 16 / 9; }
  .app .category-card h2 { min-height: 36px; padding: 4px; font-size: 12px; line-height: 1.4; }
  .app .selection-mark { width: 24px; height: 24px; font-size: 14px; top: 5px; inset-inline-start: 5px; }
  .app .session-sidebar { display: block; width: auto; max-width: none; padding: 0; padding-inline-start: 12px; border-top: 0; border-inline-start: 1px solid #47657d; text-align: center; }
  .app .session-sidebar > h2 { font-size: 23px; line-height: 1.4; margin: 0 0 8px; }
  .app .short-line { display: none; }
  .app .team-list { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .app .team { min-height: 44px; padding: 5px 8px; gap: 6px; }
  .app .team strong { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
  .app .team > svg:first-child { font-size: 22px; }
  .app .selection-summary { justify-content: center; gap: 6px; margin: 8px 0; padding: 5px 0; }
  .app .selection-summary strong { font-size: 16px; }
  .app .selection-summary p { font-size: 11px; }
  .app .summary-check { width: 26px; height: 26px; font-size: 16px; }
  .app .start-button { width: 100%; min-height: 44px; margin: 6px 0 0; padding: 5px 10px; font-size: 16px; }
  .app .start-button svg { font-size: 20px; }
  .app .credit-note, .app .session-start-controls .credit-note { font-size: 11px; line-height: 1.5; margin: 3px 0 0; }
  .app .season-divider { margin: 10px 0; }
  .app .season-link { font-size: 16px; margin: 0; }
  .app .season-copy, .app .season-soon { font-size: 11px; line-height: 1.5; }
  .app .lounge-illustration { height: 110px; width: 100%; margin: 8px 0 0; }

  .app .game-shell {
    max-width: none;
    padding: max(8px, var(--display-safe-top)) max(12px, var(--display-safe-right)) 8px max(12px, var(--display-safe-left));
  }
  .app .header-lasers { height: 4px; }
  .display-mode .header-lasers { display: none; }

  .app .scoreboard { gap: 10px; margin-bottom: 8px; }
  .app .score-team { min-height: 48px; padding: 5px 12px; gap: 8px; flex-wrap: nowrap; }
  .app .score-team > svg { font-size: 20px; flex-shrink: 0; }
  .app .score-team > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .app .score-team > div > span { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
  .app .score-team strong { font-size: 24px; line-height: 1.4; }
  .app .turn-tag { font-size: 11px; line-height: 1.5; margin: 0; padding: 2px 6px; white-space: nowrap; }

  .app .question-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; max-width: none; padding: 10px 16px; }
  .app .question-view > * { min-width: 0; overflow-wrap: anywhere; }
  .app .question-meta { grid-column: 1 / -1; font-size: 13px; line-height: 1.5; gap: 12px; }
  .app .timer { grid-column: 2; grid-row: 2; margin: 0; gap: 8px; }
  .app .timer strong { font-size: 26px; line-height: 1.4; min-width: 40px; }
  .app .timer > svg { font-size: 20px; }
  .app .timer .icon-button { min-width: 44px; min-height: 44px; }
  .app .question-team { grid-column: 1; grid-row: 2; align-self: center; justify-self: center; margin: 0; padding: 2px 10px; font-size: 13px; line-height: 1.5; }
  .app .question-view h1 { grid-column: 1 / -1; font-size: clamp(20px, 5.8vh, 29px); font-size: clamp(20px, 5.8dvh, 29px); line-height: 1.5; margin: 6px 0; }
  .app .question-instruction { align-self: center; margin: 0; font-size: 13px; line-height: 1.5; }
  .app .reveal-button { justify-self: center; min-width: 180px; min-height: 44px; padding: 6px 18px; margin: 0; font-size: 16px; }

  .app .question-view:has(.answer-area) h1 { grid-column: 1; grid-row: 3; align-self: center; }
  .app .question-view:has(.answer-area) .question-meta { grid-column: 1; grid-row: 1; align-self: center; }
  .app .question-view:has(.answer-area) .timer { grid-row: 1; }
  .app .answer-area { grid-column: 2; grid-row: 2 / 4; margin: 0; padding: 0 12px 0 0; border-top: 0; border-inline-start: 1px solid #ffffff26; }
  .app .answer-label { font-size: 12px; line-height: 1.4; }
  .app .answer-area h2 { display: inline; font-size: 21px; line-height: 1.4; margin: 0 8px; }
  .app .answer-area > p { font-size: 13px; line-height: 1.5; margin: 3px 0; }
  .app .question-source { font-size: 11px; line-height: 1.4; margin: 4px 0; }
  .app .answer-area .award-label { font-size: 12px; margin: 6px 0; margin-top: 6px !important; }
  .app .award-buttons { display: grid; grid-template-columns: 1fr 1fr .65fr; gap: 6px; margin: 0; }
  .app .award-buttons > button { min-width: 0; min-height: 44px; padding: 4px 6px; gap: 4px; font-size: 12px; line-height: 1.3; }
  .app .award-buttons > button > svg { display: none; }
  .app .award-buttons small { font-size: 10px; }
  .app .award-buttons strong { font-size: 13px; white-space: nowrap; flex-shrink: 0; }
  .app .report-button { min-height: 44px; font-size: 11px; margin: 2px 0 0; }

  .app .board-title { font-size: 20px; line-height: 1.4; margin: 4px 0; }
  .app .board-instruction { font-size: 12px; line-height: 1.5; margin: 4px 0 8px; }
  .app .question-board { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .app .board-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 4px; }
  .app .board-column > img { grid-column: 1 / -1; height: 36px; }
  .app .board-column > h2 { grid-column: 1 / -1; min-height: 26px; font-size: 12px; line-height: 1.4; padding: 4px; }
  .app .board-column > button { min-width: 0; min-height: 44px; font-size: 18px; padding: 3px; }
  .app .board-column > button > span { font-size: 10px; }

  /* A normal-flow exit remains reachable and never covers an answer or action. */
  .app .exit-display { position: static; display: block; width: fit-content; min-height: 44px; margin: 0 max(12px, var(--display-safe-right)) max(8px, var(--display-safe-bottom)) max(12px, var(--display-safe-left)); font-size: 13px; }
  .display-mode .site-header { display: none; }
}

@media (orientation: landscape) and (max-width: 700px) and (max-height: 540px) {
  .app .home-layout { grid-template-columns: minmax(0, 1fr) 165px; gap: 10px; }
  .app .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
