
/* Portrait playfield and responsive side rails. */
.web-app body {
  display: block;
  padding: 0;
  background: radial-gradient(ellipse at 50% 0, #192535 0, #0c111a 65%);
}
.web-app .game-layout {
  display: grid;
  grid-template-columns: min(100%, max(280px, 76dvh));
  justify-content: center;
  height: 100dvh;
  width: 100%;
  max-width: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.game-layout .arcade { min-width: 0; min-height: 0; }
.web-app .game-layout .arcade { border-radius: 0; }
.game-layout .arcade .field { min-height: 0; }
.game-layout .bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game-layout .bar strong { font-size: clamp(17px, 2.5vw, 24px); }
.game-layout .bar .label { font-size: clamp(7px, 1vw, 9px); }
.game-layout .bar .status { margin-left: 0; }
.game-rail { display: none; }
.compact-tools, .game-utilities {
  display: flex;
  align-items: center;
  gap: 8px;
}
.compact-tools {
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 8px 10px;
  background: #131c28;
  border-bottom: 1px solid #293746;
}
.compact-tools .game-utilities { margin-left: auto; }
.game-utilities .icon, .game-utilities .fullscreen-toggle {
  position: static;
  width: 38px;
  height: 38px;
  background: #141f2c;
}
.game-utilities .fullscreen-toggle svg { width: 17px; height: 17px; }
.shop-trigger {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 5px 10px;
  border: 1px solid #3a6a5c;
  border-radius: 8px;
  background: #1a302b;
  color: #b0f6d5;
  font-size: 12px;
}
.shop-trigger:hover { background: #224338; }
.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #655335;
  border-radius: 99px;
  padding: 3px 8px;
  background: #292319;
  color: #ffe3a5;
  font-size: 11px;
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#compactNav { order: 1; }
#compactNav .game-site-links {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  padding: 1px 0 0;
}
#compactNav .studio-return-button {
  padding: 5px 6px;
  min-height: 36px;
  font-size: 9px;
  flex: 1;
}
/* The dock uses a common button shape and surface for all three actions. */
.web-app .action-dock {
  background: #121e2b;
  border-top-color: #354458;
  padding: 10px 12px 7px;
  gap: 8px;
}
.web-app .action-dock .action {
  --accent: #b0f6d5;
  background: #1a293b;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 62%, #29374c);
  border-radius: 11px;
  box-shadow: inset 0 -3px 0 #0b1422;
  min-height: 54px;
}
.web-app .action-dock .weapon { --accent: #94dbff; }
.web-app .action-dock .singularity { --accent: var(--special-accent, #d8b6ff); }
.web-app .action-dock .action:not(:disabled):hover {
  background: #24364c;
  border-color: var(--accent);
}
.web-app .action-dock .action:not(:disabled):active { box-shadow: inset 0 2px 4px #060d19; }
.web-app .action-dock .charged { box-shadow: inset 0 -3px 0 #0b1422, 0 0 13px color-mix(in srgb, var(--accent) 18%, transparent); }
.web-app .action-dock .singularity::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--charge, 0%);
  height: 2px;
  background: var(--accent);
}
.web-app .controls { background: #121e2b; }
.brand-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.test-badge {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid #645c98;
  border-radius: 6px;
  background: #282540;
  color: #e5d9ff;
  font-size: 9px;
  letter-spacing: .08em;
  font-weight: 700;
  white-space: nowrap;
}
.ship-test .shop-trigger .coin-pill, .ship-test .shop-header-tools .coin-pill { display: none; }
.ship-card .ship-special { color: #c7b8f1; }
.shop-test-note {
  padding: 9px 11px;
  border: 1px solid #534773;
  border-radius: 8px;
  color: #e5d9ff;
  background: #26243d;
  font-size: 12px;
}
@media (min-width: 800px) and (min-aspect-ratio: 5/4) {
  .web-app .game-layout {
    grid-template-columns: minmax(0, 1fr) min(88dvh, calc(100dvh - 144px), calc(100% - 336px), 1000px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .web-app .arcade { grid-area: 1 / 2 / -1 / 3; }
  .web-app .rail-left { grid-column: 1; }
  .web-app .rail-right { grid-column: 3; }
  .web-app .compact-tools { display: none; }
  .web-app .game-rail {
    display: grid;
    grid-row: 1 / -1;
    grid-template-rows: subgrid;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    padding: clamp(9px, 1.2vw, 18px);
  }
  .web-app .rail-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 330px;
    justify-self: center;
  }
  .rail-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #eaf7f4;
    font-size: clamp(16px, 1.9vw, 26px);
    font-weight: 800;
    text-decoration: none;
  }
  .rail-brand span { color: var(--mint); font-size: 24px; }
  .rail-top .shop-trigger { width: 100%; min-height: 42px; border-radius: 10px; }
  .rail-top .game-site-links { display: grid; justify-content: stretch; padding: 0; gap: 6px; }
  .rail-top .studio-return-button {
    justify-content: flex-start; min-height: 34px; padding: 6px 8px;
    font-size: 11px; background: #192639; color: #c9dbeb; border-color: #3b4b62;
  }
  .rail-right .game-utilities { justify-content: flex-end; }
  .rail-right #statsBoard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 7px;
    padding: 0;
    background: none;
    border: 0;
  }
  .rail-right #statsBoard > div {
    min-width: 0;
    min-height: 58px;
    justify-content: center;
    padding: 7px 8px;
    border-radius: 10px;
    background: #182639;
    border: 1px solid #394d65;
  }
  .rail-right #statsBoard .label { font-size: 8px; white-space: nowrap; color: #b3c6da; }
  .rail-right #statsBoard strong { font-size: clamp(14px, 1.8vw, 24px); letter-spacing: 0; line-height: 1.12; }
  .rail-right #statsBoard .kill-best { line-height: 1; letter-spacing: .25px; }
  .equipped-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 8px;
    background: #192639;
    border: 1px solid #394d65;
    border-radius: 9px;
  }
  .equipped-summary span { color: #b3c6da; font-size: 10px; }
  .equipped-summary strong { color: var(--mint); font-size: 12px; }
  .ad-space {
    display: grid;
    place-items: center;
    align-self: center;
    justify-self: center;
    width: 100%;
    max-width: 330px;
    height: 100%;
    max-height: 600px;
    min-height: 0;
    overflow: hidden;
    background: #101a26;
    border: 1px dashed #2a3b4d;
    border-radius: 12px;
  }
  .ad-space > * { grid-area: 1 / 1; }
  .ad-space .ad-slot { width: 100%; height: 100%; z-index: 1; }
  .ad-space .ad-slot:not(:empty) + .ad-placeholder { display: none; }
  .ad-placeholder { color: #8a9db1; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
  .web-app .sector-strip { padding: 8px 13px; background: #192639; }
}
@media (max-height: 520px) and (min-width: 800px) and (min-aspect-ratio: 5/4) {
  .web-app .game-layout { grid-template-columns: minmax(0, 1fr) min(78dvh, calc(100dvh - 112px), calc(100% - 336px)) minmax(0, 1fr); }
  .web-app .game-rail, .web-app .rail-top { gap: 5px; }
  .rail-right #statsBoard > div { min-height: 40px; padding: 4px 6px; gap: 3px; }
  .web-app .sector-strip { padding: 4px 8px; }
  .web-app .action-dock .action { min-height: 42px; }
}
@media (max-width: 600px) {
  .web-app .action-dock { gap: 5px; padding: 6px 7px 5px; }
  .web-app .action-dock .action { gap: 4px; padding-inline: 3px; min-height: 51px; }
  .web-app #specialName { letter-spacing: 0; }
}
@media (max-width: 420px) {
  .compact-tools { padding: 6px 8px; }
  .game-utilities { gap: 5px; }
  .game-utilities .icon, .game-utilities .fullscreen-toggle { width: 34px; height: 34px; }
  .shop-trigger { min-height: 34px; }
}

/* The hangar sits above the arena while the run is paused. */
.ship-shop {
  width: min(850px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(14px, 3vw, 26px);
  border: 1px solid #3a5364;
  border-radius: 16px;
  background: #111c29;
  color: #eaf2f8;
  box-shadow: 0 28px 100px #0009;
}
.ship-shop::backdrop { background: #050a13c9; }
.shop-header, .shop-header-tools, .shop-earn {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shop-header, .shop-earn { justify-content: space-between; }
.shop-header h2 { font-size: clamp(23px, 4vw, 34px); }
.shop-header .eyebrow { margin-bottom: 3px; font-size: 8px; }
.shop-close { font-size: 24px; line-height: 1; }
.shop-earn {
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid #344657;
  border-radius: 10px;
  background: #142433;
}
.shop-earn p, .shop-earn small { margin: 0; color: #b2c5d6; font-size: 11px; }
.shop-earn p { flex: 1; }
.shop-earn small { flex-basis: 100%; }
.reward-button, .ship-card button {
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid #4d705d;
  border-radius: 7px;
  background: #203b32;
  color: #b0f6d5;
  font-size: 12px;
}
.reward-button span { margin-left: 5px; color: #ffe3a5; }
.reward-button:disabled, .ship-card button:disabled {
  cursor: default;
  opacity: .7;
  background: #1e2a37;
  border-color: #394c5c;
  color: #b6c6d4;
}
.ship-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ship-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 6px;
  padding: 10px;
  border: 1px solid #304456;
  border-radius: 10px;
  background: #162332;
}
.ship-card[data-equipped="true"] { border-color: #65b89e; }
.ship-card h3 { margin: 0; font-size: 14px; }
.ship-card p { margin: 0 0 2px; color: #adc0d2; font-size: 11px; line-height: 1.4; }
.ship-card button { margin-top: auto; }
.shop-notice { color: #b0f6d5; font-size: 12px; margin: 12px 0 0; }
@media (max-width: 580px) {
  .ship-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ship-card { padding: 8px; }
  .shop-header-tools { gap: 5px; }
}

/* Arcade shell, action glyphs and hangar presentation. */
.power-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.action-symbol {
  width: clamp(16px, 3.3vw, 24px);
  height: clamp(16px, 3.3vw, 24px);
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.web-app body {
  background: radial-gradient(ellipse at 50% 35%, #152943, #0a1323 66%, #070f1d);
}
.web-app .arcade { background: transparent; border: 0; box-shadow: none; }
.web-app .sector-strip {
  background: #102335;
  border: 1px solid #3a796f;
  border-bottom-color: #2b4c5d;
  border-radius: 11px 11px 0 0;
}
.web-app .field { border: 1px solid #3a796f; border-top: 0; border-radius: 0 0 11px 11px; overflow: hidden; }
.web-app .action-dock, .web-app .controls { background: transparent; border: 0; }
.web-app .action-dock { padding-inline: 0; }
.web-app .action-dock .action {
  background: color-mix(in srgb, var(--accent) 9%, #0b1627);
  box-shadow: inset 0 -2px 0 #040b16;
}
.web-app .action-dock .action:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 80%, #29374c);
}
.web-app .action-dock .action:not(:disabled):hover,
.web-app .action-dock .action.active-power,
.web-app .action-dock .action.charged {
  background: color-mix(in srgb, var(--accent) 15%, #0b1627);
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--accent) 13%, transparent);
}
.web-app .action-dock .action:not(:disabled):active {
  background: color-mix(in srgb, var(--accent) 24%, #0b1627);
}
.web-app .compact-tools { background: #0e1c2d; }
.web-app .overlay { background: #081322b8; }
.web-app .overlay .primary { color: #06251d; background: #8af1ce; }
.web-app .overlay .menu-button { background: #102737; border-color: #2e5a61; }
.web-app .overlay .menu-button:hover { background: #183747; }
.web-app .arena-note { color: #8ea5ba; }

.ship-shop { background: #0c1727; }
.ship-card { background: #122133; }
.ship-card .ship-preview {
  width: 100%;
  height: clamp(72px, 13dvh, 125px);
  display: block;
  padding: 9px;
  object-fit: contain;
  border-radius: 7px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--ship-color) 19%, #0b1526), #0b1526 72%);
}
.ship-card h3 { color: var(--ship-color); }
.ship-card[data-equipped="true"] { border-color: var(--ship-color); }

@media (min-width: 800px) and (min-aspect-ratio: 5/4) {
  .web-app .arcade { margin-block: clamp(4px, 1.4dvh, 13px) 0; }
  .rail-brand { gap: 5px; color: #8af1ce; }
  .rail-brand .brand-mark { width: clamp(30px, 4.2vw, 56px); flex: 0 0 auto; }
  .rail-brand span {
    color: inherit;
    font-size: clamp(19px, 3vw, 43px);
    line-height: .87;
    font-weight: 800;
    font-style: italic;
    letter-spacing: -.045em;
    text-transform: uppercase;
  }
  .rail-right #statsBoard > div, .equipped-summary {
    border-color: #355976;
    background: linear-gradient(155deg, #162b40, #0e1c30);
  }
  .rail-right #statsBoard > div { text-align: center; }
  .equipped-summary { justify-content: flex-start; flex-wrap: nowrap; gap: 8px; }
  .equipped-summary img { width: 34px; height: 34px; object-fit: contain; }
  .equipped-summary span, .equipped-summary strong { display: block; }
  .equipped-summary span { margin-bottom: 2px; text-transform: uppercase; font-size: 8px; letter-spacing: .07em; }
  .ad-space {
    background: radial-gradient(ellipse at 20% 15%, #11243a, #0b1728 72%);
    border-color: #3d5472;
  }
}
@media (max-width: 799px), (max-aspect-ratio: 5/4) {
  .web-app .sector-strip, .web-app .field { border-radius: 0; }
  .web-app .action-dock { padding-inline: 7px; }
}

/* Keep game overlays legible without filtering the moving canvas underneath. */
.web-app .overlay { background: #09111bea; backdrop-filter: none; }
.web-app .policy-links { display: flex; justify-content: center; gap: 16px; font-size: 12px; }
.web-app .policy-links a { color: #b0d2ce; padding: 5px 0; text-underline-offset: 3px; }
.web-app .ad-space:has(.ad-slot:empty) { visibility: hidden; }
.web-app .hof-privacy a { color: #b0f6d5; }

/* Boss Rush arcade accents and readable combat callouts. */
.sector-strip {
 position: relative; min-width: 0; isolation: isolate; overflow: hidden;
 background: linear-gradient(100deg,#122b38,#19233d);
}
#sectorLabel { font-weight: 700; color: #a2ffe2; }
#encounterLabel { color: #d4caff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sectorProgress {
 position: absolute; inset: auto 0 0; height: 2px; transform: scaleX(0); transform-origin: left;
 background: linear-gradient(90deg,#69f2c9,#84bcff,#d2a9ff);
}
.bar .label { white-space: nowrap; }
.stat-icon { display: inline-block; width: .84em; height: .84em; margin-inline-end: .28em; border: 1px solid currentColor; border-radius: 50%; vertical-align: .03em; color: #8ee8d9; }
.stat-icon.clock { border-right-color: #476785; }
.stat-icon.target { border-radius: 1px; transform: rotate(45deg) scale(.7); color: #e0baff; }
.overlay .orb { display: grid; place-items: center; color: #9cffe1; }
.overlay .orb svg { width: 58%; height: 58%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.web-app .home-menu .primary { background: #b1ffe1; box-shadow: 0 3px #3e9d88,0 8px 24px #34d4ad26; font-weight: 800; }
.web-app .home-menu .primary:active { transform: translateY(2px); box-shadow: 0 1px #3e9d88; }
.home-menu #message { color: #c4d6e8; }
.boss-panel {
 --boss-color: #e5baff;
 inset-inline: 50% auto; top: 9px; transform: translateX(-50%);
 width: min(440px,calc(100% - 24px)); padding: 7px 10px 6px; box-sizing: border-box;
 border: 1px solid color-mix(in srgb,var(--boss-color) 57%,#23334b);
 border-radius: 9px; background: #0a1322eb; box-shadow: 0 5px 18px #04091877;
}
.boss-panel.apex { top: 23%; }
.boss-caption { align-items: center; gap: 8px; color: #eef6ff; margin-bottom: 5px; }
.boss-caption strong { flex: 1; letter-spacing: .08em; }
#bossRank { padding: 3px 5px; border-radius: 4px; color: #10202b; background: var(--boss-color); font-weight: 700; letter-spacing: .045em; }
#bossHealthText { color: var(--boss-color); white-space: nowrap; font-variant-numeric: tabular-nums; }
.boss-panel .boss-health-track { height: 5px; background: #242c43; }
.boss-panel #bossHealth { background: linear-gradient(90deg,var(--boss-color),#fff2d8); }
.boss-panel.enraged:not(.apex) #bossHealth { background: linear-gradient(90deg,#ff6b86,#ffd58e); }
.boss-panel.apex.enraged #bossHealth { background: linear-gradient(90deg,var(--boss-color),#fff2d8); }
.coin-mark { width: 1.2em; height: 1.2em; vertical-align: -.24em; object-fit: contain; }
.boss-attack { color: var(--boss-color); font-size: 9px; font-weight: 700; text-align: center; margin-top: 5px; letter-spacing: .13em; }
@media(max-width:460px) {
 .boss-caption,.boss-attack { font-size: 8px; }
 .boss-panel { padding: 5px 8px; }
 .stat-icon { display: none; }
}
@media(prefers-reduced-motion:reduce) {
 .web-app .home-menu .primary:active { transform: none; }
}
.home-menu #message { display: block; margin: 0 0 12px; font-size: clamp(10px,1.3vw,14px); line-height: 1.35; }
.home-menu #overline { padding: 5px 10px; border-radius: 20px; background: #1d3b45; color: #bcfff1; }
.action-dock .action-symbol { border-radius: 7px; background: #ffffff0d; padding: 3px; }
#kills { display: inline-block; }
@media(max-height:500px){.home-menu #message{display:none;}}
.field .apex-layer { position:absolute; right:auto; bottom:auto; pointer-events:none; }

