/* Nerve — fluid layout for phone through desktop */

:root {
  --nerve-bg: #0b0e11;
  --nerve-panel: #12161b;
  --nerve-safe: #ffb347;
  --nerve-danger: #ff4d4d;
  --nerve-banked: #34d399;
  --nerve-muted: #6b7280;
  --nerve-text: #eef1f5;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(40, 12, 6, 0.45) 0%, rgba(6, 8, 12, 0.72) 70%);
  pointer-events: none;
  animation: introVeil 3.4s ease forwards;
}

.intro-overlay.is-done {
  display: none;
}

.intro-title {
  font-family: 'Bungee', 'Anton', Impact, sans-serif;
  font-size: clamp(4.2rem, 18vw, 10rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 0.9;
  color: #fff6e8;
  text-shadow:
    0 0 12px rgba(255, 220, 140, 0.95),
    0 0 36px rgba(255, 120, 30, 0.8),
    0 0 80px rgba(255, 40, 20, 0.45),
    0 6px 0 #6a1000;
  animation: introWord 3.4s ease forwards;
}

@keyframes introWord {
  0% {
    opacity: 0;
    transform: scale(0.78) translateY(18px);
    filter: blur(12px);
  }
  20% {
    opacity: 1;
    transform: scale(1.06) translateY(0);
    filter: blur(0);
  }
  58% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.14) translateY(-10px);
    filter: blur(8px);
  }
}

@keyframes introVeil {
  0%, 52% { opacity: 1; }
  100% { opacity: 0; }
}

.nerve-page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--nerve-bg);
  color: var(--nerve-text);
}

#nerve-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.nerve-page .shg-game-header {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  background: rgba(16, 20, 26, 0.62);
  border-bottom-color: rgba(28, 36, 48, 0.7);
  backdrop-filter: blur(8px);
}

.nerve-page .shg-game-title {
  color: var(--nerve-text);
}

.nerve-page .shg-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding: 1rem 1rem 1.25rem;
  background: rgba(11, 14, 17, 0.45);
}

.shg-header-spacer {
  width: 1px;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.music-toggle {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(16, 20, 26, 0.55);
  color: var(--nerve-text);
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: inherit;
}

.music-toggle-icon {
  width: 1.05rem;
  height: 1.05rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 9v6h4l5 5V4L8 9H4zm13.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 9v6h4l5 5V4L8 9H4zm13.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4z'/></svg>") center / contain no-repeat;
}

.music-toggle.is-muted {
  color: var(--nerve-muted);
}

.music-toggle.is-muted .music-toggle-icon {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 9v6h4l5 5V4L8 9H4zm12.5 1.5 1.4-1.4 1.1 1.1-1.4 1.4 1.4 1.4-1.1 1.1-1.4-1.4-1.4 1.4-1.1-1.1 1.4-1.4-1.4-1.4 1.1-1.1 1.4 1.4z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 9v6h4l5 5V4L8 9H4zm12.5 1.5 1.4-1.4 1.1 1.1-1.4 1.4 1.4 1.4-1.1 1.1-1.4-1.4-1.4 1.4-1.1-1.1 1.4-1.4-1.4-1.4 1.1-1.1 1.4 1.4z'/></svg>") center / contain no-repeat;
}

@media (hover: hover) and (pointer: fine) {
  .music-toggle:hover {
    border-color: var(--nerve-safe);
    color: var(--nerve-safe);
  }
}

.game-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding:
    clamp(0.4rem, 1.5vh, 1.25rem)
    clamp(0.75rem, 3vw, 1.75rem)
    clamp(0.5rem, 1.5vh, 1.25rem);
}

.nerve-screen {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  min-height: 0;
  gap: clamp(0.75rem, 2.5vh, 1.75rem);
}

