/* =========================================================================
   HANGAR v2 — the ship-selection screen, restyled.

   Loaded after style.css and hud.css so it wins on equal specificity; where
   the old rules used a bare class this uses `#shipSelect .x` and never needs
   !important. The markup is unchanged: everything here is paint.

   The reference: a tighter, brighter command deck. Panels are flat plates
   with glowing corner brackets and a hard cyan edge; readouts have small
   glyphs; the two mode pickers are rows of cards with a chevron; LAUNCH is
   a slab of gold with a real bloom. The centre stage gets a holographic pad
   under the model.
   ========================================================================= */

#shipSelect {
  --hg-cyan: #3fd2ff;
  --hg-cyan-dim: rgba(63, 210, 255, .55);
  --hg-line: rgba(63, 190, 255, .42);
  --hg-line-soft: rgba(63, 170, 240, .2);
  --hg-panel: linear-gradient(172deg, rgba(8, 20, 38, .92), rgba(4, 10, 22, .94));
  --hg-text: #eaf6ff;
  --hg-mute: #7f9fc4;
  --hg-gold: #f4b63a;
  background:
    radial-gradient(ellipse at 50% 112%, rgba(30, 120, 210, .42), transparent 52%),
    radial-gradient(ellipse at 50% 50%, rgba(18, 60, 120, .22), transparent 60%),
    radial-gradient(ellipse at 10% -6%, rgba(24, 80, 150, .26), transparent 46%),
    radial-gradient(ellipse at 92% 4%, rgba(18, 60, 120, .24), transparent 42%),
    linear-gradient(178deg, #050b17 0%, #02060f 48%, #040d1f 100%);
}
/* the floor grid, brighter and closer to the eye than before */
#shipSelect::before {
  left: -30%; right: -30%; bottom: -16%; height: 62%;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(50, 165, 255, .28), transparent 58%),
    linear-gradient(transparent 0, rgba(63, 170, 255, .13) 1px, transparent 2px) 0 0 / 100% 28px,
    linear-gradient(90deg, transparent 0, rgba(63, 170, 255, .13) 1px, transparent 2px) 0 0 / 44px 100%;
  transform: perspective(520px) rotateX(61deg);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 40%);
          mask-image: linear-gradient(180deg, transparent 0, #000 40%);
}

/* (The glow under the hull is a shader disc in hangar3d.js now.) */
#shipSelect #hangarCanvas { z-index: 1; }

/* ---- top chrome --------------------------------------------------------- */
#shipSelect .hgTop {
  height: 54px; padding: 0 16px 0 22px;
  background: linear-gradient(180deg, rgba(8, 20, 38, .96), rgba(4, 10, 22, .9));
  border-bottom: 1px solid var(--hg-line);
  box-shadow: 0 1px 0 rgba(63, 210, 255, .12), 0 10px 30px rgba(0, 0, 0, .5);
}
#shipSelect .hgTop::after {
  right: 60%; height: 2px;
  background: linear-gradient(90deg, var(--hg-cyan) 0 30%, transparent);
  filter: drop-shadow(0 0 8px var(--hg-cyan));
}
#shipSelect .hgTitle { font-size: 22px; letter-spacing: 6px; text-shadow: 0 0 18px rgba(63, 210, 255, .35); }
#shipSelect .hgTitle em {
  color: var(--hg-cyan); margin-right: 14px; padding-right: 14px;
  border-right: 1px solid var(--hg-line-soft);
  text-shadow: 0 0 10px var(--hg-cyan);
}
#shipSelect .hgTopRight { display: flex; align-items: center; gap: 10px; height: 100%; }
/* both chips: one height, one baseline, no stray offsets from the old absolute chip */
#shipSelect #credChip, #shipSelect #acctChip {
  position: static; top: auto; right: auto; margin: 0; box-sizing: border-box;
  display: inline-flex; align-items: center; height: 36px; line-height: 1;
}
#shipSelect #credChip {
  margin: 0; padding: 0 16px; height: 36px;
  font-size: 15px; letter-spacing: 1px; color: #ffd36a;
  background: linear-gradient(180deg, rgba(10, 22, 40, .95), rgba(5, 12, 24, .95));
  border: 1px solid rgba(244, 182, 58, .5);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  box-shadow: 0 0 16px rgba(244, 182, 58, .12), inset 0 1px 0 rgba(255, 220, 140, .18);
}
#shipSelect #credChip .credIcon {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 9px; color: #1a1204;
  background: radial-gradient(circle at 40% 35%, #ffe08a, #f0a92e 70%);
  box-shadow: 0 0 10px rgba(244, 182, 58, .7);
}
#shipSelect #acctChip {
  height: 36px; padding: 0 16px 0 40px;
  font-size: 14px; letter-spacing: 1.5px; text-transform: none;
  color: var(--hg-text);
  background: linear-gradient(180deg, rgba(10, 22, 40, .95), rgba(5, 12, 24, .95));
  border: 1px solid var(--hg-line);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  box-shadow: 0 0 16px rgba(63, 210, 255, .12), inset 0 1px 0 rgba(140, 220, 255, .18);
  position: relative;
}
#shipSelect #acctChip::before {
  content: '◈'; position: absolute; left: 14px; top: 50%; translate: 0 -50%;
  font-size: 15px; color: var(--hg-cyan); text-shadow: 0 0 8px var(--hg-cyan);
}

