/* ============================================================
   AVENGERS: DOOMSDAY — TRAILER COUNTDOWN CSS
   Matches the official trailer end card styling (3:06 & 3:11)
   ============================================================ */

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

:root {
  --green-glow: rgba(110, 240, 140, 0.25);
  --green-accent: #6ee68c;
  --text-white: #f5f9f6;
  --text-muted: rgba(210, 235, 220, 0.72);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
  color: var(--text-white);
  font-family: 'Rajdhani', sans-serif;
  user-select: none;
}

/* ── CINEMATIC BACKDROP ── */
.cinema-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #020503 url('../images/trailer_bg.jpg') no-repeat center center;
  background-size: cover;
  transition: transform 8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Atmospheric light beam ray streaming from the top window */
.light-beam {
  position: absolute;
  top: -10%;
  left: 38%;
  width: 45%;
  height: 120%;
  background: linear-gradient(
    135deg,
    rgba(180, 255, 190, 0.09) 0%,
    rgba(90, 220, 110, 0.05) 35%,
    transparent 70%
  );
  filter: blur(28px);
  pointer-events: none;
  animation: beamBreathe 7s ease-in-out infinite alternate;
}

@keyframes beamBreathe {
  0% { opacity: 0.75; transform: rotate(1deg) scale(0.98); }
  100% { opacity: 1.0; transform: rotate(-1deg) scale(1.02); }
}

/* Floating micro-dust particles in the green beam */
.dust-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(1.5px 1.5px at 45% 25%, rgba(180, 255, 190, 0.35), transparent),
    radial-gradient(1px 1px at 55% 35%, rgba(140, 240, 160, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 60% 45%, rgba(200, 255, 200, 0.3), transparent),
    radial-gradient(1px 1px at 50% 60%, rgba(160, 255, 180, 0.2), transparent);
  background-size: 550px 550px;
  animation: dustDrift 20s linear infinite;
}

@keyframes dustDrift {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-20px) translateX(10px); }
  100% { transform: translateY(0) translateX(0); }
}

/* ── STAGE VIEWPORT ── */
.stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 4vw;
}

/* ── DISPLAY CONTAINER ── */
.display-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Centered slightly above the crossbar for optimal balance */
  transform: translateY(-2vh);
  transition: opacity 0.6s ease, transform 0.6s ease;
  width: 100%;
  max-width: 1400px;
}

/* ── 1. DATE HEADLINE ("12.18.26 IS DOOMSDAY") ── */
.date-headline {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 6.2rem);
  line-height: 1;
  color: #e5ece6;
  letter-spacing: 0.1em;
  word-spacing: 0.28em;
  white-space: nowrap;
  margin-bottom: clamp(1.2rem, 3vh, 2.6rem);
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.95),
    0 4px 25px rgba(0, 0, 0, 0.8),
    0 0 35px rgba(110, 230, 130, 0.15);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.date-headline .date-digits {
  color: #eef5ef;
}

.date-headline .is-doomsday {
  color: #e5ede6;
  margin-left: 0.18em;
}

/* ── 2. TRAILER COUNTDOWN ("00 : 24 : 14 : 59 : 57") ── */
.trailer-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Numbers + colons row */
.timer-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  line-height: 1;
  width: 100%;
}

/* Each unit box (Number on top, Label underneath) */
.time-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: clamp(2.8rem, 8vw, 8.8rem);
}

/* Number digits */
.time-box .val {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 6.4vw, 7rem);
  line-height: 1;
  letter-spacing: 0.08em;
  color: #f7fbf8;
  text-shadow:
    0 2px 14px rgba(0, 0, 0, 0.95),
    0 4px 30px rgba(0, 0, 0, 0.85),
    0 0 35px rgba(120, 250, 150, 0.22);
  transition: color 0.15s, transform 0.15s;
}

/* Subtle glow pulse on tick */
.time-box .val.tick-pulse {
  color: #ffffff;
  text-shadow:
    0 0 25px rgba(130, 255, 160, 0.6),
    0 2px 14px rgba(0, 0, 0, 0.95);
}

/* Unit Labels (MONTHS, DAYS, HOURS, MINUTES, SECONDS) */
.time-box .unit-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: clamp(0.55rem, 1.2vw, 1.1rem);
  letter-spacing: 0.26em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: clamp(6px, 1.2vh, 16px);
  /* Compensation for letter-spacing to ensure absolute center alignment */
  padding-left: 0.26em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* Colons between time boxes */