.nerve-screen * {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.nerve-screen .hs-name-input {
  user-select: text;
  -webkit-user-select: text;
}

.top {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
}

.stat { text-align: left; }
.stat.right { text-align: right; }

.stat-label {
  font-size: clamp(0.62rem, 1.4vw, 0.75rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nerve-muted);
  font-weight: 600;
}

.stat-value {
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 8px rgba(8, 10, 14, 0.7);
}

.stat-value.live { color: var(--nerve-banked); }

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: clamp(1rem, 4vh, 2rem);
  min-height: 0;
}

.score {
  font-size: clamp(3.4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease, text-shadow 0.25s ease;
  text-shadow: 0 0 30px rgba(255, 179, 71, 0.15), 0 2px 14px rgba(8, 10, 14, 0.65);
}

.score.hot {
  color: var(--nerve-danger);
  text-shadow: 0 0 40px rgba(255, 77, 77, 0.45);
}

.meter-wrap {
  position: relative;
  width: 100%;
  max-width: min(28rem, 100%);
}

.skill-track {
  position: relative;
  width: 100%;
  height: clamp(2.5rem, 6vw, 3.5rem);
  min-height: 40px;
  border-radius: 14px;
  background: #1c2229;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.skill-track.idle { opacity: 0.45; }

.skill-rail {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  bottom: 0;
}

.skill-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 40%;
  width: 20%;
  background: rgba(52, 211, 153, 0.28);
  border-left: 2px solid var(--nerve-banked);
  border-right: 2px solid var(--nerve-banked);
}

.skill-pointer {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  z-index: 2;
  pointer-events: none;
  backface-visibility: hidden;
}

.skill-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a8a, #ff2a2a 55%, #c01010);
  box-shadow: 0 0 8px 2px rgba(255, 40, 40, 0.55);
}

.skill-track.idle .skill-dot {
  opacity: 0.85;
  animation: skillDotPulse 0.85s ease-in-out infinite;
}

