/* =========================================================
   DarkArcade – thème pastel gris / bleu
   ========================================================= */
:root {
  --bg: #5d6470;
  --bg-deep: #d3d9e2;
  --surface: #eceff3;
  --surface-2: #f7f8fa;
  --line: #d3d9e2;
  --page-ink: #f1f4f8;          /* texte posé directement sur le fond gris */
  --page-ink-soft: #c5ccd8;
  --header-bg: rgba(68, 74, 85, .9);
  --header-line: rgba(255, 255, 255, .08);
  --card: #6c7481;              /* un cran plus clair que le fond */
  --card-sunken: rgba(30, 34, 42, .16);
  --card-line: rgba(255, 255, 255, .13);
  --card-ink: #f2f5f9;
  --card-text: #dde2ea;
  --card-ink-soft: #c2c9d5;
  --ink: #2e3747;
  --ink-soft: #66718a;
  --blue-50: #eef4fc;
  --blue-100: #dbe7f8;
  --blue-200: #bcd2f1;
  --blue-300: #9dbbe8;
  --blue-500: #6b8fcf;
  --blue-700: #45639e;
  --grey-300: #c8cfdb;
  --grey-500: #8e98ab;
  --pink: #e9a8b9;
  --lcd: #dfeaf7;
  --lcd-ink: #3b5584;

  --yt: #e46a6a;
  --twitch: #9c84d8;
  --fb: #6f95dc;
  --x: #3f4552;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 24, 32, .18), 0 10px 28px rgba(20, 24, 32, .22);
  --shadow-hover: 0 2px 4px rgba(20, 24, 32, .2), 0 18px 44px rgba(20, 24, 32, .32);

  --font-pixel: "Press Start 2P", ui-monospace, monospace;
  --font-title: "Chakra Petch", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(157, 187, 232, .22), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(197, 183, 230, .12), transparent 60%),
    linear-gradient(180deg, #646b78, var(--bg) 40%, #555c68);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video { max-width: 100%; display: block; }
a { color: var(--blue-700); }
button { font: inherit; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--header-line);
  box-shadow: 0 4px 20px rgba(20, 24, 32, .18);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--page-ink);
  flex-shrink: 0;
}
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(var(--blue-500) 0 0) 7px 7px / 6px 6px no-repeat,
    linear-gradient(var(--blue-500) 0 0) 21px 7px / 6px 6px no-repeat,
    linear-gradient(var(--pink) 0 0) 7px 21px / 20px 6px no-repeat,
    var(--blue-100);
  box-shadow: inset 0 0 0 2px var(--blue-300);
}
.logo-text {
  font-family: var(--font-pixel);
  font-size: 15px;
  letter-spacing: 1px;
}
.logo-text span { color: var(--blue-300); }

/* ---------- Menu ---------- */
.site-nav { display: flex; gap: 4px; margin-right: auto; }
.site-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--page-ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; background: rgba(157, 187, 232, .2); box-shadow: inset 0 -2px 0 var(--blue-300); }
.site-nav a:focus-visible { outline: 3px solid var(--blue-300); outline-offset: 2px; }

/* ---------- Radio ---------- */
.radio {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #50565f;
  border: 1px solid var(--header-line);
  border-radius: 14px;
  padding: 6px 8px 6px 6px;
  box-shadow: var(--shadow);
  min-width: 0;
  flex: 0 1 560px;
}
.radio-lcd {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--lcd);
  color: var(--lcd-ink);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--blue-200);
}
.radio-lcd::after { /* scanlines */
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(59, 85, 132, .06) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.radio-badge {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--blue-500);
  color: #fff;
  flex-shrink: 0;
}
.radio-marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-pixel);
  font-size: 10px;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.radio-marquee span { display: inline-block; padding-left: 4px; }
.radio.is-playing .radio-marquee span {
  padding-left: 100%;
  animation: marquee 14s linear infinite;
}
@keyframes marquee { to { transform: translateX(-100%); } }