/* ---- the two plates ----------------------------------------------------- */
#shipSelect .hgLeft,
#shipSelect .hgPanel {
  background: var(--hg-panel);
  border: 1px solid var(--hg-line);
  clip-path: none;
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(63, 210, 255, .06),
    0 0 28px rgba(40, 150, 255, .14),
    0 18px 40px rgba(0, 0, 0, .5),
    inset 0 1px 0 rgba(140, 220, 255, .16),
    inset 0 0 70px rgba(10, 45, 90, .28);
}
/* hard cyan edge along the top */
#shipSelect .hgLeft::before,
#shipSelect .hgPanel::before {
  width: 100%; height: 2px; left: 0; right: auto; top: 0;
  background: linear-gradient(90deg, transparent, var(--hg-cyan) 30% 70%, transparent);
  filter: drop-shadow(0 0 8px var(--hg-cyan));
}
/* glowing corner brackets: one element, four corners, drawn as a masked
   gradient border so the plate itself stays a clean rectangle */
#shipSelect .hgLeft::after,
#shipSelect .hgPanel::after {
  /* inset 0, not -1px: a pseudo that pokes 1px past the padding box counts as
     scrollable overflow, and the plate grew a scrollbar for it. */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border: 2px solid var(--hg-cyan);
  border-radius: 4px;
  -webkit-mask:
    linear-gradient(#000 0 0) top left / 22px 22px no-repeat,
    linear-gradient(#000 0 0) top right / 22px 22px no-repeat,
    linear-gradient(#000 0 0) bottom left / 22px 22px no-repeat,
    linear-gradient(#000 0 0) bottom right / 22px 22px no-repeat;
          mask:
    linear-gradient(#000 0 0) top left / 22px 22px no-repeat,
    linear-gradient(#000 0 0) top right / 22px 22px no-repeat,
    linear-gradient(#000 0 0) bottom left / 22px 22px no-repeat,
    linear-gradient(#000 0 0) bottom right / 22px 22px no-repeat;
  filter: drop-shadow(0 0 6px var(--hg-cyan));
  opacity: .9;
}

#shipSelect .hgLeft { width: 264px; left: 18px; padding: 16px 16px 14px; gap: 8px; }
/* no scrollbars, ever. Both plates fit; if a tiny window forces a scroll it is
   by touch or wheel, not by a Windows scrollbar slab down the side. */
#shipSelect .hgLeft, #shipSelect .hgPanel { overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
#shipSelect .hgLeft::-webkit-scrollbar, #shipSelect .hgPanel::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* LAUNCH is the last thing on the plate; SETTINGS sits above it as a quiet
   row, and the permadeath note is the only thing under the gold. */
#shipSelect .hgDesc { order: 0; } #shipSelect .hgPlay { order: 1; } #shipSelect .hgMode { order: 2; }
#shipSelect .hgSettings { order: 3; } #shipSelect .hgTest { order: 4; } #shipSelect .hgPerma { order: 5; } #shipSelect .hgSelect { order: 6; }
/* LAUNCH never leaves the screen: last in the column and stuck to its bottom */
#shipSelect .hgSelect { position: sticky; bottom: 0; z-index: 2; flex: 0 0 auto; }
#shipSelect .hgPerma { position: static; margin: 0 0 10px; }
#shipSelect .hgPanel > .hgSettings { margin: 0 0 12px; }
#shipSelect .hgPanel > .hgTest { margin: 0 0 12px; }
#shipSelect .hgPanel { width: 340px; right: 18px; top: 16px; bottom: 16px; padding: 18px 18px 16px; }

/* section labels: "// PERFORMANCE" */
#shipSelect .hgLeftHead,
#shipSelect .hgFleetHead {
  font-size: 11px; font-weight: 700; letter-spacing: 3.2px; color: var(--hg-cyan);
  opacity: 1; text-shadow: 0 0 10px rgba(63, 210, 255, .45);
}
#shipSelect .hgLeftHead::before { content: '// '; opacity: .7; }
#shipSelect .hgLeftHead + .hgStats { margin-bottom: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--hg-line-soft); }

/* ---- stats: glyph · label · segmented bar · value ------------------------ */
#shipSelect .hgStats { gap: clamp(8px, 1.4vh, 14px); }
#shipSelect .hgStat { gap: 12px; }
#shipSelect .hgStat::before {
  content: '◎'; width: 20px; text-align: center; flex: 0 0 auto;
  font-size: 15px; line-height: 1; color: var(--hg-cyan);
  text-shadow: 0 0 8px var(--hg-cyan);
}
#shipSelect .hgStat:nth-child(2)::before { content: '»'; font-size: 18px; }
#shipSelect .hgStat:nth-child(3)::before { content: '◉'; }
#shipSelect .hgStat:nth-child(4)::before { content: '⚡'; font-size: 13px; }
#shipSelect .hgStat > span { width: 66px; font-size: 13px; letter-spacing: 1.2px; color: #d7e8fb; }
#shipSelect .hgStat .segs { gap: 3px; height: 16px; }
#shipSelect .hgStat .segs i {
  height: 100%; transform: skewX(-18deg);
  background: rgba(40, 90, 150, .28);
  border: 1px solid rgba(63, 170, 255, .1);
}
#shipSelect .hgStat .segs i.on {
  background: linear-gradient(180deg, #9ae8ff 0%, #3fc4ff 45%, #1a86d6 100%);
  border-color: rgba(160, 230, 255, .5);
  box-shadow: 0 0 10px rgba(63, 200, 255, .75), inset 0 1px 0 rgba(255, 255, 255, .35);
}
#shipSelect .hgStat > b { width: 34px; font-size: 17px; letter-spacing: 1px; color: #fff; text-shadow: 0 0 10px rgba(63, 210, 255, .4); }

/* ---- ability kit: 4 x 2 grid of framed tiles ---------------------------- */
/* auto-fill: a nine-ability hull gets a fifth column instead of a lonely third row */
#shipSelect .hgAbils { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
#shipSelect .hgAbil { max-width: 52px; }
#shipSelect .hgAbil {
  width: auto; height: auto; aspect-ratio: 1;
  background: linear-gradient(172deg, rgba(10, 26, 48, .95), rgba(4, 12, 24, .98));
  border: 1px solid var(--hg-line-soft);
  border-radius: 4px; clip-path: none;
  box-shadow: inset 0 0 18px rgba(40, 140, 255, .1), inset 0 1px 0 rgba(140, 220, 255, .1);
  position: relative;
}
#shipSelect .hgAbil::after {
  content: ''; position: absolute; inset: 3px; pointer-events: none;
  border: 1px solid rgba(63, 210, 255, .18); border-radius: 2px;
}
#shipSelect .hgAbil:hover {
  border-color: var(--hg-cyan);
  box-shadow: 0 0 16px rgba(63, 200, 255, .45), inset 0 0 18px rgba(63, 200, 255, .18);
}
#shipSelect .hgAbil .aico { width: 60%; height: 60%; filter: drop-shadow(0 0 6px rgba(120, 200, 255, .5)); }

/* VIEW ABILITIES-style footer on the left plate: the settings button, kept
   as the quiet third tier but styled to match the rows on the right */
#shipSelect .hgTopRight > .hgSettings {
  order: -1; margin: 0; width: auto; height: 36px; padding: 0 14px;
  display: inline-flex; align-items: center; box-sizing: border-box;
  font-size: 11px; letter-spacing: 2.4px; color: #a9c6e6;
  background: linear-gradient(180deg, rgba(10, 22, 40, .95), rgba(5, 12, 24, .95));
  border: 1px solid var(--hg-line-soft); border-radius: 0; clip-path: none;
}
#shipSelect .hgTopRight > .hgSettings::after { content: none; }
#shipSelect .hgTopRight > .hgSettings:hover { color: #fff; border-color: var(--hg-cyan); }
#shipSelect .hgSettings {
  margin-top: auto; padding: 11px 0;
  font-size: 12px; letter-spacing: 3px; color: #a9c6e6;
  background: linear-gradient(180deg, rgba(14, 32, 58, .7), rgba(8, 18, 34, .7));
  border: 1px solid var(--hg-line-soft); border-radius: 4px; clip-path: none;
  box-shadow: inset 0 1px 0 rgba(140, 220, 255, .1);
}
#shipSelect .hgSettings::after { content: '  ›'; color: var(--hg-cyan); }
#shipSelect .hgSettings:hover { color: #fff; border-color: var(--hg-cyan); box-shadow: 0 0 16px rgba(63, 200, 255, .3); }

