/* === CHARGEMENT DES POLICES ARCADE UNIQUEMENT === */
@font-face {
  font-family: 'Karmatic';
  src: url('../fonts/ka1.ttf') format('truetype');
}
@font-face {
  font-family: 'ArcadePix';
  src: url('../fonts/ARCADEPI.TTF') format('truetype');
}
@font-face {
  font-family: 'Arcade8In';
  src: url('../fonts/8-bit Arcade In.ttf') format('truetype');
}

/* === PALETTE STRICTE : ROUGE, ORANGE, CYAN === */
:root {
  --c-red: #ff2e3b;
  --c-orange: #ff8800;
  --c-cyan: #00e5ff;
}

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

body {
  position: relative;
  background-color: #030306;
  background-image: url('../images/fond_arcade_login.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #f4f4f8;
  font-family: Arial, Helvetica, sans-serif;
  padding: 1.5rem 1rem;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 15, 0.34);
  z-index: 0;
  transition: background 0.9s ease;
  pointer-events: none;
}

body.standby::before {
  background: rgba(2, 2, 5, 0.95);
}

/* === ÉCLAIRS EN ARRIÈRE-PLAN === */
#lightning-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* === CADRE CRT === */
.crt-bezel {
  position: relative;
  z-index: 2;
  width: 94%;
  max-width: 1040px;
  background: linear-gradient(145deg, rgba(32, 32, 38, 0.94), rgba(14, 14, 18, 0.96));
  padding: 18px;
  border-radius: 24px;
  border: 3px solid #383842;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.88),
    0 0 35px rgba(255, 46, 59, 0.22),
    0 0 60px rgba(0, 229, 255, 0.14);
  transition: box-shadow 0.8s ease;
}

body.standby .crt-bezel {
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.98);
}

/* === ÉCRAN CRT SEMI-TRANSPARENT === */
.crt-screen {
  position: relative;
  background: rgba(10, 12, 18, 0.68);
  backdrop-filter: blur(3px);
  border-radius: 16px;
  border: 4px solid #050508;
  padding: 1.6rem 2.2rem 2rem;
  overflow: hidden;
  box-shadow:
    inset 0 0 55px rgba(0, 0, 0, 0.85),
    inset 0 0 18px rgba(0, 229, 255, 0.12);
  transition: background 0.8s ease;
}

body.standby .crt-screen {
  background: rgba(3, 3, 6, 0.96);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 1);
}

/* Scanlines CRT */
.crt-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.25) 0px,
    rgba(0, 0, 0, 0.25) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 10;
}

/* === ÉCRAN DE DÉMARRAGE (INSERT COINS) === */
#boot-screen {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.35s ease;
}

#boot-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.insert-coin-btn {
  font-family: 'Arcade8In', 'ArcadePix', monospace;
  font-size: clamp(2rem, 5vw, 3.3rem);
  letter-spacing: 3px;
  color: var(--c-orange);
  background: transparent;
  border: 3px solid var(--c-orange);
  border-radius: 12px;
  padding: 1.1rem 2.4rem;
  cursor: pointer;
  text-shadow:
    -2px 0 0 var(--c-red),
     2px 0 0 var(--c-cyan),
     0 0 18px rgba(255, 136, 0, 0.85);
  box-shadow:
    0 0 24px rgba(255, 136, 0, 0.35),
    inset 0 0 16px rgba(255, 136, 0, 0.2);
  animation: coinPulse 1.25s infinite;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.insert-coin-btn:hover {
  transform: scale(1.06);
  background: rgba(255, 136, 0, 0.16);
  box-shadow:
    0 0 38px rgba(255, 136, 0, 0.7),
    inset 0 0 22px rgba(255, 46, 59, 0.3);
}

.insert-coin-btn:active {
  transform: scale(0.96);
}

@keyframes coinPulse {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.45; }
}

/* === CONTENU PRINCIPAL & ALLUMAGE CRT === */
#main-arcade-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.4rem;
  width: 100%;
}

body.standby #main-arcade-content {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.powered-on #main-arcade-content {
  visibility: visible;
  animation: crtTurnOn 0.55s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes crtTurnOn {
  0% {
    opacity: 0;
    transform: scale(1, 0.02);
    filter: brightness(3);
  }
  45% {
    opacity: 1;
    transform: scale(1, 0.08);
    filter: brightness(2.2);
  }
  100% {
    opacity: 1;
    transform: scale(1, 1);
    filter: brightness(1);
  }
}

