/* STARWARD: Alliance Expedition — cockpit styling.
   Instrument panels floating over the 3D viewport, in the reference art's
   language: translucent deep-blue glass, hairline cyan rules, clipped
   corners, hexagonal speed pod, a scarlet boss bar for the Red Maw.
   System font stacks only; nothing is fetched. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #020409;
  color: #dfeaf8;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(2, 6, 18, 0.5) 100%);
}

.hud { position: fixed; z-index: 5; pointer-events: none; }
.hud-topleft { top: 18px; left: 20px; width: 330px; }
.hud-topright { top: 18px; right: 20px; text-align: center; }
.hud-bottomleft { bottom: 18px; left: 20px; width: 300px; }
.hud-bottomright { bottom: 18px; right: 20px; text-align: right; }
.hud-right { top: 248px; right: 20px; width: 300px; }

.panel {
  background: linear-gradient(160deg, rgba(8, 24, 52, 0.78), rgba(4, 12, 30, 0.66));
  border: 1px solid rgba(126, 200, 255, 0.4);
  border-radius: 4px;
  padding: 12px 14px;
  backdrop-filter: blur(3px);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.panel-kicker {
  font-size: 10px; letter-spacing: 0.22em; color: #7ec8ff;
  margin-bottom: 7px; font-weight: 600;
}

#objective-text { font-size: 15px; line-height: 1.45; font-weight: 600; color: #eaf4ff; }
#course-text { margin-top: 6px; font-size: 12px; color: #9fc3e8; }

#radar {
  border-radius: 50%;
  border: 1px solid rgba(126, 200, 255, 0.5);
  background: radial-gradient(circle, rgba(10, 30, 60, 0.55), rgba(4, 10, 24, 0.75));
}
#sector-name { margin-top: 6px; font-size: 11px; letter-spacing: 0.28em; color: #cfe6ff; font-weight: 600; }
#coords { font-size: 11px; color: #7d99bd; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Boss bar: the Red Maw's health, top centre, scarlet on black glass. */
#boss-wrap {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  width: min(560px, 44vw); z-index: 6; text-align: center;
  opacity: 0; transition: opacity 0.5s; pointer-events: none;
}
#boss-wrap.boss-show { opacity: 1; }
#boss-name {
  font-size: 13px; letter-spacing: 0.3em; color: #ff8a7a; font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 77, 77, 0.65); margin-bottom: 5px;
}
#boss-bar {
  height: 12px; border: 1px solid rgba(255, 110, 90, 0.7);
  background: rgba(30, 4, 8, 0.72); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
#boss-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #e02020, #ff7a4d);
  box-shadow: 0 0 14px rgba(255, 77, 77, 0.8);
  transition: width 0.25s;
}