/* ---- centre stage --------------------------------------------------------- */
#shipSelect .hgStage { left: 336px; right: 376px; top: 3%; }
/* the title fits the stage, whatever the window: no wrapping onto the hull */
#shipSelect .hgClass, #shipSelect .hgName, #shipSelect .hgTag { white-space: nowrap; }
#shipSelect .hgClass { font-size: 13px; letter-spacing: 6px; text-shadow: 0 0 12px var(--hg-cyan); }
#shipSelect .hgName {
  letter-spacing: .22em; margin-top: 2px;
  font-size: clamp(26px, min(4.6vw, 8.5vh), 64px);
  text-shadow: 0 0 46px rgba(63, 200, 255, .75), 0 0 12px rgba(160, 230, 255, .45), 0 3px 0 rgba(0, 0, 0, .6);
}
#shipSelect .hgTag { font-size: clamp(9px, 1.05vw, 14px); letter-spacing: .4em; color: #63c3f5; text-shadow: 0 0 10px rgba(63, 200, 255, .4); }
#shipSelect .hgTag::after {
  content: ''; display: block; width: 260px; height: 1px; margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, var(--hg-cyan), transparent);
  filter: drop-shadow(0 0 6px var(--hg-cyan));
}

#shipSelect .hgArrow {
  width: 60px; height: 70px; font-size: 40px; color: var(--hg-cyan);
  background: linear-gradient(180deg, rgba(8, 22, 42, .82), rgba(4, 10, 22, .9));
  border: 1px solid var(--hg-line); border-radius: 6px;
  clip-path: none;
  box-shadow: 0 0 18px rgba(63, 200, 255, .18), inset 0 1px 0 rgba(140, 220, 255, .18);
  text-shadow: 0 0 12px var(--hg-cyan);
}
#shipSelect .hgArrow:hover { box-shadow: 0 0 28px rgba(63, 200, 255, .45), inset 0 0 20px rgba(63, 200, 255, .16); }
#shipSelect .hgArrow.left { left: 348px; }
#shipSelect .hgArrow.right { right: 388px; }

