/* Modular game-specific visual theme, layered over the existing Haulin Hope Arcade skin. */
body{background:radial-gradient(ellipse at 50% 0%,#56230f 0%,#151012 44%,#080809 100%)}
.stage{border-color:#fb8c35;box-shadow:0 0 0 4px #271609,0 0 34px #f6722166,0 18px 45px #000b}
.stage::after{content:'';position:absolute;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 24px #020205aa}
.brand h1{letter-spacing:.3px}.hud .stat{box-shadow:0 0 13px #f8702460,inset 0 2px 8px #fff1}
#game{image-rendering:auto;user-select:none;-webkit-user-select:none}
#start:disabled{filter:grayscale(.5);opacity:.6;cursor:not-allowed}
#left,#right{font-size:23px;font-weight:900;border-radius:12px;min-width:82px;padding:9px 16px;
background:linear-gradient(#353032,#0f1113);border:2px solid #fa8e38;color:white;touch-action:none;user-select:none}
.touch-controls{display:flex;justify-content:center;gap:20px;margin-top:12px}
.touch-controls p{margin:0;align-self:center;color:#cbbcae;font-size:12px}
.overlay{background:rgba(6,6,8,.77)}.overlay-card{background:linear-gradient(145deg,#301c15,#0b0b0c 76%)}
.flash{text-transform:uppercase;-webkit-text-stroke:1px #431c0a;z-index:2;top:34%}
@media (min-width:750px){.touch-controls{display:none}}
@media (max-width:540px){.touch-controls{gap:9px}.touch-controls p{font-size:10px}
  .flash{font-size:clamp(30px,8vw,54px)}.overlay-card{padding:18px 13px}}
/* Explicit copy colours also cover browsers where inherited root text differs. */
body{color:#fff}
.brand h1{color:#fff}
.brand small,.stat small,.footer small{color:#f1dbc6}
.footer p,.controls{color:#e7d0bf}

/* 01A mobile ergonomics: legible 2x2 scoreboard and a full-height pause button.
   Canvas remains aspect-locked, with pointer capture and wide touch targets. */
@media (max-width: 540px) {
  .shell {padding-inline: max(7px, env(safe-area-inset-left)) max(7px, env(safe-area-inset-right));}
  .hud {grid-template-columns:repeat(2,minmax(0,1fr)) 48px;gap:6px;}
  .hud .stat:nth-child(1){grid-column:1;grid-row:1}
  .hud .stat:nth-child(2){grid-column:2;grid-row:1}
  .hud .stat:nth-child(3){grid-column:1;grid-row:2}
  .hud .stat:nth-child(4){grid-column:2;grid-row:2}
  .hud #pause {grid-column:3;grid-row:1/span 2;min-width:44px;min-height:80px;align-self:stretch}
  .stat {min-height:42px}
  .stat small {font-size:10px;letter-spacing:.7px}
  .stat strong {font-size:clamp(22px,6vw,29px)}
  .hearts strong {font-size:clamp(18px,5vw,27px)}
  .touch-controls {align-items:center;justify-content:space-between;margin-top:9px;gap:8px}
  .touch-controls button {min-height:48px;flex:1;padding:10px 6px;white-space:nowrap}
  .touch-controls p {max-width:95px;text-align:center;line-height:1.25}
  .footer {grid-template-columns:1fr 1fr;gap:7px}
  .footer p {grid-column:1/-1;grid-row:2;margin:4px 0 0}
  .footer>div {min-width:0}
}
@media (max-width: 360px) {
  header{gap:5px}
  .brand small{letter-spacing:1px;font-size:9px}
  .brand h1{font-size:clamp(20px,6vw,27px)}
  .touch-controls p{font-size:10px}
}
/* Landscape touch devices can still use large hold-to-move buttons. */
@media (min-width:750px) and (pointer:coarse) {.touch-controls{display:flex}}
@media (max-height:540px) and (orientation:landscape) and (pointer:coarse){
  .shell{max-width:650px}
  .brand h1{font-size:clamp(22px,4vw,32px)}
  .touch-controls{margin-top:5px}
}
#left:focus-visible,#right:focus-visible,#pause:focus-visible,#sound:focus-visible,#start:focus-visible{
  outline:3px solid #fff3c6;outline-offset:3px;
}
@media (max-width:540px) {
  .touch-controls button{font-size:clamp(15px,4.8vw,19px);line-height:1.1;}
  .touch-controls p{flex:0 1 95px;min-width:0}
}
@media (max-width:540px) {
  .touch-controls #left,.touch-controls #right{font-size:clamp(15px,4.8vw,19px);}
}
/* Playable landscape layout for touch phones: game in the middle, HUD/controls at either side. */
@media (orientation:landscape) and (max-height:540px) and (min-width:600px) and (pointer:coarse) {
  .shell{
    width:100%;max-width:none;height:100dvh;min-height:300px;
    display:grid;grid-template-columns:minmax(145px,1fr) calc((100dvh - 16px) * .8) minmax(145px,1fr);
    grid-template-rows:auto 1fr;align-items:start;gap:5px;padding:5px;
  }
  header{grid-column:1;grid-row:1;display:flex;flex-wrap:wrap;justify-content:center;gap:4px;padding:0}
  .brand{order:3;flex-basis:100%}
  .brand small{font-size:9px;letter-spacing:1px}
  .brand h1{font-size:clamp(18px,3.3vw,25px);line-height:.95;margin:2px 0}
  .back,.square{font-size:13px;min-width:38px;padding:5px 8px;border-radius:9px}
  .hud{grid-column:1;grid-row:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;gap:5px}
  .hud .stat{min-height:55px;padding:2px}
  .hud .stat small{font-size:9px;letter-spacing:0}
  .hud .stat strong{font-size:22px}
  .hud #pause{grid-column:1/-1;min-height:44px}
  .stage{grid-column:2;grid-row:1 / 3;align-self:center;border-radius:12px;border-width:2px;max-width:none}
  .touch-controls{grid-column:3;grid-row:1;display:flex;flex-direction:column;gap:6px;margin:0}
  .touch-controls p{display:none}
  .touch-controls #left,.touch-controls #right{min-height:50px;width:100%;font-size:18px;padding:5px}
  .footer{grid-column:3;grid-row:2;display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:2px 0 0}
  .footer>div{padding:4px 1px}
  .footer small{font-size:9px;letter-spacing:.1px}
  .footer strong{font-size:19px}
  .footer p{grid-column:1/-1;grid-row:2;font-size:11px;line-height:1.2;margin:5px 0}
  .safety{display:none}
  .overlay{padding:5px}
  .overlay-card{border-radius:12px;padding:9px 6px}
  .stamp{font-size:8px;letter-spacing:.3px}
  .overlay h2{font-size:clamp(21px,5.3vh,29px);margin:5px 0}
  .overlay p{font-size:11px;line-height:1.25;margin:5px 0}
  .play{font-size:13px;border-radius:9px;padding:7px 8px}
  .controls{display:none}
  .flash{font-size:clamp(20px,5vw,36px)}
}
/* Keep the whole playing field and controls in reach on tall touch tablets. */
@media (min-width:541px) and (orientation:portrait) and (pointer:coarse) {
  .stage {max-width:min(100%,calc((100dvh - 320px) * .8));margin-inline:auto;}
  .touch-controls {max-width:640px;margin-inline:auto;}
}

/* 01C Desktop sizing: the playable canvas scales visually while game coordinates
   remain 600 x 750. Do not apply to touch phones/landscape side-by-side layout. */
.size-tools {display:none}
@media (min-width: 750px) and (pointer: fine) {
  .shell {max-width:min(850px, max(560px, calc(var(--stage-size, 480px) + 48px)));padding-top:7px;padding-bottom:13px}
  header{padding:3px 0 7px;gap:8px}
  .brand h1{font-size:clamp(25px,3.4vw,35px);line-height:.9;margin:3px 0}
  .brand small{font-size:10px;letter-spacing:1.2px}
  .back{padding:8px 10px}
  header>.square{padding:8px 9px}
  .footer{margin-top:8px}
  .footer>div{padding:5px}
  .footer strong{font-size:23px}
  .safety{margin-top:8px}

  .stage {width:min(100%, var(--stage-size, 480px));margin-left:auto;margin-right:auto}
  .size-tools {
    display:flex;align-items:center;justify-content:center;gap:9px;
    border:1px solid #754322;border-radius:13px;
    background:linear-gradient(160deg,#251b18,#101011);padding:7px 12px;
    margin:0 auto 9px;box-shadow:0 3px 18px #0008;
  }
  .size-title {font:800 12px 'Barlow Condensed',Impact,sans-serif;letter-spacing:1px;color:#f3c9a3;white-space:nowrap}
  .size-tools button {flex:0 0 auto;color:#fff;cursor:pointer;background:#31221b;border:1px solid #db782f;border-radius:8px;font-weight:800;min-height:34px}
  .size-tools .size-step{width:36px;font-size:21px;line-height:1}
  .size-tools .size-fit{padding:5px 11px;font-size:11px;white-space:nowrap;letter-spacing:.5px}
  .size-tools .size-fit[aria-pressed="true"]{background:#8b410d;border-color:#ffac4d}
  .size-tools input[type="range"]{flex:1 1 130px;min-width:75px;max-width:200px;accent-color:#ff8d2b;cursor:pointer;height:24px}
  .size-tools output{min-width:46px;text-align:right;color:#ffad66;font:800 14px 'Barlow Condensed',Impact,sans-serif;white-space:nowrap}
  .size-tools :focus-visible{outline:3px solid #ffdf9c;outline-offset:2px}
}
@media (prefers-reduced-motion:reduce){.size-tools button{transition:none}}
