:root{--free-pix-loading-background:radial-gradient(circle at center,#21162c,#08060b 65%)}
.pixelating-screen[hidden]{display:none}
#loading{background:var(--free-pix-loading-background)}
#loading img{position:static;inset:auto;width:min(440px,75vw);height:auto;object-fit:contain;justify-self:center}
#loading span{transform:none;margin-top:24px;text-shadow:none}
[data-how-it-works][hidden]{display:none!important}
.pixelating-screen{position:fixed;inset:0;z-index:100;background:var(--free-pix-loading-background);display:flex;flex-direction:column;align-items:center;justify-content:safe center;overflow:auto;gap:24px;padding:24px;color:#fff8e7;text-align:center}
.pixelating-screen img{width:min(440px,75vw);height:auto;object-fit:contain}
#pixelatingText{min-height:1.5em;margin:0;font:700 clamp(22px,5vw,36px)/1.5 monospace;white-space:nowrap}
#pixelatingError{max-width:580px;font:600 18px/1.5 system-ui,sans-serif}
#pixelatingRecovery{color:#ffdc66;font:700 16px system-ui,sans-serif}
.pixelating-screen> *{flex-shrink:0}
#creationProgress{max-width:580px;line-height:1.5;overflow-wrap:anywhere}
#pixelatingRecovery:not([hidden]){min-height:44px;display:grid;place-content:center}
#pixelatingSupport:not([hidden]){min-height:44px;display:grid;place-content:center;color:#ffdc66;font:700 14px system-ui,sans-serif}
#howDialog .policy-links a{display:inline-flex;align-items:center;min-height:44px}
@media(max-height:500px){.pixelating-screen{gap:12px;padding:16px}.pixelating-screen img{max-height:30dvh}}
#howDialog{box-sizing:border-box;width:620px;max-width:calc(100vw - 32px);max-height:85vh;overflow:auto;color:#fff8e7;background:#15101d;border:1px solid #ffdc66;padding:24px;font:16px/1.5 system-ui,sans-serif}
#howDialog::backdrop{background:#000b}
#howDialog .how-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:14px;border-bottom:1px solid #493b51}
#howDialog h2{margin:0;color:#ffdc66;font:800 clamp(20px,4vw,28px)/1.25 monospace}
#howDialog .how-player{color:#67d7d1;font:800 13px monospace;white-space:nowrap;animation:how-player-blink 1.4s ease-in-out infinite}
@keyframes how-player-blink{0%,100%{opacity:1}50%{opacity:.65}}
#howDialog .how-steps{display:grid;gap:20px;list-style:none;padding:0;margin:22px 0}
#howDialog .how-steps li{--step-color:#67d7d1;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:start;gap:14px}
#howDialog .how-steps li:nth-child(even){--step-color:#ffdc66}
#howDialog .how-number{display:grid;place-items:center;width:38px;height:38px;box-sizing:border-box;border:1px solid var(--step-color);color:var(--step-color);font:800 18px monospace}
#howDialog h3{margin:0;color:var(--step-color);font:800 clamp(16px,3vw,19px)/1.35 monospace}
#howDialog .how-steps p{margin:4px 0 0;font-size:14px}
#howDialog .how-footer{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding-top:16px;border-top:1px solid #493b51}
#howDialog button{flex-shrink:0;padding:10px 16px;border:1px solid #ffdc66;color:#ffdc66;background:#09070c;font:800 14px monospace;cursor:pointer}
#howDialog button:hover{background:#30213b}
#howDialog button:focus-visible,#howDialog summary:focus-visible{outline:2px solid #67d7d1;outline-offset:4px}
#howDialog details{min-width:0;font-size:13px;margin:0;line-height:1.6}
#howDialog summary{cursor:pointer;color:#fff8e7;font-weight:700}
@media(max-width:480px){#howDialog{padding:18px}#howDialog .how-header{gap:10px}#howDialog .how-player{font-size:11px}#howDialog .how-steps{gap:18px}#howDialog .how-steps li{gap:10px}#howDialog .how-footer{flex-direction:column;gap:14px}#howDialog button{align-self:flex-end}}
@media(prefers-reduced-motion:reduce){#howDialog .how-player{animation:none}}

/* Free PIX Game Over only; normal Continue and legacy artwork remain unchanged. */
.free-pix-game-over-hero{display:contents}
.free-pix-game-over-splat{display:none}
body:has(#gameCompleteCard.pixed-end-card) #continueCard.game-over:not([hidden]){position:fixed;inset:0;z-index:90;display:grid;place-items:center;overflow:auto;padding:clamp(16px,4vw,40px);background:var(--free-pix-loading-background);container-type:normal}
body:has(#gameCompleteCard.pixed-end-card) .game-over .continue-artwork{position:relative;inset:auto;transform:none;display:grid;justify-items:center;gap:18px;width:min(640px,100%);aspect-ratio:auto;container-type:normal}
body:has(#gameCompleteCard.pixed-end-card) .game-over .continue-background{display:none}
body:has(#gameCompleteCard.pixed-end-card) .game-over .free-pix-game-over-hero{position:relative;isolation:isolate;display:grid;place-content:center;justify-items:center;gap:10px;width:100%;min-height:clamp(260px,48vmin,420px);padding:36px 8px}
body:has(#gameCompleteCard.pixed-end-card) .game-over .free-pix-game-over-splat{display:block;position:absolute;inset:0;z-index:-1;width:100%;height:100%;object-fit:contain;pointer-events:none}
body:has(#gameCompleteCard.pixed-end-card) .game-over #continueTitle{position:static;inset:auto;transform:none;width:auto;margin:0;color:#fff8e7;font:clamp(36px,8vmin,78px)/1.1 "Black Ops One",monospace;letter-spacing:.04em;text-shadow:3px 4px #160609;white-space:nowrap}
body:has(#gameCompleteCard.pixed-end-card) .game-over #continueCountdown{position:static;inset:auto;transform:none;margin:0;color:#ffdc66;font:clamp(80px,18vmin,152px)/1 "Black Ops One",monospace;font-variant-numeric:tabular-nums;text-align:center;text-shadow:3px 4px #160609}
body:has(#gameCompleteCard.pixed-end-card) .game-over #continueMessage{position:static;inset:auto;width:min(540px,100%);margin:0;color:#fff8e7;font:600 clamp(15px,2.4vmin,20px)/1.5 "Chakra Petch",sans-serif;text-shadow:none}
body:has(#gameCompleteCard.pixed-end-card) .game-over .continue-actions{position:static;inset:auto;display:flex;justify-content:center;flex-wrap:wrap;gap:14px;width:100%}
body:has(#gameCompleteCard.pixed-end-card) .game-over .continue-actions button{min-height:44px;max-width:100%;padding:12px 18px;font-size:clamp(13px,2vmin,17px);box-shadow:3px 3px #08060b}
@media(max-height:500px){body:has(#gameCompleteCard.pixed-end-card) .game-over .continue-artwork{gap:10px}body:has(#gameCompleteCard.pixed-end-card) .game-over .free-pix-game-over-hero{min-height:180px;padding:16px 8px}body:has(#gameCompleteCard.pixed-end-card) .game-over #continueTitle{font-size:36px}body:has(#gameCompleteCard.pixed-end-card) .game-over #continueCountdown{font-size:76px}}

/* Mobile presentation only. Desktop rules and original control nodes stay intact. */
.mobile-landscape-reminder{display:none}
@media(max-width:700px),(pointer:coarse){
  .mobile-landscape-reminder{display:block;max-width:34em;margin:0;color:#c8bfd0;font:400 13px/1.4 "Chakra Petch",system-ui,sans-serif;text-wrap:balance}
  .effects-controls.mobile-audio-row{display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;gap:8px;font-size:11px;max-width:100%;justify-self:center}
  .effects-controls.mobile-audio-row button{min-height:44px;min-width:56px;margin:0;padding:6px 8px;font-size:11px;white-space:nowrap}
  .effects-controls.mobile-audio-row label{gap:4px;white-space:nowrap}
  .effects-controls.mobile-audio-row input{width:60px;min-height:44px}
  .funnel-splash .topbar.funnel-header{grid-template-columns:90px minmax(0,1fr);gap:4px 8px;min-height:0}
  .funnel-splash .funnel-header .brand--free-pix{width:90px;grid-column:1;grid-row:1}
  .funnel-splash .funnel-header .effects-controls.mobile-audio-row{grid-column:2;grid-row:1;justify-self:end}
  .funnel-splash .funnel-header .funnel-nav{grid-column:1/-1;grid-row:2;flex-direction:row;justify-content:center;gap:16px;font-size:11px}
  #ownerRecoveryNotice{display:none}
  #continueCard #ownerRecoveryNotice,#gameCompleteCard.pixed-end-card #ownerRecoveryNotice{display:block;position:static;max-width:100%;margin:2px 0;font:400 12px/1.35 "Chakra Petch",system-ui,sans-serif;text-align:center;color:#c8bfd0}
  #ownerRecoveryNotice .recovery-explanation{display:none}
  #ownerRecoveryNotice a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:4px 8px;max-width:100%;color:#e8c97c;text-underline-offset:3px}
  .game-frame:has(>#gameCompleteCard.pixed-end-card:not([hidden])){height:calc(100dvh - 144px);min-height:0;max-height:none;aspect-ratio:auto;margin:0 auto}
  .game-frame:has(>#gameCompleteCard.pixed-end-card:not([hidden]))>canvas{position:absolute;inset:0}
  #continueCard .mobile-audio-row{position:static;transform:none;width:max-content;max-width:100%;margin:0 auto}
}
@media(orientation:landscape) and (pointer:coarse){
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))){grid-template-columns:56px minmax(0,1fr);align-content:center;align-items:center;gap:2px 8px;padding:6px}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) .pixed-end-logo{grid-column:1;grid-row:1/3;width:56px;margin:0}
  #gameCompleteCard.pixed-end-card>.eyebrow{grid-column:2;grid-row:1;font-size:9px;margin:0;line-height:1.2}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) #gameCompleteTitle{grid-column:2;grid-row:2;font-size:24px;line-height:1.05}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) #gameCompleteMessage{grid-column:1/-1;grid-row:3;font-size:12px;margin:0;line-height:1.2}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) #funnelCompletion{grid-column:1/-1;grid-row:4;grid-template-columns:1fr 1fr;gap:4px;width:min(640px,100%);margin:0 auto}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) #funnelCompletion :is(button,a){min-height:44px;padding:4px 8px;font-size:12px}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) #ownerRecoveryNotice{grid-column:1/-1;grid-row:5;margin:0}
}

/* Mobile Victory only: reclaim the header space without altering the HUD. */
@media(max-width:700px),(pointer:coarse){
  body:has(#gameCompleteCard.pixed-end-card:not([hidden])):not(:has(#customGameInformation:not([hidden]))) .topbar{display:none}
  body:has(#gameCompleteCard.pixed-end-card:not([hidden])):not(:has(#customGameInformation:not([hidden]))) .arcade-shell{
    grid-template-rows:1fr auto;gap:0;min-height:100dvh;
    padding-top:max(14px,env(safe-area-inset-top));
    padding-bottom:max(18px,env(safe-area-inset-bottom));
    padding-left:max(10px,env(safe-area-inset-left));
    padding-right:max(10px,env(safe-area-inset-right));
  }
  .game-frame:has(>#gameCompleteCard.pixed-end-card:not([hidden])):not(:has(#customGameInformation:not([hidden]))){
    height:calc(100dvh - max(14px,env(safe-area-inset-top)) - max(18px,env(safe-area-inset-bottom)));
  }
}

/* Continue retains the original content styles; only its mobile header is compact. */
@media(max-width:700px),(pointer:coarse){
  .topbar.mobile-continue-header{grid-template-columns:90px auto minmax(0,1fr);gap:4px;min-height:0}
  .mobile-continue-header .brand--free-pix{width:90px;grid-column:1;grid-row:1/3}
  .mobile-continue-header .funnel-nav{grid-column:2/4;grid-row:1;justify-content:center;font-size:10px}
  .mobile-continue-header>.sound{grid-column:2;grid-row:2;justify-self:start;padding:4px 6px;font-size:10px}
  .mobile-continue-header .effects-controls{grid-column:3;grid-row:2;justify-self:end;font-size:10px;gap:4px}
  .mobile-continue-header .effects-controls input{width:60px}
  .mobile-continue-header .effects-controls button{padding:4px 6px;font-size:10px}
  .game-frame:has(>#continueCard:not([hidden]):not(.game-over)){aspect-ratio:auto;height:auto;max-height:none}
  .game-frame:has(>#continueCard:not([hidden]):not(.game-over))>canvas{position:absolute;inset:0}
  #continueCard:not(.game-over){position:relative;inset:auto}
}
@media(orientation:landscape) and (pointer:coarse){
  .topbar.mobile-continue-header,.funnel-splash .topbar.funnel-header{min-height:0;height:36px;padding:2px 6px;gap:6px;grid-template-columns:minmax(80px,1fr) auto auto auto}
  .mobile-continue-header .brand--free-pix,.funnel-splash .funnel-header .brand--free-pix{grid-column:1;grid-row:1;width:100px;font-size:16px}
  .mobile-continue-header .free-pix-header-logo,.funnel-splash .funnel-header .free-pix-header-logo{max-height:28px}
  .mobile-continue-header .funnel-nav,.funnel-splash .funnel-header .funnel-nav{grid-column:2;grid-row:1}
  .mobile-continue-header>.sound,.funnel-splash .funnel-header>.sound{grid-column:3;grid-row:1}
  .mobile-continue-header .effects-controls,.funnel-splash .funnel-header .effects-controls{grid-column:4;grid-row:1}
  .funnel-splash .funnel-header .funnel-nav{flex-direction:row;align-items:center;gap:22px;font-size:10px}
  .funnel-splash .funnel-header>.sound{padding:4px 6px;font-size:10px}
  .funnel-splash .funnel-header .effects-controls{font-size:10px;gap:4px;justify-self:end}
  .funnel-splash .funnel-header .effects-controls button{padding:4px 6px;font-size:10px}
  .funnel-splash .funnel-header .effects-controls input{width:60px}
  .funnel-splash .topbar.funnel-header{margin-left:max(0px,calc(env(safe-area-inset-left,0px) - clamp(10px,2vw,28px)));margin-right:max(0px,calc(env(safe-area-inset-right,0px) - clamp(10px,2vw,28px)))}
}
@media(orientation:landscape) and (pointer:coarse) and (max-width:700px){
  .funnel-splash .funnel-header .funnel-nav{gap:8px}
}
@media(orientation:landscape) and (pointer:coarse) and (max-width:600px){
  .funnel-splash .topbar.funnel-header{grid-template-columns:minmax(56px,1fr) auto auto auto;gap:4px}
  .funnel-splash .funnel-header .brand--free-pix{width:80px}
}
@media(orientation:landscape) and (pointer:coarse){
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))){grid-template-columns:minmax(0,1fr);align-content:safe center;padding:8px 10px}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) .pixed-end-logo{display:none}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden])))>.eyebrow{grid-column:1;grid-row:1}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) #gameCompleteTitle{grid-column:1;grid-row:2}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) #gameCompleteMessage{grid-column:1;grid-row:3}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) #funnelCompletion{grid-column:1;grid-row:4;grid-template-columns:minmax(0,1fr);width:min(480px,100%);margin-top:10px}
  #gameCompleteCard.pixed-end-card:not(:has(#customGameInformation:not([hidden]))) #ownerRecoveryNotice{grid-column:1;grid-row:5}
}