#shipSelect .hgDots { left: 336px; right: 376px; bottom: 16px; gap: 14px; }
#shipSelect .hgDots i { width: 10px; height: 10px; background: rgba(63, 170, 255, .28); box-shadow: inset 0 0 0 1px rgba(63, 210, 255, .3); }
#shipSelect .hgDots i.on { background: var(--hg-cyan); box-shadow: 0 0 14px var(--hg-cyan), 0 0 4px #fff; }

/* ---- right plate: description → modes → fleet size → LAUNCH -------------- */
#shipSelect .hgPanelName, #shipSelect .hgPanelClass { display: none; }   /* the stage already says it, twice */
#shipSelect .hgDesc {
  margin: 0 0 14px; padding: 0 0 14px 42px; position: relative;
  font-size: 12px; line-height: 1.5; color: #b7cde6;
  border-bottom: 1px solid var(--hg-line-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#shipSelect .hgDesc::before {
  content: '⛨'; position: absolute; left: 4px; top: 2px;
  font-size: 22px; line-height: 1; color: var(--hg-cyan);
  text-shadow: 0 0 10px var(--hg-cyan);
}

/* mode rows: glyph · NAME · note · chevron */
#shipSelect .hgPlay {
  margin: 0 0 16px; padding: 0; gap: 8px;
  border: 0; background: none; border-radius: 0;
}
#shipSelect .hgPlay button {
  position: relative; align-items: center; gap: 12px;
  min-height: clamp(40px, 7.2vh, 60px); padding: 0 40px 0 64px;
  border: 1px solid var(--hg-line-soft); border-radius: 5px;
  background: linear-gradient(180deg, rgba(12, 28, 52, .7), rgba(6, 14, 28, .8));
  color: #d7e8fb; font-size: 17px; letter-spacing: .1em;
  box-shadow: inset 0 1px 0 rgba(140, 220, 255, .08);
  transition: all .15s;
}
#shipSelect .hgPlay button em { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-left: auto; }
#shipSelect .hgPlay button::before {
  /* the glyph, in a framed square */
  content: '◉'; position: absolute; left: 12px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 38px; height: 38px;
  font-size: 20px; color: var(--hg-cyan);
  background: rgba(63, 170, 255, .08);
  border: 1px solid var(--hg-line-soft); border-radius: 4px;
  text-shadow: 0 0 8px var(--hg-cyan);
}
#shipSelect .hgPlay button[data-play="solo"]::before  { content: '☺'; }
#shipSelect .hgPlay button[data-play="rogue"]::before { content: '☠'; }
#shipSelect .hgPlay button[data-play="mp"]::before    { content: '⚔'; }
#shipSelect .hgPlay button::after {
  content: '›'; position: absolute; right: 16px; top: 50%; translate: 0 -50%;
  font-size: 26px; line-height: 1; color: var(--hg-cyan); font-weight: 400;
  text-shadow: 0 0 8px var(--hg-cyan);
}
#shipSelect .hgPlay button:hover { border-color: var(--hg-line); background: linear-gradient(180deg, rgba(18, 42, 76, .8), rgba(8, 20, 40, .85)); }
#shipSelect .hgPlay button.on {
  color: #fff; border-color: var(--hg-cyan);
  background: linear-gradient(180deg, rgba(26, 78, 140, .8), rgba(12, 36, 72, .9));
  box-shadow: 0 0 22px rgba(63, 200, 255, .3), inset 0 1px 0 rgba(160, 230, 255, .3), inset 0 0 30px rgba(63, 200, 255, .1);
}
#shipSelect .hgPlay button.on::before { background: rgba(63, 200, 255, .18); border-color: var(--hg-cyan); }
#shipSelect .hgPlay button.locked { color: #8fa4bd; }
#shipSelect .hgPlay button.mpNudge {
  background: linear-gradient(135deg, #ffe392, #ffc13d);
  color: #241600;
  border: 2px solid #fff0b5 !important;
  animation: hgNudge 1.8s ease-in-out infinite;
}
#shipSelect .hgPlay button.mpNudge::before,
#shipSelect .hgPlay button.mpNudge::after {
  color: #392400; text-shadow: none;
}
#shipSelect .hgPlay button.mpNudge::before {
  background: rgba(70, 40, 0, .12); border-color: #a56600;
}
#shipSelect .hgPlay button.mpNudge {
  flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 3px; padding-top: 7px; padding-bottom: 7px; white-space: normal;
}
#shipSelect .hgPlay button.mpNudge em {
  display: block; margin-left: 0; font-size: 10px; opacity: 1;
  color: #392400; font-weight: 800; letter-spacing: .03em; white-space: normal;
}
@keyframes hgNudge {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 184, 40, .5); }
  50% { box-shadow: 0 0 30px 5px rgba(255, 184, 40, .8); }
}
@media (prefers-reduced-motion: reduce) {
  #shipSelect .hgPlay button.mpNudge { animation: none; box-shadow: 0 0 16px rgba(255, 184, 40, .6); }
}
@media (max-width: 600px), (max-height: 600px) {
  #shipSelect .hgPlay button.mpNudge em { font-size: 8px; }
}