.radio-eq { display: flex; align-items: flex-end; gap: 2px; height: 18px; flex-shrink: 0; }
.radio-eq i { width: 3px; height: 4px; background: var(--blue-500); border-radius: 1px; }
.radio.is-playing .radio-eq i { animation: eq .9s ease-in-out infinite alternate; }
.radio-eq i:nth-child(2) { animation-delay: -.3s !important; }
.radio-eq i:nth-child(3) { animation-delay: -.6s !important; }
.radio-eq i:nth-child(4) { animation-delay: -.15s !important; }
.radio-eq i:nth-child(5) { animation-delay: -.45s !important; }
@keyframes eq { from { height: 3px; } to { height: 18px; } }

.radio-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.rbtn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--page-ink-soft);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.rbtn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.rbtn svg { width: 16px; height: 16px; fill: currentColor; }
.rbtn-play { background: var(--blue-500); color: #fff; width: 40px; height: 40px; border-radius: 12px; }
.rbtn-play:hover { background: var(--blue-700); color: #fff; }
.rbtn:disabled { opacity: .4; cursor: default; background: transparent; }
.rbtn-play:disabled { background: var(--blue-500); }
.rbtn-play .i-pause { display: none; }
.radio.is-playing .rbtn-play .i-play { display: none; }
.radio.is-playing .rbtn-play .i-pause { display: block; }
.rbtn:focus-visible, .link-tile:focus-visible, .media-thumb:focus-visible, .card-cover:focus-visible {
  outline: 3px solid var(--blue-300);
  outline-offset: 2px;
}

#radio-volume {
  width: 84px;
  margin-left: 6px;
  accent-color: var(--blue-500);
}

/* ---------- Hero ---------- */
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 56px 0 32px; }
.hero-kicker {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--blue-300);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--font-title);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -.5px;
  color: var(--page-ink);
}
.hero-sub { margin: 0; color: var(--page-ink-soft); font-size: 18px; max-width: 46ch; }

/* ---------- Grille de cards ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  padding-bottom: 36px;
}
.loading, .error { color: var(--page-ink-soft); }

.card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #727a87, var(--card) 120px);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: var(--card-ink);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  min-width: 0;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255, 255, 255, .08); border-color: rgba(157, 187, 232, .35); }

/* Tailles de card (champ news.layout) : normal = 1 colonne, large = 2 colonnes, full = toute la largeur.
   Sur écran étroit, toutes repassent sur une colonne. */
@media (min-width: 900px) {
  /* Large : bannière panoramique en haut, texte dessous */
  .card--large { grid-column: span 2; }
  .card--large .card-cover { aspect-ratio: 21 / 9; }
  .card--large .card-body { padding: 24px 28px 26px; }

  /* Pleine largeur : image à gauche, texte à droite */
  .card--full { grid-column: 1 / -1; flex-direction: row; }
  .card--full .card-media { display: flex; flex-direction: column; flex: 1.4; }
  .card--full .card-cover { flex: 1; aspect-ratio: auto; min-height: 420px; }
  .card--full .card-body { flex: 1; padding: 36px 40px; gap: 18px; }
  .card--large .card-links, .card--full .card-links { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

.card-media { position: relative; background: #565d69; }
.card-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  background: var(--bg-deep);
  overflow: hidden;
}
.card-cover .play-icon { z-index: 2; }

/* Image dans un cadre fixe (voir fitImage dans app.js) */
.fit { position: absolute; inset: 0; overflow: hidden; background: #3d434e; }
.fit-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(28px) brightness(.55) saturate(1.3); transform: scale(1.2);
}
.fit-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; transition: transform .4s ease;
}
.fit.is-fill .fit-img { object-fit: cover; }
.fit.is-fill .fit-bg { display: none; }
.fit.is-pixel .fit-img, img.is-pixel { image-rendering: pixelated; }
.card:hover .fit-img { transform: scale(1.03); }

.pin-badge {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 2;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--pink);
  color: #fff;
}

