/* DS-1 Imperial analysis console chrome — restrained, technical, diegetic. */

:root {
  --accent: #8fd6ff;
  --accent-dim: #3d6a82;
  --ink: #d7e3ec;
  --ink-dim: #7e94a3;
  --panel-bg: rgba(6, 10, 14, 0.62);
  --panel-edge: rgba(143, 214, 255, 0.28);
  --warn: #ffb46a;
  --ok: #7dffb0;
  --danger: #ff5a4e;
  --laser: #6cff5a;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Courier New", monospace;
  --sans: "Helvetica Neue", "Arial Narrow", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #04060a;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#viewport { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

/* ------------------------------- buttons ------------------------------- */
.hud-button {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(12, 20, 28, 0.72);
  border: 1px solid var(--panel-edge);
  padding: 12px 26px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.hud-button:hover, .hud-button:focus-visible {
  background: rgba(24, 44, 60, 0.85);
  border-color: var(--accent);
  color: #ffffff;
  outline: none;
}
.hud-button:active { background: rgba(40, 70, 92, 0.9); }
.hud-mini { padding: 6px 14px; font-size: 10px; }

/* ----------------------------- title screen ---------------------------- */
.title-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(8, 14, 22, 0.28) 0%, rgba(3, 5, 9, 0.78) 100%);
  z-index: 40;
}
.title-frame { text-align: center; max-width: min(720px, 92vw); padding: 24px; }
.title-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.34em;
  color: var(--ink-dim); text-transform: uppercase; margin-bottom: 18px;
}
.title-main {
  font-size: clamp(26px, 5vw, 46px); font-weight: 600;
  letter-spacing: 0.16em; color: #eef6fb;
  text-shadow: 0 0 24px rgba(143, 214, 255, 0.35);
}
.title-sub {
  font-family: var(--mono); font-size: clamp(13px, 2vw, 17px); font-weight: 400;
  letter-spacing: 0.3em; color: var(--accent); margin-top: 10px;
}
.title-rule {
  height: 1px; margin: 18px auto; width: 68%;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
}
.title-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 26px; }
.title-button { width: min(340px, 80vw); }
.title-meta {
  margin-top: 30px; display: flex; flex-direction: column; gap: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  color: var(--ink-dim); text-transform: uppercase;
}
.title-scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* --------------------------------- HUD --------------------------------- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 30; font-family: var(--mono); }
.hud.hidden, .hidden { display: none !important; }

.hud-panel {
  position: absolute;
  background: var(--panel-bg);
  border: 1px solid var(--panel-edge);
  padding: 8px 12px;
  font-size: 11px;
  backdrop-filter: blur(2px);
}
.hud-panel-head {
  font-size: 9px; letter-spacing: 0.28em; color: var(--ink-dim);
  border-bottom: 1px solid rgba(143, 214, 255, 0.16);
  padding-bottom: 4px; margin-bottom: 6px; text-transform: uppercase;
}
.hud-row { display: flex; gap: 10px; justify-content: space-between; min-width: 240px; line-height: 1.7; }
.hud-key { color: var(--ink-dim); letter-spacing: 0.14em; white-space: nowrap; }
.hud-val { color: var(--ink); letter-spacing: 0.08em; text-align: right; }
.hud-val.ok { color: var(--ok); }
.hud-val.warn { color: var(--warn); }
.hud-val.danger { color: var(--danger); }
.hud-val.laser { color: var(--laser); }

.hud-topleft { top: 14px; left: 14px; }
.hud-topright { top: 14px; right: 14px; }
.hud-bottomleft { bottom: 14px; left: 14px; }
.hud-bottomright { bottom: 14px; right: 14px; max-width: 44vw; }
#hud-hint-lines { display: flex; flex-direction: column; gap: 2px; color: var(--ink-dim); letter-spacing: 0.1em; }
#hud-hint-lines b { color: var(--ink); font-weight: 600; }

.hud-topbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; pointer-events: auto;
}

.hud-frame-corner { position: absolute; width: 22px; height: 22px; border: 1px solid var(--panel-edge); }
.hud-frame-corner.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.hud-frame-corner.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.hud-frame-corner.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.hud-frame-corner.br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

.hud-banner {
  position: absolute; top: 22%; left: 50%; transform: translateX(-50%);
  font-size: 15px; letter-spacing: 0.4em; color: var(--accent);
  background: var(--panel-bg); border: 1px solid var(--panel-edge);
  padding: 10px 30px; text-transform: uppercase; white-space: nowrap;
}
.hud-banner.danger { color: var(--danger); border-color: rgba(255, 90, 78, 0.45); }
.hud-banner.laser { color: var(--laser); border-color: rgba(108, 255, 90, 0.45); }

.hud-charge {
  position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%);
  width: min(400px, 60vw); height: 4px;
  border: 1px solid rgba(108, 255, 90, 0.4); background: rgba(6, 12, 8, 0.7);
}
#hud-charge-fill { height: 100%; width: 0%; background: var(--laser); box-shadow: 0 0 12px var(--laser); }

/* crosshair */
.crosshair { position: absolute; top: 50%; left: 50%; width: 0; height: 0; }
.crosshair-dot {
  position: absolute; width: 3px; height: 3px; margin: -1.5px;
  background: var(--accent); border-radius: 50%;
}
.crosshair-ring {
  position: absolute; width: 26px; height: 26px; margin: -13px;
  border: 1px solid rgba(143, 214, 255, 0.4); border-radius: 50%;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.crosshair.lock .crosshair-ring { border-color: var(--laser); transform: scale(0.72); }
.crosshair.lock .crosshair-dot { background: var(--laser); }

.lock-hint {
  position: absolute; top: 60%; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.3em; color: var(--ink-dim);
  background: var(--panel-bg); border: 1px solid var(--panel-edge);
  padding: 8px 20px; text-transform: uppercase;
}

/* flash overlay for discharge */
.flash {
  position: fixed; inset: 0; z-index: 35; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(190, 255, 190, 0.95), rgba(108, 255, 90, 0.35) 60%, transparent 100%);
  opacity: 0;
}
.flash.on { animation: flashbang 0.9s ease-out forwards; }
@keyframes flashbang { 0% { opacity: 1; } 100% { opacity: 0; } }

/* mobile / touch notice */
.mobile-notice {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3, 5, 9, 0.9);
}
.mobile-notice-card {
  max-width: min(440px, 88vw); text-align: center;
  border: 1px solid var(--panel-edge); background: var(--panel-bg);
  padding: 22px; font-size: 13px; line-height: 1.6; color: var(--ink);
}
.mobile-notice-card .hud-button { margin-top: 16px; }

@media (max-width: 700px) {
  .hud-panel { font-size: 9px; padding: 6px 8px; }
  .hud-row { min-width: 150px; }
  .hud-bottomright { display: none; }
  .title-main { letter-spacing: 0.1em; }
}