/* fleet size: two cards under a "// FLEET SIZE" label drawn by the box itself */
#shipSelect .hgMode {
  position: relative; margin: 0 0 16px; padding: 22px 0 0; gap: 10px;
  border: 0; background: none; border-radius: 0;
}
#shipSelect .hgMode::before {
  content: '// FLEET SIZE'; position: absolute; left: 0; top: 0;
  font-size: 11px; font-weight: 700; letter-spacing: 3.2px; color: var(--hg-cyan);
  text-shadow: 0 0 10px rgba(63, 210, 255, .45);
}
#shipSelect .hgMode button {
  padding: clamp(7px, 1.4vh, 13px) 6px clamp(6px, 1.2vh, 11px);
  border: 1px solid var(--hg-line-soft); border-radius: 5px;
  background: linear-gradient(180deg, rgba(12, 28, 52, .7), rgba(6, 14, 28, .8));
  color: #d7e8fb; font-size: 19px; font-weight: 700; letter-spacing: .12em;
  box-shadow: inset 0 1px 0 rgba(140, 220, 255, .08);
}
#shipSelect .hgMode button em { margin-top: 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
#shipSelect .hgMode button.on {
  color: #fff; border-color: var(--hg-cyan);
  background: linear-gradient(180deg, rgba(26, 78, 140, .8), rgba(12, 36, 72, .9));
  box-shadow: 0 0 22px rgba(63, 200, 255, .3), inset 0 1px 0 rgba(160, 230, 255, .3);
}
#shipSelect .hgMode button.on em { opacity: 1; color: #9fe3ff; }