.media-strip {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card-sunken);
  border-top: 1px solid var(--card-line);
  overflow-x: auto;
}
.media-thumb {
  position: relative;
  flex: 0 0 72px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-deep);
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb:hover { border-color: var(--blue-300); }
.play-icon {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(46, 55, 71, .25);
}
.play-icon::before {
  content: "";
  width: 0; height: 0;
  border-left: 12px solid #fff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 3px;
}
.card-cover .play-icon::before { border-left-width: 26px; border-top-width: 16px; border-bottom-width: 16px; }

.card-body { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 24px; }

.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--card-ink-soft); }
.card-meta time { font-weight: 500; margin-right: 4px; }
.tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(157, 187, 232, .2);
  color: #dbe7f8;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(157, 187, 232, .32);
}

.card-title {
  font-family: var(--font-title);
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -.2px;
}
.card--large .card-title { font-size: clamp(28px, 3vw, 36px); }
.card--full .card-title { font-size: clamp(30px, 3.6vw, 46px); }
.card--full .rich { font-size: 16.5px; }

.rich { color: var(--card-text); font-size: 15.5px; }
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p { margin: 0 0 10px; }
.rich ul, .rich ol { margin: 0 0 10px; padding-left: 22px; }
.rich strong { color: #fff; }
.rich a { color: var(--blue-200); text-decoration-color: var(--blue-300); text-underline-offset: 3px; }

/* ---------- Bouton « Voir plus » ---------- */
.news-more-wrap { display: flex; justify-content: center; padding-bottom: 64px; }
.news-more {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border: 1px solid rgba(157, 187, 232, .45);
  border-radius: 14px;
  background: var(--card);
  color: var(--card-ink);
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .15s, border-color .15s, transform .15s;
}
.news-more::after {
  content: "";
  width: 0; height: 0;
  border-top: 7px solid var(--blue-300);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}
.news-more:hover { background: #77808d; border-color: var(--blue-300); transform: translateY(-2px); }
.news-more:focus-visible { outline: 3px solid var(--blue-300); outline-offset: 3px; }
.news-more:disabled { opacity: .6; cursor: progress; transform: none; }
.news-more[hidden] { display: none; }
.card-title:focus { outline: none; }

/* ---------- Liens réseaux ---------- */
.card-links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: auto; padding-top: 6px; }
.link-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: var(--card-sunken);
  text-decoration: none;
  color: var(--card-ink);
  transition: border-color .15s, background .15s;
}
.link-tile:hover { border-color: rgba(157, 187, 232, .45); background: rgba(157, 187, 232, .14); }
.link-thumb {
  position: relative;
  flex: 0 0 96px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
}
.link-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.link-thumb svg { width: 24px; height: 24px; fill: currentColor; position: relative; }
.link-thumb .brand-dot {
  position: absolute; right: 4px; bottom: 4px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 6px;
}
.link-thumb .brand-dot svg { width: 12px; height: 12px; }
.link-text { min-width: 0; display: flex; flex-direction: column; }
.link-platform { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.link-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.link--youtube .link-thumb, .link--youtube .brand-dot { background: var(--yt); }
.link--twitch  .link-thumb, .link--twitch  .brand-dot { background: var(--twitch); }
.link--facebook .link-thumb, .link--facebook .brand-dot { background: var(--fb); }
.link--x .link-thumb, .link--x .brand-dot { background: var(--x); }
.link--youtube .link-platform { color: #f4a3a3; }
.link--twitch .link-platform { color: #c9b8f0; }
.link--facebook .link-platform { color: #b0c9f2; }
.link--x .link-platform { color: #d3d8e0; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0;
  padding: 0;
  width: fit-content;
  max-width: 94vw;
  max-height: 94vh;
  overflow: visible;
  background: transparent;
}
.lightbox::backdrop { background: rgba(38, 46, 61, .72); backdrop-filter: blur(4px); }
.lightbox-figure { margin: 0; }
.lightbox-body video { width: min(1100px, 94vw); max-height: 82vh; border-radius: 14px; background: #1f2633; }
/* Image en taille réelle, jamais redimensionnée : défilement si elle dépasse */
.lightbox-scroll {
  display: flex;
  max-width: 94vw;
  max-height: 84vh;
  overflow: auto;
  border-radius: 14px;
  background: #1f2633;
  overscroll-behavior: contain;
}
.lightbox-scroll:focus-visible { outline: 3px solid var(--blue-300); outline-offset: 3px; }
.lightbox-img { display: block; margin: auto; width: auto; height: auto; max-width: none; max-height: none; flex-shrink: 0; }
.lightbox-size { opacity: .7; font-variant-numeric: tabular-nums; margin-left: 6px; }
.lightbox-scroll.is-pannable { cursor: grab; }
.lightbox-scroll.is-dragging { cursor: grabbing; user-select: none; }
.lightbox-body figcaption { display: grid; justify-items: center; gap: 6px; }
.lightbox-caption { opacity: .9; }
.zoom-bar {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px;
  border-radius: 12px; background: rgba(31, 38, 51, .85); font-size: 13px;
}
.zbtn {
  min-width: 34px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: #e8edf5; font: inherit; font-size: 15px; cursor: pointer;
}
.zbtn:hover { background: rgba(255, 255, 255, .12); }
.zbtn:focus-visible { outline: 2px solid var(--blue-300); }
.zbtn-level { min-width: 64px; font-variant-numeric: tabular-nums; font-size: 13px; }
.lightbox-body figcaption { color: #e8edf5; text-align: center; padding: 10px; font-size: 14px; }
.lightbox-body .missing { background: var(--surface); padding: 40px; border-radius: 14px; text-align: center; color: var(--ink-soft); }
.lightbox-close {
  position: fixed; top: 16px; right: 16px; z-index: 2;
  width: 40px; height: 40px;
  border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  font-size: 24px; line-height: 1;
  cursor: pointer;
}

/* ---------- Page « à venir » ---------- */
.coming-soon {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 640px;
  margin: 8px auto 72px;
  padding: 44px 32px;
  text-align: center;
  background: linear-gradient(180deg, #727a87, var(--card) 120px);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: var(--card-text);
}
.coming-soon h2 { font-family: var(--font-title); font-size: 34px; color: var(--card-ink); margin: 6px 0 0; }
.coming-soon p { margin: 0 0 10px; max-width: 42ch; }
.coming-soon .news-more { text-decoration: none; }
.coming-soon .news-more::after { display: none; }
.soon-screen {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(320px, 100%);
  padding: 28px 20px;
  border-radius: 14px;
  background: var(--lcd);
  color: var(--lcd-ink);
  box-shadow: inset 0 0 0 1px var(--blue-200);
  overflow: hidden;
}
.soon-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(59, 85, 132, .07) 0 1px, transparent 1px 3px);
}
.soon-blink { font-family: var(--font-pixel); font-size: 14px; letter-spacing: 2px; animation: blink 1.1s steps(1) infinite; }
.soon-bar { width: 100%; height: 14px; border: 2px solid var(--lcd-ink); border-radius: 3px; padding: 2px; }
.soon-bar i { display: block; height: 100%; width: 30%; background: repeating-linear-gradient(90deg, var(--blue-500) 0 8px, transparent 8px 10px); animation: load 3s steps(12) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes load { from { width: 8%; } to { width: 100%; } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--header-line);
  background: rgba(60, 65, 75, .6);
  text-align: center;
  padding: 28px 24px;
  color: var(--page-ink-soft);
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 16px; }
  .site-nav { margin-right: 0; }
  .site-nav a { flex: 1; text-align: center; }
  .radio { flex: 1 1 auto; gap: 6px; }
  .radio-badge { display: none; }
  #radio-volume { display: none; }
  main { padding: 0 16px; }
  .hero { padding: 32px 0 24px; }
  .news-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .card-body { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
