/* ==================================================================================================================
   Hangar (#kaiju-hangar): a mech bay, not a dialog. The loadout fills the screen over the hangar-bay art; the mech
   stands in the room (no boxed thumbnail) on a lit floor ring inside targeting brackets; the frame and weapon pickers
   are HUD glass at the sides; the bottom is a mission
   briefing strip (battleground coordinates, threat pips) ending in a hazard-striped Deploy plate.
   Layout (columns, breakpoints, what each height drops) stays in style.css; this file is the look. Loaded last.
   ================================================================================================================== */

#kaiju-hangar {
  --hg-opt: 44px; /* the height of every footer button row: battleground, wave, difficulty and Deploy */
  --hg-glass: rgba(9, 9, 11, 0.66);
  --hg-glass-hi: rgba(18, 18, 21, 0.78);
  --hg-edge: rgba(201, 162, 74, 0.28);
  --hg-stencil: 'Saira Stencil One', var(--font-sign);
}

/* ---------- The bay: full screen, the art behind everything ---------- */
#kaiju-hangar.kaiju-settings {
  padding: 0;
  background:
    radial-gradient(ellipse 58% 62% at 50% 54%, rgba(5, 5, 6, 0) 0 30%, rgba(5, 5, 6, 0.72) 100%),
    linear-gradient(180deg, rgba(5, 5, 6, 0.82) 0, rgba(5, 5, 6, 0.25) 22%, rgba(5, 5, 6, 0.2) 58%, rgba(5, 5, 6, 0.94) 100%),
    #060607 url('../images/hangar-bay.webp') center 72% / cover no-repeat;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* faint scanlines over the whole bay, and a slow sweep of light down it */
#kaiju-hangar.kaiju-settings::before,
#kaiju-hangar.kaiju-settings::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
#kaiju-hangar.kaiju-settings::before { background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px); }
#kaiju-hangar.kaiju-settings::after {
  background: linear-gradient(180deg, transparent 0, rgba(201, 162, 74, 0.05) 48%, rgba(201, 162, 74, 0.09) 50%, transparent 52%);
  background-size: 100% 260%;
  animation: hg-sweep 9s linear infinite;
}
@keyframes hg-sweep { from { background-position: 0 100%; } to { background-position: 0 -160%; } }

#kaiju-hangar .kaiju-hangar-card.ew-loadout {
  position: relative; z-index: 1;
  width: 100%; max-width: none;
  height: 100dvh; max-height: none;
  border: 0;
  background: none;
  box-shadow: none;
}
@media (min-width: 900px) and (min-height: 521px) {
  #kaiju-hangar .kaiju-hangar-card.ew-loadout { height: 100dvh; padding: clamp(12px, 2.4vh, 28px) clamp(16px, 2.6vw, 40px) clamp(12px, 2vh, 22px); }
}

/* ---------- Head: a stencilled bay title ---------- */
#kaiju-hangar .ew-head { border-bottom: 0; background: linear-gradient(90deg, var(--hg-edge), transparent 60%) left bottom / 100% 1px no-repeat; }
#kaiju-hangar .ew-loadout h2 { font-family: var(--hg-stencil); font-weight: 400; letter-spacing: 0.12em; font-size: clamp(24px, 3vw, 40px); line-height: 1; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8); }
#kaiju-hangar .ew-loadout .ew-eyebrow { display: flex; align-items: center; gap: 10px; }
#kaiju-hangar .ew-loadout .ew-eyebrow::before { content: ''; width: 8px; height: 8px; background: var(--ew-gold); transform: rotate(45deg); box-shadow: 0 0 10px rgba(201, 162, 74, 0.8); animation: hg-blink 2.4s ease-in-out infinite; }
@keyframes hg-blink { 50% { opacity: 0.35; } }
#kaiju-hangar .ew-tool-btn { background: var(--hg-glass); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---------- Side panels: HUD glass ---------- */
#kaiju-hangar .ew-panel {
  padding: clamp(10px, 1.6vh, 16px) clamp(10px, 1vw, 14px);
  background:
    linear-gradient(var(--ew-gold), var(--ew-gold)) left top / 2px 34px no-repeat,
    linear-gradient(var(--hg-edge), var(--hg-edge)) left top / 1px 100% no-repeat,
    linear-gradient(160deg, var(--hg-glass-hi), var(--hg-glass));
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}
#kaiju-hangar .ew-weapons {
  background:
    linear-gradient(var(--ew-gold), var(--ew-gold)) right top / 2px 34px no-repeat,
    linear-gradient(var(--hg-edge), var(--hg-edge)) right top / 1px 100% no-repeat,
    linear-gradient(200deg, var(--hg-glass-hi), var(--hg-glass));
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%, 0 16px);
}
#kaiju-hangar .ew-panel-title { font-size: 11px; letter-spacing: 0.3em; }