/* LAUNCH: the one gold thing on the screen, and it glows like it */
#shipSelect .hgSelect {
  margin-top: auto; padding: clamp(12px, 2.4vh, 20px) 0;
  font-size: clamp(16px, 2.6vh, 24px); letter-spacing: 10px; color: #2a1a04;
  background: linear-gradient(180deg, #ffd873 0%, #f3b23a 50%, #d98f16 100%);
  border: 1px solid #ffe9a8; border-radius: 3px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  box-shadow:
    0 0 34px rgba(244, 182, 58, .55), 0 0 80px rgba(244, 182, 58, .22),
    inset 0 1px 0 rgba(255, 246, 214, .95), inset 0 -12px 26px rgba(140, 85, 5, .35);
  text-shadow: 0 1px 0 rgba(255, 240, 190, .7);
}
/* the striped hazard bands at either end */
#shipSelect .hgSelect::before,
#shipSelect .hgSelect::after {
  content: ''; position: absolute; top: 6px; bottom: 6px; width: 10px;
  background: repeating-linear-gradient(135deg, rgba(90, 55, 5, .55) 0 3px, transparent 3px 7px);
  opacity: .8;
}
#shipSelect .hgSelect::before { left: 8px; }
#shipSelect .hgSelect::after { right: 8px; }
#shipSelect .hgSelect:hover {
  background: linear-gradient(180deg, #ffe38d 0%, #ffbf47 50%, #e69c1f 100%);
  box-shadow: 0 0 48px rgba(250, 190, 65, .7), 0 0 110px rgba(244, 182, 58, .3), inset 0 1px 0 rgba(255, 248, 220, .98);
}
#shipSelect .hgSelect span { margin-left: 6px; }
#shipSelect .hgSelect.locked { box-shadow: none; }
#shipSelect .hgSelect.locked::before, #shipSelect .hgSelect.locked::after { display: none; }

#shipSelect .hgTest { margin-top: 10px; border-radius: 4px; clip-path: none; border-color: var(--hg-line-soft); }
#shipSelect .hgPerma { margin-top: 10px; color: #c08a4a; letter-spacing: 2px; }

