/* v0.2.21 artwork layer */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;white-space:nowrap!important;}

/* Generated decorative artwork replaces the CSS-drawn map surface and rails. */
#app{
  background-image:url("assets/desktop-map-bg.png")!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
  background-size:100% 100%!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
#app::before,#app::after{content:none!important;display:none!important;}
.map-rail-left,.map-rail-right{display:none!important;}

/* Purpose-built logo asset remains real artwork layered above the map. */
#app-header{pointer-events:none;}
#game-logo{display:block;width:100%;height:auto;margin:0 auto;object-fit:contain;filter:drop-shadow(0 7px 7px rgba(70,48,20,.36));}
#app-header #subtitle{display:none!important;}

/* Standalone tagline artwork, separated from the map background. */
#mobile-tagline{
  display:block!important;
  pointer-events:none!important;
  text-decoration:none!important;
  transform:none!important;
}
#bwsq-art{
  display:block!important;
  width:100%!important;
  height:auto!important;
}

/* The sound toggle lives beside Menu while retaining its existing toggle logic. */
#menu-control #sound-toggle-button{
  margin:0!important;
  min-width:0!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  transform:none!important;
  box-shadow:0 5px 14px rgba(0,0,0,.44)!important;
}
#menu-control #sound-toggle-button:hover{transform:none!important;}
#menu-control #sound-toggle-button:active{transform:scale(.94)!important;}

/* Drive the visible icon directly from the button state so the mute glyph is
   unambiguous even when earlier SVG display rules are present. */
#menu-control #sound-toggle-button[aria-pressed="false"] #sound-on-icon{display:block!important;}
#menu-control #sound-toggle-button[aria-pressed="false"] #sound-off-icon{display:none!important;}
#menu-control #sound-toggle-button[aria-pressed="true"] #sound-on-icon{display:none!important;}
#menu-control #sound-toggle-button[aria-pressed="true"] #sound-off-icon{display:block!important;}

/* Sound-on gets the same thin blue line used around the scoring panel. */
#menu-control #sound-toggle-button[aria-pressed="false"]{
  border:1px solid rgba(18,85,114,.42)!important;
  outline:1px solid rgba(18,85,114,.42)!important;
  outline-offset:-1px!important;
}
#menu-control #sound-toggle-button[aria-pressed="true"]{
  border:1px solid rgba(70,70,55,.2)!important;
  outline:0!important;
}

/* Match the normal countdown to the scoreboard ink; preserve the existing
   glowing danger treatment once the timer enters its final three seconds. */
#timer-value:not(.timer-danger){
  color:var(--map-ink)!important;
  text-shadow:none!important;
}
#timer-value.timer-danger{
  color:var(--color-danger)!important;
  text-shadow:0 0 16px rgba(239,68,68,.45)!important;
}

/* Slightly deeper Start blue, stronger drop shadows throughout the interface,
   and clean white rings around the place images on desktop and mobile. */
#difficulty-select{box-shadow:0 4px 8px rgba(64,48,28,.34)!important;}
#start-game-button{
  background:linear-gradient(#157acd,#0460ae)!important;
  box-shadow:0 5px 10px rgba(21,59,82,.56)!important;
}
#menu-button{box-shadow:0 4px 8px rgba(64,48,28,.36)!important;}
.city-image-frame{
  border-color:#fff!important;
  box-shadow:0 4px 10px rgba(44,40,30,.4)!important;
}
.city-name{box-shadow:0 3px 7px rgba(61,48,30,.36)!important;}
.city-card.correct-card .city-image-frame{
  box-shadow:0 0 0 7px rgba(34,197,94,.42),0 4px 10px rgba(44,40,30,.4)!important;
}
.city-card.incorrect-card .city-image-frame{
  box-shadow:0 0 0 7px rgba(239,68,68,.42),0 4px 10px rgba(44,40,30,.4)!important;
}
#score-popup{box-shadow:0 16px 36px rgba(0,0,0,.84)!important;}
#menu-panel{box-shadow:0 18px 40px rgba(0,0,0,.84)!important;}

