/* ============================================================
   NEON ARCADE — feuille de style (re-skin graphique)
   Thème : pixel art / arcade authentique années 80
   Layout intact (positions, flex/grid, aspect-ratios, shrink).
   Seuls les graphismes (couleurs, gradients, ombres, ornements)
   sont remplacés.
   ============================================================ */

:root {
  /* ===== PALETTE — couleurs directes saturées ===== */
  --bg:           #0e0e14;
  --bg-deep:      #05050a;
  --bg-cabinet:   #1f1f26;
  --bg-mid:       #15151c;
  --bg-soft:      #0a0a10;

  /* Couleurs arcade authentique 80s */
  --arcade-red:   #e63946;
  --arcade-yellow:#ffd60a;
  --arcade-cyan:  #00d4ff;
  --arcade-green: #06d6a0;
  --arcade-pink:  #ff4d8d;
  --arcade-blue:  #2563eb;

  /* Legacy aliases (remappées pour ne pas casser les références) */
  --neogeo-blue-deep:    var(--bg-deep);
  --neogeo-blue-mid:     var(--bg-cabinet);
  --neogeo-blue-light:   var(--bg-cabinet);
  --neogeo-blue-edge:    var(--bg-deep);
  --neogeo-piping:       var(--bg-deep);
  --neogeo-piping-deep:  var(--bg-deep);
  --marquee-red:         var(--arcade-red);
  --marquee-yellow:      var(--arcade-yellow);
  --marquee-amber:       var(--arcade-yellow);
  --chrome-dark:         var(--bg-deep);
  --chrome-mid:          var(--bg-cabinet);
  --chrome-light:        var(--arcade-yellow);
  --chrome-glint:        var(--arcade-yellow);
  --coin-gold:           var(--arcade-yellow);
  --coin-gold-light:     var(--arcade-yellow);
  --coin-door:           var(--bg-deep);

  /* Texte */
  --text:         #f5f5f5;
  --text-dim:     #b0b0b8;
  --text-mute:    #6c6c74;

  /* Legacy UI : alias cyan/magenta → couleurs directes */
  --cyan:         var(--arcade-cyan);
  --cyan-soft:    var(--arcade-yellow);
  --magenta:      var(--arcade-red);
  --magenta-soft: #e9d8b0;
  --warning-red:  var(--arcade-red);
  --lime:         var(--arcade-green);
  --yellow:       var(--arcade-yellow);
  --orange:       #ff7b00;
  --pink:         var(--arcade-pink);
  --bg-void:      var(--bg-deep);
  --bg-deep-legacy: #0a0a10;
  --bg-mid-legacy:  #15151c;
  --bg-soft-legacy: #2c2c34;
  --line:         #2c2c34;
  --glow-cyan:    none;
  --glow-magenta: none;
  --glow-soft:    none;
  --bevel-top:    none;
  --bevel-bot:    none;

  --font-display: 'Press Start 2P', 'VT323', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Header partagé : Arcade fixe 1rem = 14px (base 14px sur <html>), donc les
   tailles en rem de shared-header.css rétrécissaient (h1 à 49px au lieu de
   la famille à 56px). On fige la valeur en px pour rester aligné sur les
   autres apps sans changer la base rem propre à l'Arcade. */
.custom-header .title-banner h1 {
  font-size: clamp(32px, 5vw, 56px);
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  background: var(--bg-deep);
}

/* ============================================================
   Décors de fond : grille pixel subtile simple (pas de scanlines
   page-wide, pas de grain animé — uniquement une grille discrète)
   ============================================================ */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg--grid {
  background-image:
    linear-gradient(rgba(255, 214, 10, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 214, 10, .04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, #000 35%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, #000 35%, transparent 90%);
}
.bg--glow, .bg--scan, .bg--noise { display: none; }

/* ============================================================
   Barre du haut — minimal, conservée du layout d'origine
   ============================================================ */
.topbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--bg-deep);
  background: var(--bg-deep);
}
.topbar__brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--arcade-yellow);
}
.topbar__nav { display: flex; gap: 24px; }
.topbar__link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: .25em;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.topbar__link:hover,
.topbar__link:focus-visible {
  color: var(--arcade-yellow);
  border-color: var(--arcade-yellow);
  outline: none;
}
.topbar__status { font-size: 11px; letter-spacing: .2em; color: var(--text-mute); }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--bg-deep);
  background: var(--bg-cabinet);
  color: var(--arcade-yellow);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot--green {
  background: var(--arcade-green);
  animation: blink 1.6s steps(2, end) infinite;
}
.dot--cyan {
  background: var(--arcade-cyan);
  animation: blink 1.2s steps(2, end) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .55; transform: scale(.85); }
}

