/* MathSprint — Shared Countdown Overlay & Pulse Bar
   Drop-in styles used by the teacher (index.html) and student (student.html)
   waiting rooms. Visually matches the leaderboard countdown so all three
   surfaces fire in lockstep. */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

.msc-countdown {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 16, 31, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: msc-overlay-in 250ms ease;
}
.msc-countdown[hidden] { display: none; }

@keyframes msc-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.msc-cd-inner {
  text-align: center;
  pointer-events: none;
  user-select: none;
  padding: 0 24px;
  max-width: 100%;
}

.msc-cd-label {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 0.3em;
  margin-bottom: 20px;
}

.msc-countdown[data-cdtype="start"] .msc-cd-label {
  color: #f6c54d;
  text-shadow: 0 0 22px rgba(246, 197, 77, 0.9);
}
.msc-countdown[data-cdtype="end"] .msc-cd-label {
  color: #ff5b6e;
  text-shadow: 0 0 22px rgba(255, 91, 110, 0.9);
}

.msc-cd-number {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: min(38vmin, 300px);
  line-height: 0.88;
  font-variant-numeric: tabular-nums;
}

.msc-countdown[data-cdtype="start"] .msc-cd-number {
  color: #f6c54d;
  text-shadow:
    0 0 80px  rgba(246, 197, 77, 0.75),
    0 0 180px rgba(246, 197, 77, 0.35),
    6px 6px 0 #000;
}
.msc-countdown[data-cdtype="end"] .msc-cd-number {
  color: #ff5b6e;
  text-shadow:
    0 0 80px  rgba(255, 91, 110, 0.75),
    0 0 180px rgba(255, 91, 110, 0.35),
    6px 6px 0 #000;
}

.msc-cd-sub {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #aab4d6;
  margin-top: 24px;
}

.msc-cd-cancel {
  display: inline-block;
  margin-top: 28px;
  pointer-events: auto;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #aab4d6;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.18);
  padding: 10px 16px;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease, transform 80ms ease;
}
.msc-cd-cancel:hover {
  color: #fff;
  border-color: #fff;
}
.msc-cd-cancel:active { transform: translateY(1px); }
.msc-cd-cancel[hidden] { display: none; }

/* Bounce animation that replays on each tick */
.msc-cd-tick {
  animation: msc-cd-tick-anim 450ms cubic-bezier(0.2, 1.35, 0.35, 1);
}
@keyframes msc-cd-tick-anim {
  0%   { transform: scale(1.45); opacity: 0.5; }
  55%  { transform: scale(0.97); }
  100% { transform: scale(1);    opacity: 1; }
}

/* ── Final-10s pulse bar (used by student.html only) ─────── */
.msc-pulse-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #ff3b5e, #c81f3e);
  color: #fff;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-shadow: 1px 1px 0 #000;
  box-shadow: 0 4px 18px rgba(255, 59, 94, 0.45);
  animation: msc-pulse-bar 1s ease-in-out infinite;
}
.msc-pulse-bar[hidden] { display: none; }

.msc-pulse-bar__num {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 26px;
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 10px;
  border-radius: 2px;
}

@keyframes msc-pulse-bar {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.25); }
}