/* Keep status/instruction copy strong and on a single line. */
#status-message{font-weight:900!important;white-space:nowrap!important;}

/* Desktop artwork sits over a repeating upholstery tile rendered at 150% scale. */
@media (min-width:901px), (max-width:900px) and (hover:hover) and (pointer:fine){
  body{
    background-image:url("assets/car-seat-fabric-tile.jpg")!important;
    background-repeat:repeat!important;
    background-size:768px 768px!important;
    background-position:center center!important;
  }
  body::after{content:none!important;display:none!important;}
}

@media (min-width:901px){
  #app-header{top:calc(4.5% + 15px)!important;left:22.5%!important;right:22.5%!important;}
  #game-logo{width:612px;max-width:100%;}
  #top-stats{top:calc(29.1% - 20px)!important;}
  #round-control{
    top:calc(39.5% - 20px)!important;
    width:592px!important;
    grid-template-columns:360px 196px!important;
    transform:translateX(-180px)!important;
  }
  #difficulty-control{width:360px!important;}
  #difficulty-select{width:360px!important;font-size:19.04px!important;}
  #start-game-button,#round-timer{width:360px!important;}
  #start-game-button{height:77px!important;font-size:36px!important;}
  #round-timer{height:72px!important;}
  #status-panel{top:calc(56.3% - 20px)!important;width:600px!important;}
  #status-message{font-size:22.1px!important;}
  #game-board{top:calc(61.8% - 20px)!important;}
  #menu-control{
    position:relative!important;
    width:128px!important;
    overflow:visible!important;
  }
  #menu-button{
    width:128px!important;
    height:58px!important;
  }
  #menu-control #sound-toggle-button{
    position:absolute!important;
    left:138px!important;
    right:auto!important;
    top:0!important;
    bottom:auto!important;
    width:58px!important;
    height:58px!important;
    border-radius:10px!important;
  }
  #mobile-tagline{
    position:absolute!important;
    right:2.7%!important;
    bottom:4.6%!important;
    left:auto!important;
    top:auto!important;
    width:225px!important;
    max-width:none!important;
    margin:0!important;
    z-index:3!important;
  }
}

@media (max-width:900px){
  #app{
    background-image:url("assets/mobile-map-bg.png")!important;
    background-position:center top!important;
    background-size:100% 100%!important;
    padding-top:21px!important;
  }
  #app-header{margin-bottom:15px!important;}
  #game-logo{width:min(79vw,414px);max-height:185px;}

  /* Move the full interactive stack upward without moving the logo. */
  #menu-control,
  #difficulty-control,
  #start-game-button,
  #round-timer,
  #game-board{
    position:relative!important;
    top:-8px!important;
  }
  #top-stats{
    width:100%!important;
    align-self:center!important;
    margin-left:auto!important;
    margin-right:auto!important;
    transform:translateY(-8px)!important;
  }

  #menu-control{
    overflow:visible!important;
  }
  #menu-control #sound-toggle-button{
    position:absolute!important;
    left:calc(100% + 8px)!important;
    right:auto!important;
    top:0!important;
    bottom:0!important;
    width:auto!important;
    height:auto!important;
    aspect-ratio:1 / 1!important;
    border-radius:9px!important;
  }

  #top-stats{margin-bottom:5px!important;}
  #round-control{margin-bottom:4px!important;gap:5px!important;}
  #difficulty-select{height:40px!important;font-size:19.04px!important;}
  #start-game-button,#round-timer{height:54px!important;}
  #menu-button{
    height:auto!important;
    min-height:0!important;
    padding-top:4px!important;
    padding-bottom:4px!important;
  }
  #status-panel{
    display:block!important;
    position:relative!important;
    top:6px!important;
    width:calc(100% - 24px)!important;
    max-width:none!important;
    min-height:16px!important;
    margin:0 auto 3px!important;
    text-align:center!important;
  }
  #status-message{
    margin:0!important;
    font-size:clamp(13px,3.25vw,16.9px)!important;
    line-height:1.15!important;
  }
  #game-board{padding-top:0!important;}
  #game-board::after{content:none!important;display:none!important;}

  #mobile-tagline{
    position:fixed!important;
    left:50%!important;
    right:auto!important;
    top:auto!important;
    bottom:calc(env(safe-area-inset-bottom,0px) + 20px)!important;
    width:min(42vw,175px)!important;
    max-width:none!important;
    margin:0!important;
    transform:translateX(-50%)!important;
    z-index:20!important;
  }
}