.skill-track.hit .skill-dot {
  background: radial-gradient(circle at 35% 30%, #fff0a8, #ff5a2a 60%, #c01010);
  box-shadow: 0 0 16px 5px rgba(255, 90, 40, 0.85);
}

.skill-track.miss .skill-dot {
  background: radial-gradient(circle at 35% 30%, #ffb0b0, #ff1a1a 50%, #8a0000);
  box-shadow: 0 0 16px 6px rgba(255, 30, 30, 0.9);
}

.skill-pointer.decoy {
  z-index: 3;
  pointer-events: none;
}

.skill-pointer.decoy .skill-dot {
  animation: decoySiren 0.18s steps(1, end) infinite;
}

@keyframes decoySiren {
  0%, 49% {
    background: radial-gradient(circle at 35% 30%, #ffb0b0, #ff1a1a 50%, #8a0000);
    box-shadow: 0 0 14px 5px rgba(255, 24, 24, 0.95);
  }
  50%, 100% {
    background: radial-gradient(circle at 35% 30%, #b8d4ff, #1a5cff 50%, #062a8a);
    box-shadow: 0 0 14px 5px rgba(30, 90, 255, 0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  .skill-pointer.decoy .skill-dot {
    animation: none;
    background: linear-gradient(90deg, #ff1a1a 0 50%, #1a5cff 50% 100%);
    box-shadow: 0 0 12px 4px rgba(255, 40, 80, 0.7);
  }
  .storm-flash,
  .storm-flash.go,
  .storm-bolt { animation: none; opacity: 0; }
}

@keyframes skillDotPulse {
  0%, 100% { transform: scale(0.9); }
  50% { transform: scale(1.12); }
}

.timer-ring-wrap {
  position: relative;
  width: clamp(3.6rem, 8vw, 5.25rem);
  height: clamp(3.6rem, 8vw, 5.25rem);
  min-width: 56px;
  min-height: 56px;
  transform: scale(1);
}

.timer-ring-wrap.pulse {
  animation: ringPulse 0.5s ease;
}

@keyframes ringPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  display: block;
}

.ring-track {
  fill: none;
  stroke: #1c2229;
  stroke-width: 8;
}

.ring-progress {
  fill: none;
  stroke: #4ba3ff;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 263.9;
  stroke-dashoffset: 0;
  transition: stroke 0.4s ease;
}

.timer-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--nerve-text);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.timer-ring-wrap.urgent .ring-progress { stroke: var(--nerve-danger); }

.timer-ring-wrap.urgent .timer-number {
  color: var(--nerve-danger);
  text-shadow: 0 0 14px rgba(255, 77, 77, 0.6);
}

.timer-ring-wrap.idle .ring-progress { stroke: var(--nerve-muted); opacity: 0.4; }
.timer-ring-wrap.idle .timer-number { color: var(--nerve-muted); }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 rgba(255, 77, 77, 0);
}

.vignette.pulse {
  animation: vignettePulse 0.55s ease;
}

@keyframes vignettePulse {
  0% { box-shadow: inset 0 0 0 0 rgba(255, 77, 77, 0); }
  30% { box-shadow: inset 0 0 70px 14px rgba(255, 77, 77, 0.4); }
  100% { box-shadow: inset 0 0 0 0 rgba(255, 77, 77, 0); }
}

.message {
  min-height: 1.4em;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 600;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 8px rgba(8, 10, 14, 0.75);
}

.message.bust { color: var(--nerve-danger); }
.message.win { color: var(--nerve-banked); }

.bottom {
  width: 100%;
}

.controls {
  width: 100%;
}

.nerve-screen button {
  border: none;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.hit-btn,
.play-again-btn {
  min-height: 52px;
  height: clamp(4.4rem, 14vw, 7rem);
}

.hit-btn {
  --hit-heat: 0;
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 28px;
  background: transparent;
  isolation: isolate;
  transition: transform 0.08s ease, filter 0.2s ease;
}

.hit-btn * { pointer-events: none; }

.hit-btn-well {
  display: block;
  height: 100%;
  padding: 7px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, #1a1208 0%, #0c0a08 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 220, 160, 0.12),
    inset 0 -6px 10px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 140, 40, 0.22),
    0 8px 28px rgba(255, 60, 20, calc(0.18 + var(--hit-heat) * 0.35));
}

.hit-btn-face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 90% at 50% 18%, #ffdca0 0%, transparent 42%),
    linear-gradient(180deg, #ffb24a 0%, #ff6a18 48%, #e03700 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -10px 14px rgba(120, 10, 0, 0.45),
    0 10px 0 #7a1400,
    0 14px 18px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.2s ease;
  filter: saturate(calc(1 + var(--hit-heat) * 0.35));
}

.hit-btn-sheen {
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.38) 48%,
    transparent 62%
  );
  animation: hitSheen 2.8s ease-in-out infinite;
}

.hit-btn-label {
  position: relative;
  font-family: 'Anton', Impact, sans-serif;
  font-size: clamp(2.1rem, 8vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
  color: #fff8e8;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55),
    0 3px 0 #9a2200,
    0 8px 16px rgba(80, 0, 0, 0.45);
}

.hit-btn:active .hit-btn-face,
.hit-btn:disabled .hit-btn-face {
  transform: translateY(6px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -8px 12px rgba(120, 10, 0, 0.5),
    0 2px 0 #7a1400,
    0 4px 8px rgba(0, 0, 0, 0.4);
}

.hit-btn:disabled {
  cursor: default;
  filter: grayscale(0.25) brightness(0.72);
}

.hit-btn:disabled .hit-btn-sheen { animation: none; opacity: 0; }

@keyframes hitSheen {
  0%, 55% { transform: translateX(-30%) rotate(8deg); opacity: 0; }
  62% { opacity: 0.85; }
  78% { transform: translateX(30%) rotate(8deg); opacity: 0; }
  100% { transform: translateX(30%) rotate(8deg); opacity: 0; }
}

.session-end {
  display: none;
  width: 100%;
  padding: 0.25rem 0;
}

.session-end.show { display: block; }

.hs-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.15rem 1.1rem 1.2rem;
  gap: 0.55rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(28, 14, 10, 0.92) 0%, rgba(10, 12, 16, 0.94) 100%);
  border: 1px solid rgba(255, 140, 50, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 80, 20, 0.12),
    0 0 40px rgba(255, 70, 20, 0.18),
    inset 0 1px 0 rgba(255, 220, 160, 0.12);
}

.hs-panel[hidden] { display: none !important; }

.hs-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
}

.hs-kicker {
  margin: 0;
  font-family: var(--shg-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--nerve-safe);
}

.hs-banner {
  margin: 0;
  font-family: 'Bungee', 'Anton', Impact, sans-serif;
  font-size: clamp(1.45rem, 6.5vw, 2.6rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 0.95;
  text-align: center;
  color: #fff6e8;
  text-shadow:
    0 0 12px rgba(255, 220, 140, 0.95),
    0 0 36px rgba(255, 120, 30, 0.8),
    0 0 80px rgba(255, 40, 20, 0.45),
    0 4px 0 #6a1000;
}

.hs-banner[hidden] {
  display: none !important;
}

.hs-banner.is-over {
  letter-spacing: 0.12em;
}

.hs-name-label {
  font-family: var(--shg-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nerve-muted);
}

.hs-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 160, 60, 0.4);
  background: rgba(8, 10, 14, 0.85);
  color: var(--nerve-text);
  font-family: 'Bungee', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}

