/* ============================================
   COUNTDOWN.EXE — terminal aesthetic
   ============================================ */

:root {
  --bg: #060a08;
  --bg-2: #0a1410;
  --green: #00ff9c;
  --green-dim: #00b870;
  --green-glow: rgba(0, 255, 156, 0.55);
  --cyan: #4dd0ff;
  --amber: #ffb347;
  --red: #ff4d6d;
  --text: #b8ffd4;
  --dim: #4a8268;
  --border: rgba(0, 255, 156, 0.25);
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Share Tech Mono', 'Courier New', monospace;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* CRT scanlines overlay */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: multiply;
}

.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* Grille en arrière-plan */
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 255, 156, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 156, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 24px 24px;
  text-align: center;
}

/* ===== HEADER ===== */
.header {
  margin-bottom: 48px;
}

.terminal-line {
  text-align: left;
  font-size: 0.85rem;
  color: var(--dim);
  margin-bottom: 28px;
  word-break: break-all;
}

.prompt { color: var(--green); }
.colon, .dollar { color: var(--text); }
.path { color: var(--cyan); }
.cmd { color: var(--text); margin-left: 6px; }

.cursor {
  display: inline-block;
  color: var(--green);
  animation: blink 1s steps(2) infinite;
  font-weight: 700;
}

.title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--green);
  text-shadow:
    0 0 4px var(--green),
    0 0 12px var(--green-glow),
    0 0 32px rgba(0, 255, 156, 0.25);
  margin-bottom: 12px;
}

.title .dot {
  color: var(--amber);
  text-shadow: 0 0 10px var(--amber);
  animation: blink 1.2s steps(2) infinite;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(77, 208, 255, 0.4);
}

/* ===== COUNTDOWN ===== */
.countdown {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 36px;
  flex-wrap: nowrap;
}

.cell {
  background:
    linear-gradient(180deg, rgba(0, 255, 156, 0.06) 0%, rgba(0, 255, 156, 0.02) 100%);
  border: 1px solid var(--border);
  padding: 22px 14px 14px;
  min-width: 130px;
  flex: 1 1 0;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(0, 255, 156, 0.05) inset,
    0 0 20px rgba(0, 255, 156, 0.08);
}

/* Coins décoratifs */
.cell::before,
.cell::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--green);
}
.cell::before {
  top: -1px; left: -1px;
  border-right: none;
  border-bottom: none;
}
.cell::after {
  bottom: -1px; right: -1px;
  border-left: none;
  border-top: none;
}

.value {
  font-family: 'Share Tech Mono', 'JetBrains Mono', monospace;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--green);
  text-shadow:
    0 0 6px var(--green),
    0 0 18px var(--green-glow);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--dim);
  margin-top: 10px;
  font-weight: 500;
}

.sep {
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--green);
  text-shadow: 0 0 10px var(--green-glow);
  align-self: center;
  animation: blink 1s steps(2) infinite;
  font-weight: 700;
}

/* ===== STATUS ===== */
.status {
  text-align: left;
  margin: 24px auto 48px;
  max-width: 560px;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  padding: 14px 18px;
}

.status-line {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
}

.dim { color: var(--dim); }

#status { color: var(--green); }

.bar {
  height: 6px;
  background: rgba(0, 255, 156, 0.08);
  border: 1px solid var(--border);
  margin: 10px 0;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background:
    linear-gradient(90deg, var(--green-dim), var(--green));
  box-shadow: 0 0 12px var(--green-glow);
  transition: width 0.5s ease-out;
}

/* ===== CHARACTER ZONE ===== */
.character-zone {
  margin-top: -40px;
  padding: 0 0 24px;
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.character-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transform-origin: bottom center;
  /* La transition s'applique aux changements de scale/opacité */
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 1.2s ease-out;
  filter: drop-shadow(0 0 24px rgba(0, 255, 156, 0.25));
}

.character {
  height: 380px;
  width: auto;
  display: block;
  /* Le fond de la vidéo est noir uni : on le fond avec le thème via un masque
     radial qui rend les bords transparents, et un léger mix-blend pour aider. */
  -webkit-mask-image: radial-gradient(
    ellipse 60% 70% at 50% 50%,
    black 85%,
    rgba(0, 0, 0, 0.9) 90%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 60% 70% at 50% 50%,
    black 85%,
    rgba(0, 0, 0, 0.9) 90%,
    transparent 100%
  );
  /* Petit traitement "écran" pour matcher le thème terminal */
  filter: contrast(1.05) saturate(1.05) brightness(1.02);
  /* Pas de styles d'interaction par défaut du <video> */
  background: transparent;
  pointer-events: none;
}

.caption {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--dim);
  letter-spacing: 0.05em;
  min-height: 1.5em;
}

/* ===== FOOTER ===== */
.footer {
  margin-top: 48px;
  padding: 24px 0;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  border-top: 1px dashed var(--border);
}

/* ===== ANIMATIONS GLOBALES ===== */
@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}

/* ===== ÉTAT FINAL (compte à zéro) ===== */
body.finished .title {
  color: var(--amber);
  text-shadow: 0 0 8px var(--amber), 0 0 24px rgba(255, 179, 71, 0.5);
}
body.finished .value {
  color: var(--amber);
  text-shadow: 0 0 6px var(--amber), 0 0 18px rgba(255, 179, 71, 0.5);
}
body.finished #status { color: var(--amber); }

/* ===== DONE PAGE ===== */
.hallelujah-zone {
  text-align: center;
  margin: 24px auto 32px;
  padding: 24px 18px;
  max-width: 760px;
}

.hallelujah {
  font-family: 'Share Tech Mono', 'JetBrains Mono', monospace;
  font-size: clamp(2.5rem, 9vw, 6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--amber);
  margin: 0;
  line-height: 1.1;
  animation: hallelujahPulse 2.4s ease-in-out infinite;
}

@keyframes hallelujahPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow:
      0 0 8px var(--amber),
      0 0 24px rgba(255, 179, 71, 0.6),
      0 0 56px rgba(255, 179, 71, 0.3);
  }
  50% {
    transform: scale(1.03);
    text-shadow:
      0 0 14px var(--amber),
      0 0 40px rgba(255, 179, 71, 0.85),
      0 0 84px rgba(255, 179, 71, 0.55);
  }
}

.emoji-zone {
  margin-top: 8px;
  padding: 0 0 24px;
  text-align: center;
}

.emoji {
  font-size: clamp(7rem, 22vw, 14rem);
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 0 24px rgba(255, 179, 71, 0.4))
          drop-shadow(0 0 48px rgba(255, 179, 71, 0.2));
  animation: emojiFloat 3.2s ease-in-out infinite;
}

@keyframes emojiFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 720px) {
  .container { padding: 24px 14px; }
  .countdown { gap: 6px; }
  .cell { min-width: 0; padding: 16px 6px 10px; }
  .label { font-size: 0.6rem; letter-spacing: 0.2em; }
  .sep { font-size: 2rem; }
  .character { height: 280px; }
  .character-zone { min-height: 340px; }
  .terminal-line { font-size: 0.72rem; }
}

@media (max-width: 420px) {
  .character { height: 220px; }
  .character-zone { min-height: 280px; }
  .cell { padding: 12px 4px 8px; }
}