@media (max-width:430px){
  #game-logo{width:min(81vw,360px);max-height:171px;}
  #mobile-tagline{width:min(40vw,160px)!important;}
}

/* Short mobile viewports need a denser vertical composition so Safari chrome
   does not push the cards and place labels below the usable viewport. */
@media (max-width:900px) and (max-height:760px) and (hover:none),
       (max-width:900px) and (max-height:760px) and (pointer:coarse){
  #app{padding-top:17px!important;padding-bottom:12px!important;}
  #app-header{margin-bottom:13px!important;}
  #game-logo{width:min(70vw,288px)!important;max-height:144px!important;}
  #top-stats{padding-top:5px!important;padding-bottom:5px!important;margin-bottom:3px!important;}
  .stat-value{margin-top:2px!important;}
  #round-control{gap:4px!important;margin-bottom:2px!important;}
  #difficulty-select{height:34px!important;}
  #start-game-button,#round-timer{height:48px!important;}
  #menu-button{height:auto!important;}
  #status-panel{top:2px!important;min-height:13px!important;margin-bottom:1px!important;}
  #status-message{font-size:13px!important;line-height:1.1!important;}
  #game-board{padding-top:0!important;padding-bottom:72px!important;}
  #mobile-tagline{width:min(34vw,132px)!important;bottom:calc(env(safe-area-inset-bottom,0px) + 16px)!important;}
}

/* Narrow desktop windows must stay in the exact desktop composition instead of
   falling through the <=900px mobile reflow. desktop-scale.js adds this class
   for non-mobile pointer environments and scales the whole 1536x1024 canvas. */