/* === BARRE DU HAUT + BOUTON SON === */
.arcade-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  font-family: 'ArcadePix', monospace;
  font-size: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.18);
}

.score-1up    { color: var(--c-red); text-shadow: 0 0 8px rgba(255, 46, 59, 0.7); }
.score-high   { color: var(--c-orange); text-shadow: 0 0 8px rgba(255, 136, 0, 0.7); }
.score-credit { color: var(--c-cyan); text-shadow: 0 0 8px rgba(0, 229, 255, 0.7); }

.sound-btn {
  font-family: 'ArcadePix', monospace;
  font-size: 1rem;
  background: rgba(20, 22, 32, 0.9);
  color: var(--c-cyan);
  border: 2px solid var(--c-cyan);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: 0.2s;
}

.sound-btn:hover {
  background: var(--c-cyan);
  color: #050508;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.7);
}

.sound-btn.active {
  border-color: var(--c-orange);
  color: var(--c-orange);
}

.sound-btn.active:hover {
  background: var(--c-orange);
  color: #050508;
  box-shadow: 0 0 12px rgba(255, 136, 0, 0.7);
}

/* === EN-TÊTE + MASCOTTE === */
.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  text-align: center;
}

.hero-avatar {
  width: 190px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(255, 136, 0, 0.45));
}

.hero-text {
  flex: 1;
  min-width: 240px;
}

h1 {
  font-family: 'Karmatic', monospace;
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  color: var(--c-orange);
  font-weight: normal;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  text-shadow:
    -3px 0px 0px rgba(255, 46, 59, 0.9),
     3px 0px 0px rgba(0, 229, 255, 0.85),
     0px 0px 20px rgba(255, 136, 0, 0.65);
}

.subtitle {
  font-family: 'ArcadePix', monospace;
  font-size: 1.25rem;
  letter-spacing: 1px;
  color: var(--c-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.55);
}

/* === TITRE - SELECT STAGE - (NOUVELLE POLICE & COULEUR) === */
.menu-box h2 {
  font-family: 'Arcade8In', 'ArcadePix', monospace;
  font-size: 2.3rem;
  color: var(--c-cyan);
  font-weight: normal;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 3px;
  text-shadow:
    -2px 0px 0px rgba(255, 46, 59, 0.8),
     2px 0px 0px rgba(255, 136, 0, 0.8),
     0px 0px 14px rgba(0, 229, 255, 0.65);
}

/* === TABLEAU DE BOUTONS UNIFIÉS + CHANGEMENT DE COULEUR AU SURVOL === */
.button-table {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.95rem;
}

@media (max-width: 650px) {
  .crt-screen {
    padding: 1.3rem 1rem;
  }
  .button-table {
    grid-template-columns: 1fr;
  }
}

.stage-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: 'ArcadePix', monospace;
  font-size: 1.22rem;
  padding: 1.05rem 1.1rem;
  background: rgba(14, 18, 28, 0.88);
  border: 2px solid var(--c-cyan);
  border-radius: 10px;
  color: #9ff6ff;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 5px 0 #005866, 0 0 10px rgba(0, 229, 255, 0.15);
  transition:
    transform 0.16s ease,
    box-shadow 0.2s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease;
}

/* Faisceau lumineux au passage de la souris */
.stage-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
  transform: skewX(-25deg);
  transition: left 0.45s ease;
}

.stage-btn:hover::before {
  left: 140%;
}

/* Changement de couleur vers Rouge/Orange incandescent au survol */
.stage-btn:hover {
  transform: translateY(-3px) scale(1.02);
  background: linear-gradient(90deg, rgba(255, 46, 59, 0.34), rgba(255, 136, 0, 0.34));
  border-color: var(--c-orange);
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 136, 0, 0.9);
  box-shadow: 0 6px 0 #8a2400, 0 0 24px rgba(255, 136, 0, 0.65);
}

.stage-btn:hover::after {
  content: " ◀";
  font-size: 0.95rem;
  color: var(--c-orange);
}

.stage-btn:active {
  transform: translateY(4px) scale(0.99);
  box-shadow: 0 1px 0 #8a2400;
}

.stage-btn.boss-stage {
  grid-column: 1 / -1;
  font-size: 1.32rem;
  padding: 1.15rem;
}

/* === PIED DE PAGE CLIGNOTANT === */
.crt-footer {
  text-align: center;
  font-family: 'Arcade8In', monospace;
  font-size: 1.9rem;
  color: var(--c-orange);
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(255, 136, 0, 0.65);
  animation: blink 1.3s infinite;
}

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