/* ============================================================
   CABINET extérieur — anthracite uniforme, bordures pixel dures
   (LAYOUT inchangé : width, margin, position, z-index)
   ============================================================ */
.cabinet {
  position: relative;
  z-index: 2;
  width: min(820px, 95vw);
  margin: 26px auto 12px;
  padding: 16px 22px 22px;
  border-radius: 0;
  background: var(--bg-cabinet);
  border: 4px solid var(--bg-deep);
  /* Ombre drop pixel hard — pas de glow */
  box-shadow:
    0 4px 0 var(--bg-deep),
    6px 6px 0 rgba(0, 0, 0, .8);
}
.cabinet::before { display: none; }

/* ============================================================
   MARQUEE — fond rouge plein, titre jaune pixel, sous-titre blanc.
   (LAYOUT inchangé : margin, padding, position, z-index)
   ============================================================ */
.cabinet__marquee {
  position: relative;
  margin: 4px 26px 0;
  padding: 26px 28px 20px;
  border-radius: 0;
  background: var(--arcade-red);
  border: 4px solid var(--bg-deep);
  box-shadow: none;
  overflow: hidden;
  isolation: isolate;
}
.marquee__stripes { display: none; }      /* bandes rétro-éclairées → supprimées */
.marquee__title {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 56px);
  text-align: center;
  letter-spacing: .08em;
  line-height: 1.05;
  /* Couleur pleine jaune — pas de gradient chrome */
  color: var(--arcade-yellow);
  background: none;
  -webkit-text-fill-color: initial;
  text-shadow: 3px 3px 0 var(--bg-deep);
  filter: none;
}
.marquee__title::before { content: none; }
.marquee__sub {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .35em;
  color: #ffffff;
  text-shadow: 2px 2px 0 var(--bg-deep);
  -webkit-text-stroke: initial;
}
.marquee__bullet {
  color: var(--arcade-yellow);
  letter-spacing: .1em;
  text-shadow: 2px 2px 0 var(--bg-deep);
  opacity: 1;
}

/* ============================================================
   CHASSIS CRT — encadré noir bezel (LAYOUT inchangé)
   ============================================================ */
.cabinet__chassis {
  position: relative;
  margin: 14px 0 14px;
  padding: 22px;
  border-radius: 0;
  background: var(--bg-deep);
  border: 3px solid var(--bg-deep);
  box-shadow:
    inset  0 0 0 1px #000,
    inset  0 4px 14px rgba(0, 0, 0, .9),
    inset  0 -2px 6px rgba(0, 0, 0, .7);
}
.screw {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg-cabinet);
  border: 1px solid #000;
  box-shadow: none;
}
.screw::before {
  content: "";
  position: absolute;
  width: 6px; height: 1.5px;
  background: #000;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(35deg);
  border-radius: 0;
}
.screw--tl { top: 8px;  left: 8px;  }
.screw--tr { top: 8px;  right: 8px; }
.screw--bl { bottom: 8px; left: 8px;  }
.screw--br { bottom: 8px; right: 8px; }

/* Speaker grille latérale — layout inchangé, look pixel clean */
.speaker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  padding: 10px;
  position: absolute;
  top: 28px; right: -56px;
  width: 44px; height: 180px;
  border-radius: 0;
  background: var(--bg-deep);
  border: 1px solid #000;
  box-shadow: none;
}
.speaker span {
  background: #000;
  border-radius: 50%;
  box-shadow: none;
}

/* ============================================================
   ÉCRAN CRT — fond noir + scanlines très subtiles confinées,
   bordures pixel dures (LAYOUT inchangé : aspect-ratio, padding)
   ============================================================ */
.crt {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 0;
  padding: 16px;
  background: #000;
  border: 6px solid #000;
  box-shadow: none;
  overflow: hidden;
}
.crt::after {
  /* Scanlines amber très subtiles — uniquement à l'intérieur du CRT */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 176, 0, .04) 0px,
    rgba(255, 176, 0, .04) 1px,
    transparent 1px,
    transparent 3px);
  z-index: 5;
}
.crt__shell {
  position: relative;
  height: 100%;
  border-radius: 0;
  background: #000;
  padding: 14px 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  z-index: 1;
}

/* Reflet statique — conservé, conservé comme détail */
.crt__glare {
  position: absolute;
  inset: 16px;
  border-radius: 0;
  background: none;
  pointer-events: none;
  z-index: 3;
}