/* ---- tooltip ------------------------------------------------------------- */
.hgTip {
  border-radius: 4px; clip-path: none;
  border: 1px solid var(--hg-line, rgba(63, 190, 255, .42));
  box-shadow: 0 0 22px rgba(63, 200, 255, .2), 0 12px 30px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(140, 220, 255, .16);
}

/* ---- small screens: keep the old compact metrics, only re-skinned -------- */
@media (max-width: 900px), (max-height: 620px) {
  #shipSelect .hgTop { height: 40px; padding: 0 10px; }
  #shipSelect .hgTitle { font-size: 11px; letter-spacing: 3px; }
  #shipSelect #credChip, #shipSelect #acctChip { height: 28px; font-size: 11px; padding-left: 12px; padding-right: 12px; }
  #shipSelect #acctChip { padding-left: 30px; }
  #shipSelect #acctChip::before { left: 10px; font-size: 12px; }
  #shipSelect .hgLeft { width: 196px; left: 8px; padding: 10px 12px 10px; gap: 8px; }
  #shipSelect .hgPanel { width: 250px; right: 8px; top: 8px; bottom: 8px; padding: 10px 10px 8px; }
  #shipSelect .hgLeft::after, #shipSelect .hgPanel::after { border-width: 1.5px; -webkit-mask-size: 14px 14px; mask-size: 14px 14px; }
  #shipSelect .hgLeftHead, #shipSelect .hgMode::before { font-size: 8px; letter-spacing: 2px; }
  #shipSelect .hgStats { gap: 7px; }
  #shipSelect .hgStat { gap: 6px; }
  #shipSelect .hgStat::before { width: 14px; font-size: 11px; }
  #shipSelect .hgStat > span { width: 46px; font-size: 9px; }
  #shipSelect .hgStat .segs { height: 9px; gap: 2px; }
  #shipSelect .hgStat > b { width: 24px; font-size: 11px; }
  #shipSelect .hgAbils { gap: 5px; }
  #shipSelect .hgAbil .aico { width: 62%; height: 62%; }
  #shipSelect .hgSettings { font-size: 9px; padding: 7px 0; letter-spacing: 2px; }
  #shipSelect .hgStage, #shipSelect .hgDots { left: 212px; right: 266px; }
  #shipSelect .hgArrow { width: 34px; height: 44px; font-size: 22px; }
  #shipSelect .hgArrow.left { left: 212px; }
  #shipSelect .hgArrow.right { right: 266px; }
  #shipSelect .hgTag::after { width: 140px; margin-top: 6px; }
  #shipSelect .hgDesc { font-size: 9.5px; line-height: 1.4; margin-bottom: 8px; padding: 0 0 8px 28px; }
  #shipSelect .hgTopRight > .hgSettings { height: 28px; font-size: 9px; padding: 0 10px; }
  #shipSelect .hgAbils { gap: 4px; }
  #shipSelect .hgAbil { max-width: 40px; }
  #shipSelect .hgDesc::before { font-size: 15px; left: 2px; }
  #shipSelect .hgPlay { gap: 5px; margin-bottom: 8px; }
  #shipSelect .hgPlay button { min-height: 36px; padding: 0 26px 0 42px; font-size: 11px; }
  #shipSelect .hgPlay button em { font-size: 7.5px; }
  #shipSelect .hgPlay button::before { width: 26px; height: 26px; font-size: 13px; left: 7px; }
  #shipSelect .hgPlay button::after { font-size: 18px; right: 9px; }
  #shipSelect .hgMode { padding-top: 14px; margin-bottom: 8px; gap: 6px; }
  #shipSelect .hgMode button { padding: 7px 4px 6px; font-size: 12px; }
  #shipSelect .hgMode button em { font-size: 7.5px; margin-top: 3px; }
  #shipSelect .hgSelect { padding: 12px 0; font-size: 14px; letter-spacing: 6px; }
  #shipSelect .hgPerma { font-size: 7.5px; }
}

/* The debris-map preview switch. Same shape as TEST BATTLE because it is the
   same kind of thing -- an author's entry point, not a way to play -- and it
   sits beside it in the same order slot. Lit when it is on, because "which
   map am I about to play" should be answerable at a glance. */
