:root {
  --bg: #060912;
  --surface: rgba(8, 12, 22, 0.92);
  --panel-bg: rgba(6, 10, 19, 0.86);
  --panel-border: rgba(138, 174, 224, 0.24);
  --hairline: rgba(255, 255, 255, 0.085);
  --cyan: #38e8ff;
  --magenta: #ff2a6d;
  --amber: #f5a623;
  --green: #38e89c;
  --red: #ff3b4e;
  --text: #edf3fc;
  --text-muted: #a1b2cc;
  --dim: #8b9cb8;
  --radius-card: 5px;
  --radius-panel: 4px;
  --radius-control: 3px;
  --radius-inner: 2px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, 'Consolas', monospace;
}

::selection {
  background: rgba(56, 232, 255, 0.28);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(56, 232, 255, 0.22);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(5, 8, 16, 0.65);
}

::-webkit-scrollbar-thumb {
  background: rgba(138, 174, 224, 0.32);
  border-radius: 3px;
}

@media (hover: hover) {
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 232, 255, 0.55);
  }
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  touch-action: none;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
}

.ui-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at center, #0e1424 0%, #05070d 100%);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0px,
    rgba(255, 255, 255, 0) 2px,
    rgba(0, 0, 0, 0.11) 3px,
    rgba(0, 0, 0, 0.11) 4px
  );
  z-index: 5;
}

.hidden {
  display: none !important;
}

/* =========================================================
   IN-GAME HUD
   ========================================================= */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#hud.phase-clear::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(56, 232, 255, 0.42), inset 0 0 44px rgba(56, 232, 255, 0.16);
  animation: phaseClearFlash 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes phaseClearFlash {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

.hud-panel {
  position: absolute;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 12px;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: border-color 160ms ease, box-shadow 180ms ease;
}

.hud-panel::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  border-top-left-radius: var(--radius-panel);
  pointer-events: none;
  transition: border-color 160ms ease;
}

.hud-top-left {
  top: max(14px, env(safe-area-inset-top, 14px));
  left: max(14px, env(safe-area-inset-left, 14px));
  width: 288px;
}

.hud-top-center {
  top: max(14px, env(safe-area-inset-top, 14px));
  left: 50%;
  transform: translateX(-50%);
  width: min(468px, 40vw);
  text-align: center;
}

.hud-top-center::before {
  border-color: var(--magenta);
}

#hud.phase-clear .hud-top-center {
  border-color: rgba(56, 232, 255, 0.72);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.56),
    0 0 24px rgba(56, 232, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

#hud.phase-clear .hud-top-center::before {
  border-color: var(--cyan);
}

.hud-top-right {
  top: max(14px, env(safe-area-inset-top, 14px));
  right: max(14px, env(safe-area-inset-right, 14px));
  width: 292px;
}

.hud-top-right::before {
  border-color: var(--magenta);
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 6px;
}

.hud-badge-group,
.hud-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 2px 6px;
  border-radius: var(--radius-inner);
  line-height: 1.25;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-cyan {
  color: #031218;
  background: var(--cyan);
}

.tag-magenta {
  color: #ffffff;
  background: var(--magenta);
}

.tag-dim {
  color: var(--text-muted);
  border: 1px solid rgba(138, 174, 224, 0.32);
  background: rgba(255, 255, 255, 0.03);
}

.bar-group {
  margin-bottom: 7px;
}

.bar-row {
  display: flex;
  gap: 8px;
}

.bar-group.small {
  flex: 1;
  min-width: 0;
}

.partner-bar-group {
  margin-bottom: 0;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--dim);
  margin-bottom: 3px;
  letter-spacing: 0.06em;
}

.bar-label span:last-child {
  color: var(--text);
}

.bar-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-inner);
  overflow: hidden;
}

.bar-track-hull {
  height: 9px;
}

.bar-fill {
  height: 100%;
  transition: width 0.08s linear, background-color 140ms ease;
}

.fill-cyan {
  background: linear-gradient(90deg, #1cc6f0, #38e8ff);
}

.fill-green {
  background: linear-gradient(90deg, #28cf8c, #6ee7b7);
}

.fill-amber {
  background: linear-gradient(90deg, #e08e16, #fbbf24);
}

/* Low-HP Critical Warning & Hit-Flash Signifiers */
.hud-top-left.hull-damaged {
  border-color: var(--magenta) !important;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.56),
    0 0 22px rgba(255, 42, 109, 0.58) !important;
}

.hud-top-left.hull-damaged::before {
  border-color: var(--magenta);
}

.hud-top-left.hull-critical {
  border-color: rgba(255, 59, 78, 0.85);
  animation: hullCriticalPulse 0.9s ease-in-out infinite alternate;
}

.hud-top-left.hull-critical::before {
  border-color: var(--red);
}

.hud-top-left.hull-critical #hp-text {
  color: #ff6b81;
  font-weight: 900;
}

.hud-top-left.hull-critical #hp-text::before {
  content: 'LOW ';
  color: #ff3b4e;
  letter-spacing: 0.08em;
}

#hp-bar.critical,
#hp-bar.hull-critical,
.hud-top-left.hull-critical #hp-bar {
  background: linear-gradient(90deg, #c9183c, #ff3b4e 55%, #ff7b8a);
  box-shadow: 0 0 10px rgba(255, 59, 78, 0.72);
}

#hp-bar.hp-flash {
  background: #ffffff !important;
  filter: brightness(1.4);
}

@keyframes hullCriticalPulse {
  0% {
    border-color: rgba(255, 59, 78, 0.52);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.54), 0 0 10px rgba(255, 59, 78, 0.25);
  }
  100% {
    border-color: rgba(255, 59, 78, 0.95);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.58), 0 0 22px rgba(255, 59, 78, 0.55);
  }
}

/* Overdrive 100% Ready Shimmer & Badge Signifier */
.fill-bomb {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.fill-bomb.ready {
  background: linear-gradient(
    110deg,
    #f59e0b 0%,
    #fde68a 38%,
    #ffffff 50%,
    #fde68a 62%,
    #f59e0b 100%
  );
  background-size: 220% 100%;
  animation: overdriveShimmer 1.35s linear infinite;
  box-shadow: 0 0 12px rgba(253, 230, 138, 0.65);
}

@keyframes overdriveShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

.hud-top-left.overdrive-ready .bar-track-bomb {
  border-color: rgba(251, 191, 36, 0.78);
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.3);
}

.hud-top-left.overdrive-ready #bomb-bar-label {
  color: #fde68a;
}

#bomb-pct.ready,
.hud-top-left.overdrive-ready #bomb-pct {
  color: #060912;
  background: #fbbf24;
  padding: 0 5px;
  border-radius: var(--radius-inner);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.hud-top-left.overdrive-ready #hud-lo-bomb {
  text-shadow: 0 0 10px rgba(253, 230, 138, 0.55);
}

#hud-lo-sub.depleted {
  color: #ff6b81 !important;
  opacity: 0.72;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
}

.stat-key {
  color: var(--dim);
  font-size: 9px;
  margin-right: 3px;
  letter-spacing: 0.05em;
}

.stat-val {
  font-weight: 800;
}

.text-cyan { color: var(--cyan); }
.text-magenta { color: var(--magenta); }
.text-amber { color: var(--amber); }

