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

body {
  background: #000;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  cursor: pointer;
}

canvas {
  display: block;
}

/* ── Overlay titre Matrix ── */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.15s;
}

.title {
  font-family: 'Courier New', monospace;
  font-size: clamp(2.5rem, 8vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  padding-left: 0.3em; /* compense l'espace trailing du letter-spacing */
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 10px #00ff41,
    0 0 30px #00ff41,
    0 0 60px #00ff41,
    0 0 120px #008f11;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* ── Écran d'extinction CRT ── */
#crt-off {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: none;
}

#crt-off.active {
  display: block;
  animation: crtOff 0.6s ease-in forwards;
}

@keyframes crtOff {
  0%   { background: rgba(200,255,200,0.08); clip-path: inset(0% 0% 0% 0%); }
  30%  { background: rgba(200,255,200,0.25); clip-path: inset(45% 0% 45% 0%); }
  60%  { background: rgba(255,255,255,0.6);  clip-path: inset(49.5% 0% 49.5% 0%); }
  85%  { background: rgba(255,255,255,0.9);  clip-path: inset(49.9% 30% 49.9% 30%); }
  100% { background: #000;                   clip-path: inset(50% 50% 50% 50%); }
}

/* ── Écran MS-DOS ── */
#dos-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 40;
  display: none;
  padding: 2rem 2.5rem;
  overflow: hidden;
  cursor: pointer;
}

#dos-screen.active {
  display: block;
}

#dos-output {
  font-family: 'Courier New', monospace;
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  color: #aaa;
  line-height: 1.55;
  white-space: pre-wrap;
}

.dos-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: #aaa;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}

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

/* ── Hint de retour ── */
#dos-hint {
  position: fixed;
  bottom: 1.5rem;
  right: 2rem;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: #444;
  z-index: 41;
  display: none;
}

#dos-screen.active ~ #dos-hint {
  display: block;
}

/* ── Footer ── */
#site-footer {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: #1a6b2a;
  z-index: 20;
  white-space: nowrap;
  pointer-events: auto;
}

#site-footer a {
  color: #00ff41;
  text-decoration: none;
  transition: text-shadow 0.2s;
}

#site-footer a:hover {
  text-shadow: 0 0 8px #00ff41;
}