/* ---------- Cards: a picked card is lit, with a gold spine ---------- */
#kaiju-hangar .ew-card {
  overflow: hidden;
  background: linear-gradient(100deg, rgba(236, 230, 214, 0.05), rgba(236, 230, 214, 0.01) 70%);
  box-shadow: inset 0 0 0 1px rgba(236, 230, 214, 0.08);
}
#kaiju-hangar .ew-card:hover { transform: translateX(3px); }
#kaiju-hangar .ew-weapons .ew-card:hover { transform: translateX(-3px); }
#kaiju-hangar .ew-card:has(:checked) {
  background:
    linear-gradient(var(--ew-gold), var(--ew-gold)) left top / 3px 100% no-repeat,
    linear-gradient(100deg, rgba(201, 162, 74, 0.24), rgba(201, 162, 74, 0.04) 75%);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.7), inset 0 0 34px rgba(201, 162, 74, 0.1), 0 0 24px -6px rgba(201, 162, 74, 0.45);
}
#kaiju-hangar .ew-weapons .ew-card:has(:checked) {
  background:
    linear-gradient(var(--ew-gold), var(--ew-gold)) right top / 3px 100% no-repeat,
    linear-gradient(260deg, rgba(201, 162, 74, 0.24), rgba(201, 162, 74, 0.04) 75%);
}
#kaiju-hangar .ew-card > :not(.kaiju-hangar-radio) { position: relative; z-index: 1; }
#kaiju-hangar .ew-card-name { letter-spacing: 0.1em; }
#kaiju-hangar .ew-card:has(:checked) .ew-card-name { text-shadow: 0 0 18px rgba(201, 162, 74, 0.45); }
#kaiju-hangar .ew-tag { background: rgba(5, 5, 6, 0.45); box-shadow: inset 0 0 0 1px rgba(236, 230, 214, 0.1); }

/* ---------- Stage: the mech stands in the bay ---------- */
#kaiju-hangar .ew-stage.kaiju-hangar-stage {
  background: none;
  box-shadow: none;
  clip-path: none;
  overflow: visible;
}
/* lit floor ring under the mech, and targeting brackets round the view */
#kaiju-hangar .ew-stage.kaiju-hangar-stage::before {
  content: ''; position: absolute; left: 50%; bottom: 4%; z-index: 0;
  width: min(78%, 420px); aspect-ratio: 4 / 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(201, 162, 74, 0.32), rgba(201, 162, 74, 0.08) 60%, transparent 72%);
  box-shadow: 0 0 0 1px rgba(201, 162, 74, 0.35), 0 0 40px rgba(201, 162, 74, 0.18);
  animation: hg-ring 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hg-ring { 50% { box-shadow: 0 0 0 1px rgba(201, 162, 74, 0.55), 0 0 56px rgba(201, 162, 74, 0.28); } }
#kaiju-hangar .ew-stage.kaiju-hangar-stage::after {
  content: ''; position: absolute; inset: calc(var(--hg-band, 54px) + 8px) 6px 6px; z-index: 0;
  --b: rgba(236, 230, 214, 0.38);
  background:
    linear-gradient(var(--b), var(--b)) left top / 22px 1px no-repeat,
    linear-gradient(var(--b), var(--b)) left top / 1px 22px no-repeat,
    linear-gradient(var(--b), var(--b)) right top / 22px 1px no-repeat,
    linear-gradient(var(--b), var(--b)) right top / 1px 22px no-repeat,
    linear-gradient(var(--b), var(--b)) left bottom / 22px 1px no-repeat,
    linear-gradient(var(--b), var(--b)) left bottom / 1px 22px no-repeat,
    linear-gradient(var(--b), var(--b)) right bottom / 22px 1px no-repeat,
    linear-gradient(var(--b), var(--b)) right bottom / 1px 22px no-repeat;
  pointer-events: none;
}
#kaiju-hangar .kaiju-hangar-canvas { z-index: 1; }
/* the name band: the mech's name stencilled over the bay, no box */
#kaiju-hangar .ew-plate {
  justify-items: center; text-align: center;
  grid-template-columns: auto auto; grid-template-areas: "name name" "frame weapon"; justify-content: center;
  padding: 2px 12px 8px;
  border-bottom: 0;
  background: none;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9);
}
#kaiju-hangar .ew-plate .ew-plate-name { font-family: var(--hg-stencil); font-weight: 400; font-size: clamp(24px, 3vw, 44px); letter-spacing: 0.12em; line-height: 1; }
#kaiju-hangar .ew-plate .ew-plate-frame,
#kaiju-hangar .ew-plate .ew-plate-weapon { font-size: 10px; letter-spacing: 0.24em; }
#kaiju-hangar .ew-plate .ew-plate-weapon::before { display: inline-block; content: '//'; width: auto; height: auto; margin: 0 8px 0 0; background: none; color: var(--ew-gold); }