/* Boss Bar */
.boss-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.boss-name {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.threat-badge {
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: var(--radius-inner);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.threat-c { background: #334155; color: #edf3fc; }
.threat-b { background: #0284c7; color: #ffffff; }
.threat-a { background: #d97706; color: #ffffff; }
.threat-s { background: #e11d48; color: #ffffff; box-shadow: 0 0 10px rgba(225, 29, 72, 0.65); }
.threat-ss { background: #c026d3; color: #ffffff; box-shadow: 0 0 14px rgba(192, 38, 211, 0.8); }
.threat-omega {
  background: linear-gradient(90deg, #ff2e88, #ffb830, #38f2ff);
  color: #05070d;
  box-shadow: 0 0 16px rgba(255, 46, 136, 0.85);
}

.boss-hp-track {
  position: relative;
  width: 100%;
  height: 11px;
  background: rgba(255, 42, 109, 0.14);
  border: 1px solid rgba(255, 42, 109, 0.48);
  border-radius: var(--radius-inner);
  overflow: hidden;
}

.boss-hp-lag {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(255, 214, 128, 0.8);
  transition: width 0.35s ease-out;
}

.boss-hp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #e11d5a, #ff2a6d 70%, #ff5c8d);
  transition: width 0.06s linear;
}

.module-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 4px;
  margin-top: 7px;
  min-height: 18px;
  max-height: 44px;
  overflow: hidden;
}

.mod-chip {
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.25;
  padding: 2px 6px;
  border-radius: var(--radius-inner);
  border: 1px solid rgba(56, 232, 255, 0.36);
  background: rgba(56, 232, 255, 0.08);
  color: #c8f2ff;
  letter-spacing: 0.05em;
  white-space: nowrap;
  animation: chipPop 220ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mod-chip.mk2 {
  border-color: rgba(245, 166, 35, 0.58);
  background: rgba(245, 166, 35, 0.14);
  color: #ffd07a;
}

.mod-chip.giant {
  border-color: rgba(255, 42, 109, 0.62);
  background: rgba(255, 42, 109, 0.16);
  color: #ffa6c4;
}

.mod-chip.synergy {
  border-color: rgba(255, 228, 94, 0.72);
  background: rgba(245, 166, 35, 0.22);
  color: #fff6c2;
  font-weight: 800;
}

.mod-chip.broken {
  border-color: rgba(255, 59, 78, 0.32);
  background: rgba(255, 59, 78, 0.08);
  color: #8f626c;
  text-decoration: line-through;
}

/* Profiler */
.profiler-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-row {
  display: grid;
  grid-template-columns: 56px 1fr 30px;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 600;
  color: var(--dim);
}

.p-row.dominant {
  color: #ffffff;
  font-weight: 800;
}

.p-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  overflow: hidden;
}

.p-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff2e88, #ff85b3);
  transition: width 0.15s linear;
}

.p-row.dominant .p-fill {
  background: linear-gradient(90deg, #ffb830, #ff2e88);
  box-shadow: 0 0 8px rgba(255, 184, 48, 0.65);
}

.p-fill-apex {
  background: linear-gradient(90deg, #38f2ff, #c084fc) !important;
}

.p-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ai-log {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
  font-size: 9.5px;
  line-height: 1.4;
  color: #9ec8fc;
  height: 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.log-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-line.alert {
  color: #ffd07a;
  font-weight: 700;
}

.mini-btn {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(168, 196, 236, 0.26);
  border-radius: var(--radius-inner);
  color: var(--text);
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 700;
  padding: 2px 5px;
  line-height: 1.25;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.mini-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(56, 232, 255, 0.14);
}

/* Alert Banner — guaranteed clear below Boss HP + wrapped module chips at all resolutions */
.alert-banner {
  position: absolute;
  top: calc(max(14px, env(safe-area-inset-top, 14px)) + 138px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 10px 30px;
  background: linear-gradient(
    90deg,
    rgba(6, 10, 20, 0),
    rgba(6, 10, 20, 0.94) 14%,
    rgba(6, 10, 20, 0.94) 86%,
    rgba(6, 10, 20, 0)
  );
  border-top: 1px solid var(--magenta);
  border-bottom: 1px solid var(--magenta);
  min-width: 400px;
  max-width: min(560px, 86vw);
  animation: bannerPulse 260ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 12;
}

.alert-banner.part-break {
  border-color: var(--amber);
}

.alert-banner.phase-clear {
  border-color: var(--cyan);
}

.alert-sub {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--magenta);
  font-weight: 800;
}

.alert-banner.part-break .alert-sub {
  color: var(--amber);
}

.alert-banner.phase-clear .alert-sub {
  color: var(--cyan);
}

.alert-main {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  margin: 3px 0;
}

.alert-reason {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

@keyframes bannerPulse {
  0% { opacity: 0; transform: translateX(-50%) scaleX(0.76); }
  100% { opacity: 1; transform: translateX(-50%) scaleX(1); }
}

.hud-bottom-hint {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom, 10px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(202, 218, 242, 0.74);
  background: rgba(6, 10, 19, 0.72);
  border: 1px solid rgba(138, 174, 224, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 5px 14px;
  border-radius: var(--radius-control);
  white-space: nowrap;
}

/* =========================================================
   OVERLAYS — FLATTENED FLIGHT-DECK ARCHITECTURE
   ========================================================= */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top, 14px))
           max(14px, env(safe-area-inset-right, 14px))
           max(14px, env(safe-area-inset-bottom, 14px))
           max(14px, env(safe-area-inset-left, 14px));
  background: radial-gradient(circle at center, rgba(6, 9, 18, 0.44) 0%, rgba(4, 6, 12, 0.86) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.overlay-card {
  width: min(592px, 100%);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid rgba(148, 184, 232, 0.25);
  border-radius: var(--radius-card);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.76),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: 26px 30px 22px;
  text-align: left;
  position: relative;
  animation: cardEnter 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.overlay-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  border-top-left-radius: var(--radius-card);
  pointer-events: none;
}

.result-card::before {
  border-color: var(--magenta);
}

.title-hero {
  margin-bottom: 16px;
}

.game-title {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.04;
  color: #ffffff;
}

.title-amp {
  font-size: 0.54em;
  font-weight: 700;
  color: var(--magenta);
  font-style: italic;
  vertical-align: baseline;
  margin: 0 2px;
}

.game-desc {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}

.game-desc strong {
  color: var(--text);
  font-weight: 700;
}

/* Flattened hairline sections (zero nested cards) */
.brief-section {
  border-top: 1px solid var(--hairline);
  padding: 12px 0;
  text-align: left;
}

.memory-box {
  background: transparent;
  border: none;
  border-top: 1px solid var(--hairline);
  padding: 12px 0;
  margin: 0;
  text-align: left;
}

.memory-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  gap: 8px;
}

.memory-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--dim);
  letter-spacing: 0.14em;
}

.memory-status {
  font-size: 11px;
  font-weight: 800;
  color: var(--magenta);
  font-variant-numeric: tabular-nums;
}

.memory-traits {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.55;
}

.memory-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-label {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
}

.toggle-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
  padding: 11px 0 14px;
  margin: 0;
  text-align: left;
}

.ctrl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-muted);
  background: transparent;
  padding: 2px 0;
  border: none;
}

kbd {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-inner);
  background: rgba(56, 232, 255, 0.09);
  border: 1px solid rgba(56, 232, 255, 0.34);
  color: var(--cyan);
  white-space: nowrap;
}

/* =========================================================
   BUTTONS & TACTILE STATES
   ========================================================= */
.btn {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-control);
  line-height: 1.2;
}

.btn-with-icon {
  padding-inline-start: 18px;
  padding-inline-end: 20px;
}

/* ONE unmistakable Primary CTA per screen */
.btn-primary {
  background: var(--magenta);
  border-color: rgba(255, 142, 178, 0.48);
  color: #ffffff;
  padding: 12px 22px;
  font-size: 13px;
  box-shadow:
    0 8px 22px rgba(255, 42, 109, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-lg {
  width: 100%;
  padding: 13px 20px;
  font-size: 13.5px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(148, 184, 232, 0.3);
  padding: 10px 14px;
  font-size: 11.5px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 9px 15px;
  font-size: 11.5px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 10.5px;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn-daily {
  border-color: rgba(245, 166, 35, 0.45);
  color: #ffd588;
  background: rgba(245, 166, 35, 0.08);
}

.btn-coop {
  border-color: rgba(56, 232, 156, 0.45);
  color: #8bf7c6;
  background: rgba(56, 232, 156, 0.08);
}

/* =========================================================
   RESULT ("AGAIN...") & PAUSE SCREENS
   ========================================================= */
.result-card,
.pause-card {
  text-align: center;
}

.pause-card {
  width: min(440px, 100%);
}

.pause-desc {
  margin-bottom: 18px;
}

.pause-actions {
  flex-direction: column;
  align-items: stretch;
}

.result-title {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 900;
  letter-spacing: 0.09em;
  color: #ffffff;
}

.result-diagnosis {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: #ffd07a;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-inner);
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.34);
  margin-bottom: 16px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 14px;
}

.r-stat {
  background: transparent;
  border: none;
  border-right: 1px solid var(--hairline);
  padding: 13px 6px;
}

.r-stat:last-child {
  border-right: none;
}

.r-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: var(--dim);
  margin-bottom: 5px;
}

.r-val {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.result-memory-box {
  border-top: none;
  padding-top: 4px;
}

.result-memory-box .memory-traits {
  margin-bottom: 4px;
}

.result-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.result-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.coop-footer-actions {
  margin-top: 16px;
}

/* =========================================================
   MOBILE / TOUCH CONTROLS
   ========================================================= */
body.touch-mode .hud-bottom-hint {
  display: none;
}

.touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

.touch-left-hint {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom, 16px));
  left: max(20px, env(safe-area-inset-left, 16px));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(56, 232, 255, 0.56);
  background: rgba(6, 10, 19, 0.52);
  border: 1px dashed rgba(56, 232, 255, 0.34);
  padding: 8px 12px;
  border-radius: var(--radius-control);
  transition: opacity 280ms ease;
}

.touch-left-hint.hint-dismissed {
  opacity: 0;
  pointer-events: none;
}

