/* The puzzle has its own wide reading surface; other site pages keep their layout. */
@media (min-width:901px) {
  main:has(#scanGrid) .wrap{width:min(1600px,calc(100% - 48px))}
  .game-wrap{grid-template-columns:minmax(0,1fr);gap:20px}
  .game-card{padding:20px;background:#fff;border-radius:16px}
  .game-side{position:static;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:18px}
  .game-side>h2,.game-side>.game-side-lead{grid-column:1/-1;margin:0}
  .game-side .side-box{margin:0}
  .active-clue-bar{min-height:64px;padding:12px 16px}
  .active-clue-bar strong{font-size:17px;line-height:1.4}
  .active-clue-meta small{font-size:11px}
  .active-answer-bar{display:flex;padding:9px 12px;margin-bottom:12px}
  .answer-slot{min-width:34px;height:36px;font-size:19px}
  .grid-viewport{padding:18px;background:#f0f3f7;border:1px solid #dce3ed}
  .keyboard-note{display:block;font-size:12px;line-height:1.5;color:#64748b}
}
.scan-grid{background:#9aa9bb;border-color:#26374d;border-radius:5px;box-shadow:0 12px 32px #1c30451a;transition:none}
.sg-cell.letter{background:#fff}
.sg-cell input{font-weight:750;font-size:calc(var(--cell-size) * .43);color:#15283e}
.sg-cell.clue{background:#e8eff6;color:#172b43}
.clue-part{font-weight:650;line-height:1.18;letter-spacing:0;padding:4px;text-wrap:pretty;hyphens:auto}
.clue-text{display:block;max-width:100%;overflow-wrap:normal}
.clue-part[data-length="short"]{font-weight:750}
.clue-part+.clue-part{border-top:1px solid #a8b9ca}
.clue-part.active{background:#dbeafe;box-shadow:inset 0 0 0 3px #4262ca;color:#102b62}
.sg-cell.letter.active{background:#e5edff;box-shadow:inset 0 0 0 1px #b6c9f2}
.sg-cell.letter.correct{background:#eff8f2}
.sg-cell input:focus{background:#fff0a3;box-shadow:inset 0 0 0 3px #4262ca}
.sg-cell.letter.word-edge-right::after,.sg-cell.letter.word-edge-bottom::before{content:none}
.sg-cell.letter.active-end-h::after,.sg-cell.letter.active-end-v::before{content:"";position:absolute;background:#4262ca;z-index:9;pointer-events:none}
.sg-cell.letter.active-end-h::after{top:0;right:0;bottom:0;width:2px}
.sg-cell.letter.active-end-v::before{left:0;right:0;bottom:0;height:2px}
.cell-arrow{stroke:#344b68;stroke-width:2}
.cell-arrow.active{stroke:#4262ca;stroke-width:2.8}
@media(max-width:900px){
  .active-clue-bar{display:grid!important;grid-template-columns:minmax(0,1fr) 28px 28px;gap:5px!important;padding:7px 9px!important;background:#f1f5ff!important;border-color:#c8d7f3!important;box-shadow:inset 3px 0 0 #4262ca!important}
  .active-clue-meta{grid-row:1;grid-column:1;display:flex;align-items:center;gap:7px;min-width:0}
  .active-clue-meta span{font-size:8px!important;letter-spacing:.04em!important;white-space:nowrap}
  .active-clue-meta small{font-size:9px!important}
  .active-clue-nav{grid-row:1;width:28px;height:26px}
  #prevClueBtn{grid-column:2}
  #nextClueBtn{grid-column:3}
  .active-clue-bar strong{grid-row:2;grid-column:1/-1;max-height:none!important;overflow:visible!important;font-size:13px!important;line-height:1.25!important}
  .active-clue-image{grid-row:3;grid-column:1;width:56px!important;height:38px!important}
  .active-clue-image[hidden]{display:none!important}
  .zoom-control{grid-row:3;grid-column:2/-1}
  .clue-part{line-height:1.12;padding:3px;hyphens:none;letter-spacing:0;font-weight:600}
  .clue-text{overflow-wrap:anywhere;hyphens:none}
  .clue-part.active{box-shadow:inset 0 0 0 2px #4262ca}
  .wg-game-nav{gap:6px;margin-top:3px;padding-top:3px}
  .wg-current-word-btn{height:27px;padding:0 8px;font-size:9px}
  .wg-current-word-btn span{font-size:13px}
  .wg-minimap-wrap{height:27px}
  .active-answer-bar>span{display:none}
  .active-answer-bar{min-height:34px!important;padding:3px 6px!important}
}
/* Keep the playing surface as clear as a printed scanword. */
.game-card{display:flex;flex-direction:column}
.game-card>.game-stats{order:8;margin-top:16px}
.game-hud{box-shadow:none;border-color:#e2e8f0;background:#fff}
.scan-grid{border-width:1px;border-color:#697b8e;border-radius:0;box-shadow:none}
.grid-viewport{background:#f8fafb;box-shadow:none}
.sg-cell.clue{background:#e6f2ee;color:#203a37}
.sg-cell.block{background:#dce4ea}
.clue-part{font-weight:500}
.clue-part[data-length="short"]{font-weight:600}
.clue-part+.clue-part{border-color:#a9bdb5}
.cell-arrow{stroke:#6684cf;stroke-width:1.35}
.cell-arrow.active{stroke:#4262ca;stroke-width:1.85;filter:none}
@media(max-width:900px){
  .active-answer-bar{display:none!important}
  body.wg-kbd-open .wg-game-nav{display:none!important}
  .wg-kbd-nav .wg-key{max-width:60px}
}
@media(min-width:901px){
  .active-answer-bar{display:none}
  .game-hud .game-stats{display:flex;flex-wrap:wrap;gap:14px}
  .game-hud .stat{padding:4px 0;border:0;box-shadow:none;gap:6px;background:transparent}
  .game-hud .stat span{font-size:10px;text-transform:none;letter-spacing:0;color:#64748b}
  .game-hud .stat strong{font-size:12px}
}
/* Native fullscreen and the iPhone fallback share a bounded, scrollable game surface. */
body.wg-fullscreen{overflow:hidden!important;padding-bottom:0!important}
body.wg-fullscreen .game-card{position:fixed!important;inset:0!important;z-index:100!important;display:flex!important;flex-direction:column!important;height:var(--wg-screen-height,100dvh)!important;min-height:0!important;padding:4px!important;margin:0!important;border:0!important;border-radius:0!important;overflow:hidden!important}
body.wg-fullscreen.wg-kbd-open .game-card{padding-bottom:calc(var(--wg-keyboard-height,196px) + 4px)!important}
body.wg-fullscreen .game-hud{position:relative!important;top:auto!important;flex:none!important;margin:0 0 4px!important;z-index:1!important}
body.wg-fullscreen .game-stats,body.wg-fullscreen .toolbar,body.wg-fullscreen .post-nav{display:none!important}
body.wg-fullscreen .grid-viewport{flex:1!important;min-height:0!important;overflow:auto!important;overscroll-behavior:contain!important;max-width:100%!important}
body.wg-fullscreen .related-scanwords{display:none!important}
@media(max-width:900px){
  body.wg-fullscreen .game-hud{padding:3px 39px 3px 3px!important}
  body.wg-fullscreen .active-clue-meta{display:none!important}
  body.wg-fullscreen .active-clue-bar{grid-template-columns:minmax(0,1fr) 24px 24px;gap:4px!important;padding:5px 7px!important;min-height:0!important}
  body.wg-fullscreen .active-clue-bar strong{grid-row:1;grid-column:1;font-size:12px!important;line-height:1.25!important;max-height:3.75em!important;overflow:auto!important}
  body.wg-fullscreen .active-clue-nav{grid-row:1;width:24px;height:28px;align-self:center}
  body.wg-fullscreen .active-clue-image{width:42px!important;height:28px!important}
  body.wg-fullscreen .wg-fullscreen-btn{top:4px;right:4px;width:30px;height:30px}
  body.wg-fullscreen .wg-game-nav{display:none!important}
  body.wg-fullscreen .active-answer-bar{min-height:30px!important;padding:2px 5px!important}
  body.wg-fullscreen .answer-slot{min-width:25px!important;height:26px!important;font-size:14px!important}
  body.wg-fullscreen .wg-mobile-keyboard{padding:4px 4px calc(4px + env(safe-area-inset-bottom))}
  body.wg-fullscreen .wg-mobile-keyboard::before{height:3px;margin-bottom:4px}
  body.wg-fullscreen .wg-mobile-keyboard::after{display:none}
  body.wg-fullscreen .wg-kbd-nav{margin-bottom:4px}
  body.wg-fullscreen .wg-kbd-nav .wg-key{height:28px;font-size:13px}
  body.wg-fullscreen .wg-kbd-nav .wg-word{font-size:9px}
  body.wg-fullscreen .wg-kbd-row{margin-bottom:3px}
  body.wg-fullscreen .wg-kbd-row .wg-key{height:38px;font-size:18px}
}
@media print{
  .game-side,.active-answer-bar{display:none!important}
  .scan-grid{box-shadow:none}
}