/* ---------- Mission briefing strip ---------- */
#kaiju-hangar .ew-footer {
  position: relative;
  padding: clamp(10px, 1.6vh, 16px) clamp(12px, 1.4vw, 18px);
  border-top: 0;
  background:
    linear-gradient(90deg, var(--ew-gold), var(--hg-edge) 30%, transparent) left top / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(9, 9, 11, 0.78), rgba(5, 5, 6, 0.9));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
#kaiju-hangar .kaiju-city-legend { color: var(--ew-gold); letter-spacing: 0.26em; }
#kaiju-hangar .kaiju-city-option { flex-direction: column; gap: 1px; background: rgba(236, 230, 214, 0.025); font-family: var(--font-sign); letter-spacing: 0.16em; text-transform: uppercase; transition: background 0.2s, color 0.2s; }
#kaiju-hangar .kaiju-city-option:hover { background: rgba(201, 162, 74, 0.08); }
#kaiju-hangar .kaiju-city-option > span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#kaiju-hangar :is(#kaiju-city-pick, #kaiju-difficulty-pick) .kaiju-city-option { letter-spacing: 0.08em; }
#kaiju-hangar .kaiju-city-option:has(:checked) { background: linear-gradient(180deg, rgba(201, 162, 74, 0.22), rgba(201, 162, 74, 0.06)); box-shadow: inset 0 -2px 0 var(--ew-gold); }
/* battleground coordinates under each city */
#kaiju-hangar #kaiju-city-pick .kaiju-city-option span::after { display: block; margin-top: 2px; overflow: hidden; color: var(--ew-mute); font-size: 8px; letter-spacing: 0.08em; white-space: nowrap; text-overflow: clip; font-variant-numeric: tabular-nums; }
#kaiju-hangar #kaiju-city-pick .kaiju-city-option:has([value="nyc"]) span::after { content: '40.7N 74.0W'; }
#kaiju-hangar #kaiju-city-pick .kaiju-city-option:has([value="tokyo"]) span::after { content: '35.7N 139.8E'; }
#kaiju-hangar #kaiju-city-pick .kaiju-city-option:has([value="oahu"]) span::after { content: '21.3N 157.9W'; }
/* difficulty as threat pips */
#kaiju-hangar #kaiju-difficulty-pick .kaiju-city-option span::before { display: block; height: 4px; margin: 0 auto 4px; content: ''; background: repeating-linear-gradient(90deg, currentColor 0 7px, transparent 7px 10px); opacity: 0.75; }
#kaiju-hangar #kaiju-difficulty-pick .kaiju-city-option:has([value="easy"]) span::before { width: 7px; }
#kaiju-hangar #kaiju-difficulty-pick .kaiju-city-option:has([value="normal"]) span::before { width: 17px; }
#kaiju-hangar #kaiju-difficulty-pick .kaiju-city-option:has([value="hard"]) span::before { width: 27px; }
#kaiju-hangar #kaiju-difficulty-pick .kaiju-city-option:has([value="brutal"]) span::before { width: 37px; color: #d0654a; }
#kaiju-hangar #kaiju-difficulty-pick .kaiju-city-option:has([value="brutal"]:checked) { color: #e07a5c; box-shadow: inset 0 -2px 0 #d0654a; border-color: #d0654a; background: linear-gradient(180deg, rgba(208, 101, 74, 0.22), rgba(208, 101, 74, 0.05)); }

/* ---------- Footer rows line up ----------
   Deploy is built like the pickers (label, a row of exactly --hg-opt, a note line) and every part of the three has a
   fixed height, so Deploy's plate shares the Starting Wave row's top and bottom in the 2x2 grid and in the single row */