.stick-ring {
  position: absolute;
  width: 112px;
  height: 112px;
  margin-left: -56px;
  margin-top: -56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.stick-cyan {
  border: 2px solid rgba(56, 232, 255, 0.68);
  background: radial-gradient(circle, rgba(56, 232, 255, 0.15), rgba(56, 232, 255, 0.02));
  box-shadow: 0 0 18px rgba(56, 232, 255, 0.28);
}

.stick-magenta {
  border: 2px solid rgba(255, 42, 109, 0.72);
  background: radial-gradient(circle, rgba(255, 42, 109, 0.16), rgba(255, 42, 109, 0.02));
  box-shadow: 0 0 18px rgba(255, 42, 109, 0.3);
}

.stick-knob {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(56, 232, 255, 0.58);
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(56, 232, 255, 0.8);
}

.stick-magenta .stick-knob {
  background: rgba(255, 42, 109, 0.62);
  box-shadow: 0 0 12px rgba(255, 42, 109, 0.85);
}

.touch-action-cluster {
  position: absolute;
  right: max(16px, env(safe-area-inset-right, 14px));
  bottom: max(18px, env(safe-area-inset-bottom, 16px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: auto;
}

.touch-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 12px;
  align-items: center;
  justify-items: center;
}

.touch-action-btn {
  --fill: 100%;
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 12, 24, 0.82);
  color: #ffffff;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0.6;
  transition: transform 80ms ease, opacity 120ms ease, box-shadow 150ms ease, border-color 140ms ease;
}

.touch-action-btn::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--fill);
  opacity: 0.28;
  z-index: 0;
}

.touch-action-btn > span {
  position: relative;
  z-index: 1;
}

.tbtn-title {
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.tbtn-sub {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.86;
}

.btn-dash::before { background: var(--green); }
.btn-rail::before { background: var(--amber); }
.btn-slash::before { background: var(--cyan); }
.btn-bomb::before { background: linear-gradient(180deg, #ff4da6, #b832ff); opacity: 0.42; }

.btn-bomb {
  --fill: 0%;
  opacity: 0.46;
  border-color: rgba(255, 77, 166, 0.34);
}

.btn-slash.ready {
  opacity: 0.98;
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(56, 232, 255, 0.5);
}

.btn-dash.ready {
  opacity: 0.96;
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(56, 232, 156, 0.45);
}

.btn-rail.ready {
  opacity: 1;
  border-color: var(--amber);
  box-shadow: 0 0 20px rgba(245, 166, 35, 0.62);
  animation: railPulse 1.15s infinite alternate;
}

.btn-bomb.ready {
  opacity: 1;
  border-color: #ff7ac6;
  background: rgba(54, 12, 46, 0.9);
  box-shadow: 0 0 22px rgba(255, 42, 140, 0.78);
  animation: bombPulse 0.75s infinite alternate;
}

.btn-bomb.ready::before {
  opacity: 0.65;
}

.touch-action-btn.depleted {
  opacity: 0.36;
  animation: none;
  border-color: rgba(255, 59, 78, 0.45);
  box-shadow: none;
}

.touch-action-btn:active,
.touch-action-btn.is-pressed {
  transform: scale(0.91);
  filter: brightness(1.22);
}

.btn-bomb:not(.ready):active {
  transform: none;
  filter: none;
}

@keyframes railPulse {
  0% { box-shadow: 0 0 12px rgba(245, 166, 35, 0.42); }
  100% { box-shadow: 0 0 24px rgba(245, 166, 35, 0.88); }
}

@keyframes bombPulse {
  0% { box-shadow: 0 0 14px rgba(255, 42, 140, 0.55); border-color: #ff66b8; }
  100% { box-shadow: 0 0 28px rgba(255, 120, 210, 0.95); border-color: #ffd6ee; }
}

/* =========================================================
   UPGRADE PILLS, DIFFICULTY, DAILY & TITLE ACTIONS
   ========================================================= */
.upgrade-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 5px;
}

.upg-pill {
  font-size: 8.5px;
  font-weight: 800;
  text-align: center;
  padding: 2px 3px;
  border-radius: var(--radius-inner);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(138, 174, 224, 0.24);
  color: var(--dim);
  letter-spacing: 0.04em;
}

.upg-pill.lit-amber {
  border-color: var(--amber);
  color: #ffd07a;
  background: rgba(245, 166, 35, 0.15);
}

.upg-pill.lit-green {
  border-color: var(--green);
  color: var(--green);
  background: rgba(56, 232, 156, 0.14);
}

.upg-pill.lit-cyan {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(56, 232, 255, 0.14);
}

.difficulty-box {
  background: transparent;
  border: none;
  border-top: 1px solid var(--hairline);
  padding: 12px 0;
  margin: 0;
  text-align: left;
}

.diff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.diff-desc {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-muted);
}

.diff-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.diff-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 184, 232, 0.24);
  border-radius: var(--radius-control);
  color: var(--dim);
  font-family: var(--font-mono);
  cursor: pointer;
}

.diff-btn.active {
  background: rgba(56, 232, 255, 0.13);
  border-color: var(--cyan);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(56, 232, 255, 0.26);
}

.diff-btn.diff-hard.active {
  background: rgba(255, 42, 109, 0.16);
  border-color: var(--magenta);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 42, 109, 0.3);
}

.diff-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.diff-sub {
  font-size: 9px;
  opacity: 0.85;
  margin-top: 2px;
}

.daily-box {
  background: transparent;
  border: none;
  border-top: 1px solid var(--hairline);
  padding: 11px 0;
  margin: 0;
  text-align: left;
}

.daily-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.daily-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--amber);
  letter-spacing: 0.08em;
}

.daily-best {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.daily-rule {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

.title-start-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 4px;
}

.btn-span-full {
  grid-column: 1 / -1;
}

.title-start-row .btn-lg {
  padding: 13px 16px;
  font-size: 13.5px;
}

.tag-daily {
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.34), rgba(255, 42, 109, 0.34));
  border: 1px solid #ffe45e;
  color: #fff6c2;
}

.tag-hard {
  background: rgba(255, 42, 109, 0.24);
  border: 1px solid var(--magenta);
  color: #ffa6c4;
}

.tag-easy {
  background: rgba(56, 232, 156, 0.2);
  border: 1px solid var(--green);
  color: var(--green);
}

.res-daily-banner {
  margin: 4px auto 10px;
  padding: 5px 12px;
  display: inline-block;
  border-radius: var(--radius-inner);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.28), rgba(255, 42, 109, 0.28));
  border: 1px solid #ffe45e;
  color: #fff6c2;
}

/* =========================================================
   DAMAGE & LOW-HP VIGNETTE
   ========================================================= */
.damage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 24, 72, 0) 46%,
    rgba(255, 24, 72, 0.34) 78%,
    rgba(255, 16, 64, 0.76) 100%
  );
  box-shadow: inset 0 0 65px rgba(255, 20, 76, 0.72);
  transition: opacity 0.06s linear;
}

.damage-vignette.low-hp {
  opacity: 0.34;
  animation: lowHpVignette 1.15s ease-in-out infinite alternate;
}

@keyframes lowHpVignette {
  0% {
    opacity: 0.24;
    box-shadow: inset 0 0 48px rgba(255, 20, 76, 0.5);
  }
  100% {
    opacity: 0.52;
    box-shadow: inset 0 0 82px rgba(255, 20, 76, 0.82);
  }
}

/* =========================================================
   TABULAR NUMERALS, MOTION & POINTER HOVER DISCIPLINE
   ========================================================= */
.stat-val,
.p-num,
#hp-text,
#bomb-pct,
#partner-hp-text,
.r-val,
.daily-best,
.ist-num,
.lo-v {
  font-variant-numeric: tabular-nums;
}

button,
.btn,
.diff-btn,
.mini-btn,
.h-opt {
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 100ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.btn:active,
.diff-btn:active,
.mini-btn:active,
.h-opt:active {
  transform: scale(0.97);
}

/* Hover-only rules guarded behind hover-capable pointers (better-ui rule) */
@media (hover: hover) {
  .mini-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(56, 232, 255, 0.08);
  }

  .btn-primary:hover {
    background: #ff407d;
    box-shadow:
      0 10px 28px rgba(255, 42, 109, 0.48),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }

  .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
  }

  .btn-ghost:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(56, 232, 255, 0.07);
  }

  .btn-daily:hover {
    background: rgba(245, 166, 35, 0.17);
    border-color: var(--amber);
    color: #ffffff;
  }

  .btn-coop:hover {
    background: rgba(56, 232, 156, 0.17);
    border-color: var(--green);
    color: #ffffff;
  }

  .diff-btn:hover {
    border-color: rgba(56, 232, 255, 0.62);
    color: var(--text);
    background: rgba(56, 232, 255, 0.05);
  }

  .diff-btn.diff-hard:hover {
    border-color: rgba(255, 42, 109, 0.65);
  }

  .h-opt:hover {
    border-color: rgba(56, 232, 255, 0.58);
    background: rgba(56, 232, 255, 0.07);
    color: #ffffff;
  }

  .h-opt[data-slot="bomb"]:hover {
    border-color: rgba(255, 42, 109, 0.6);
    background: rgba(255, 42, 109, 0.08);
  }

  .h-opt[data-slot="sub"]:hover,
  .h-opt[data-slot="melee"][data-id="HYPER_LANCE"]:hover {
    border-color: rgba(245, 166, 35, 0.6);
    background: rgba(245, 166, 35, 0.08);
  }

  .title-license-link:hover {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
  }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.982);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chipPop {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================================================
   TITLE FOOTER
   ========================================================= */
.title-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--dim);
}

