/* =========================================================
   BLACK FRIDAY — OBSIDIAN, NEON YELLOW & ALERT RED THEME
   ========================================================= */
:root {
  --bg-black: #050506;
  --bg-panel: #0e0e11;
  --neon-yellow: #f5ff00;
  --alert-red: #ff173a;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);

  --card-border: rgba(245, 255, 0, 0.45);

  --font-display: "Anton", Impact, sans-serif;
  --font-tech: "Chakra Petch", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 20%, #1a0810 0%, var(--bg-black) 62%);
  color: var(--white);
  font-family: var(--font-tech);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.cyber-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
}

/* Controls */
.controls {
  position: fixed;
  top: clamp(14px, 2.5vw, 24px);
  right: clamp(14px, 2.5vw, 24px);
  z-index: 25;
  display: flex;
  gap: 8px;
}

.ctrl-btn {
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--card-border);
  background: rgba(12, 12, 15, 0.88);
  color: var(--neon-yellow);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.ctrl-btn svg { width: 18px; height: 18px; }
.ctrl-btn:hover, .ctrl-btn:focus-visible {
  background: var(--neon-yellow);
  color: #050506;
  outline: none;
}
.ctrl-btn[aria-pressed="true"] {
  background: var(--alert-red);
  border-color: var(--alert-red);
  color: #fff;
}

#sound-btn .icon-on { display: none; }
#sound-btn[aria-pressed="true"] .icon-on { display: block; }
#sound-btn[aria-pressed="true"] .icon-off { display: none; }
#fullscreen-btn .icon-compress { display: none; }
body.is-fullscreen #fullscreen-btn .icon-compress { display: block; }
body.is-fullscreen #fullscreen-btn .icon-expand { display: none; }

.toast {
  position: fixed;
  top: 70px;
  right: clamp(14px, 2.5vw, 24px);
  z-index: 30;
  padding: 8px 14px;
  background: var(--neon-yellow);
  color: #050506;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Stage */
.stage {
  position: relative;
  z-index: 10;
  width: min(960px, 92vw);
  padding: clamp(28px, 5vh, 54px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(18px, 3vh, 30px);
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  background: rgba(255, 23, 58, 0.16);
  border: 1px solid var(--alert-red);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--neon-yellow);
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--alert-red);
  box-shadow: 0 0 12px var(--alert-red);
  animation: blinkDot 0.9s steps(2) infinite;
}

@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* Glitch Headline */
.title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 12vw, 8.2rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: 0.04em;
  color: var(--neon-yellow);
  text-shadow: 0 0 36px rgba(245, 255, 0, 0.25);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.72;
}

.glitch::before {
  color: var(--alert-red);
  transform: translate(-2px, 0);
  clip-path: inset(12% 0 66% 0);
  animation: glitchSliceA 3.4s infinite steps(2);
}

.glitch::after {
  color: #ffffff;
  transform: translate(2px, 0);
  clip-path: inset(68% 0 10% 0);
  animation: glitchSliceB 2.7s infinite steps(2);
}

@keyframes glitchSliceA {
  0%, 86%, 100% { transform: translate(0, 0); opacity: 0; }
  88% { transform: translate(-4px, -1px); opacity: 0.85; }
  92% { transform: translate(3px, 1px); opacity: 0.85; }
}

@keyframes glitchSliceB {
  0%, 90%, 100% { transform: translate(0, 0); opacity: 0; }
  92% { transform: translate(4px, 1px); opacity: 0.8; }
  96% { transform: translate(-3px, -1px); opacity: 0.8; }
}

.milestone-badge {
  margin-top: 6px;
  padding: 6px 18px;
  background: var(--alert-red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Brutalist Sharp Neon Cards */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 20px);
  width: 100%;
}

.volt-card {
  position: relative;
  padding: clamp(22px, 3.4vw, 36px) 10px clamp(16px, 2.4vw, 24px);
  background: var(--bg-panel);
  border: 2px solid var(--card-border);
  box-shadow: 0 0 32px rgba(245, 255, 0, 0.08), inset 0 0 24px rgba(255, 23, 58, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.volt-card::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: 14px;
  height: 14px;
  border-top: 3px solid var(--alert-red);
  border-left: 3px solid var(--alert-red);
}

.volt-card::after {
  content: "";
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-bottom: 3px solid var(--neon-yellow);
  border-right: 3px solid var(--neon-yellow);
}

.volt-card:hover {
  transform: translateY(-4px);
  border-color: var(--neon-yellow);
  box-shadow: 0 0 36px rgba(245, 255, 0, 0.28);
}

body.final-ten .volt-card[data-unit="seconds"] {
  transform: scale(1.09);
  background: var(--alert-red);
  border-color: var(--neon-yellow);
  box-shadow: 0 0 54px rgba(255, 23, 58, 0.85);
}

body.final-ten .volt-card[data-unit="seconds"] .digits,
body.final-ten .volt-card[data-unit="seconds"] .unit-label {
  color: var(--neon-yellow);
}

.digits {
  display: inline-flex;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7.8vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.digit-slot {
  position: relative;
  display: inline-block;
  width: 0.58em;
  height: 1.06em;
  overflow: hidden;
}

.digit-char {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.digit-char.enter { transform: translateY(75%) skewX(-10deg); opacity: 0; }
.digit-char.active {
  transform: translateY(0) skewX(0);
  opacity: 1;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}
.digit-char.exit {
  transform: translateY(-75%) skewX(10deg);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.unit-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--neon-yellow);
}

.final-pulse {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(12rem, 36vw, 30rem);
  color: rgba(255, 23, 58, 0.22);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
}
.final-pulse.pop { animation: flashSlam 0.85s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes flashSlam {
  0% { opacity: 0; transform: scale(1.4); }
  20% { opacity: 1; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.1); }
}

/* Progress */
.progress-wrap {
  width: min(600px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

#progress-percent { color: var(--neon-yellow); font-weight: 700; }

.progress-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(245, 255, 0, 0.35);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--alert-red), var(--neon-yellow));
  box-shadow: 0 0 18px rgba(245, 255, 0, 0.5);
  transition: width 0.6s ease;
}

.fact-line {
  max-width: 60ch;
  min-height: 2.8em;
  font-size: clamp(0.94rem, 1.65vw, 1.12rem);
  font-weight: 600;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.fact-line.fading { opacity: 0; transform: translateY(5px); }

/* Celebration */
.celebration {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 5, 6, 0.9);
  backdrop-filter: blur(8px);
}
.celebration[hidden] { display: none; }

.celebration-card {
  max-width: 720px;
  padding: clamp(32px, 6vw, 56px) clamp(24px, 5vw, 48px);
  background: #0d0d10;
  border: 3px solid var(--neon-yellow);
  box-shadow: 0 0 80px rgba(255, 23, 58, 0.45);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.celebration-kicker {
  padding: 5px 14px;
  background: var(--alert-red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.celebration-title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8.6vw, 5.4rem);
  line-height: 0.98;
  color: var(--neon-yellow);
}

.celebration-sub {
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  color: var(--white);
  max-width: 40ch;
}

.celebration-hint {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--alert-red);
}

@media (max-width: 680px) {
  .countdown { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot, .glitch::before, .glitch::after, .final-pulse.pop { animation: none !important; }
  .digit-char.active, .digit-char.exit, .fact-line, .progress-fill { transition: none !important; }
}
