@media screen {
  *,*::before,*::after{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}
  input,textarea,select,[contenteditable="true"],[contenteditable="true"] *,[contenteditable=""]{-webkit-user-select:text;user-select:text}
  img,a{-webkit-touch-callout:none}
}
body.mp-playing .mp-studio{height:var(--mp-studio-height,min(26vh,260px));min-height:0}body.mp-playing .mp-studio[data-collapsed]{display:none}
#gameMenuToggle{display:none}.game-menu{position:fixed;inset:0 0 0 auto;margin:0;width:min(380px,100%);height:100dvh;max-height:100dvh;max-width:100%;padding:18px;padding-bottom:max(18px,env(safe-area-inset-bottom));border:1px solid #7588ab;border-radius:0;background:#101b35;color:#f5f7ff;overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box}.game-menu::backdrop{background:#030816bc;backdrop-filter:blur(3px)}.game-menu header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}.game-menu h2{font-size:21px;margin:0}.game-menu h3{font-size:14px;color:#f3d150;margin:20px 0 12px}.game-menu button{min-height:44px}.game-menu header button{width:44px;min-width:44px;padding:8px}.game-menu-tools{display:grid;grid-template-columns:1fr;gap:8px}.game-menu-tools button{display:flex;align-items:center;justify-content:flex-start;gap:12px;width:100%!important;padding:12px!important;text-align:left;font-size:14px!important;white-space:normal}.game-menu-tools button i{width:22px;flex-shrink:0;font-size:18px}.game-menu .game-menu-icon-label::after{content:attr(data-menu-label);font-size:14px;line-height:1.35}.game-menu .lifelines,.game-menu .mp-lifelines{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}.game-menu .lifelines button,.game-menu .mp-lifelines button{min-width:0;min-height:58px}.game-menu .mp-standings{border:0;background:none;padding:0;margin:24px 0 0;box-shadow:none}.game-menu .mp-standings ol{display:block;overflow:visible}.game-menu .mp-standings li{padding:10px 0;border-bottom:1px solid #394a69}.game-menu-icon-label::after{display:none}.game-menu .game-menu-icon-label::after{display:inline}.game-menu [hidden]{display:none!important}body.is-playing .language-control{display:none!important}
@media(max-width:1024px),(max-width:1180px) and (max-height:600px){
  /* A moving panel-wide highlight overflowed the viewport behind fixed overlays. */
  body.is-playing .question-panel::before{animation:none!important;transform:none;inset:0}
  body.mp-playing #gameMenuToggle{display:grid;place-items:center;width:44px;min-height:44px;padding:8px;flex-shrink:0}
  body.is-playing .mobile-game-bar{grid-template-columns:minmax(0,1fr) 82px 38px 38px!important;gap:4px!important}
  body.is-playing .mobile-game-bar .mobile-end-button{width:38px}
  body.is-playing .question-actions{display:grid;grid-template-columns:40px 40px minmax(40px,1fr) 40px 40px;gap:6px;margin-top:8px}
  body.is-playing .question-actions button{min-height:40px;min-width:0;padding:6px}
  body.is-playing .question-actions #reportButton{width:auto;flex:auto;font-size:0}
  body.is-playing .question-actions #reportButton i{font-size:16px}
  body.is-playing .question-actions #soundButton,body.is-playing .question-actions #audioSettingsButton{width:40px}
  body.is-playing .question-actions #confirmAnswer{grid-column:1 / -1;grid-row:2;width:100%;min-height:44px}
  body.is-playing #speechStatus{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  body.is-playing #gameStatus:empty{display:none}
  body.mp-playing .mp-game-layout{grid-template-columns:minmax(0,1fr)}
  body.mp-playing .mp-studio{height:var(--mp-studio-height,clamp(60px,calc(100dvh - 430px),300px));min-height:0}
  body.mp-playing .mp-studio[data-collapsed]{display:none}
  body.mp-playing .mp-header{flex-wrap:nowrap}
  body.mp-playing .mp-header #mpConnection{font-size:11px;min-width:0}
  body.mp-playing .mp-app{padding:10px}
  body.mp-playing #mpFeedback{font-size:13px;line-height:1.35}
}
@media(max-height:500px) and (orientation:landscape){body.mp-playing .mp-studio{display:none}body.mp-playing .mp-question{min-height:50px}body.mp-playing .mp-answer{min-height:44px}}
@media(max-width:1024px) and (max-height:700px){
  body.mp-playing .mp-header{padding-bottom:8px}
  body.mp-playing .mp-game-layout{margin-top:8px}
  body.mp-playing .mp-console{padding:8px}
  body.mp-playing .mp-question{min-height:56px;padding:8px;margin:8px 0}
  body.mp-playing .mp-answer{min-height:48px;padding:6px}
  body.mp-playing .mp-console>progress{margin:6px 0}
  body.mp-playing .mp-lifelines{margin-bottom:8px}
  body.mp-playing #mpHint{padding:6px 8px;margin-top:6px;display:flex;flex-wrap:wrap;gap:6px 12px;font-size:12px}
  body.mp-playing #mpHint .mp-vote{display:inline-flex;gap:5px;min-width:48px;margin:0}
  body.mp-playing #mpHint .mp-vote progress{display:none}
  body.mp-playing #mpHint p{margin:0}
  body.mp-playing #mpFeedback{min-height:18px;margin-top:6px;font-size:12px}
}
@media(max-height:500px) and (orientation:landscape){
  body.is-playing .question-actions{grid-template-columns:40px 40px minmax(40px,1fr) 40px 40px minmax(180px,1fr)}
  body.is-playing .question-actions #confirmAnswer{grid-column:6;grid-row:1}
  body.mp-playing .mp-answers{grid-template-columns:repeat(4,minmax(0,1fr))}
  body.mp-playing .mp-question{padding:8px}
  body.mp-playing .mp-answer{padding:6px}
  body.mp-playing #mpFeedback{min-height:18px;margin-top:6px;font-size:12px}
  body.mp-playing #mpHint{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;padding:6px 8px;margin-top:6px;font-size:12px}
  body.mp-playing #mpHint[hidden]{display:none}
  body.mp-playing #mpHint .mp-vote{display:inline-flex;gap:5px;min-width:48px;margin:0}
  body.mp-playing #mpHint .mp-vote progress{display:none}
  body.mp-playing #mpHint p{margin:0}
}
.game-menu-tools #mobileWalkAwayButton,.game-menu-tools #mpLeave{order:99;margin-top:10px;border-color:#a7636e}