/* HUD haut du CRT — pixels jaune (LAYOUT inchangé) */
.crt__hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 6px 8px;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--arcade-yellow);
  border-bottom: 2px solid #1a1a1a;
}
.crt__hud-left { text-align: left; }
.crt__hud-right { text-align: right; }
.crt__hud-center { text-align: center; color: var(--arcade-red); }
.hud-label { display: inline-block; margin-right: 6px; color: var(--text-mute); }
.hud-value {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-deep);
  border: 1px solid #1a1a1a;
  color: var(--arcade-cyan);
  font-variant-numeric: tabular-nums;
}
.hud-pulse { color: var(--arcade-red); }

/* Pied du CRT */
.crt__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--arcade-yellow);
  text-shadow: none;
  padding: 4px 8px;
  border-top: 2px solid #1a1a1a;
}
.crt__foot em { font-style: normal; color: #fff; }
.press-start {
  color: var(--arcade-yellow);
  text-shadow: none;
  animation: blink 1.2s steps(2, end) infinite;
}
.ps-arrow { color: var(--arcade-red); margin-right: 4px; }
@keyframes blink { 50% { opacity: 0; } }
.indicator { display: inline-flex; gap: 4px; }
.indicator span {
  width: 6px; height: 6px;
  background: var(--bg-deep);
  border-radius: 50%;
  box-shadow: none;
}
.indicator span:nth-child(1) { background: var(--arcade-red); }
.indicator span:nth-child(3) {
  background: var(--arcade-green);
  animation: blink 2.4s steps(2, end) infinite;
}

/* ============================================================
   CAROUSEL — layout intact (perspective 3D conservé pour le JS),
   graphics simplifiés
   ============================================================ */
.carousel {
  position: relative;
  perspective: 1200px;
  perspective-origin: 50% 40%;
  display: grid;
  place-items: center;
  min-height: 0;
}
.carousel__viewport {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.carousel__hint {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--text-mute);
  z-index: 10;
}
kbd {
  font-family: inherit;
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid #1a1a1a;
  border-bottom-width: 2px;
  border-radius: 0;
  background: #000;
  color: var(--arcade-cyan);
}

/* Boutons flèches — pixel block (LAYOUT inchangé : position, taille) */
.arrow {
  position: absolute;
  top: 38%;
  z-index: 30;
  width: 52px; height: 78px;
  border: 2px solid var(--arcade-red);
  background: #000;
  color: var(--arcade-red);
  border-radius: 0;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s ease, background .15s ease, color .15s ease;
  text-shadow: none;
  box-shadow: none;
}
.arrow svg { width: 30px; height: 30px; }
.arrow--left { left: -10px; }
.arrow--right { right: -10px; }
.arrow:hover,
.arrow:focus-visible {
  outline: none;
  background: var(--arcade-red);
  color: #fff;
  box-shadow: 4px 4px 0 var(--bg-deep);
}
.arrow:active { transform: translate(1px, 1px); }
.arrow::after { display: none; }

/* ============================================================
   CARTES — pixel-clean : fond noir, bordure 3px accent, corners
   (LAYOUT intact : width 280, translateX 110, scale calc)
   ============================================================ */
.card {
  position: absolute;
  top: 50%; left: 50%;
  width: 280px;
  --offset: 0;
  --abs:    0;
  --tx:  calc(var(--offset) * 110px);
  --tz:  0;
  --ry:  0;
  --sc:  calc(1 - var(--abs) * .15);
  --op:  calc(1 - var(--abs) * .55);
  --bl:  0;
  --accent: var(--arcade-yellow);

  transform:
    translate(-50%, -50%)
    translateX(var(--tx))
    scale(var(--sc));
  opacity: var(--op);
  z-index: calc(50 - var(--abs) * 10);
  transition:
    transform .35s cubic-bezier(.4, 0, .2, 1),
    opacity .3s ease;
  pointer-events: none;
  cursor: default;
}
.card.is-active { pointer-events: auto; cursor: pointer; }
.card.is-hidden { opacity: 0 !important; pointer-events: none !important; }

.card__inner {
  position: relative;
  padding: 14px 14px 16px;
  border-radius: 0;
  background: #000;
  border: 3px solid var(--accent);
  box-shadow:
    4px 4px 0 var(--bg-deep);
  display: grid;
  grid-template-rows: 1fr auto auto auto auto;
  gap: 8px;
  text-align: center;
}
/* 4 corner brackets accent (8 segments via ::before) */
.card__inner::before {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) 0      0    / 14px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0      0    / 2px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100%   0    / 14px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100%   0    / 2px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0      100% / 14px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0      100% / 2px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100%   100% / 14px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100%   100% / 2px 14px no-repeat;
  opacity: 1;
}
.card__inner::after { content: none; }
.card.is-active .card__inner {
  border-color: var(--accent);
  box-shadow:
    4px 4px 0 var(--accent),
    8px 8px 0 var(--bg-deep);
}

