/* Void Shooter — a vertical debris field. */

/* Show/hide utility the script toggles on the pause button; it was missing
   from this sheet, so the pause button never hid. Standard definition. */
.hidden {
  display: none !important;
}

:root {
  --vs-bg: #020611;
  --vs-deep: #01030a;
  --vs-cyan: #22d3ee;
  --vs-violet: #8b5cf6;
  --vs-amber: #fbbf24;
  --vs-pink: #f472b6;
  --vs-text: #e0f2fe;
  --vs-muted: #93a9c4;
  --vs-line: rgba(125, 211, 252, 0.18);
  --vs-line-strong: rgba(125, 211, 252, 0.34);
  --vs-font: "Bahnschrift", "Eurostile", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.vs-page {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(900px 560px at 50% -14%, rgba(139, 92, 246, 0.28), transparent 62%),
    radial-gradient(700px 420px at 108% 112%, rgba(34, 211, 238, 0.16), transparent 60%),
    linear-gradient(180deg, #060a1c, var(--vs-bg) 65%, var(--vs-deep));
  color: var(--vs-text);
  font-family: var(--vs-font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.vs-wrap {
  width: 100%;
  max-width: 540px;
  height: calc(100dvh - var(--app-header-h, 64px) - 8px);
  margin: 0 auto;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

/* ---------- Top bar ---------- */

.vs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
}

.vs-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.vs-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--vs-line-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.vs-brand-copy {
  min-width: 0;
}

.vs-title {
  margin: 0;
  font-size: clamp(0.98rem, 4.2vw, 1.18rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #67e8f9, #a78bfa 60%, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vs-subtitle {
  margin: 3px 0 0;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vs-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-topbar-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.vs-icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--vs-line);
  border-radius: 999px;
  background: rgba(6, 20, 36, 0.72);
  color: var(--vs-text);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 150ms ease, transform 120ms ease;
}

.vs-icon-btn:hover {
  border-color: var(--vs-cyan);
}

.vs-icon-btn:active {
  transform: scale(0.94);
}

.vs-icon-btn.is-muted {
  color: var(--vs-muted);
}

.vs-pause-glyph {
  display: block;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 8px 0 0 currentColor;
  margin-right: 8px;
}

/* ---------- HUD ---------- */

.vs-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.vs-chip {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 9px;
  border: 1px solid var(--vs-line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 48, 76, 0.5), rgba(4, 14, 30, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 18px rgba(0, 0, 0, 0.3);
}

.vs-chip .k {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #7dd3fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-chip .v {
  font-size: 1.08rem;
  font-weight: 800;
  color: #f0f9ff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

/* ---------- Stage ---------- */

.vs-stage {
  position: relative;
  flex: 1;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.38);
  border-radius: 18px;
  background:
    radial-gradient(80% 60% at 50% 30%, rgba(34, 211, 238, 0.12), transparent 70%),
    #01030a;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 22px 50px -22px rgba(0, 0, 0, 0.85),
    inset 0 0 50px rgba(1, 3, 10, 0.9);
}

.vs-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 3px),
    radial-gradient(120% 85% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0.4;
}

#canvas {
  display: block;
  width: 420px;
  height: 620px;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
}

/* ---------- Pads ---------- */

.vs-pads {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.vs-pad {
  min-width: 0;
  min-height: 50px;
  padding: 6px;
  border: 1px solid rgba(34, 211, 238, 0.42);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(13, 38, 58, 0.94), rgba(3, 12, 24, 0.94));
  color: #7dd3fc;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 4px 0 rgba(34, 211, 238, 0.24);
  transition: transform 90ms ease, box-shadow 90ms ease;
}

.vs-pad:active,
.vs-pad.is-pressed {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(34, 211, 238, 0.24);
}

.vs-pad.fire {
  color: #031018;
  background: linear-gradient(135deg, var(--vs-amber), #f97316);
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 4px 0 rgba(251, 191, 36, 0.28);
}

.vs-hint {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: center;
  color: var(--vs-muted);
}

/* ---------- Overlays ---------- */

.vs-overlay {
  position: fixed;
  inset: var(--app-header-h, 64px) 0 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  background:
    radial-gradient(560px 320px at 50% 38%, rgba(34, 211, 238, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(1, 3, 12, 0.9), rgba(1, 2, 8, 0.97));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.vs-card {
  width: 100%;
  max-width: 360px;
  margin: auto;
  padding: clamp(18px, 5vw, 26px);
  border: 1px solid var(--vs-line-strong);
  border-radius: 22px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(139, 92, 246, 0.12), transparent 62%),
    linear-gradient(160deg, rgba(11, 24, 44, 0.98), rgba(2, 6, 16, 0.99));
  box-shadow: 0 26px 60px -22px rgba(0, 0, 0, 0.9);
  text-align: center;
  animation: vs-rise 260ms cubic-bezier(0.34, 1.3, 0.64, 1) both;
}

.vs-card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  text-align: left;
}

.vs-card-brand img {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 1px solid var(--vs-line-strong);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.vs-eyebrow {
  margin: 0 0 4px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #67e8f9;
}

.vs-card h2 {
  margin: 0;
  font-size: clamp(1.55rem, 7vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f0f9ff;
}

.vs-card-brand h2 {
  font-size: clamp(1.25rem, 5vw, 1.6rem);
}

.vs-lead {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #bae6fd;
}

.vs-rules {
  margin: 0 0 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--vs-line);
  list-style: none;
  display: grid;
  gap: 7px;
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--vs-muted);
}

.vs-rules li {
  position: relative;
  padding-left: 17px;
}

.vs-rules li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--vs-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

.vs-btn {
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--vs-cyan), var(--vs-violet) 55%, var(--vs-pink));
  color: #031018;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 12px 28px -12px rgba(34, 211, 238, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 130ms ease, filter 150ms ease;
}

.vs-btn:hover {
  filter: brightness(1.05);
}

.vs-btn:active {
  transform: translateY(1px);
}

.vs-score-final {
  margin: 10px 0 2px;
  font-size: clamp(2rem, 10vw, 2.8rem);
  font-weight: 800;
  color: var(--vs-amber);
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.45);
  font-variant-numeric: tabular-nums;
}

.vs-muted {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--vs-muted);
}