.colon {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 6.4vw, 7rem);
  line-height: 1;
  color: #e5f0e7;
  padding: 0 clamp(4px, 1.2vw, 22px);
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.95),
    0 0 20px rgba(100, 230, 130, 0.15);
  align-self: flex-start;
}

/* ── VIEW MODES ── */
/* Mode: Under The Date (both visible) */
body.mode-under-date .date-headline {
  display: block;
}
body.mode-under-date .trailer-countdown {
  display: flex;
}

/* Mode: Pure Countdown (Only countdown centered) */
body.mode-countdown-only .date-headline {
  display: none;
}
body.mode-countdown-only .display-container {
  transform: translateY(0);
}
body.mode-countdown-only .time-box .val {
  font-size: clamp(3rem, 8.5vw, 9.2rem);
}
body.mode-countdown-only .colon {
  font-size: clamp(3rem, 8.5vw, 9.2rem);
}

/* Mode: Trailer Sequence (Alternates with fade) */
body.mode-sequence.seq-date .date-headline {
  opacity: 1;
  transform: scale(1);
}
body.mode-sequence.seq-date .trailer-countdown {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}
body.mode-sequence.seq-countdown .date-headline {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}
body.mode-sequence.seq-countdown .trailer-countdown {
  opacity: 1;
  transform: scale(1);
}

/* ── CONTROLS / FOOTER ── */
.controls-hint {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0.65;
  transition: opacity 0.3s ease;
}
.controls-hint:hover {
  opacity: 1;
}

.hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 25, 15, 0.7);
  border: 1px solid rgba(80, 200, 110, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: #cfe5d4;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.hint-pill:hover {
  background: rgba(20, 45, 25, 0.85);
  border-color: rgba(110, 240, 140, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}

.dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-accent);
  box-shadow: 0 0 8px var(--green-accent);
  animation: dotPulse 2s infinite alternate;
}

@keyframes dotPulse {
  0% { opacity: 0.5; }
  100% { opacity: 1; transform: scale(1.2); }
}

.admin-link {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.admin-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
}

/* ── SCANLINE OVERLAY ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 3px
  );
}

/* Subtle Cinema Edge Vignette */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  background: radial-gradient(
    ellipse 85% 85% at 50% 50%,
    transparent 45%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* ── ZERO SCREEN ── */
#zero-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  text-align: center;
}
#zero-screen.active {
  display: flex;
}
.zero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: clamp(4.5rem, 14vw, 14rem);
  letter-spacing: 0.1em;
  color: #ffffff;
  text-shadow: 0 0 60px rgba(100, 255, 140, 0.5);
  line-height: 1;
}
.zero-subtitle {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 5rem);
  letter-spacing: 0.35em;
  color: var(--green-accent);
  margin-top: 10px;
}
.zero-date {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(0.9rem, 1.8vw, 1.5rem);
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 25px;
}

/* ── RESPONSIVE ADAPTATIONS ── */
@media (max-width: 900px) {
  .date-headline {
    font-size: clamp(1.8rem, 5.5vw, 3.8rem);
    margin-bottom: 1rem;
    white-space: normal;
  }
  .time-box {
    min-width: clamp(2.5rem, 7vw, 5rem);
  }
  .time-box .val {
    font-size: clamp(1.8rem, 5.8vw, 4rem);
  }
  .colon {
    font-size: clamp(1.8rem, 5.8vw, 4rem);
    padding: 0 clamp(3px, 0.8vw, 10px);
  }
  .time-box .unit-name {
    font-size: clamp(0.5rem, 1vw, 0.8rem);
    letter-spacing: 0.15em;
  }
}

@media (max-width: 550px) {
  .date-headline {
    font-size: clamp(1.4rem, 6.5vw, 2.4rem);
  }
  .time-box .val {
    font-size: clamp(1.3rem, 5.6vw, 2.2rem);
  }
  .colon {
    font-size: clamp(1.3rem, 5.6vw, 2.2rem);
    padding: 0 2px;
  }
  .time-box .unit-name {
    font-size: 0.48rem;
    letter-spacing: 0.1em;
  }
}