.game-art {
  aspect-ratio: 16 / 9;
  min-height: 110px;
  margin: 0 auto 4px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 0;
  background: #0a0a10;
  border: 1px solid #1a1a1a;
  image-rendering: pixelated;
}
.game-art svg { width: 100%; height: 100%; image-rendering: pixelated; }
.game-art__logo {
  display: block;
  width: 100%;
  height: 100%;
  margin: auto;
  object-fit: contain;
  object-position: center;
  filter: none;
  image-rendering: pixelated;
}
.card.is-active .game-art__logo {
  filter: none;
}
.card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: .12em;
  color: var(--accent);
  text-shadow: 2px 2px 0 #000;
}
.card.is-active .card__title { animation: title-pulse 1.6s steps(2, end) infinite; }
@keyframes title-pulse { 50% { opacity: .55; } }
.card__font { display: none; }
.card__year {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--text-mute);
}
.card__tagline {
  margin: 0;
  font-size: 11px;
  color: var(--text-dim);
  min-height: 28px;
}
.card__play {
  appearance: none;
  border: 2px solid var(--accent);
  background: #000;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .25em;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 0;
  text-shadow: none;
  box-shadow: none;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.card__play:hover {
  background: var(--accent);
  color: #000;
}
.card__play:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}
.card__play:active {
  background: var(--accent);
  color: #000;
  transform: translate(1px, 1px);
}

/* ============================================================
   PANNEAU DE CONTRÔLE — anthracite uniforme (LAYOUT intact)
   ============================================================ */
.cabinet__panel {
  position: relative;
  margin: 0;
  padding: 26px 30px 26px;
  border-radius: 0;
  background: var(--bg-cabinet);
  border-top: 4px solid var(--bg-deep);
  box-shadow: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  transform: none;
  transform-origin: top center;
}
.cabinet__panel::before { display: none; }
.cabinet__panel::after { display: none; }

/* Joystick — layout intact, look pixel plat */
.joystick, .buttons { display: flex; align-items: center; }
.joystick {
  position: relative;
  width: 100px;
  height: 96px;
  justify-self: end;
}
.joystick__base {
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid #000;
  box-shadow: none;
}
.joystick__base::before { display: none; }
.joystick__stick {
  position: absolute;
  left: 50%; bottom: 36px;
  transform: translateX(-50%);
  width: 14px; height: 40px;
  background: #888;
  border-radius: 0;
  box-shadow: none;
}
.joystick__stick::before {
  content: "";
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--arcade-red);
  border: 2px solid #000;
  box-shadow: none;
}

/* Boutons arcade - layout intact, couleurs pixel */
.buttons { justify-self: start; gap: 12px; align-items: flex-start; }
.buttons .btn:nth-child(2) { transform: translateY(-6px); }
.buttons .btn:nth-child(3) { transform: translateY(-14px); }
.buttons .btn:nth-child(4) { transform: translateY(-6px); }
.buttons { justify-self: start; gap: 12px; }
.btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid #000;
  box-shadow: none;
  background-color: var(--bg-cabinet);
}
.btn--blue   { background-color: var(--arcade-blue); }
.btn--red    { background-color: var(--arcade-red);   }
.btn--yellow { background-color: var(--arcade-yellow); }
.btn--green  { background-color: var(--arcade-green);  }
.btn:hover { filter: none; border-color: var(--arcade-yellow); }

/* Fente à pièces — pixel */
.coin-slot {
  position: absolute;
  top: 18px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: .25em;
  background: var(--bg-deep);
  padding: 6px 12px;
  border-radius: 0;
  border: 1px solid #000;
  box-shadow: none;
}
.coin-slot__hole {
  width: 28px; height: 6px;
  border-radius: 0;
  background: var(--arcade-yellow);
  box-shadow: none;
}
.coin-slot__label {
  color: var(--arcade-yellow);
  text-shadow: none;
  font-family: var(--font-display);
  letter-spacing: .15em;
}

