/* iPhone layout: fit the useful controls first; allow natural scroll on short screens. */
.story-picture picture{display:block;width:100%;height:100%;min-height:0}
.audio-recovery{display:flex;align-items:center;justify-content:center;gap:10px;flex:none;padding:8px 12px;background:#fff4dd;color:#173c61;border-radius:14px;margin:0 0 8px}
.audio-recovery[hidden]{display:none}.audio-recovery p{margin:0;font-size:14px}.audio-recovery button{min-height:44px;flex:none}
@media(max-width:700px){
 body.halloween-game{--rrdd-header-height:48px;--rrdd-footer-height:0px;padding:0!important;min-height:100dvh;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
 body.halloween-game .topbar{height:48px;min-height:48px;padding:2px 10px}
 body.halloween-game .topbar .logo{width:80px;height:36px}
 body.halloween-game .header-tools{height:44px;gap:6px;padding:0}
 body.halloween-game .header-tools button{width:44px;height:44px;min-height:44px;padding:0}
 body.halloween-game .rrdd-game-header-spacer{height:48px;min-height:48px;flex:none}
 body.halloween-game .rrdd-game-footer,body.halloween-game .rrdd-display-bar{display:none!important}
 body.halloween-game main{width:100%;max-width:none;height:auto!important;min-height:0;flex:1;display:flex;flex-direction:column;padding:0 8px max(8px,env(safe-area-inset-bottom));gap:8px;overflow:auto}
 body.halloween-game .journey-score{position:relative;display:grid;grid-template-columns:1fr 1fr 1fr;grid-template-rows:46px 30px;align-items:center;gap:0;flex:none;height:78px;min-height:78px;padding:0 6px;margin:0}
 body.halloween-game .score-centre{grid-column:2;grid-row:1;position:static;line-height:1;text-align:center}
 body.halloween-game .score-centre>span{font-size:8px;letter-spacing:2px}
 body.halloween-game #journeyScore{font-size:42px;line-height:.85;display:block}
 body.halloween-game #scoreGain{display:none}
 body.halloween-game .journey-score .rrdd-challenge-timer{position:static;grid-column:1;grid-row:1;justify-self:start;margin:0}
 body.halloween-game .journey-score .rrdd-challenge-timer b{font-size:21px}
 body.halloween-game #starRoute{position:static;grid-column:1/-1;grid-row:2;width:min(100%,390px);height:30px;min-height:0;justify-self:center;gap:2px;padding:2px 7px;margin:0;box-sizing:border-box}
 body.halloween-game #starRoute button{width:auto;height:24px;min-height:0;flex:1;padding:0}
 body.halloween-game #starRoute svg{width:100%;height:100%;max-height:24px}
 body.halloween-game .view{height:auto!important;min-height:0;flex:1 0 auto;margin:0;box-sizing:border-box}
 body.halloween-game .view[hidden]{display:none!important}
 body.halloween-game #read{display:grid;grid-template-columns:1fr;grid-template-rows:minmax(100px,1fr) auto;gap:8px;flex:1 0 470px}
 body.halloween-game .story-picture{height:auto;min-height:100px;max-height:240px;margin:0;border-radius:18px}
 body.halloween-game .story-picture img{width:100%;height:100%;object-fit:cover;object-position:center}
 body.halloween-game .reading-card{padding:12px;gap:8px;overflow:visible;border-radius:18px;height:auto;min-height:0}
 body.halloween-game #sceneTitle,body.halloween-game .word-card>.eyebrow{display:none}
 body.halloween-game #sentence{font-size:21px;line-height:1.22;margin:0}
 body.halloween-game #readAgain,body.halloween-game #openMini{min-height:44px;font-size:15px;padding:9px 14px}
 body.halloween-game .word-card{display:grid;grid-template-columns:minmax(90px,.8fr) minmax(0,1.4fr);align-items:center;gap:8px;padding:9px;margin:0}
 body.halloween-game #word{font-size:20px;min-height:44px;text-align:left;padding:0}
 body.halloween-game #meaning{font-size:13px;line-height:1.35;margin:0}
 
 body.halloween-game #watch{flex:1 0 420px}
 body.halloween-game .watch-layout{height:100%;min-height:420px;display:grid;grid-template-columns:1fr;grid-template-rows:minmax(280px,1fr) auto;gap:8px;padding:0}
 body.halloween-game .film{height:100%;max-height:none;min-height:280px;width:auto;max-width:100%;aspect-ratio:9/16;justify-self:center}
 body.halloween-game .watch-copy{padding:4px 8px;text-align:center}
 body.halloween-game .watch-copy h1,body.halloween-game .watch-copy>.eyebrow,body.halloween-game .watch-copy>.small{display:none}
 body.halloween-game #watchStatus{font-size:13px;margin:0 0 8px}
 body.halloween-game #beginRead{min-height:44px;padding:9px 14px}
 body.halloween-game .play-view{padding:10px;flex:1 0 450px;overflow:visible}
 body.halloween-game .mini-header{gap:6px;grid-template-columns:minmax(0,1fr) 44px;align-items:center;min-height:44px}
 body.halloween-game #play .mini-header h2{font-size:20px;line-height:1.15;margin:0;grid-row:1;grid-column:1}
 body.halloween-game #hearMini{font-size:0;width:44px;height:44px;min-height:44px;padding:0;grid-row:1;grid-column:2}
 body.halloween-game #hearMini:before{content:'🔊';font-size:20px}
 body.halloween-game .board{min-height:300px}
 body.halloween-game .play-actions{flex-wrap:nowrap;gap:6px;min-height:44px}
 body.halloween-game .play-actions button{min-height:44px;white-space:nowrap}
 body.halloween-game #dragNote{width:auto;font-size:11px;line-height:1.25}
 body.halloween-game .feedback{font-size:12px;margin:4px 0}
 body.halloween-game .costume-wardrobe{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
 body.halloween-game .costume-wardrobe h3{grid-column:1/-1}
 body.halloween-game .costume-options{display:contents}
 body.halloween-game .costume-choice{width:100%;max-width:none;min-height:64px}
 body.halloween-game .costume-choice span{font-size:10px}
 body.halloween-game .memory-view{padding:10px;gap:8px;flex:1 0 440px;overflow:visible}
 body.halloween-game .memory-view .mini-header{display:block;min-height:0}
 body.halloween-game .memory-view h2{font-size:20px;margin:0}
 body.halloween-game .memory-clue{font-size:15px;min-height:44px;padding:8px}
 body.halloween-game .memory-view .book,body.halloween-game .memory-view.complete .book{min-height:180px;height:auto;max-height:270px;width:100%;aspect-ratio:3/2;flex:1 0 180px}
 body.halloween-game .memory-view .photo-tray{height:95px;min-height:95px;max-width:100%;width:100%;gap:8px}
 body.halloween-game .memory-view .photo-tray .photo{min-width:0;padding:4px;flex:1;height:95px}
 body.halloween-game .memory-view .photo-tray .photo span{font-size:10px}
 body.halloween-game .claim-trophy{font-size:17px;min-height:48px;max-width:100%;padding:10px}
 body.halloween-game .audio-recovery{gap:6px;padding:6px;margin:0}
 body.halloween-game .audio-recovery p{font-size:12px}
 body.halloween-game .audio-recovery button{font-size:13px;padding:7px}
}
@media(max-width:700px){
 body.halloween-game header.topbar.rrdd-game-header{height:48px!important;min-height:48px!important}
 body.halloween-game .rrdd-header-spacer{height:48px!important;min-height:48px!important;flex:none}
 body.halloween-game #read{flex-basis:420px}
}
@media(max-width:700px){
 body.halloween-game .journey-score:has(.score-preview-notice){grid-template-rows:46px 30px 14px;height:92px;min-height:92px}
 body.halloween-game .score-preview-notice{position:static;grid-column:1/-1;grid-row:3;margin:0;font-size:8px;line-height:12px;text-align:center}
 body.halloween-game .play-view{flex-basis:420px}
}

/* A single mobile scoreboard: five stars, centred score, five stars. */
.mobile-pause-exit{display:none}
.touch-drag-ghost{position:fixed!important;z-index:10000!important;pointer-events:none!important;touch-action:none!important;width:88px!important;height:88px!important;min-width:0!important;min-height:0!important;max-width:88px!important;padding:6px!important;margin:0!important;transform:translate(-50%,-105%) scale(1.08)!important;translate:none!important;opacity:1!important;outline:0!important;background:#fff4dc!important;border:3px solid #ffdc70!important;border-radius:16px!important;box-shadow:0 8px 18px #20113388!important}
.touch-drag-ghost>*{pointer-events:none!important}.touch-drag-ghost svg,.touch-drag-ghost img{width:100%!important;height:100%!important;object-fit:contain!important}.touch-drag-ghost>span:last-child:not(.cape-object){display:none!important}.touch-drag-ghost .cape-object{height:100%!important;width:100%!important}
.drag-source{opacity:.4!important}.drop-near{outline:4px solid #ffde68!important;outline-offset:4px;box-shadow:0 0 22px #ffe16dcc!important}
body.halloween-game [data-item],body.halloween-game .cape-choice{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
body.halloween-game .board[data-input-state=listening] .cape-choice,body.halloween-game .board[data-input-state=voice-error] .cape-choice{opacity:.5;filter:saturate(.5)}
@media(max-width:700px){
 body.halloween-game header.rrdd-game-header .rrdd-game-brand{left:8px!important;top:5px!important;transform:none!important;width:76px!important;height:36px!important;object-fit:contain}
 body.halloween-game header.rrdd-game-header .rrdd-game-exit{display:none!important}
 body.halloween-game header.rrdd-game-header .rrdd-game-tools{height:48px!important;min-height:48px!important;padding:2px 6px!important;gap:4px!important}
 body.halloween-game .journey-score .rrdd-challenge-timer{position:fixed!important;top:10px!important;right:104px!important;width:62px!important;height:30px!important;z-index:25!important;display:block!important;padding:0!important;margin:0!important;text-align:right;line-height:28px}
 body.halloween-game .journey-score .rrdd-challenge-timer b{font-size:22px!important;color:#ffce4d!important;text-shadow:0 2px #95723a!important;font-variant-numeric:tabular-nums}
 body.halloween-game .journey-score .rrdd-challenge-timer span,body.halloween-game .journey-score .rrdd-challenge-timer small{display:none!important}
 body.halloween-game .journey-score,body.halloween-game .journey-score:has(.score-preview-notice){height:58px;min-height:58px;grid-template-columns:repeat(5,minmax(0,1fr)) 76px repeat(5,minmax(0,1fr));grid-template-rows:58px;padding:0 5px;isolation:isolate}
 body.halloween-game .journey-score:before{content:'';position:absolute;left:0;right:0;top:14px;height:32px;z-index:-1;background:#392153;box-shadow:inset 0 0 6px #e1a9ff66;border:2px solid #af82d1;border-radius:24px}
 body.halloween-game .score-centre{grid-column:6;grid-row:1;align-self:center;z-index:1;padding:0 1px;background:#503065;border-radius:20px;min-width:0}
 body.halloween-game .score-centre>span{display:none}
 body.halloween-game #journeyScore{font-size:40px;line-height:1.1}
 body.halloween-game #journeyScore[data-digits='4']{font-size:29px}
 body.halloween-game #starRoute{display:contents}
 body.halloween-game #starRoute button{grid-row:1;align-self:center;width:100%;height:27px;padding:1px;min-width:0}
 body.halloween-game #starRoute svg{width:100%;height:100%;max-height:27px}
 body.halloween-game .score-preview-notice{position:absolute;bottom:-4px;left:0;right:0;font-size:7px;line-height:8px;pointer-events:none}
 .mobile-pause-exit{display:flex;align-items:center;justify-content:center;min-height:44px;margin-top:12px;color:#173c61;font-weight:800}
 body.halloween-game .audio-recovery{flex-wrap:wrap;gap:6px;padding:7px}
 body.halloween-game .audio-recovery p{flex:1 0 100%;text-align:center;font-weight:700}
 body.halloween-game .audio-recovery button{flex:1;min-height:44px;font-size:13px;white-space:nowrap}
 body.halloween-game .cape-paint-area{min-width:44px;min-height:44px}
}
@media(max-width:700px){
 body.halloween-game header .rrdd-challenge-timer{position:static!important;display:flex!important;align-items:center;justify-content:flex-end;width:62px!important;min-width:62px!important;height:44px!important;min-height:44px!important;background:transparent!important;border:0!important;padding:0!important;margin:0 4px 0 0!important}
 body.halloween-game header .rrdd-challenge-timer b{font:22px Froople,sans-serif!important;color:#ffcd45!important;text-shadow:0 2px #986b2f;font-variant-numeric:tabular-nums}
 body.halloween-game header .rrdd-challenge-timer span,body.halloween-game header .rrdd-challenge-timer small{display:none!important}
}
@media(max-width:700px){
 body.halloween-game.rrdd-game-shell header.rrdd-game-header .rrdd-game-tools{padding:2px 6px!important;height:48px!important;min-height:48px!important;gap:4px!important}
}
/* Keep the drop frame inside the printed left page, independently of grid padding. */
body.halloween-game .memory-view:not(.complete) #photoSlot{position:absolute;left:11%;top:19%;width:35%;height:54%;margin:0;padding:clamp(5px,1vw,12px);border-width:2px;box-sizing:border-box;overflow:hidden}
body.halloween-game .memory-view:not(.complete) #book>.album-overview{grid-column:2;grid-row:1}
body.halloween-game #photoSlot .empty-photo{font-size:clamp(24px,4vw,48px)}
/* Keep the overview thumbnails on the right page as the drop target is inset. */
body.halloween-game .memory-view:not(.complete) #book>.album-overview{position:absolute;left:54%;top:19%;width:35%;height:54%;padding:0}
body.halloween-game .memory-view:not(.complete) .album-overview>h3{position:absolute;top:-17%;left:-4%;width:108%;margin:0;font-size:clamp(10px,1.8vw,26px)}
@media(max-width:700px){
 body.halloween-game .memory-view:not(.complete) .album-overview .memories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:6px;width:100%;height:100%;align-content:center;align-items:center;justify-items:center}
 body.halloween-game .memory-view:not(.complete) .album-overview .memories .photo{width:100%;height:90%;min-height:0;max-height:100%;padding:3px;box-sizing:border-box}
 body.halloween-game .memory-view:not(.complete) .album-overview .memories .photo img{width:100%;height:100%;object-fit:contain}
 body.halloween-game .memory-view:not(.complete) .album-overview .memories .photo span{display:none}
}