.hs-name-input:focus {
  border-color: var(--nerve-safe);
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.2);
}

.hs-skip {
  border: none;
  background: none;
  color: var(--nerve-muted);
  font-family: var(--shg-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.2rem;
}

.hs-table {
  width: 100%;
  font-family: var(--shg-font-mono);
}

.hs-head,
.hs-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr 4rem;
  gap: 0.4rem;
  align-items: center;
  padding: 0.42rem 0.55rem;
}

.hs-head {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nerve-muted);
  border-bottom: 1px solid rgba(255, 140, 50, 0.25);
}

.hs-head span:last-child,
.hs-row span:last-child {
  text-align: right;
}

.hs-row {
  color: var(--nerve-text);
  font-size: 0.82rem;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(8px);
  animation: hsRowIn 0.45s ease forwards;
}

.hs-row:nth-child(odd) {
  background: rgba(255, 90, 30, 0.08);
}

.hs-row.is-you {
  background: rgba(255, 179, 71, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.35);
}

.hs-row:nth-child(1) { animation-delay: 0.05s; }
.hs-row:nth-child(2) { animation-delay: 0.12s; }
.hs-row:nth-child(3) { animation-delay: 0.19s; }
.hs-row:nth-child(4) { animation-delay: 0.26s; }
.hs-row:nth-child(5) { animation-delay: 0.33s; }

.hs-rank {
  font-weight: 700;
  color: var(--nerve-safe);
}