/* Pieds de la borne — pixel */
.cabinet__feet {
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  margin-top: -6px;
}
.cabinet__feet span {
  width: 56px; height: 16px;
  background: var(--bg-deep);
  border: 1px solid #000;
  border-top: 1px solid var(--bg-deep);
  border-radius: 0;
  box-shadow: none;
}

/* ============================================================
   SIDEBARS — anthracite pixel (LAYOUT inchangé : position fixed)
   ============================================================ */
.sidebar {
  position: fixed;
  top: 50%;
  width: 200px;
  z-index: 3;
  background: var(--bg-cabinet);
  border: 2px solid var(--bg-deep);
  border-radius: 0;
  padding: 16px 14px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateY(-50%);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .5);
}
.sidebar--left  { left: 24px; }
.sidebar--right { right: 24px; }
.sidebar__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .25em;
  color: var(--arcade-red);
  text-shadow: 2px 2px 0 var(--bg-deep);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--bg-deep);
}
.sidebar__list {
  margin: 0; padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.sidebar__list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  padding: 6px 4px;
  border-left: 3px solid var(--arcade-cyan);
  background: #000;
  border-radius: 0;
  color: var(--text-dim);
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar__list li:hover {
  background: var(--bg-deep);
  color: var(--text);
  border-left-color: var(--arcade-yellow);
}
.sidebar__list .rank  { color: var(--arcade-yellow); }
.sidebar__list .name  { color: var(--text); letter-spacing: .14em; }
.sidebar__list .score { color: var(--arcade-cyan); font-variant-numeric: tabular-nums; }

.sidebar__meta {
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 11px;
}
.sidebar__meta > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 6px 4px;
  background: #000;
  border-radius: 0;
  border-left: 3px solid var(--arcade-cyan);
}
.sidebar__meta dt  { color: var(--text-mute); letter-spacing: .15em; }
.sidebar__meta dd  { margin: 0; color: var(--text); letter-spacing: .1em; }
.sidebar__tip {
  margin: 12px 0 0;
  font-size: 10px;
  color: var(--text-mute);
  line-height: 1.45;
  letter-spacing: .1em;
}

/* ============================================================
   BOTTOMBAR — plat noir avec accent rouge (LAYOUT inchangé)
   ============================================================ */
.bottombar {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 14px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .25em;
  color: var(--text-mute);
  background: var(--bg-deep);
  border-top: 2px solid var(--arcade-red);
}
.bottombar__pipe { color: var(--arcade-red); }

/* ============================================================
   OVERRIDES JEUX (snake/pacman/invaders/etc.) — LAYOUT INTACT
   Graphics modernisées (grid pixel, scanlines dur, etc.)
   ============================================================ */
.snake-board {
  width: min(640px, 96%);
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}
.snake-hud {
  display: flex; flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: space-between;
  padding: 8px 4px;
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--bg-deep);
}
.snake-canvas-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  width: min(580px, 100%, calc(100dvh - 240px));
  margin: 0 auto;
  border: 2px solid var(--arcade-green);
  border-radius: 0;
  background: #000;
  box-shadow: 4px 4px 0 var(--bg-deep);
  overflow: hidden;
}
.snake-canvas-wrap::after { display: none; }
.snake-canvas-wrap canvas { display: block; outline: none; width: 100%; height: 100%; }
.snake-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.snake-overlay.is-on { opacity: 1; pointer-events: auto; }