.vs-card-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.vs-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--vs-line);
  border-radius: 12px;
  color: var(--vs-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease;
}

.vs-link:hover {
  color: var(--vs-text);
  border-color: var(--vs-line-strong);
}

.vs-controls {
  margin: 12px 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--vs-muted);
}

.vs-hide {
  display: none !important;
}

/* ---------- Motion ---------- */

@keyframes vs-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 360px) {
  .vs-logo {
    display: none;
  }

  .vs-title {
    font-size: 1rem;
  }
}

@media (max-width: 380px) {
  .vs-wrap {
    padding-inline: 9px;
    gap: 6px;
  }

  .vs-hud {
    gap: 4px;
  }

  .vs-chip {
    padding: 5px 6px;
  }

  .vs-chip .k {
    font-size: 0.44rem;
    letter-spacing: 0.1em;
  }

  .vs-chip .v {
    font-size: 0.94rem;
  }

  .vs-pad {
    min-height: 46px;
    font-size: 0.98rem;
  }

  .vs-title {
    letter-spacing: 0.1em;
  }

  .vs-subtitle {
    display: none;
  }
}

@media (max-height: 720px) {
  .vs-hint {
    display: none;
  }
}

@media (max-height: 600px) {
  .vs-wrap {
    gap: 5px;
    padding-top: 6px;
  }

  .vs-pad {
    min-height: 44px;
  }
}

@media (min-width: 900px) {
  .vs-wrap {
    max-width: 380px;
    padding-top: 16px;
  }
}
