/* The artwork fills the viewport; the last grid row is always reserved. */
:root{--ad-reserve:calc(121px + env(safe-area-inset-bottom,0px));--app-header:64px}
.app-shell{height:100svh;height:100dvh;grid-template-rows:var(--app-header) minmax(0,1fr) 32px var(--ad-reserve)}
.site-footer{grid-row:3;min-height:32px;padding:0;border:0;justify-content:center}
.privacy-button{min-height:32px;padding:4px 8px;font-size:13px}
#advertising-slot{position:fixed;inset:auto 0 0;height:var(--ad-reserve);background:transparent;pointer-events:none;border:0;z-index:90}
#toast{bottom:calc(var(--ad-reserve) + 36px);z-index:100}
.top-tools{flex-shrink:0}

@media(max-width:760px){:root{--app-header:56px}.edition{display:none}}
/* Compact portrait retains every game action, with tighter grouping. */
@media(max-width:760px) and (max-height:800px){
  .home-emblem,.home-intro .tagline{display:none}
  .home-screen{gap:10px}
  .oral-demo{padding:12px 16px}
  .oral-demo>p{font-size:22px;margin:8px 0 10px}
  .game-logo{font-size:2.55rem}
  .home-intro .eyebrow{margin-bottom:8px}
  .settings-screen,.settings-screen:has(.difficulty-group){gap:10px}
  .settings-panel{min-height:210px}
  .difficulty-body{padding:9px 11px}
  .settings-tabs button{min-height:48px}
  .theme-body{min-height:54px}
  .center-screen .status-mark{display:none}
  body:is([data-screen=judge],[data-screen=result]) .play-screen>.screen-top{display:none}
  .center-screen{gap:10px}
}
@media(max-width:559px) and (max-height:680px){
  :root{--app-header:48px}
  .topbar{gap:8px}
  .top-tools .icon-button{width:34px;height:34px}
  .game-brand{font-size:17px}
  #app{padding:8px 0}
  .home-screen{gap:8px}
  .game-logo{font-size:2.1rem}
  .home-intro .eyebrow{font-size:10px;margin-bottom:5px}
  .oral-demo{padding:10px 14px}
  .demo-heading{display:none}
  .oral-demo>p{font-size:20px;margin:0 0 8px}
  .spoken-bids>span{flex-direction:row;gap:4px;padding:5px 2px}
  .spoken-bids b{font-size:21px}
  .home-actions{gap:6px}
  .home-difficulty{padding:6px 10px}
  .home-difficulty strong{font-size:14px}
  .home-links .text-button{min-height:34px;padding:5px 0}
  .button,.home-actions .button-xl{min-height:44px;padding:10px 12px}
  .screen-top{margin-bottom:4px}
  .back-button{min-height:32px;padding:4px 0}
  .question-layout{gap:6px}
  .topic h1{font-size:24px;line-height:1.13;margin:8px 0 0}
  .topic-links .text-button{min-height:32px;padding:5px 0}
  .announcement{padding:10px 12px}
  .announcement-heading .eyebrow{display:none}
  .announcement-heading label{font-size:18px}
  .target-stepper{margin-top:2px}
  .target-stepper input{height:50px;font-size:45px}
  .step-button{width:40px;height:40px}
  #target-caption{font-size:13px;margin:0 0 7px}
  .settings-screen,.settings-screen:has(.difficulty-group){gap:8px}
  .settings-screen .screen-top{min-height:32px}
  .settings-screen h1{font-size:24px}
  .settings-tabs button{min-height:42px;padding:5px;font-size:14px}
  .settings-panel{min-height:186px}
  .difficulty-body{min-height:48px;padding:7px 10px}
  .level-copy strong{font-size:14px}
  .level-copy small{font-size:12px}
  .theme-body{min-height:48px;padding:8px;font-size:13px}
  .setting-group legend{font-size:14px;margin-bottom:8px}
  .settings-bottom{padding-top:8px}
  .settings-bottom .button{min-height:40px}
  .center-screen{gap:7px}
  .center-screen h1{font-size:30px}
  .recap-question{padding:10px;font-size:19px;margin:0}
  .result-copy{font-size:15px;line-height:1.4}
  .result-contract{padding:10px 0;margin:0}
  .result-contract strong{font-size:44px}
  .verdict-buttons{margin-top:3px}
}
/* Landscape keeps its existing 91px reserve, even with no ad. */
@media(min-width:560px) and (max-height:600px){
  :root{--ad-reserve:calc(91px + env(safe-area-inset-bottom,0px));--app-header:44px}
  #app{padding:6px 0}
  .home-screen{display:grid;gap:8px 28px}
  .home-intro{grid-row:1}
  .home-actions{grid-row:1/3}
  .home-emblem,.tagline{display:none}
  .game-logo{font-size:2.1rem}
  .oral-demo{grid-row:2;padding:8px 12px}
  .oral-demo>p{font-size:18px;margin:0 0 6px}
  .home-difficulty{padding:6px 10px}
  .home-actions{gap:6px}
  .home-links .text-button{min-height:32px;padding:4px 0}
  .button,.home-actions .button-xl{min-height:40px;padding:8px 12px}
  .screen-top{margin-bottom:3px}
  .back-button{min-height:30px;padding:3px 0}
  .question-layout{display:grid;gap:20px}
  .topic h1{font-size:23px;line-height:1.12;margin:8px 0 0}
  .topic-links .text-button{min-height:30px;padding:4px 0}
  .announcement{padding:8px 12px}
  .announcement-heading label{font-size:18px}
  .target-stepper input{height:44px;font-size:40px}
  #target-caption{margin:0 0 6px}
  .timer-layout{grid-template-columns:minmax(0,1.15fr) 90px minmax(0,1fr);gap:16px;max-width:880px}
  .clock-wrap{width:90px;height:90px}
  .clock-digits{font-size:39px}
  .pause-button{min-height:30px;font-size:12px}
  .answer-tracker{padding-bottom:8px}
  .count-buttons .button{min-height:40px}
  .center-screen{display:grid;gap:6px 24px}
  .center-screen h1{font-size:28px}
  .result-copy{font-size:14px}
  .result-contract{padding:8px 0}
  .result-contract strong{font-size:40px}
  .settings-screen,.settings-screen:has(.difficulty-group){display:grid;grid-template-columns:118px minmax(0,1fr);gap:6px 18px}
  .settings-panel{min-height:0}
  .settings-screen .screen-top{min-height:30px}
  .settings-tabs button{min-height:34px;padding:4px}
  .difficulty-body{min-height:36px;padding:5px 10px}
  .level-copy strong{font-size:14px}
  .theme-body{min-height:42px;font-size:13px;padding:6px}
  .settings-bottom{padding-top:5px}
  .settings-bottom .button{min-height:36px;padding:7px 12px}
}
@media(min-width:560px) and (max-height:360px){
  :root{--app-header:40px}
  .app-shell{grid-template-rows:var(--app-header) minmax(0,1fr) 26px var(--ad-reserve)}
  .site-footer,.privacy-button{min-height:26px;font-size:12px}
  #app{padding:3px 0}
  .home-intro .eyebrow{display:none}
  .home-screen{gap:5px 24px}
  .game-logo{font-size:1.95rem}
  .oral-demo>p{font-size:16px}
  .oral-demo{padding:6px 10px}
  .home-actions .button-xl{min-height:38px}
  .home-links{gap:14px}
  .home-difficulty small{font-size:11px}
  .question-layout{gap:16px}
  .play-screen>.screen-top{min-height:24px}
  .back-button{font-size:13px;min-height:24px;padding:0}
  .announcement{padding:5px 10px}
  .announcement-heading label{font-size:16px}
  .target-stepper input{height:36px;font-size:34px}
  .target-stepper .step-button{width:34px;height:34px}
  #target-caption{font-size:12px;margin:0 0 4px}
  .announcement>.button{min-height:34px;font-size:14px;padding:6px}
  .topic h1{font-size:21px}
  .settings-screen,.settings-screen:has(.difficulty-group){grid-template-columns:108px minmax(0,1fr);grid-template-rows:24px 1fr 34px;gap:3px 16px}
  .settings-screen .screen-top{grid-column:1;grid-row:1;min-height:24px}
  .settings-screen h1{display:none}
  .settings-tabs{grid-column:1;grid-row:2;gap:0;padding:2px}
  .settings-tabs button{min-height:27px;font-size:12px;padding:2px}
  .settings-tabs button small{display:none}
  .settings-panel{grid-column:2;grid-row:1/4}
  .settings-bottom{display:contents}
  .settings-bottom>div{display:none}
  .settings-bottom .button{grid-column:1;grid-row:3;min-height:34px;padding:5px;font-size:14px}
  .setting-group legend{margin-bottom:5px;font-size:13px}
  .level-copy strong{font-size:14px}
  .level-copy small{display:none}
  .difficulty-body{min-height:34px;padding:5px 8px}
  .theme-body{min-height:44px;font-size:12px}
  .panel-hint{font-size:13px;margin-top:8px}
  .center-screen{gap:5px 22px}
  .center-screen h1{font-size:26px}
  .judge-count,.judge-target{font-size:14px}
  .recap-question{padding:6px 8px;font-size:16px}
  .center-screen .text-button{min-height:28px;padding:2px 0}
}
@media(max-width:760px) and (min-height:801px) and (max-height:900px){
  .home-emblem{width:52px;margin-bottom:2px}
  .home-screen{gap:12px}
  .game-logo{font-size:2.7rem}
  .home-intro .tagline{font-size:15px;margin-top:8px}
  .oral-demo{padding:14px 18px}
}
@media(min-width:761px) and (min-height:601px) and (max-height:850px){
  body:is([data-screen=judge],[data-screen=result]) .play-screen>.screen-top{display:none}
  .center-screen{gap:12px}
  .center-screen .status-mark{margin:0}
}
@media(min-width:560px) and (min-height:361px) and (max-height:600px){.game-brand{font-size:19px}}
@media(min-width:560px) and (min-height:361px) and (max-height:420px){
  .settings-screen,.settings-screen:has(.difficulty-group){grid-template-columns:108px minmax(0,1fr);grid-template-rows:24px 1fr 34px;gap:3px 16px}
  .settings-screen .screen-top{grid-column:1;grid-row:1;min-height:24px}
  .settings-screen h1{display:none}
  .settings-tabs{grid-column:1;grid-row:2;gap:0;padding:2px}
  .settings-tabs button{min-height:27px;font-size:12px;padding:2px}
  .settings-tabs button small{display:none}
  .settings-panel{grid-column:2;grid-row:1/4}
  .settings-bottom{display:contents}
  .settings-bottom>div{display:none}
  .settings-bottom .button{grid-column:1;grid-row:3;min-height:34px;padding:5px;font-size:14px}
}

/* One fixed AdSense unit. The reserve never depends on fill or consent. */
#advertising-slot{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;padding:0 0 calc(8px + env(safe-area-inset-bottom,0px))}
.ad-label{font-size:10px;line-height:12px;color:var(--muted);letter-spacing:.04em}
#ad-banner{width:320px;height:50px;flex:0 0 50px;visibility:hidden;pointer-events:auto;background:transparent}
#bottom-ad{vertical-align:top}
#bottom-ad[data-ad-status="unfilled"]{visibility:hidden}
.site-footer{gap:12px}
.privacy-link{color:var(--muted);font-size:12px;text-underline-offset:3px;text-align:center}
.privacy-button{color:var(--muted)}
@media(max-width:420px){.site-footer{gap:8px}.privacy-button,.privacy-link{max-width:50%;font-size:11px;line-height:1.2;padding:2px 0}}
@media(max-width:319px){#ad-banner{display:none}}