.gauge { margin-bottom: 9px; }
.gauge-head {
  display: flex; justify-content: space-between;
  font-size: 10.5px; letter-spacing: 0.18em; color: #9fc3e8; margin-bottom: 3px;
  font-variant-numeric: tabular-nums;
}
.bar { height: 8px; background: rgba(126, 200, 255, 0.14); border: 1px solid rgba(126, 200, 255, 0.25); }
.bar-fill { height: 100%; width: 100%; background: #37c8ff; transition: width 0.2s; }
.bar-fill.hull { background: #7ef0c8; }
.bar-fill.shield { background: #57b6ff; box-shadow: 0 0 8px rgba(87, 182, 255, 0.7); }

#chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.chip {
  flex: 1 1 60px; text-align: center; padding: 5px 2px 4px;
  background: rgba(126, 200, 255, 0.08); border: 1px solid rgba(126, 200, 255, 0.22);
}
.chip-num { display: block; font-size: 16px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.chip-label { font-size: 8.5px; letter-spacing: 0.16em; color: #7d99bd; }

#weapons { margin-bottom: 10px; text-align: left; padding: 9px 12px; }
.weapon-slot { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 2px 0; }
.weapon-icon { color: #7ec8ff; font-size: 14px; }
.weapon-name { letter-spacing: 0.14em; color: #cfe6ff; flex: 1; }
#missile-count { color: #ffd98a; font-variant-numeric: tabular-nums; }
.weapon-key {
  border: 1px solid rgba(126, 200, 255, 0.5); border-radius: 3px;
  padding: 0 5px; font-size: 10px; color: #9fc3e8;
}
#lock-state { margin-top: 5px; font-size: 11px; letter-spacing: 0.2em; text-align: center; }
.lock-none { color: #5f7fa8; }
.lock-ing { color: #ffd98a; }
.lock-on { color: #ff8a7a; text-shadow: 0 0 8px rgba(255, 77, 77, 0.7); }

#speed-box {
  display: inline-block; min-width: 190px; padding: 12px 20px 10px;
  background: linear-gradient(200deg, rgba(8, 24, 52, 0.8), rgba(4, 12, 30, 0.65));
  border: 1px solid rgba(126, 200, 255, 0.4);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
  text-align: center;
}
#speed-value { font-size: 44px; font-weight: 700; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(126, 200, 255, 0.55); }
#speed-unit { font-size: 11px; color: #9fc3e8; letter-spacing: 0.14em; margin-top: 3px; }
#survey-progress { font-size: 11px; color: #7d99bd; margin-top: 4px; }

#log-panel { max-height: 240px; overflow: hidden; }
.log-line { font-size: 12px; line-height: 1.5; color: #c8dcf2; padding: 2px 0; border-bottom: 1px solid rgba(126, 200, 255, 0.08); }
.log-warn { color: #ffb35c; }
.log-find { color: #7ef0c8; }
.log-story { color: #ffb8e2; }

#scan-wrap {
  position: fixed; bottom: 108px; left: 50%; transform: translateX(-50%);
  width: 300px; text-align: center; z-index: 6; opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
#scan-wrap.scan-show { opacity: 1; }
#scan-label { font-size: 11px; letter-spacing: 0.2em; color: #7ef0c8; margin-bottom: 4px; }
#scan-bar { height: 6px; background: rgba(126, 240, 200, 0.15); border: 1px solid rgba(126, 240, 200, 0.4); }
#scan-fill { height: 100%; width: 0; background: #7ef0c8; }

#prompt {
  position: fixed; bottom: 74px; left: 50%; transform: translateX(-50%);
  z-index: 6; font-size: 15px; font-weight: 600; color: #eaf4ff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); transition: opacity 0.2s; pointer-events: none;
  background: rgba(4, 12, 30, 0.55); padding: 6px 16px; border: 1px solid rgba(126, 200, 255, 0.3);
}

#card {
  position: fixed; left: 50%; top: 21%; transform: translate(-50%, -12px);
  width: min(430px, 86vw); z-index: 7; text-align: center;
  background: linear-gradient(170deg, rgba(10, 30, 64, 0.9), rgba(4, 12, 30, 0.85));
  border: 1px solid rgba(126, 240, 200, 0.55); padding: 16px 20px 14px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}
#card.card-show { opacity: 1; transform: translate(-50%, 0); }
#card-kicker { font-size: 10px; letter-spacing: 0.3em; color: #7ef0c8; }
#card-title { font-size: 19px; font-weight: 700; margin: 5px 0 4px; color: #fff; }
#card-body { font-size: 13px; line-height: 1.55; color: #c8dcf2; margin: 0 0 8px; }
.yield {
  display: inline-block; margin: 2px 3px; padding: 3px 9px; font-size: 11px; font-weight: 700;
  color: #062a1a; background: #7ef0c8; border-radius: 2px; letter-spacing: 0.06em;
}

#overlay {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 38%, rgba(6, 16, 38, 0.42), rgba(2, 4, 12, 0.88) 78%);
}
#overlay.hidden { display: none; }
#overlay-box { text-align: center; max-width: 620px; padding: 30px; }
#overlay-kicker { font-size: 11px; letter-spacing: 0.34em; color: #7ec8ff; }
#overlay-title {
  font-size: 76px; margin: 8px 0 0; letter-spacing: 0.14em; font-weight: 800; color: #fff;
  text-shadow: 0 0 34px rgba(126, 200, 255, 0.65), 0 0 90px rgba(126, 200, 255, 0.3);
}
#overlay-sub { font-size: 17px; letter-spacing: 0.3em; color: #ffd98a; margin-top: 2px; }
#overlay-body { margin: 20px auto 24px; font-size: 14.5px; line-height: 1.75; color: #c8dcf2; max-width: 520px; }
#overlay-body .stat-row { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(126, 200, 255, 0.16); padding: 4px 2px; font-variant-numeric: tabular-nums; }
#overlay-body .grade { font-size: 54px; font-weight: 800; color: #ffd98a; text-shadow: 0 0 26px rgba(255, 217, 138, 0.6); line-height: 1.1; }
#overlay-button {
  pointer-events: auto; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700; letter-spacing: 0.12em;
  color: #04122e; background: linear-gradient(180deg, #9fe0ff, #37c8ff);
  border: none; padding: 13px 34px; border-radius: 3px;
  box-shadow: 0 0 24px rgba(55, 200, 255, 0.45);
}
#overlay-button:hover { filter: brightness(1.12); }
#overlay-hint { margin-top: 20px; font-size: 11.5px; color: #7d99bd; letter-spacing: 0.06em; line-height: 1.7; }