#shipSelect .hgTest#hgMapBtn { order: 4; }
#shipSelect #hgMapBtn.hgOn {
  border-color: rgba(255, 196, 80, .6);
  color: #ffe6ab;
  box-shadow: 0 0 18px rgba(255, 196, 80, .22), inset 0 0 14px rgba(255, 180, 70, .12);
}
#shipSelect #hgMapBtn.hgOn em { color: #ffd98f; }

/* Admin-only authored-map choice. It sits directly under DEBRIS MAP so the
   selected layout and the preview switch read as one control. */
#shipSelect .hgMapPicker {
  order: 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: -6px 0 12px;
}
#shipSelect .hgMapPicker.hidden { display: none !important; }
#shipSelect .hgMapPicker::before {
  content: '// ADMIN MAP PREVIEW';
  grid-column: 1 / -1;
  color: var(--hg-cyan);
  font-size: 9px;
  letter-spacing: 2px;
  opacity: .8;
}
#shipSelect .hgMapPicker button {
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid var(--hg-line-soft);
  border-radius: 4px;
  background: rgba(18, 40, 61, .78);
  color: #a9c6dc;
  font: 700 11px/1.1 'Chakra Petch', system-ui, sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}
#shipSelect .hgMapPicker button.on {
  border-color: rgba(255, 196, 80, .72);
  color: #ffe6ab;
  background: rgba(82, 57, 20, .62);
  box-shadow: 0 0 12px rgba(255, 196, 80, .18);
}
#shipSelect .hgMapDefault::before { content: '// DEFAULT FOR ALL PLAYERS'; }
#shipSelect .hgMapDefault button.on {
  border-color: rgba(80, 211, 255, .78);
  color: #d9f7ff;
  background: rgba(20, 65, 82, .7);
  box-shadow: 0 0 12px rgba(80, 211, 255, .2);
}
#shipSelect .hgMapDefault button:disabled { opacity: .55; cursor: wait; }


/* ══ THE CAMERA CUTOUT ═════════════════════════════════════════════════════
   Every safe-area rule in this project lived in hud.css, so the IN-MATCH HUD
   dodged the notch and the hangar, the menus and the modals did not -- they
   ran their content to the physical edge and put it under the cutout and the
   rounded corners.

   Landscape is the case that matters: the island sits on one SIDE, and which
   side depends on which way the phone is turned. env() answers that for us --
   safe-area-inset-left is 0 on one rotation and ~35px on the other, so
   honouring both is the same rule for both orientations.

   Applied as padding on the screen containers rather than as a margin, so the
   backgrounds still cover the full display and only the CONTENT is indented.
   ════════════════════════════════════════════════════════════════════════ */
body.iosApp {
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
/* EVERY full-screen surface, not a list I keep adding to one screen at a
   time. Each of these is `position: fixed; inset: 0`, so it spans the display
   edge to edge and puts its content under the camera unless told otherwise.
   The movement chooser is the one that showed it up -- cut off on the left,
   because it was not on the list. */
body.iosApp .overlay,
body.iosApp #shipSelect,
body.iosApp #loadScreen,
body.iosApp #rotatePrompt,
body.iosApp #checkinModal,
body.iosApp #mpModal,
body.iosApp #authModal,
body.iosApp #settingsModal,
body.iosApp #moveIntro,
body.iosApp #shipPicker,
body.iosApp #diagPanel,
body.iosApp #adminPanel,
body.iosApp #seoIntro {
  padding-left: var(--safe-l, 0px);
  padding-right: var(--safe-r, 0px);
  box-sizing: border-box;
}
/* The carousel arrows are positioned against the viewport rather than the
   padded box, so they need the inset -- but as a MARGIN, not by restating
   `left`. Restating it was a real bug: this selector carries an extra class,
   so it beat the responsive rule that moves the arrows in to 212px on a narrow
   screen and put them back at 348px -- off the side of a phone, which is why
   they vanished. A margin composes with whatever offset the breakpoints chose
   instead of replacing it. */
body.iosApp #shipSelect .hgArrow.left  { margin-left: var(--safe-l, 0px); }
body.iosApp #shipSelect .hgArrow.right { margin-right: var(--safe-r, 0px); }
