/* The preview projects the same combat ground onto the backdrop. */
#select-screen {
  isolation: isolate;
  position: relative;
}
#select-screen::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: var(--floor-art-height, 100%);
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(0deg, #080f18 0%, #09131b44 35%, #06101b82),
    var(--picked-map, url('assets/arenas/hangar-realista.png')) center / 100% 100%;
  mask-image: linear-gradient(#000 87%, transparent);
}
#select-screen {
  background: #080f18;
}
#select-screen .showcase-art img {
  object-position: center;
}
#select-screen .showcase-halo {
  inset: auto 25% auto;
  top: var(--portrait-ground, 92%);
  height: 6%;
  transform: translateY(-40%);
}
#select-screen .stat-line span { white-space: nowrap; }
#select-screen .fighter-extra .stat-line {
  grid-template-columns: 95px repeat(5, 13px);
}

:root {
  --hud-life: clamp(16px, 2.5vh, 28px);
  --hud-energy: clamp(10px, 1.5vh, 17px);
  --hud-track: #081421df;
  --hud-gold: linear-gradient(0deg, #d78812, #ffda69);
  --hud-blue: linear-gradient(0deg, #2087aa, #a3edff);
}
#battle-shell .health-bar, #street-stage .street-health, .online-hud progress {
  height: var(--hud-life);
}
#battle-shell .meter-bar, #street-stage .street-meter, .online-hud progress.online-energy {
  height: var(--hud-energy);
  width: 100%;
}
#battle-shell :is(.health-bar,.meter-bar), #street-stage :is(.street-health,.street-meter), .online-hud progress {
  background: var(--hud-track);
  border: 1px solid #b8d1e3a6;
  box-shadow: 0 3px 9px #0009;
  transform: skewX(-9deg);
  border-radius: 2px;
  overflow: hidden;
}
#battle-shell :is(.health-fill,.meter-bar > div), #street-stage :is(.street-health i,.street-meter i) {
  background: var(--hud-gold);
}
#battle-shell .right-hud :is(.health-fill,.meter-bar > div), #street-stage .street-enemy-hud .street-health i {
  background: var(--hud-blue);
}
.online-hud progress { appearance: none; }
.online-hud progress::-webkit-progress-bar { background: var(--hud-track); }
.online-hud progress::-webkit-progress-value { background: var(--hud-gold); }
.online-hud section:last-child progress::-webkit-progress-value { background: var(--hud-blue); }
.online-hud progress::-moz-progress-bar { background: var(--hud-gold); }
.online-hud section:last-child progress::-moz-progress-bar { background: var(--hud-blue); }