html.desktop-canvas-mode,html.desktop-canvas-mode body{
  width:100%!important;
  height:100%!important;
  overflow:hidden!important;
}
html.desktop-canvas-mode body{
  position:relative!important;
  display:block!important;
  min-height:0!important;
  background-image:url("assets/car-seat-fabric-tile.jpg")!important;
  background-repeat:repeat!important;
  background-size:768px 768px!important;
  background-position:center center!important;
}
html.desktop-canvas-mode body::after{content:none!important;display:none!important;}
html.desktop-canvas-mode #app{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  width:1536px!important;
  height:1024px!important;
  min-height:0!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  display:block!important;
  flex-direction:initial!important;
  overflow:hidden!important;
  transform:translate(-50%,-50%) scale(var(--desktop-scale,1))!important;
  transform-origin:center center!important;
  background-image:url("assets/desktop-map-bg.png")!important;
  background-position:center!important;
  background-size:100% 100%!important;
}
html.desktop-canvas-mode #app-header{
  position:absolute!important;
  top:calc(4.5% + 15px)!important;
  left:22.5%!important;
  right:22.5%!important;
  width:auto!important;
  margin:0!important;
}
html.desktop-canvas-mode #game-logo{
  width:612px!important;
  max-width:100%!important;
  max-height:none!important;
}
html.desktop-canvas-mode #top-stats{
  position:absolute!important;
  left:19.5%!important;
  top:calc(29.1% - 20px)!important;
  width:164px!important;
  display:flex!important;
  flex-direction:column!important;
  margin:0!important;
  padding:14px 16px!important;
}
html.desktop-canvas-mode .stat-card{
  text-align:left!important;
  padding:5px 0!important;
  border-right:0!important;
}
html.desktop-canvas-mode .stat-label{font-size:12px!important;}
html.desktop-canvas-mode .stat-value{font-size:23px!important;}
html.desktop-canvas-mode #round-control{
  position:absolute!important;
  left:50%!important;
  top:calc(39.5% - 20px)!important;
  width:592px!important;
  height:auto!important;
  margin:0!important;
  display:grid!important;
  grid-template-columns:360px 196px!important;
  grid-template-areas:"difficulty ." "start menu"!important;
  column-gap:36px!important;
  row-gap:14px!important;
  transform:translateX(-180px)!important;
}
html.desktop-canvas-mode #difficulty-control{
  position:static!important;
  width:360px!important;
  transform:none!important;
  grid-area:difficulty!important;
  justify-self:start!important;
}
html.desktop-canvas-mode #difficulty-select{
  width:360px!important;
  height:54px!important;
  font-size:19.04px!important;
}
html.desktop-canvas-mode #start-game-button,
html.desktop-canvas-mode #round-timer{
  grid-area:start!important;
  width:360px!important;
  justify-self:start!important;
}
html.desktop-canvas-mode #start-game-button{
  height:77px!important;
  font-size:36px!important;
}
html.desktop-canvas-mode #round-timer{height:72px!important;}
html.desktop-canvas-mode #menu-control{
  position:relative!important;
  top:auto!important;
  right:auto!important;
  width:128px!important;
  transform:none!important;
  grid-area:menu!important;
  justify-self:start!important;
  align-self:center!important;
  overflow:visible!important;
}
html.desktop-canvas-mode #menu-button{
  width:128px!important;
  height:58px!important;
  font-size:17px!important;
}
html.desktop-canvas-mode #menu-control #sound-toggle-button{
  position:absolute!important;
  left:138px!important;
  right:auto!important;
  top:0!important;
  bottom:auto!important;
  width:58px!important;
  height:58px!important;
  border-radius:10px!important;
}
html.desktop-canvas-mode #status-panel{
  display:block!important;
  position:absolute!important;
  left:50%!important;
  right:auto!important;
  top:calc(56.3% - 20px)!important;
  width:600px!important;
  margin:0!important;
  transform:translateX(-50%)!important;
  text-align:center!important;
}
html.desktop-canvas-mode #status-message{font-size:22.1px!important;}
html.desktop-canvas-mode #game-board{
  position:absolute!important;
  left:30%!important;
  right:auto!important;
  top:calc(61.8% - 20px)!important;
  bottom:auto!important;
  width:40%!important;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  grid-template-columns:235px 88px 235px!important;
  gap:22px!important;
  justify-content:center!important;
  align-items:start!important;
}
html.desktop-canvas-mode .city-card{
  width:235px!important;
  max-width:none!important;
}
html.desktop-canvas-mode .city-image-frame{
  width:228px!important;
  max-width:none!important;
  border-width:7px!important;
}
html.desktop-canvas-mode .city-name{font-size:18px!important;}
html.desktop-canvas-mode .state-name{font-size:11px!important;}
html.desktop-canvas-mode .population{font-size:20px!important;}
html.desktop-canvas-mode #versus{
  margin-top:96px!important;
  font-size:50px!important;
}
html.desktop-canvas-mode #mobile-tagline{
  position:absolute!important;
  right:2.7%!important;
  bottom:4.6%!important;
  left:auto!important;
  top:auto!important;
  width:225px!important;
  max-width:none!important;
  margin:0!important;
  transform:none!important;
  z-index:3!important;
}
html.desktop-canvas-mode #app-footer{display:none!important;}
html.desktop-canvas-mode #score-popup{
  top:108px!important;
  width:280px!important;
  padding:14px 16px 12px!important;
}