#kaiju-hangar .ew-footer { align-items: start; }
/* (a fieldset's legend sits outside its flex gap, so the spacing is margins on every column alike) */
#kaiju-hangar .ew-footer .kaiju-city-pick { row-gap: 0; }
#kaiju-hangar .ew-footer .kaiju-city-legend { display: block; height: 14px; margin: 0 0 7px; padding: 0; line-height: 14px; white-space: nowrap; }
#kaiju-hangar .ew-footer .kaiju-city-option { height: var(--hg-opt); min-height: 0; padding-block: 0; }
#kaiju-hangar .ew-footer .kaiju-city-credit { height: 16px; margin-top: 7px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#kaiju-hangar .ew-footer .ew-actions { display: flex; flex: 0 0 auto; flex-direction: column; align-items: stretch; justify-content: flex-start; align-self: start; min-width: 220px; margin: 0; padding: 0; }
#kaiju-hangar .ew-footer .ew-actions .kaiju-launch { height: var(--hg-opt); min-height: 0; padding-top: 0; padding-bottom: 0; }
@media (min-width: 900px) and (min-height: 521px) and (max-height: 860px) { #kaiju-hangar { --hg-opt: 38px; } }
@media (min-width: 900px) and (min-height: 521px) and (max-height: 660px) { #kaiju-hangar { --hg-opt: 32px; } #kaiju-hangar #kaiju-city-pick .kaiju-city-option span::after { display: none; } }
@media (max-height: 520px) and (orientation: landscape) {
  #kaiju-hangar { --hg-opt: 34px; }
  /* style.css hides the note lines here: Deploy's goes too, so both columns stay label + row */
  #kaiju-hangar .ew-footer .kaiju-city-credit { display: none; }
}

/* ---------- Deploy: a launch plate with hazard stripes ---------- */
#kaiju-hangar .ew-actions .kaiju-launch {
  position: relative;
  width: 100%;
  padding-left: 46px;
  font-family: var(--hg-stencil); font-weight: 400; font-size: 18px; letter-spacing: 0.26em;
  background:
    repeating-linear-gradient(-45deg, #0a0a0c 0 7px, transparent 7px 14px) left top / 30px 100% no-repeat,
    linear-gradient(180deg, #e2c071, var(--ew-gold) 55%, #a9843a);
  box-shadow: inset 0 1px 0 rgba(255, 245, 210, 0.6), 0 10px 30px -8px rgba(201, 162, 74, 0.6);
}
#kaiju-hangar .ew-actions .kaiju-launch::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 250, 230, 0.45) 50%, transparent 70%) -150% 0 / 60% 100% no-repeat;
  animation: hg-glint 3.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hg-glint { 0%, 55% { background-position: -150% 0; } 85%, 100% { background-position: 250% 0; } }
#kaiju-hangar .ew-actions .kaiju-launch:hover { background: repeating-linear-gradient(-45deg, #0a0a0c 0 7px, transparent 7px 14px) left top / 30px 100% no-repeat, linear-gradient(180deg, #f0d68f, #d6b05c 55%, #b8923f); }

/* ---------- Small screens: the same look, lighter ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  #kaiju-hangar .ew-plate .ew-plate-name { font-size: 18px; }
  #kaiju-hangar .ew-actions .kaiju-launch { min-width: 0; font-size: 15px; }
  #kaiju-hangar .kaiju-hangar-hint { display: none; }
  #kaiju-hangar #kaiju-city-pick .kaiju-city-option span::after { display: none; }
}
@media (max-width: 719px) {
  #kaiju-hangar .kaiju-hangar-card.ew-loadout { overflow: auto; }
  #kaiju-hangar #kaiju-city-pick .kaiju-city-option span::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #kaiju-hangar.kaiju-settings::after,
  #kaiju-hangar .ew-stage.kaiju-hangar-stage::before,
  #kaiju-hangar .ew-actions .kaiju-launch::after,
  #kaiju-hangar .ew-loadout .ew-eyebrow::before { animation: none; }
}

/* ---------- Combat profile always whole ----------
   Hovering a weapon compares it in the Combat Profile (damage, range, energy), but the weapon cards filled the panel and
   the profile was cut off after Armor, which a weapon never changes. The profile keeps its full height; the weapon
   list gives way (scrolls if it must), and only the picked weapon is a full card. */
@media (min-width: 900px) and (min-height: 521px) {
  #kaiju-hangar .ew-weapons .ew-stats { flex: none; }
  #kaiju-hangar .ew-weapons .ew-list { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(201, 162, 74, 0.4) transparent; }
  #kaiju-hangar .ew-weapons .ew-list > .ew-card { flex: none; }
}
/* unpicked weapons are one-line rows (the name); the picked one opens to its role, fire rate and tags */
#kaiju-hangar .ew-weapon-card:not(:has(:checked)) { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; }
#kaiju-hangar .ew-weapon-card:not(:has(:checked)) :is(.ew-card-head, .ew-tags) { display: none; }
#kaiju-hangar .ew-weapon-card:not(:has(:checked)) .ew-card-name { flex: 1; min-width: 0; text-align: left; font-size: 13.5px; letter-spacing: 0.04em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