.title-license-link {
  color: rgba(56, 232, 255, 0.84);
  text-decoration: none;
  border-bottom: 1px dotted rgba(56, 232, 255, 0.48);
  padding-bottom: 1px;
  transition: color 140ms ease, border-color 140ms ease;
}

/* =========================================================
   2P CO-OP P2P LOBBY & PARTNER LIFE-SHARE HUD
   ========================================================= */
.text-emerald {
  color: #3dff9e;
}

.modal-head {
  margin-bottom: 14px;
}

.partner-hud {
  margin-top: 8px;
  padding: 7px 0 0;
  border: none;
  border-top: 1px solid rgba(56, 232, 156, 0.36);
  background: transparent;
}

.partner-hud.partner-revive-blink {
  border-top-color: #6effc4;
}

.partner-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.partner-name {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #6effc4;
}

.partner-badge {
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-inner);
  letter-spacing: 0.06em;
  background: rgba(56, 232, 156, 0.13);
  color: #6effc4;
  border: 1px solid rgba(56, 232, 156, 0.42);
}

.partner-badge.critical {
  background: rgba(255, 42, 109, 0.18);
  color: #ff82ac;
  border-color: rgba(255, 42, 109, 0.52);
}

.coop-card {
  width: min(568px, 100%);
  text-align: left;
}

.coop-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 11px;
  border-radius: var(--radius-control);
  margin-bottom: 4px;
  background: rgba(56, 232, 255, 0.07);
  border: 1px solid rgba(56, 232, 255, 0.28);
  color: var(--cyan);
}

.coop-status-bar::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.coop-status-bar.connected {
  background: rgba(56, 232, 156, 0.11);
  border-color: rgba(56, 232, 156, 0.48);
  color: #6effc4;
}

.coop-status-bar.error {
  background: rgba(255, 42, 109, 0.12);
  border-color: rgba(255, 42, 109, 0.48);
  color: #ff82ac;
}

.coop-section {
  background: transparent;
  border: none;
  border-top: 1px solid var(--hairline);
  padding: 12px 0;
  margin: 0;
}

.coop-sec-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 8px;
}

.coop-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.coop-btn-row-spaced {
  margin-bottom: 8px;
}

.coop-btn-row .btn {
  flex: 1;
  min-width: 124px;
  font-size: 11px;
  padding: 8px 10px;
}

.coop-signal-box {
  width: 100%;
  resize: vertical;
  background: rgba(4, 7, 15, 0.94);
  color: #d6ecff;
  caret-color: var(--cyan);
  border: 1px solid rgba(148, 184, 232, 0.28);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.45;
  user-select: text;
  -webkit-user-select: text;
}

.coop-signal-box::placeholder {
  color: var(--dim);
}

/* =========================================================
   LOCKED IN-GAME LOADOUT STRIP & PRE-SORTIE ARMAMENT HANGAR
   ========================================================= */
.loadout-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
}

.lo-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: var(--radius-inner);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 184, 232, 0.18);
  min-width: 0;
}

.lo-k {
  font-size: 8px;
  font-weight: 700;
  color: var(--dim);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.lo-v {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hangar-card {
  width: min(936px, 100%);
  padding: 24px 28px 22px;
}

.hangar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.hangar-title {
  margin: 0 0 4px;
  font-size: clamp(21px, 3vw, 26px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.hangar-sub {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

.hangar-grid {
  display: grid;
  grid-template-columns: 1.42fr 1fr;
  gap: 24px;
  padding-top: 14px;
}

.hangar-slots {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.h-group {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.h-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.h-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
  gap: 8px;
}

.h-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--dim);
}

.h-val {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.h-options {
  display: grid;
  gap: 6px;
}

.h-options.cols-4 { grid-template-columns: repeat(4, 1fr); }
.h-options.cols-3 { grid-template-columns: repeat(3, 1fr); }
.h-options.cols-2 { grid-template-columns: repeat(2, 1fr); }

.h-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 184, 232, 0.22);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
}

.h-opt.active {
  border-color: var(--cyan);
  background: rgba(56, 232, 255, 0.13);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(56, 232, 255, 0.28);
}

.h-opt.active::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
}

.h-opt[data-slot="melee"][data-id="HYPER_LANCE"].active,
.h-opt[data-slot="sub"].active {
  border-color: var(--amber);
  background: rgba(245, 166, 35, 0.14);
  box-shadow: inset 0 1px 0 rgba(245, 166, 35, 0.3);
}

.h-opt[data-slot="melee"][data-id="HYPER_LANCE"].active::after,
.h-opt[data-slot="sub"].active::after {
  background: var(--amber);
}

.h-opt[data-slot="bomb"].active {
  border-color: var(--magenta);
  background: rgba(255, 42, 109, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 42, 109, 0.32);
}

.h-opt[data-slot="bomb"].active::after {
  background: var(--magenta);
}

.h-svg {
  width: 24px;
  height: 13px;
  opacity: 0.8;
  margin-bottom: 2px;
}

.h-opt.active .h-svg {
  opacity: 1;
}

.h-opt-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.h-opt-sub {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--dim);
  line-height: 1.32;
}

.h-opt.active .h-opt-sub {
  color: #dbe8fa;
}

/* Right Column: Live Tactical Inspector */
.hangar-inspector {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--hairline);
  padding-left: 22px;
}

.insp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.insp-slot {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: var(--dim);
}

.insp-role {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--cyan);
}

.insp-name {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.insp-desc {
  margin: 0 0 16px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-muted);
  min-height: 62px;
}

.insp-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.ist-row {
  display: grid;
  grid-template-columns: 92px 1fr 26px;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--dim);
  letter-spacing: 0.08em;
}

.ist-track {
  position: relative;
  height: 7px;
  border-radius: var(--radius-inner);
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(25% - 1px),
      rgba(6, 10, 19, 0.72) calc(25% - 1px),
      rgba(6, 10, 19, 0.72) 25%
    ),
    rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.ist-fill {
  height: 100%;
  background: var(--cyan);
  border-radius: 1px;
  box-shadow: inset -2px 0 0 rgba(255, 255, 255, 0.45);
  transition: width 180ms cubic-bezier(0.16, 1, 0.3, 1), background-color 180ms ease;
}

.ist-num {
  text-align: right;
  font-weight: 800;
  color: var(--text);
}

.insp-summary {
  margin-top: 14px;
  margin-bottom: auto;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 184, 232, 0.16);
}

.insp-sum-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin-bottom: 5px;
}