/* Keep result placement explicit: optional review must not displace saving controls. */
@media screen {
  body.is-result #resultScreen{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-areas:"check save" "check actions" "check scores" "check extras" "review review";gap:16px;align-items:start;align-content:start;min-height:0;padding:20px}
  #resultScreen #check{grid-area:check;min-width:0;max-width:none;padding:22px;border:1px solid #b6a05b;background:linear-gradient(135deg,#163552,#0d163c 85%);border-radius:8px}
  #resultScreen #saveForm{grid-area:save;min-width:0;max-width:none;margin:0;padding:16px;border:1px solid #617393;border-radius:8px;background:#14213b}
  #resultScreen .result-actions{grid-area:actions;min-width:0;justify-content:flex-start;align-items:center}
  #resultScreen #resultScores{grid-area:scores;max-width:none;padding:12px 0;border:0;border-top:1px solid #ffffff26;background:none}
  #resultScreen #resultExtras{grid-area:extras;max-width:none;padding:12px 0;border-top:1px solid #ffffff26}
  #resultScreen #wrongAnswerReview{grid-area:review;margin-top:8px}
  #resultScreen .save-row{grid-template-columns:minmax(0,1fr)}
  #resultScreen .save-row input{width:100%;min-width:0}
  #resultScreen .check-visual{display:block;height:130px;margin-bottom:16px}
  #resultScreen .check-visual span{font-size:28px}
  #resultScreen .check-label{letter-spacing:0}
  #resultScreen #resultAmount{font-size:44px;line-height:1.1;margin-bottom:16px;white-space:nowrap}
  #resultScreen .check-time{font-size:13px;line-height:1.5;margin:8px 0}
  #resultScreen .check-time strong{display:inline;width:auto;font-size:15px;margin:0;padding:0;border:0}
  #resultScreen #checkName{font-size:24px;padding-bottom:0;border:0;overflow-wrap:anywhere}
  #resultScreen .result-actions #printButton{font-size:13px;flex:1 1 130px;width:auto;padding:10px}
  #resultScreen .result-actions #playAgainButton{flex:1 1 160px;min-height:44px}
  #resultScreen .result-actions #soundButton,#resultScreen .result-actions #audioSettingsButton{flex:0 0 44px;width:44px;min-height:44px}
  #resultScreen .result-stats{margin:12px 0}
  #resultScreen #resultExplanation:empty{display:none}
}
@media screen and (max-width:600px){
  body.is-result #resultScreen{grid-template-columns:minmax(0,1fr);grid-template-areas:"check" "save" "actions" "scores" "extras" "review";gap:12px;padding:10px}
  #resultScreen #check{padding:16px}
  #resultScreen .check-visual{height:100px;margin-bottom:12px}
  #resultScreen #resultAmount{font-size:40px;margin-bottom:12px}
  #resultScreen #saveForm{padding:12px}
  #resultScreen .result-actions{gap:8px}
  #resultScreen .result-actions #printButton,#resultScreen .result-actions #playAgainButton{flex:1 1 calc(50% - 8px);font-size:13px;padding:10px 6px}
  #resultScreen #wrongAnswerReview{padding-top:16px}
  #resultScreen #wrongReviewAnswers{grid-template-columns:minmax(0,1fr)}
}
@media screen and (max-width:600px) and (max-height:700px){
  #resultScreen .check-visual{height:70px}
  #resultScreen #check{padding:12px}
  #resultScreen .check-time{margin:4px 0}
  #resultScreen .result-stats{margin:8px 0}
}