.pacman-board {
  width: min(640px, 96%);
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}
.pacman-hud {
  display: flex; flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: space-between;
  padding: 8px 4px;
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--bg-deep);
}
.pacman-hud .stat em {
  display: inline-block;
  min-width: 5ch;
  font-style: normal;
  font-weight: bold;
  color: var(--arcade-yellow);
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.pacman-canvas-wrap {
  position: relative;
  aspect-ratio: 19 / 22;
  width: min(580px, 100%, calc((100dvh - 220px) * 19 / 22));
  margin: 0 auto;
  border: 2px solid var(--arcade-yellow);
  border-radius: 0;
  background: #000;
  box-shadow: 4px 4px 0 var(--bg-deep);
  overflow: hidden;
}
.pacman-canvas-wrap::after { display: none; }
.pacman-canvas-wrap canvas { display: block; outline: none; width: 100%; height: 100%; }
.pacman-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.pacman-overlay.is-on { opacity: 1; pointer-events: auto; }

.invaders-board {
  width: min(640px, 96%);
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}
.invaders-hud {
  display: flex; flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: space-between;
  padding: 8px 4px;
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--bg-deep);
}
.invaders-canvas-wrap {
  position: relative;
  aspect-ratio: 7 / 6;
  width: min(700px, 100%, calc((100dvh - 240px) * 7 / 6));
  margin: 0 auto;
  border: 2px solid var(--arcade-green);
  border-radius: 0;
  background: #000;
  box-shadow: 4px 4px 0 var(--bg-deep);
  overflow: hidden;
  image-rendering: pixelated;
}
.invaders-canvas-wrap::after { display: none; }
.invaders-canvas-wrap canvas {
  display: block;
  outline: none;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.invaders-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.invaders-overlay.is-on { opacity: 1; pointer-events: auto; }

.tetris-board {
  width: min(640px, 96%);
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}
.tetris-hud {
  display: flex; flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: space-between;
  padding: 8px 4px;
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--bg-deep);
}
.tetris-hud .stat em {
  display: inline-block;
  min-width: 5ch;
  font-style: normal;
  font-weight: bold;
  color: var(--arcade-cyan);
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.tetris-play-area {
  display: grid;
  grid-template-columns: 110px auto 110px;
  gap: 14px;
  align-items: start;
  justify-content: center;
}
.tetris-side {
  width: 96px;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.tetris-side-label {
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--text-mute);
}
.tetris-side canvas {
  width: 96px;
  height: 96px;
  background: #000;
  border: 1px solid var(--bg-deep);
  border-radius: 0;
}
.tetris-canvas-wrap {
  position: relative;
  aspect-ratio: 1 / 2;
  width: min(240px, 100%, calc((100dvh - 200px) / 2));
  margin: 0 auto;
  border: 2px solid var(--arcade-cyan);
  border-radius: 0;
  background: #000;
  box-shadow: 4px 4px 0 var(--bg-deep);
  overflow: hidden;
}
.tetris-canvas-wrap canvas { display: block; outline: none; width: 100%; height: 100%; }
.tetris-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.tetris-overlay.is-on { opacity: 1; pointer-events: auto; }

/* --- Asteroids : board vectoriel (accent rose néon) --- */
.asteroids-board {
  width: min(640px, 96%);
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}
.asteroids-hud {
  display: flex; flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: space-between;
  padding: 8px 4px;
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--bg-deep);
}
.asteroids-hud .stat em {
  display: inline-block;
  min-width: 5ch;
  font-style: normal;
  font-weight: bold;
  color: #FF5DA2;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.asteroids-canvas-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  width: min(700px, 100%, calc((100dvh - 240px) * 4 / 3));
  margin: 0 auto;
  border: 2px solid #FF5DA2;
  border-radius: 0;
  background: #000;
  box-shadow: 4px 4px 0 var(--bg-deep);
  overflow: hidden;
}
.asteroids-canvas-wrap::after { display: none; }
.asteroids-canvas-wrap canvas { display: block; outline: none; width: 100%; height: 100%; }
.asteroids-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.asteroids-overlay.is-on { opacity: 1; pointer-events: auto; }

/* ============================================================
   GAME STAGE — modal plein écran (LAYOUT inchangé : minmax shrink)
   ============================================================ */