.insp-build-line {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.hangar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS (1024x768, Tablet, 390x844 Mobile)
   ========================================================= */

/* Compact Desktop Height (e.g. 1280x800, 1024x768) */
@media (max-height: 800px) and (min-width: 681px) {
  .overlay-card {
    padding: 20px 26px 18px;
  }
  .title-hero {
    margin-bottom: 12px;
  }
  .game-title {
    font-size: 36px;
    margin-bottom: 6px;
  }
  .brief-section,
  .memory-box,
  .difficulty-box,
  .daily-box {
    padding: 9px 0;
  }
  .controls-grid {
    padding: 9px 0 11px;
  }
  .hangar-card {
    padding: 18px 24px 18px;
  }
  .hangar-slots {
    gap: 9px;
  }
  .h-group {
    padding-bottom: 9px;
  }
  .h-opt {
    padding: 7px 9px;
  }
  .insp-desc {
    min-height: 48px;
    margin-bottom: 12px;
  }
}

/* Compact Laptop & Tablet Landscape (681px .. 1060px) */
@media (max-width: 1060px) {
  .hud-top-left,
  .hud-top-right {
    width: 248px;
    padding: 8px 10px;
  }
  .hud-top-right .hud-header {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .hud-top-right .hud-btn-group {
    width: 100%;
    justify-content: space-between;
  }
  .hud-top-center {
    width: min(372px, 38vw);
    padding: 8px 10px;
  }
  .boss-name {
    font-size: 10.5px;
  }
  .ai-log {
    height: 32px;
    font-size: 8.5px;
  }
  .alert-banner {
    min-width: 320px;
    padding: 8px 20px;
    top: calc(max(14px, env(safe-area-inset-top, 14px)) + 132px);
  }
  .alert-main {
    font-size: 15.5px;
  }
  .hud-bottom-hint {
    gap: 10px;
    font-size: 9.5px;
    padding: 4px 11px;
  }
}

@media (max-width: 860px) {
  .hangar-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hangar-inspector {
    border-left: none;
    border-top: 1px solid var(--hairline);
    padding-left: 0;
    padding-top: 14px;
  }
  .h-options.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .insp-desc {
    min-height: 0;
    margin-bottom: 12px;
  }
}

/* Portrait & Smartphone Layout (<= 680px, tested at 390x844) */
@media (max-width: 680px) {
  .hud-bottom-hint {
    display: none;
  }

  .hud-top-center {
    top: max(8px, env(safe-area-inset-top, 8px));
    left: max(8px, env(safe-area-inset-left, 8px));
    right: max(8px, env(safe-area-inset-right, 8px));
    width: auto;
    transform: none;
    padding: 6px 9px;
  }

  .boss-title-row {
    margin-bottom: 4px;
  }

  .boss-name {
    font-size: 9.5px;
    letter-spacing: 0.06em;
  }

  .threat-badge {
    font-size: 8.5px;
    padding: 1px 5px;
  }

  .boss-hp-track {
    height: 8px;
  }

  .module-chips {
    margin-top: 5px;
    min-height: 15px;
    max-height: 36px;
    gap: 3px;
  }

  .mod-chip {
    font-size: 7.5px;
    padding: 1px 4px;
  }

  .hud-top-left {
    top: calc(max(8px, env(safe-area-inset-top, 8px)) + 96px);
    left: max(8px, env(safe-area-inset-left, 8px));
    width: calc(50% - 11px);
    padding: 6px 7px;
  }

  .hud-top-right {
    top: calc(max(8px, env(safe-area-inset-top, 8px)) + 96px);
    right: max(8px, env(safe-area-inset-right, 8px));
    width: calc(50% - 11px);
    padding: 6px 7px;
  }

  .hud-header {
    margin-bottom: 4px;
    gap: 3px;
  }

  .hud-unit-tag,
  .hud-top-right .tag-magenta {
    display: none;
  }

  .hud-badge-group {
    width: 100%;
    justify-content: space-between;
  }

  .hud-btn-group {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 3px;
  }

  .tag {
    font-size: 8px;
    padding: 1px 4px;
    white-space: nowrap;
  }

  .mini-btn {
    font-size: 7.5px;
    padding: 2px 4px;
    white-space: nowrap;
  }

  .bar-group {
    margin-bottom: 4px;
  }

  .bar-row {
    gap: 5px;
  }

  .bar-label {
    font-size: 7.5px;
    margin-bottom: 2px;
  }

  .bar-track,
  .bar-track-hull {
    height: 6px;
  }

  .loadout-strip {
    margin-top: 4px;
    padding-top: 4px;
    gap: 3px;
  }

  .lo-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 2px 4px;
  }

  .lo-k {
    font-size: 6.5px;
  }

  .lo-v {
    font-size: 8px;
    max-width: 100%;
  }

  .upgrade-strip {
    margin-top: 4px;
    gap: 3px;
  }

  .upg-pill {
    font-size: 7px;
    padding: 1px 2px;
  }

  .stats-row {
    font-size: 8px;
    margin-top: 4px;
    padding-top: 4px;
    gap: 2px;
  }

  .stat-key {
    font-size: 7px;
    margin-right: 1px;
  }

  .p-row {
    grid-template-columns: 40px 1fr 24px;
    font-size: 7.5px;
    gap: 4px;
  }

  .ai-log {
    display: none;
  }

  .alert-banner {
    top: calc(max(8px, env(safe-area-inset-top, 8px)) + 318px);
    min-width: 0;
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    padding: 7px 12px;
  }

  .alert-sub {
    font-size: 8.5px;
    letter-spacing: 0.14em;
  }

  .alert-main {
    font-size: 13px;
  }

  .alert-reason {
    font-size: 9.5px;
  }

  .overlay {
    padding: max(10px, env(safe-area-inset-top, 10px))
             max(10px, env(safe-area-inset-right, 10px))
             max(10px, env(safe-area-inset-bottom, 10px))
             max(10px, env(safe-area-inset-left, 10px));
  }

  .overlay-card,
  .hangar-card {
    padding: 18px 15px 16px;
    max-height: calc(100dvh - 20px);
  }

  .game-title {
    font-size: 28px;
  }

  .controls-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .title-start-row {
    grid-template-columns: 1fr;
  }

  .title-start-row .btn-lg {
    width: 100%;
    padding: 12px 14px;
    font-size: 13px;
  }

  .h-options.cols-3 {
    grid-template-columns: 1fr;
  }

  .result-stats {
    grid-template-columns: 1fr 1fr;
  }

  .r-stat {
    padding: 10px 6px;
  }

  .r-stat:nth-child(2n) {
    border-right: none;
  }

  .r-stat:nth-child(1),
  .r-stat:nth-child(2) {
    border-bottom: 1px solid var(--hairline);
  }

  .result-actions-grid {
    grid-template-columns: 1fr;
  }

  .touch-left-hint {
    left: max(12px, env(safe-area-inset-left, 12px));
    bottom: max(24px, env(safe-area-inset-bottom, 20px));
    max-width: 124px;
    padding: 7px 8px;
    font-size: 8.5px;
    letter-spacing: 0.1em;
    line-height: 1.35;
    text-align: center;
  }

  .touch-action-cluster {
    right: max(12px, env(safe-area-inset-right, 12px));
    bottom: max(18px, env(safe-area-inset-bottom, 16px));
  }

  .touch-btn-grid {
    gap: 10px;
  }

  .touch-action-btn {
    width: 66px;
    height: 66px;
  }
}

/* =========================================================
   ACCESSIBILITY: REDUCED MOTION & FORCED COLORS
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .overlay-card,
  .mod-chip,
  .alert-banner,
  .hud-top-left.hull-critical,
  .fill-bomb.ready,
  .btn-rail.ready,
  .btn-bomb.ready,
  .damage-vignette.low-hp,
  #hud.phase-clear::after {
    animation: none !important;
  }

  button,
  .btn,
  .diff-btn,
  .mini-btn,
  .h-opt,
  .ist-fill,
  .bar-fill,
  .boss-hp-lag,
  .boss-hp-fill {
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .hud-panel,
  .overlay-card,
  .btn,
  .diff-btn,
  .h-opt,
  .mini-btn {
    border: 1px solid ButtonText;
  }
  :focus-visible {
    outline: 2px solid Highlight;
  }
}

/* =========================================================
   2026-11-24 改修：タイトル（ロゴ）・ハンガー（実機プレビュー）・HUD の簡素化
   既存の指定より後ろに置いて上書きする
   ========================================================= */
[hidden] { display: none !important; }
:root { --tb: 0px; }
@supports (height: 100svh) { :root { --tb: max(0px, calc(100% - 100svh)); } }

button { touch-action: manipulation; }

/* ---------- タイトル ---------- */
.overlay-title {
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(6, 9, 18, 0.18) 0%, rgba(6, 9, 18, 0.62) 58%, rgba(4, 6, 12, 0.92) 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.title-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2.2vh, 20px);
  width: min(440px, 100%);
}
.title-logo { margin: 0; line-height: 0; }
.logo-svg {
  width: min(40vh, 74vw, 340px);
  height: auto;
  overflow: visible;
  display: block;
}
.lg-w { fill: #edf3fc; opacity: 0; animation: lgWordIn 520ms cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(1000ms + var(--r) * 140ms); }
.lg-loop { opacity: 0; animation: lgIn 260ms ease-out forwards, lgChase 2.88s linear infinite; animation-delay: calc(var(--i) * 55ms), calc(1900ms + var(--i) * 180ms); }
.lg-c { fill: #2d3d5c; }
.lg-a { fill: #ff1d25; }
.lg-gl { opacity: 0; fill: #38e8ff; animation: lgGlow 2.88s linear infinite; animation-delay: calc(1900ms + var(--i) * 180ms); }
.lg-gl.lg-a { fill: #ff5a60; }
.lg-glow { filter: url(#lgBlur); }
@keyframes lgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes lgWordIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes lgChase {
  0% { fill: #9ff4ff; }
  10% { fill: var(--lg-base, #2d3d5c); }
  100% { fill: var(--lg-base, #2d3d5c); }
}
.lg-a.lg-loop { --lg-base: #ff1d25; animation-name: lgIn, lgChaseA; }
@keyframes lgChaseA {
  0% { fill: #ffd0d2; }
  14% { fill: #ff1d25; }
  100% { fill: #ff1d25; }
}
@keyframes lgGlow {
  0% { opacity: 0.95; }
  16% { opacity: 0; }
  100% { opacity: 0; }
}
.title-tag {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--text-muted);
  padding-left: 0.42em;
  opacity: 0;
  animation: lgWordIn 600ms ease-out 1500ms forwards;
}
.title-actions {
  width: min(340px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  animation: lgIn 500ms ease-out 1650ms forwards;
}
.title-actions #start-btn { width: 100%; padding: 15px 20px; font-size: 15px; letter-spacing: 0.24em; }
.title-sub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.title-sub-actions .btn { flex-direction: column; gap: 3px; padding: 9px 8px; }
.btn-k { font-size: 11.5px; letter-spacing: 0.14em; }
.btn-s { font-family: var(--font-sans); font-size: 10px; font-weight: 600; letter-spacing: 0.02em; opacity: 0.78; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-memory {
  margin: 2px 0 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--dim);
}
.title-memory.has-memory { color: #ffb3c8; }
.title-footer {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(max(14px, env(safe-area-inset-bottom, 14px)) + var(--tb));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  font-size: 11px;
  border: 0;
  margin: 0;
  padding: 0;
}
.title-link {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 1px solid rgba(161, 178, 204, 0.3);
}
@media (hover: hover) { .title-link:hover { color: var(--cyan); border-color: var(--cyan); } }
.title-footer-brand { color: rgba(139, 156, 184, 0.6); font-size: 10px; letter-spacing: 0.1em; }

.sound-toggle {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px));
  right: max(14px, env(safe-area-inset-right, 14px));
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  min-height: 36px;
  background: rgba(8, 12, 22, 0.6);
  color: var(--text);
  border: 1px solid rgba(148, 184, 232, 0.3);
  border-radius: var(--radius-control);
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: 0.14em;
  cursor: pointer;
}
.sound-toggle .snd-off { display: none; }
.sound-toggle[aria-pressed="false"] { color: var(--dim); }
.sound-toggle[aria-pressed="false"] .snd-on { display: none; }
.sound-toggle[aria-pressed="false"] .snd-off { display: inline; }

/* ---------- ハンガー ---------- */
.overlay-hangar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(440px, 44vw);
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  padding: 0;
  background: linear-gradient(90deg, rgba(4, 6, 12, 0) 0%, rgba(4, 6, 12, 0) 52%, rgba(4, 6, 12, 0.55) 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.hangar-stage {
  position: relative;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  padding: 0 0 calc(max(18px, env(safe-area-inset-bottom, 18px)) + var(--tb)) max(18px, env(safe-area-inset-left, 18px));
}
.stage-caption {
  width: min(380px, 100%);
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(6, 10, 20, 0.5), rgba(6, 10, 20, 0.82));
  border: 1px solid rgba(148, 184, 232, 0.18);
  border-radius: var(--radius-panel);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.stage-tags { display: flex; justify-content: space-between; gap: 8px; font-size: 9px; letter-spacing: 0.14em; font-weight: 800; }
.stage-caption .insp-slot { color: var(--text-muted); }
.stage-caption .insp-role { text-align: right; }
.stage-caption .insp-name { margin: 6px 0 4px; font-size: 17px; letter-spacing: 0.06em; }
.stage-caption .insp-desc { margin: 0 0 10px; font-family: var(--font-sans); font-size: 12px; line-height: 1.65; color: var(--text-muted); }
.stage-caption .insp-stats { display: grid; gap: 4px; }
.stage-caption .ist-row { display: grid; grid-template-columns: 74px 1fr 26px; align-items: center; gap: 8px; font-size: 9px; letter-spacing: 0.1em; color: var(--dim); }
.stage-caption .ist-track { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.stage-caption .ist-fill { height: 100%; width: 0; transition: width 260ms cubic-bezier(.2,.8,.2,1); }
.stage-caption .ist-num { text-align: right; color: var(--text); font-weight: 700; }

.hangar-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: max(16px, env(safe-area-inset-top, 16px)) max(18px, env(safe-area-inset-right, 18px)) calc(max(16px, env(safe-area-inset-bottom, 16px)) + var(--tb)) 18px;
  background: rgba(6, 10, 19, 0.9);
  border-left: 1px solid rgba(148, 184, 232, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: panelIn 320ms cubic-bezier(.16,1,.3,1) both;
}
@keyframes panelIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.hangar-header { display: flex; align-items: center; gap: 10px; margin: 0; }
.hangar-header .hangar-title { margin: 0; font-size: 16px; letter-spacing: 0.26em; flex: 1; }
.icon-btn {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(148,184,232,0.28);
  border-radius: var(--radius-control);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn svg { width: 16px; height: 16px; }

.h-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.h-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 8px 8px 7px;
  min-width: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(148,184,232,0.16);
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-family: var(--font-mono);
  cursor: pointer;
  text-align: left;
}
.h-tab-k { font-size: 8.5px; letter-spacing: 0.12em; font-weight: 800; }
.h-tab-v { font-size: 10.5px; font-weight: 700; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-tab.active { background: rgba(56,232,255,0.08); border-color: rgba(56,232,255,0.4); border-bottom-color: var(--cyan); color: var(--cyan); }

.h-groups .h-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.h-groups .h-options[data-group="melee"] { grid-template-columns: 1fr; }
.h-groups .h-options[data-group="sub"],
.h-groups .h-options[data-group="bomb"] { grid-template-columns: 1fr; }
.h-groups .h-opt {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  text-align: left;
  padding: 11px 12px;
  min-height: 54px;
}
.h-groups .h-opt .h-svg { grid-row: 1 / span 2; width: 36px; height: 22px; }
.h-groups .h-opt .h-opt-name { font-size: 12px; }
.h-groups .h-opt .h-opt-sub { font-size: 10.5px; }

.h-setup { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--hairline); margin-top: auto; }
.h-setup-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.h-setup-k { font-size: 9px; letter-spacing: 0.16em; color: var(--dim); font-weight: 800; }
.h-setup-note { margin: 0; font-family: var(--font-sans); font-size: 11px; line-height: 1.55; color: var(--text-muted); }
.h-setup-note:empty { display: none; }
.seg { display: inline-flex; border: 1px solid rgba(148,184,232,0.28); border-radius: var(--radius-control); overflow: hidden; }
.seg-btn {
  padding: 7px 10px;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  border-left: 1px solid rgba(148,184,232,0.18);
  font: 800 9.5px/1 var(--font-mono);
  letter-spacing: 0.1em;
  cursor: pointer;
}
.seg-btn:first-child { border-left: 0; }
.seg-btn.active { background: rgba(56,232,255,0.14); color: var(--cyan); }
.seg-btn.diff-hard.active { background: rgba(255,42,109,0.16); color: #ff7aa2; }
.seg-btn.btype-gamma.active { background: rgba(56,242,255,0.16); color: #38f2ff; }
.seg-btn.btype-sigma.active { background: rgba(200,77,255,0.18); color: #d99bff; }
.seg-btn.btype-mix.active { background: rgba(245,166,35,0.18); color: #ffd588; }
.h-pilot-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.h-pilot-btn {
  padding: 7px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(148,184,232,0.24);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
  cursor: pointer;
}
.h-pilot-btn.active[data-pilot="p1"] {
  background: rgba(56,232,255,0.12);
  border-color: rgba(56,232,255,0.5);
  color: var(--cyan);
}
.h-pilot-btn.active[data-pilot="p2"] {
  background: rgba(56,255,156,0.12);
  border-color: rgba(56,255,156,0.52);
  color: #6effc4;
}
.h-daily { padding: 8px 10px; border: 1px solid rgba(245,166,35,0.35); border-radius: var(--radius-control); background: rgba(245,166,35,0.06); }
.h-daily-top { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: #ffd588; margin-bottom: 4px; }
.h-daily-best { color: var(--text-muted); font-weight: 700; }
.hangar-launch { width: 100%; flex-shrink: 0; letter-spacing: 0.24em; }

/* ハンガーの操作方法（2026-11-24）。マウスのある端末はキー、指の端末は指の操作 */
.h-ctrl { display: grid; gap: 5px; padding-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.h-ctrl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.h-ctrl-list li { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-sans); font-size: 11px; line-height: 1.4; color: var(--text-muted); white-space: nowrap; }
.h-ctrl-list kbd {
  display: inline-block;
  min-width: 18px;
  padding: 2px 5px 1px;
  border: 1px solid rgba(148,184,232,0.32);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: 800 9px/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-align: center;
}
.h-ctrl-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .h-ctrl-pc { display: none; }
  .h-ctrl-touch { display: flex; }
}

/* ハンガー：スマホ・狭い画面は上がプレビュー、下が選択 */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .overlay-hangar {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 40%) minmax(0, 1fr);
    background: linear-gradient(180deg, rgba(4,6,12,0) 0%, rgba(4,6,12,0) 30%, rgba(4,6,12,0.5) 42%);
  }
  .hangar-stage { align-items: flex-end; padding: 0 10px 8px; }
  .stage-caption { width: 100%; padding: 8px 10px; }
  .stage-caption .insp-name { font-size: 14px; margin: 3px 0 2px; }
  .stage-caption .insp-desc { font-size: 11px; line-height: 1.5; margin-bottom: 6px; }
  .stage-caption .insp-stats { grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 3px; }
  .stage-caption .ist-row { grid-template-columns: 58px 1fr 22px; font-size: 8px; gap: 5px; }
  .hangar-panel {
    border-left: 0;
    border-top: 1px solid rgba(148,184,232,0.2);
    padding: 12px max(12px, env(safe-area-inset-right, 12px)) calc(max(12px, env(safe-area-inset-bottom, 12px)) + var(--tb)) max(12px, env(safe-area-inset-left, 12px));
    gap: 10px;
    animation-name: panelUp;
  }
  @keyframes panelUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .hangar-header .hangar-title { font-size: 14px; }
  .h-tab { padding: 7px 6px 6px; }
  .h-tab-k { font-size: 7.5px; }
  .h-tab-v { font-size: 9.5px; }
  .h-groups .h-opt { min-height: 48px; padding: 9px 10px; }
  .h-groups .h-options[data-group="sub"],
  .h-groups .h-options[data-group="bomb"] { grid-template-columns: 1fr; }
}

/* ---------- HUD（戦闘中）：体力・ゲージ・ボス・スコアだけ ---------- */
.hud-top-left { width: 236px; padding: 9px 11px 8px; }
.hud-top-left .hud-header { margin-bottom: 6px; justify-content: flex-start; }
.gauge-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 7px; margin-top: 7px; }
.gauge { min-width: 0; }
.gauge-k { display: block; font-size: 8px; letter-spacing: 0.08em; color: var(--dim); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge .bar-track { height: 4px; }
.gauge-od #bomb-pct { color: var(--text); }
.hud-top-left .upgrade-strip { margin-top: 7px; }
.hud-top-left.overdrive-ready .gauge-od .gauge-k { color: #ff7aa2; }

.hud-top-center { width: min(420px, 38vw); padding: 8px 12px 7px; }
.hud-top-center .boss-name { font-size: 10.5px; }
.learn-line { margin-top: 5px; font-size: 9px; letter-spacing: 0.1em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learn-k { color: #ff7aa2; font-weight: 800; }
#learn-v { color: var(--text-muted); }

.hud-top-right {
  width: auto;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  position: absolute;
}
.hud-top-right::before { display: none; }
.score-box { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.score-val { font-size: 22px; font-weight: 800; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.score-sub { font-size: 9px; letter-spacing: 0.08em; }
.hud-top-right .hud-btn-group { gap: 6px; }
.hud-top-right .mini-btn { font-size: 9px; padding: 6px 9px; min-height: 30px; background: rgba(8,12,22,0.62); }
.mini-btn-icon { width: 34px; display: inline-grid; place-items: center; padding: 0 !important; }
.mini-btn-icon svg { width: 14px; height: 14px; }
.hud-top-right .mini-btn[aria-pressed="false"] { color: var(--dim); }

.alert-banner { top: calc(max(14px, env(safe-area-inset-top, 14px)) + 92px); }

@media (max-width: 680px) {
  .hud-top-center { padding: 6px 9px; }
  .learn-line { font-size: 8px; margin-top: 3px; }
  .hud-top-left {
    top: calc(max(8px, env(safe-area-inset-top, 8px)) + 64px);
    width: min(200px, 54vw);
    padding: 6px 8px;
  }
  .hud-top-left .hud-header { display: none; }
  .gauge-row { gap: 5px; margin-top: 5px; }
  .gauge-k { font-size: 7px; }
  .hud-top-left .upgrade-strip { margin-top: 4px; gap: 3px; }
  /* 2P協力の相方HUD：スマホ縦画面では1行スリム表示にして視界をすっきり保つ */
  .partner-hud {
    margin-top: 5px;
    padding: 4px 0 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 6px;
  }
  .partner-head {
    margin-bottom: 0;
    gap: 4px;
  }
  .partner-name { font-size: 8px; letter-spacing: 0.05em; }
  .partner-badge { font-size: 7px; padding: 1px 4px; }
  .partner-bar-group {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }
  .partner-bar-group .bar-label {
    order: 2;
    margin-bottom: 0;
    font-size: 7.5px;
    flex-shrink: 0;
  }
  .partner-bar-group #partner-net-tag { display: none; }
  .partner-bar-group .bar-track {
    order: 1;
    flex: 1;
    min-width: 36px;
    height: 4px;
  }
  .hud-top-right {
    top: calc(max(8px, env(safe-area-inset-top, 8px)) + 64px);
    right: max(8px, env(safe-area-inset-right, 8px));
    width: auto;
    padding: 0;
  }
  .score-val { font-size: 16px; }
  .score-sub { font-size: 8px; }
  .hud-top-right .mini-btn { min-height: 30px; font-size: 8px; padding: 5px 7px; }
  /* スマホ縦画面では左右16px余白を確保しつつ1行に収まりやすくして縦幅をスリム化 */
  .alert-banner {
    top: calc(max(8px, env(safe-area-inset-top, 8px)) + 156px);
    min-width: 0;
    width: calc(100% - 32px);
    max-width: 368px;
    padding: 4px 10px;
    background: linear-gradient(
      90deg,
      rgba(6, 10, 20, 0),
      rgba(6, 10, 20, 0.84) 10%,
      rgba(6, 10, 20, 0.84) 90%,
      rgba(6, 10, 20, 0)
    );
  }
  .alert-sub {
    font-size: 7.5px;
    letter-spacing: 0.12em;
    line-height: 1.2;
  }
  .alert-main {
    font-size: 11px;
    letter-spacing: 0.05em;
    margin: 1px 0;
    line-height: 1.25;
  }
  .alert-reason {
    font-size: 8.5px;
    line-height: 1.3;
  }
}

/* ---------- ポーズ・結果・協力 ---------- */
.pause-settings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.set-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(148,184,232,0.26);
  border-radius: var(--radius-control);
  color: var(--text);
  font-family: var(--font-mono);
  cursor: pointer;
}
.set-k { font-size: 8.5px; letter-spacing: 0.14em; color: var(--dim); font-weight: 800; }
.set-v { font-size: 13px; font-weight: 800; color: var(--cyan); }
.set-btn[aria-pressed="false"] .set-v { color: var(--dim); }
.pause-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin: 0 0 16px; font-size: 11px; }
.pause-keys div { display: flex; gap: 8px; align-items: baseline; }
.pause-keys dt { min-width: 52px; color: var(--cyan); font-weight: 700; font-size: 10px; }
.pause-keys dd { margin: 0; font-family: var(--font-sans); color: var(--text-muted); }
body.touch-mode .pc-only { display: none; }
.modal-lead { margin: 6px 0 0; font-family: var(--font-sans); font-size: 12px; line-height: 1.7; color: var(--text-muted); }
.coop-status-bar:empty { display: none; }
.result-memory-box { margin: 14px 0 16px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--radius-control); background: rgba(255,255,255,0.02); }
.result-memory-box .memory-label { font-family: var(--font-sans); font-size: 11px; font-weight: 700; color: #ff7aa2; margin-bottom: 4px; }
.result-again { letter-spacing: 0.18em; }

@media (prefers-reduced-motion: reduce) {
  .lg-w, .lg-loop, .title-tag, .title-actions { animation: none !important; opacity: 1 !important; }
  .lg-gl { animation: none !important; opacity: 0 !important; }
  .hangar-panel { animation: none; }
}

/* ---------- オンライン協力のロビー ---------- */
.coop-consent { font-family: var(--font-sans); font-size: 11.5px; line-height: 1.7; color: var(--text-muted); padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--radius-control); background: rgba(255,255,255,0.02); margin-bottom: 10px; }
.coop-consent p { margin: 0 0 4px; }
.coop-consent ul { margin: 0 0 8px; padding-left: 1.2em; }
.coop-consent strong { color: #ffd588; font-weight: 700; }
.coop-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; align-items: stretch; }
.coop-join { display: flex; gap: 6px; min-width: 0; }
.coop-code-input {
  flex: 1; min-width: 0;
  padding: 9px 10px;
  font: 700 16px/1 var(--font-mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(148,184,232,0.3);
  border-radius: var(--radius-control);
  user-select: text; -webkit-user-select: text;
  touch-action: manipulation;
}
.coop-actions .btn:disabled, .coop-join .btn:disabled, .coop-code-input:disabled { opacity: 0.4; cursor: not-allowed; }
.coop-room { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid rgba(56,232,156,0.35); border-radius: var(--radius-control); background: rgba(56,232,156,0.05); }
.coop-code-big { display: flex; align-items: baseline; gap: 10px; }
.coop-code-k { font-size: 9px; letter-spacing: 0.2em; color: var(--dim); font-weight: 800; }
#coop-room-code { font-size: 24px; font-weight: 800; letter-spacing: 0.3em; color: #8bf7c6; user-select: text; -webkit-user-select: text; }
.coop-room-btns { display: flex; gap: 6px; }
.link-btn { margin-top: 8px; background: none; border: 0; padding: 4px 0; color: var(--text-muted); font: 600 11px/1.4 var(--font-sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.coop-status-bar.waiting::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: currentColor; animation: netBlink 1s steps(2) infinite; vertical-align: middle; }
@keyframes netBlink { 50% { opacity: 0.2; } }
.h-net { color: #8bf7c6; }
@media (max-width: 520px) { .coop-actions { grid-template-columns: 1fr; } }

/* タイトル：横長はロゴを左・ボスを右。縦長はロゴの背後を暗く */
.title-center { position: relative; }
.title-center::before {
  content: '';
  position: absolute;
  inset: -12% -22%;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 42%, rgba(4, 6, 12, 0.82) 0%, rgba(4, 6, 12, 0.55) 45%, rgba(4, 6, 12, 0) 72%);
  pointer-events: none;
}
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .overlay-title { align-items: flex-start; padding-left: max(7vw, env(safe-area-inset-left, 0px)); }
  .overlay-title { background: linear-gradient(90deg, rgba(4,6,12,0.88) 0%, rgba(4,6,12,0.55) 34%, rgba(4,6,12,0) 60%), radial-gradient(ellipse at 70% 50%, rgba(6,9,18,0) 30%, rgba(4,6,12,0.7) 100%); }
  .title-center::before { display: none; }
  .title-center { align-items: flex-start; width: 380px; }
  .logo-svg { width: min(44vh, 340px); }
  .title-tag { padding-left: 0; }
  .title-memory { text-align: left; }
  .title-footer { justify-content: flex-start; padding-left: max(7vw, env(safe-area-inset-left, 0px)); }
}
@media (max-width: 680px) {
  .hud-top-center { width: auto; left: max(8px, env(safe-area-inset-left, 8px)); right: max(8px, env(safe-area-inset-right, 8px)); transform: none; }
}
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .overlay-hangar { grid-template-rows: minmax(0, 44%) minmax(0, 1fr); }
  .stage-caption .insp-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---------- BOOT（読み込み → TAP TO START） ---------- */
.overlay-boot {
  z-index: 40;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 45%, #0a1020 0%, #05070d 70%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: opacity 520ms ease, visibility 0s linear 520ms;
}
.overlay-boot.leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-center { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.boot-logo { line-height: 0; }
.boot-svg { width: min(36vh, 64vw, 300px); height: auto; overflow: visible; display: block; }
.bt-w { fill: #edf3fc; opacity: 0.08; transition: opacity 600ms ease; }
.bt-seg { fill: #1a2438; transition: fill 220ms ease; }
.bt-seg.on { fill: #38e8ff; }
.bt-seg.lg-a.on { fill: #ff1d25; }
.bt-gl { opacity: 0; fill: #38e8ff; transition: opacity 260ms ease; }
.bt-gl.lg-a { fill: #ff5a60; }
.bt-gl.on { opacity: 0.55; }
.bt-glow { filter: url(#btBlur); }
/* 読み終わったら：文字が出て、光が一周しつづける（タイトルと同じ動き） */
.overlay-boot.ready .bt-w { opacity: 1; }
.overlay-boot.ready .bt-seg.lg-c { --lg-base: #2d3d5c; fill: #2d3d5c; animation: lgChase 2.88s linear infinite; animation-delay: calc(var(--i) * 180ms); }
.overlay-boot.ready .bt-seg.lg-a { fill: #ff1d25; animation: lgChaseA 2.88s linear infinite; animation-delay: calc(var(--i) * 180ms); }
.overlay-boot.ready .bt-gl { opacity: 0; animation: lgGlow 2.88s linear infinite; animation-delay: calc(var(--i) * 180ms); }
.boot-status { margin: 0; font: 700 10px/1 var(--font-mono); letter-spacing: 0.32em; color: var(--dim); min-height: 1em; }
.boot-pct { color: var(--cyan); }
.overlay-boot.ready .boot-status { visibility: hidden; }
.boot-start {
  min-width: 260px;
  min-height: 52px;
  padding: 14px 26px;
  background: transparent;
  border: 1px solid rgba(56, 232, 255, 0.0);
  color: var(--text);
  font: 800 14px/1 var(--font-mono);
  letter-spacing: 0.34em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 400ms ease, border-color 300ms ease;
}
.boot-start:disabled { cursor: default; }
.overlay-boot.ready .boot-start { opacity: 1; border-color: rgba(56, 232, 255, 0.35); animation: tapBlink 1.6s ease-in-out infinite; }
@keyframes tapBlink { 0%, 100% { color: #edf3fc; } 50% { color: rgba(237, 243, 252, 0.35); } }
.tap-touch { display: none; }
body.touch-mode .tap-touch { display: inline; }
body.touch-mode .tap-mouse { display: none; }
@media (prefers-reduced-motion: reduce) {
  .overlay-boot.ready .bt-seg, .overlay-boot.ready .bt-gl, .overlay-boot.ready .boot-start { animation: none !important; }
}

/* タイトルのフッター：ほかの AMIX のゲームと同じ並び（制作：AMIX｜トミナガハルキ / ゲーム紹介 / ライセンス / 無料ゲーム一覧） */
.title-credit {
  margin: 0;
  /* 2026-11-24 本人「もう少しだけ小さく」で 11px → 10px。スマホでリンクの途中で折り返していたので、リンクは切らずに区切りで折り返す */
  font: 600 10px/2 -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: rgba(237, 243, 252, 0.72);
  text-align: center;
  white-space: normal;
  padding: 0 12px;
}
.title-credit a, .title-credit .cr-g { white-space: nowrap; }
.title-credit a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(237, 243, 252, 0.4);
  padding: 10px 0;
  touch-action: manipulation;
}
.title-credit .sep { margin: 0 .6em; opacity: .5; }
@media (hover: hover) { .title-credit a:hover { color: var(--cyan); } }
@media (min-width: 900px) and (min-aspect-ratio: 5/4) { .title-credit { text-align: left; } }

/* リザルトの見出し：ロゴの「AGAIN」＋「＞＞＞＞＞」に光が左から右へ流れる（2026-11-24） */
.result-again { margin: 4px 0 14px; line-height: 0; text-align: center; }
.again-svg { width: min(100%, 440px); height: auto; overflow: visible; }
.ga-w { fill: #edf3fc; }
.ga-a { fill: #ff1d25; }
.ga-c { fill: #2d3d5c; animation: gaFlow 1.5s linear infinite; animation-delay: calc(var(--i) * 0.16s); }
.ga-g { fill: #38e8ff; opacity: 0; animation: gaGlow 1.5s linear infinite; animation-delay: calc(var(--i) * 0.16s); }
@keyframes gaFlow { 0% { fill: #9ff4ff; } 22% { fill: #2d3d5c; } 100% { fill: #2d3d5c; } }
@keyframes gaGlow { 0% { opacity: 0.9; } 25% { opacity: 0; } 100% { opacity: 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ga-c, .ga-g { animation: none; } }

/* 音の設定の窓（タイトルの SOUND から開く・2026-11-24） */
.sound-panel {
  position: absolute;
  z-index: 5;
  top: calc(max(14px, env(safe-area-inset-top, 14px)) + 44px);
  right: max(14px, env(safe-area-inset-right, 14px));
  width: min(270px, calc(100vw - 28px));
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  background: rgba(6, 10, 19, 0.94);
  border: 1px solid rgba(148, 184, 232, 0.3);
  border-radius: var(--radius-control);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: spIn 160ms cubic-bezier(.16,1,.3,1) both;
}
.sound-panel.hidden { display: none; }
@keyframes spIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.sp-row + .sp-row { border-top: 1px solid var(--hairline); padding-top: 9px; }
.sp-txt { display: grid; gap: 3px; min-width: 0; }
.sp-k { font: 800 10.5px/1 var(--font-mono); letter-spacing: 0.16em; color: var(--text); }
.sp-d { font: 500 11px/1.3 var(--font-sans); color: var(--text-muted); }
.sp-btn {
  min-width: 64px;
  min-height: 40px;
  padding: 0 12px;
  background: rgba(56, 232, 255, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(56, 232, 255, 0.45);
  border-radius: var(--radius-control);
  font: 800 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  cursor: pointer;
  touch-action: manipulation;
}
.sp-btn[aria-pressed="false"] { background: transparent; color: var(--dim); border-color: rgba(148, 184, 232, 0.25); }
.sp-btn:disabled { opacity: 0.4; cursor: default; }
.sound-toggle { touch-action: manipulation; }
.sound-toggle[aria-expanded="true"] { border-color: rgba(56, 232, 255, 0.6); }