:fullscreen :is(#select-screen,#splash-screen,#main-menu,#street-menu,#online-lobby):not([hidden]) {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
}
:fullscreen :is(.topbar,.street-topbar,.online-topbar) {
  position: absolute;
  inset: 0 0 auto;
  z-index: 8;
}
:fullscreen :is(#select-screen,#street-menu,#online-lobby) { padding-top: 50px; }
:fullscreen :is(#game-screen,#street-play,#online-battle):not([hidden]),
:fullscreen:is(#battle-shell,#street-stage,#online-battle-shell) {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
}
:fullscreen :is(#battle-shell,#street-stage,#online-battle-shell) {
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}
:fullscreen :is(#game-canvas,#street-game canvas,#online-canvas) {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: fill;
}
:fullscreen #game-screen .game-toolbar {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 6;
  background: #071019c0;
}
:fullscreen #online-battle .online-hud { position: absolute; inset: 12px 5% auto; z-index: 2; }
:fullscreen #online-battle .online-battle-footer { position: absolute; inset: auto 0 0; z-index: 2; }
:fullscreen .playing .topbar { display: none; }
@media (max-height: 500px) {
  :root { --hud-life: 12px; --hud-energy: 7px; }
}


#street-menu {
  background: linear-gradient(0deg,#080f18 0%,#09131b55 35%,#06101b88),
    url('assets/arenas/hangar-realista.png') center top / 100% var(--street-floor-height, 100%) no-repeat #080f18;
}
:fullscreen :is(.street-top,.online-header) {
  position:absolute;
  top:0;
  z-index:8;
}
:fullscreen body:has(#street-play:not([hidden])) .street-top,
:fullscreen body:has(#online-battle:not([hidden])) .online-header {display:none}
#battle-shell :is(.coop-health-bar,.coop-meter-bar) {
  background: var(--hud-track);
  border: 1px solid #b8d1e3a6;
  transform: skewX(-9deg);
  border-radius: 2px;
}
#battle-shell .coop-health-bar { height: var(--hud-life); }
#battle-shell .coop-meter-bar { height: var(--hud-energy); }
#battle-shell :is(.coop-health-bar,.coop-meter-bar) > div { background: var(--hud-blue); }

/* Keep the active arena visible behind its pause commands. */
#game-screen .game-toolbar[hidden] { display: none; }
#pause-overlay:not([hidden]) {
  display: grid;
  place-items: center start;
  padding: 4% 6%;
  background: linear-gradient(90deg, #07111bd9, #07111b35 49%, transparent 72%);
  backdrop-filter: none;
}
#pause-overlay .overlay-card {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  justify-items: start;
}
#pause-overlay h2 {
  margin: 0 0 12px;
  font: italic clamp(38px, 6vw, 86px)/1 'Bowlby One SC', Impact, sans-serif;
}
#pause-overlay button {
  width: auto;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  box-shadow: none;
  font: italic clamp(12px, 1.45vw, 22px)/1.2 'Bowlby One SC', Impact, sans-serif;
}
#pause-overlay #resume-button { color: #ffd04b; }
#pause-overlay .overlay-card{
  width:min(94%,840px);max-height:94%;overflow:auto;display:grid;
  grid-template-columns:minmax(145px,.7fr) minmax(0,1.4fr);gap:clamp(16px,3vw,44px);
}
.pause-navigation{display:grid;justify-items:start;align-content:start;gap:.45rem}
.pause-reference{padding:.75rem 0 .5rem 1rem;border-left:2px solid #ffbf39;color:#fff}
#pause-overlay .pause-reference p{margin:0;color:#ffbf39;letter-spacing:.06em}
.pause-reference h3{font:clamp(22px,3vw,46px)/1.15 'Bowlby One SC',Impact,sans-serif;margin:.12em 0 .35em}
.pause-reference dl{margin:0}
.pause-reference dl>div{display:grid;grid-template-columns:minmax(110px,1fr) minmax(0,1.4fr);gap:.6rem;padding:.35em 0;border-bottom:1px solid #7891a744}
.pause-reference dt,.pause-reference dd{margin:0;font-weight:700;font-size:clamp(.65rem,1.15vw,1rem)}
.pause-reference small{display:block;color:#bdccdb;font:500 .82em/1.25 system-ui,sans-serif}
@media(max-width:540px) and (orientation:portrait){
  #pause-overlay .overlay-card{grid-template-columns:1fr;gap:.4rem}
  .pause-reference{padding:.35em 0 .3em .65em}
}
#settings-dialog #settings-fxquality,
#settings-dialog #settings-fxquality option {
  font: 13px 'Bowlby One SC', Impact, sans-serif;
  color: #fff;
  background: #172632;
}

@media (min-width: 1050px) {
  #select-screen .selection {
    width: 100%;
    max-width: 1760px;
    padding-inline: clamp(20px, 3vw, 56px);
  }
  #select-screen .selection-stage {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 1.05fr) minmax(0, 1fr);
    grid-template-rows: minmax(clamp(370px, 51vh, 570px), auto) auto;
  }
  #select-screen .showcase-art {
    height: clamp(350px, 49vh, 550px);
  }
  #select-screen .showcase-top { display: none; }
  #select-screen .fighter-select-core { align-self: center; }
  #select-screen .fighter-extra { margin-top: 4px; }
}