.game-stage {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .95);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.game-stage.is-on { display: flex; }
.game-stage__frame {
  background: var(--bg-cabinet);
  border: 4px solid var(--bg-deep);
  box-shadow: inset 0 0 0 2px var(--arcade-red);
  width: min(960px, 96vw);
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 0;
}
.game-stage__bar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--arcade-red);
  border-bottom: 4px solid var(--bg-deep);
}
.game-stage__pin {
  width: 14px; height: 14px;
  background: var(--arcade-yellow);
  border: 2px solid var(--bg-deep);
}
.game-stage__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: .15em;
  color: var(--arcade-yellow);
  text-shadow: 2px 2px 0 var(--bg-deep);
}
.game-stage__sub {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .25em;
  color: #fff;
}
.game-stage__brand {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .25em;
  color: #fff;
}
.game-stage__close {
  appearance: none;
  border: 2px solid var(--bg-deep);
  background: var(--arcade-yellow);
  color: #000;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .25em;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.game-stage__close svg { width: 14px; height: 14px; fill: none; }
.game-stage__close:hover { background: #fff; }

.game-stage__viewport {
  position: relative;
  background: #000;
  padding: 18px clamp(14px, 3vw, 36px);
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}
.game-stage__bottom {
  padding: 8px 16px;
  background: var(--bg-deep);
  text-align: center;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .25em;
  color: var(--arcade-yellow);
  border-top: 2px solid var(--bg-deep);
}

/* ============================================================
   RESPONSIVE — media queries conservées (LAYOUT inchangé)
   ============================================================ */
/* ============================================================
   MOBILE — tailles des boards (adaptées aux écrans tactiles)
   Les canvas-wrap utilisent aspect-ratio + grid stretch : la
   rangée 1fr étire la hauteur et l'aspect-ratio transfert cette
   hauteur en largeur → débordement horizontal sur petit écran.
   Fix : colonne minmax(0,1fr) + wrap 100% + min-width:0.
   Les jeux redimensionnent leur canvas via getBoundingClientRect
   donc le rendu suit automatiquement.
   ============================================================ */
@media (max-width: 760px) {
  .snake-board, .pacman-board, .invaders-board, .tetris-board, .asteroids-board {
    min-width: 0;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }
  .snake-canvas-wrap, .pacman-canvas-wrap, .invaders-canvas-wrap, .tetris-canvas-wrap, .asteroids-canvas-wrap {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
  }
  /* Pong / Breakout : même logique (CSS inline dans les modules) */
  .pong-board, .breakout-board { min-width: 0; width: 100%; }
  .pong-canvas-wrap, .breakout-canvas-wrap { width: 100%; max-width: 100%; }
  /* Tetris : colonnes latérales compactées pour laisser la place au play area */
  .tetris-play-area { grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 8px; }
  .tetris-side { width: 52px; }
  .tetris-side canvas { width: 52px; height: 52px; }
  /* Sur très petit écran (portrait), les canvas dont le ratio est plus
     haut que large (tetris 1:2, pacman 19/22) sont contraints par la
     hauteur ; la largeur découle de l'aspect-ratio. */
  .tetris-canvas-wrap, .pacman-canvas-wrap {
    width: auto;
    height: min(100%, calc(100dvh - 190px));
    max-width: 100%;
  }
  /* Les lignes d'aide clavier sont remplacées par le gamepad tactile */
  .snake-controls, .pacman-controls, .invaders-controls,
  .tetris-controls, .pong-controls, .breakout-controls, .asteroids-controls { display: none; }
  /* Stage : moins de padding pour maximiser la surface de jeu */
  .game-stage { padding: 6px; }
  .game-stage__frame {
    width: min(960px, 96vw);
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    max-height: calc(100vh - 12px);
    border-width: 3px;
  }
  .game-stage__viewport { min-width: 0; max-width: 100%; padding: 10px 8px; }
}

@media (max-width: 1100px) {
  .sidebar { display: none; }
}
@media (max-width: 760px) {
  .topbar { padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .cabinet { padding: 14px 16px 18px; margin: 22px auto 12px; }
  .cabinet__marquee { margin: 4px 22px 0; padding: 20px 18px 16px; }
  .cabinet__chassis { margin: 12px 0 12px; padding: 16px 14px; }
  .crt { padding: 12px; }
  .crt__shell { padding: 10px 12px; gap: 8px; }
  .arrow { width: 44px; height: 64px; }
  .arrow--left { left: -6px; }
  .arrow--right { right: -6px; }
  .marquee__title { font-size: 28px; }
}
@media (max-width: 460px) {
  .card { width: 240px; }
  .marquee__title { font-size: 22px; }
  .arrow { width: 36px; height: 52px; }
}

/* ============================================================
   TOUCH — cibles tactiles généreuses sur mobile
   (flèches du carousel, bouton PRESS START, gamepad plus grand
   sur très petit écran)
   ============================================================ */
@media (max-width: 760px) and (pointer: coarse) {
  .arrow { width: 48px; height: 64px; }
  .card__play {
    font-size: 11px;
    padding: 14px 16px;
    min-height: 48px;
  }
  /* Gamepad : légèrement compacté pour ne pas masquer les jeux */
  .arcade-pad { padding: 0 10px 12px; }
  .arcade-pad__dpad {
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
  }
  .arcade-pad__btn { width: 58px; height: 58px; }
  .arcade-pad__btn.is-primary { width: 70px; height: 70px; }
  .arcade-pad__cell svg { width: 22px; height: 22px; }
}

/* ============================================================
   PAYSAGE (mobile/tablette en rotation) — pad sur les flancs,
   canvas agrandi à la hauteur dispo.
   ============================================================ */
@media (orientation: landscape) and (pointer: coarse) and (max-height: 560px) {
  /* Boards : colonne unique qui s'adapte (même logique que le bloc ≤760px) */
  .snake-board, .pacman-board, .invaders-board, .tetris-board, .asteroids-board {
    min-width: 0;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }
  /* Canvas : hauteur bornée par le viewport (100dvh en paysage = hauteur
     réelle de l'écran) ; l'aspect-ratio déduit la largeur → le canvas
     tient en hauteur SANS déborder horizontalement. */
  .snake-canvas-wrap, .pacman-canvas-wrap, .invaders-canvas-wrap, .tetris-canvas-wrap, .asteroids-canvas-wrap {
    min-width: 0;
    width: auto;
    height: min(560px, calc(100dvh - 170px));
    max-width: 100%;
    max-height: 100%;
  }
  .pong-board, .breakout-board { min-width: 0; width: 100%; }
  .pong-canvas-wrap, .breakout-canvas-wrap {
    width: auto;
    height: min(560px, calc(100dvh - 170px));
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto; /* les wraps pong/breakout n'ont pas ce centrage dans leur CSS inline */
  }
  .tetris-play-area { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 6px; }
  .tetris-side { width: 40px; }
  .tetris-side canvas { width: 40px; height: 40px; }
  /* Masque les lignes d'aide clavier (remplacées par le pad) */
  .snake-controls, .pacman-controls, .invaders-controls,
  .tetris-controls, .pong-controls, .breakout-controls, .asteroids-controls { display: none; }
  /* HUD compacté pour donner la hauteur au jeu */
  .snake-hud, .pacman-hud, .invaders-hud, .tetris-hud, .asteroids-hud { padding: 4px; gap: 6px 12px; }
  /* Stage : padding minimal, frame en pleine largeur */
  .game-stage { padding: 4px; }
  .game-stage__frame { width: 100vw; max-height: calc(100vh - 8px); }
  .game-stage__viewport { padding: 6px; }
  /* Gamepad : D-pad à gauche, boutons à droite (vrai pad) */
  .arcade-pad {
    top: 0;
    bottom: 0;
    align-items: center;
    padding: 0 12px;
  }
  .arcade-pad__dpad {
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
  }
  .arcade-pad__btn { width: 52px; height: 52px; }
  .arcade-pad__btn.is-primary { width: 60px; height: 60px; }
  .arcade-pad__cell svg { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   TOUCH CONTROLS — gamepad virtuel (mobile/tablette)
   Injecté dans le stage par touch-controls.js.
   Semi-transparent pour ne pas masquer le jeu ; positionné en
   bas de l'écran, D-pad à gauche, boutons d'action à droite.
   ============================================================ */
.arcade-pad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 14px 16px;
  pointer-events: none; /* la zone creuse ne bloque pas le jeu */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.arcade-pad__dpad {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 4px;
  pointer-events: auto;
}
.arcade-pad__cell {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(10, 16, 32, .55);
  border: 2px solid rgba(0, 229, 255, .55);
  color: rgba(0, 229, 255, .95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5), inset 0 0 8px rgba(0, 229, 255, .12);
}
.arcade-pad__cell.is-dir { cursor: pointer; }
.arcade-pad__cell.is-dir:active,
.arcade-pad__cell.is-dir.is-held {
  background: rgba(0, 229, 255, .5);
  color: #fff;
}
.arcade-pad__cell.is-void { background: transparent; border-color: transparent; box-shadow: none; }
.arcade-pad__cell svg { width: 24px; height: 24px; pointer-events: none; }

.arcade-pad__actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: auto;
}
.arcade-pad__btn {
  appearance: none;
  border: 2px solid rgba(255, 93, 162, .7);
  background: rgba(30, 6, 22, .6);
  color: #FF5DA2;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .55), inset 0 0 10px rgba(255, 93, 162, .15);
  touch-action: none;
}
.arcade-pad__btn.is-primary {
  border-color: rgba(255, 210, 61, .8);
  background: rgba(40, 30, 4, .6);
  color: #FFD23D;
  width: 76px;
  height: 76px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .55), inset 0 0 10px rgba(255, 210, 61, .18);
}
.arcade-pad__btn:active,
.arcade-pad__btn.is-held {
  background: rgba(255, 93, 162, .55);
  color: #fff;
}
.arcade-pad__btn.is-primary:active,
.arcade-pad__btn.is-primary.is-held {
  background: rgba(255, 210, 61, .6);
  color: #000;
}
.arcade-pad__btn-label {
  font-family: var(--font-display, 'Press Start 2P', monospace);
  font-size: 8px;
  letter-spacing: .08em;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}