.hs-row:nth-child(1) .hs-rank { color: #ffd76a; text-shadow: 0 0 10px rgba(255, 215, 100, 0.7); }
.hs-row:nth-child(2) .hs-rank { color: #d8e2ea; }
.hs-row:nth-child(3) .hs-rank { color: #e0a070; }

.hs-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.hs-empty {
  padding: 0.9rem 0.55rem;
  text-align: center;
  color: var(--nerve-muted);
  font-size: 0.78rem;
}

@keyframes hsRowIn {
  to { opacity: 1; transform: translateY(0); }
}

.play-again-btn {
  width: 100%;
  min-height: 48px;
  height: 3.25rem;
  border-radius: 18px;
  background: var(--nerve-safe);
  color: #1a1300;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 0.06s ease;
}

.play-again-btn:active { transform: scale(0.97); }

.kbd-hint {
  display: none;
  margin: 0.7rem 0 0;
  text-align: center;
  font-family: var(--shg-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--nerve-muted);
}

.flash {
  position: absolute;
  inset: 0;
  background: var(--nerve-danger);
  opacity: 0;
  pointer-events: none;
}

.flash.go {
  animation: flashAnim 0.4s ease-out;
}

.storm-flash {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse 70% 60% at 45% 18%, rgba(255, 255, 255, 0.95) 0%, rgba(210, 225, 255, 0.55) 38%, rgba(180, 200, 255, 0.12) 70%, transparent 100%),
    #dfe8ff;
}

.storm-flash.go {
  animation: stormFlash 0.78s ease-out;
}

@keyframes stormFlash {
  0% { opacity: 0; }
  5% { opacity: 0.95; }
  12% { opacity: 0.08; }
  20% { opacity: 0.88; }
  32% { opacity: 0.1; }
  42% { opacity: 0.62; }
  100% { opacity: 0; }
}

.storm-bolt {
  position: absolute;
  top: -6%;
  width: 22%;
  height: 70%;
  background: #fff;
  filter: drop-shadow(0 0 10px #e8f2ff) drop-shadow(0 0 28px #9ec4ff);
  opacity: 0;
}

.storm-bolt.a {
  left: 28%;
  clip-path: polygon(52% 0, 64% 0, 42% 34%, 60% 34%, 30% 100%, 38% 46%, 20% 46%);
}

.storm-bolt.b {
  left: 54%;
  clip-path: polygon(40% 0, 55% 0, 48% 28%, 68% 28%, 36% 100%, 44% 50%, 26% 50%);
}

.storm-flash.go .storm-bolt.a { animation: stormBolt 0.78s ease-out; }
.storm-flash.go .storm-bolt.b { animation: stormBolt 0.78s ease-out 0.07s; }

@keyframes stormBolt {
  0%, 100% { opacity: 0; }
  6% { opacity: 1; }
  14% { opacity: 0.15; }
  22% { opacity: 1; }
  40% { opacity: 0.2; }
  52% { opacity: 0.7; }
}

.pause-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.62);
  backdrop-filter: blur(7px);
  cursor: pointer;
}

.pause-overlay.show { display: flex; }

.pause-card {
  text-align: center;
  pointer-events: none;
}

.pause-title {
  font-family: 'Anton', Impact, sans-serif;
  font-size: clamp(2.6rem, 10vw, 4.6rem);
  letter-spacing: 0.16em;
  line-height: 1;
  color: var(--nerve-text);
  text-shadow: 0 0 28px rgba(255, 179, 71, 0.35);
}

.pause-hint {
  margin: 0.85rem 0 0;
  font-family: var(--shg-font-mono);
  font-size: clamp(0.72rem, 1.8vw, 0.85rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nerve-muted);
}

@keyframes flashAnim {
  0% { opacity: 0.55; }
  100% { opacity: 0; }
}

/* Desktop / fine pointer: show keyboard hint, give the stage more air */
@media (hover: hover) and (pointer: fine) {
  .kbd-hint { display: block; }

  .hit-btn:hover .hit-btn-face {
    filter: saturate(calc(1.08 + var(--hit-heat) * 0.35)) brightness(1.06);
  }

  .game-stage {
    padding-top: clamp(0.75rem, 3vh, 2rem);
    padding-bottom: clamp(0.75rem, 3vh, 2rem);
  }
}

@media (min-width: 900px) {
  .nerve-screen {
    max-width: 48rem;
  }

  .meter-wrap {
    max-width: 32rem;
  }
}

/* Compact phones: keep controls reachable without shrinking tap targets too far */
@media (max-width: 400px) {
  .nerve-page .shg-game-header {
    padding: 0.65rem 0.85rem;
    gap: 0.5rem;
  }

  .hit-btn,
  .play-again-btn {
    height: 5.2rem;
  }
}

/* Short viewports (phone landscape, small laptop windows) */
@media (max-height: 640px) {
  .nerve-page .shg-footer {
    display: none;
  }

  .nerve-page .shg-game-header {
    padding: 0.45rem 1rem;
  }

  .center {
    gap: 0.65rem;
  }

  .hs-banner {
    font-size: clamp(1.05rem, 5.5vh, 1.85rem);
  }

  .score {
    font-size: clamp(2.4rem, 10vh, 4rem);
  }

  .hit-btn,
  .play-again-btn {
    height: 4rem;
  }
}

@media (max-height: 480px) {
  .stat-label { font-size: 0.58rem; }
}
