/* ==========================================================================
   ELIE - Design system
   Projet Elie par Ryuzaki Labs
   Palette derivee du logo : noir chaud, or, rouge sang.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces (noir chaud, pas gris bleute) */
  --ink-1000: #070606;
  --ink-900:  #0d0b0b;
  --ink-800:  #151111;
  --ink-700:  #1d1818;
  --ink-600:  #262020;
  --ink-500:  #332b2b;

  /* Accents */
  --gold:      #f0b429;
  --gold-400:  #f7c94b;
  --gold-600:  #d19a17;
  --gold-glow: rgba(240, 180, 41, .16);

  --blood:     #8a0707;
  --blood-600: #a51010;
  --blood-400: #c92a2a;
  --blood-glow: rgba(138, 7, 7, .35);

  /* Texte */
  --text:        #f6f1ea;
  --text-muted:  #a99f97;
  --text-faint:  #766e69;
  --on-gold:     #1a1200;

  /* Traits & ombres */
  --line:        rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow:    0 8px 24px -8px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .85);

  /* Rayons */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Rythme */
  --gap:  16px;
  --gap-lg: 24px;
  --pad-x: 20px;

  /* Chrome applicatif */
  --rail: 108px;          /* largeur de l'aside desktop */
  --topbar: 60px;         /* hauteur du header mobile */
  --tabbar: 68px;         /* hauteur du menu bas mobile */
  --safe-b: env(safe-area-inset-bottom, 0px);

  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Halo discret en fond, rappelle le rouge du logo sans salir les contenus */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 15% -10%, rgba(138, 7, 7, .38), transparent 60%),
    radial-gradient(700px 420px at 95% 0%, rgba(240, 180, 41, .07), transparent 55%);
}

h1, h2, h3, h4, h5 {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
  margin: 0;
  color: var(--text);
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .18s var(--ease);
}

img { max-width: 100%; display: block; }

button { font: inherit; color: inherit; }

::selection { background: var(--gold); color: var(--on-gold); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Barres de defilement */
* { scrollbar-width: thin; scrollbar-color: var(--ink-500) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--ink-500);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--ink-600); background-clip: content-box; }

/* --------------------------------------------------------------------------
   3. Coquille applicative : aside + zone principale + tabbar
   -------------------------------------------------------------------------- */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.app__main {
  padding: calc(var(--topbar) + 12px) var(--pad-x) calc(var(--tabbar) + var(--safe-b) + 28px);
  max-width: 1180px;
  margin: 0 auto;
}

/* ---- Header mobile ---- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: rgba(13, 11, 11, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.topbar__logo img {
  height: 34px;
  width: auto;
}

/* Fine ligne doree sous le header */
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-glow) 30%, var(--gold-glow) 70%, transparent);
}

/* ---- Aside desktop ---- */
.rail { display: none; }

/* ---- Tabbar mobile ---- */
.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: stretch;
  height: calc(var(--tabbar) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(13, 11, 11, .82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--line);
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  position: relative;
  transition: color .18s var(--ease);
}

.tabbar__item:hover { color: var(--text); }

.tabbar__item.is-active { color: var(--gold); }

.tabbar__item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 34px;
  height: 3px;
  border-radius: 0 0 var(--r-pill) var(--r-pill);
  background: var(--gold);
  box-shadow: 0 0 18px 2px var(--gold-glow);
}

/* ---- Icones : SVG au trait, en currentColor ---- */
.ico {
  width: 25px;
  height: 25px;
  flex: none;
  display: block;
  transition: transform .2s var(--ease);
}

/* A l'etat actif : trait plus epais et leger relevement */
.tabbar__item.is-active .ico,
.rail__item.is-active .ico {
  transform: translateY(-1px) scale(1.06);
  stroke-width: 2;
}

.rail__item .ico { width: 27px; height: 27px; }

/* --------------------------------------------------------------------------
   4. Titres de section
   -------------------------------------------------------------------------- */
.section { margin: 0 0 40px; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.section__title {
  font-size: clamp(19px, 2.2vw, 24px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section__title::before {
  content: "";
  width: 4px;
  height: 1.05em;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--gold), var(--blood-400));
  flex: none;
}

.section__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.section__link:hover { color: var(--gold); }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

.lead { color: var(--text-muted); font-size: 15.5px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

/* --------------------------------------------------------------------------
   5. Boutons, puces, badges
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  background: var(--gold);
  color: var(--on-gold);
  transition: transform .18s var(--ease), background .18s var(--ease),
              box-shadow .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.btn:hover { background: var(--gold-400); transform: translateY(-1px); box-shadow: 0 10px 24px -12px var(--gold); }
.btn:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .06); border-color: var(--gold); color: var(--gold); box-shadow: none; }

.btn--blood { background: var(--blood-600); color: #fff; }
.btn--blood:hover { background: var(--blood-400); box-shadow: 0 10px 24px -12px var(--blood-400); }

.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 13px; }

.btn--icon {
  padding: 0;
  width: 42px;
  height: 42px;
  flex: none;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn--icon:hover { background: rgba(255, 255, 255, .12); color: var(--gold); box-shadow: none; }
.btn--icon svg { width: 20px; height: 20px; }

.btn[aria-disabled="true"],
.btn:disabled { opacity: .4; pointer-events: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all .18s var(--ease);
}
a.chip:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-glow); }
.chip.is-active { color: var(--on-gold); background: var(--gold); border-color: var(--gold); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--gold-glow);
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .03em;
}

/* --------------------------------------------------------------------------
   6. Cartes
   -------------------------------------------------------------------------- */
.panel {
  background: linear-gradient(180deg, var(--ink-800), var(--ink-900));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel + .panel { margin-top: var(--gap-lg); }

.panel__title {
  font-size: 18px;
  margin-bottom: 16px;
}

/* --- Carte podcast --- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

/* Pochettes de podcast : carrees en base (1024x1024 cote CDN). */
.card__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--ink-700);
}

/* Visuels 3:4 (divinites, illustrations generees en --ar 3:4). */
.card__media--portrait { aspect-ratio: 3 / 4; }

/* Visuels 1.91:1 (formats reseaux sociaux, cover_fb). */
.card__media--wide { aspect-ratio: 1.91 / 1; }

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.card:hover .card__media img { transform: scale(1.05); }

/* Voile bas pour que le texte survivant sur l'image reste lisible */
.card__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(180deg, transparent, rgba(7, 6, 6, .75));
  opacity: .9;
}

.card__play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .9);
  opacity: 0;
  transform: translateY(8px) scale(.9);
  transition: all .22s var(--ease);
}
.card:hover .card__play,
.card:focus-within .card__play { opacity: 1; transform: translateY(0) scale(1); }
.card__play svg { width: 20px; height: 20px; }

.card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card__title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card:hover .card__title { color: var(--gold); }

.card__meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.card__actions { margin-top: 12px; }

/* --- Carte categorie (visuel plein cadre) --- */
.tile {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .22s var(--ease), border-color .22s var(--ease);
}
.tile:hover { transform: translateY(-4px); border-color: var(--gold); }

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.tile:hover img { transform: scale(1.07); }

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 6, 6, .1) 30%, rgba(7, 6, 6, .85));
}

.tile__label {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 16px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tile__label span:last-child { color: var(--gold); font-size: 18px; transition: transform .2s var(--ease); }
.tile:hover .tile__label span:last-child { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   7. Rails horizontaux & grilles
   -------------------------------------------------------------------------- */
.rail-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 68%;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  margin: 0 calc(var(--pad-x) * -1);
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  -ms-overflow-style: none;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}
.rail-scroll::-webkit-scrollbar { display: none; }
.rail-scroll.is-dragging { cursor: grabbing; }
.rail-scroll > * { scroll-snap-align: start; }
/* Pendant le drag on neutralise les clics parasites sur les liens */
.rail-scroll.is-dragging a { pointer-events: none; }

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* --------------------------------------------------------------------------
   8. Carrousel
   -------------------------------------------------------------------------- */
/* Les visuels du carrousel sont televerses en 1200x630 (meme gabarit que les
   cover_fb) : le cadre est cale sur ce format exact, donc aucun recadrage.
   Le bandeau occupe toute la largeur de la zone principale.
   Les puces sont SOUS le cadre, jamais posees sur le visuel. */
.carousel {
  width: 100%;
}

.carousel__frame {
  position: relative;
  aspect-ratio: 1200 / 630;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-1000);
  box-shadow: var(--shadow-lg);
}

.carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .55s var(--ease);
}
.carousel__slide.is-active { opacity: 1; visibility: visible; }

/* Positionnement absolu de bout en bout : la hauteur du visuel ne depend
   d'aucune chaine de height:100% qui pourrait se casser. */
.carousel__slide a { position: absolute; inset: 0; display: block; }

.carousel__slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(7, 6, 6, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.carousel__nav:hover { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.carousel__nav--prev { left: 12px; }
.carousel__nav--next { right: 12px; }
.carousel__nav svg { width: 18px; height: 18px; }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  border: 0;
  padding: 0;
  background: var(--ink-500);
  cursor: pointer;
  transition: all .3s var(--ease);
}
.dot:hover { background: var(--text-faint); }
.dot.is-active { width: 26px; background: var(--gold); }

/* --------------------------------------------------------------------------
   9. Page podcast : entete, lecteur, playlist
   -------------------------------------------------------------------------- */
.show-head {
  display: grid;
  gap: 22px;
  padding: 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(138, 7, 7, .5), transparent 70%),
    linear-gradient(180deg, var(--ink-800), var(--ink-900));
  box-shadow: var(--shadow);
}

@media (min-width: 720px) {
  .show-head { grid-template-columns: 220px 1fr; align-items: center; padding: 28px; }
}

.show-head__cover {
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
}
.show-head__cover img { width: 100%; height: 100%; object-fit: cover; }

.show-head__title {
  font-size: clamp(24px, 4vw, 34px);
  margin: 8px 0 10px;
}

.show-head__desc {
  color: var(--text-muted);
  max-width: 62ch;
}

/* --- Lecteur --- */
.player {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--ink-800), var(--ink-900));
  padding: 20px;
  box-shadow: var(--shadow);
}

.player__now {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 24px;
}
.player__now .eyebrow { flex: none; }
.player__track {
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player__spacer { flex: 1; }

.ctrl {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .18s var(--ease);
}
.ctrl:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.ctrl.is-on { color: var(--gold); background: var(--gold-glow); }
.ctrl svg { width: 20px; height: 20px; }

.ctrl--play {
  width: 54px;
  height: 54px;
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: 0 12px 28px -12px var(--gold);
}
.ctrl--play:hover { background: var(--gold-400); color: var(--on-gold); transform: scale(1.04); }
.ctrl--play svg { width: 26px; height: 26px; }

.player__seek {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-muted);
}

.track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--ink-600);
  overflow: visible;
}

.track__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--blood-400), var(--gold));
}

.track__fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%) scale(0);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-glow);
  transition: transform .18s var(--ease);
}
.track:hover .track__fill::after { transform: translateY(-50%) scale(1); }

.track input[type="range"] {
  position: absolute;
  inset: -8px 0;
  width: 100%;
  height: calc(100% + 16px);
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.player__volume { position: relative; }

.volume-pop {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--ink-700);
  box-shadow: var(--shadow-lg);
}
.volume-pop[hidden] { display: none; }

/* --- Playlist --- */
.playlist { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 2px; }

.playlist__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--r);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.playlist__item:hover { background: rgba(255, 255, 255, .05); }

.playlist__num {
  flex: none;
  width: 26px;
  text-align: center;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

.playlist__title {
  flex: 1;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist__item.is-playing {
  background: var(--gold-glow);
  border-color: rgba(240, 180, 41, .3);
}
.playlist__item.is-playing .playlist__title { color: var(--gold); font-weight: 600; }
.playlist__item.is-playing .playlist__num { color: var(--gold); }

/* Petit egaliseur anime sur la piste en cours */
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; flex: none; }
.playlist__item.is-playing .eq { display: flex; }
.eq i {
  width: 3px;
  border-radius: 2px;
  background: var(--gold);
  animation: eq 1s var(--ease) infinite;
}
.eq i:nth-child(1) { height: 60%; animation-delay: -.2s; }
.eq i:nth-child(2) { height: 100%; animation-delay: -.5s; }
.eq i:nth-child(3) { height: 40%; }

@keyframes eq {
  0%, 100% { transform: scaleY(.4); }
  50%      { transform: scaleY(1); }
}

/* --------------------------------------------------------------------------
   10. Formulaires
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--ink-800);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-glow); }
.field svg { width: 18px; height: 18px; flex: none; color: var(--text-faint); }

.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 10px 0;
  outline: none;
}
.field input::placeholder { color: var(--text-faint); }

.input, .select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: var(--ink-800);
  color: var(--text);
  font: inherit;
  outline: none;
}
.input:focus, .select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-glow); }

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. Agenda
   -------------------------------------------------------------------------- */
.event {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--ink-800);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.event:hover { border-color: var(--line-strong); transform: translateX(2px); }

.event__date {
  flex: none;
  width: 62px;
  height: 66px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: var(--r);
  background: linear-gradient(160deg, var(--blood-600), var(--blood));
  border: 1px solid rgba(255, 255, 255, .12);
}
.event__day {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.event__month {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .75);
  margin-top: 3px;
}

.event__body { flex: 1; min-width: 0; }
.event__name { font-size: 16px; margin-bottom: 3px; }
.event__when { font-size: 12.5px; color: var(--text-muted); }

.event-list { display: grid; gap: 12px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.pager__title { font-size: 20px; text-align: center; }

/* Carte evenement compacte (rail accueil) */
.event-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--ink-800), var(--ink-900));
  min-height: 100%;
}
.event-card__name { font-size: 16px; }

/* --------------------------------------------------------------------------
   12. Divers : arbre, modale, etats vides, pied de page
   -------------------------------------------------------------------------- */
.tree-canvas {
  height: min(70vh, 640px);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(700px 400px at 50% 0%, rgba(138, 7, 7, .25), transparent 70%),
    var(--ink-800);
  position: relative;
  overflow: hidden;
}
.tree-canvas svg { width: 100%; height: 100%; }
.tree-canvas .btn { position: absolute; top: 14px; left: 14px; z-index: 2; }

.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.legend h3 { font-size: 14px; margin-bottom: 10px; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-muted); }
.legend .swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 6, 6, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal[hidden] { display: none; }

.modal__panel {
  width: min(480px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: var(--ink-800);
  box-shadow: var(--shadow-lg);
  padding: 22px;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}

.about {
  display: grid;
  gap: 26px;
  align-items: center;
  padding: 32px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 320px at 100% 0%, rgba(138, 7, 7, .4), transparent 70%),
    linear-gradient(180deg, var(--ink-800), var(--ink-900));
}
@media (min-width: 760px) {
  .about { grid-template-columns: 190px 1fr; gap: 36px; padding: 40px; }
}
.about img { width: 150px; margin: 0 auto; }
.about p + p { margin-top: 14px; }

.footer {
  margin-top: 44px;
  padding: 26px 0 6px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.footer nav { display: flex; gap: 16px; }
.footer a:hover { color: var(--gold); }

.loader {
  display: grid;
  place-items: center;
  padding: 26px;
  color: var(--text-muted);
  font-size: 13px;
}
.loader[hidden] { display: none; }

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   13. Desktop : l'aside remplace la tabbar
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  :root { --pad-x: 36px; }

  .topbar, .tabbar { display: none; }

  .rail {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: var(--rail);
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 10px;
    background: linear-gradient(180deg, var(--ink-800), var(--ink-1000));
    border-right: 1px solid var(--line);
  }

  /* Liseré rouge -> or sur le bord de l'aside */
  .rail::after {
    content: "";
    position: absolute;
    top: 0; right: -1px; bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--blood-400) 20%, var(--gold) 60%, transparent);
    opacity: .5;
  }

  .rail__logo { margin-bottom: 26px; }
  .rail__logo img { width: 62px; }

  .rail__item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 13px 4px;
    border-radius: var(--r);
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    position: relative;
    transition: color .18s var(--ease), background .18s var(--ease);
  }
  .rail__item:hover { color: var(--text); background: rgba(255, 255, 255, .05); }

  .rail__item.is-active {
    color: var(--gold);
    background: var(--gold-glow);
  }
  .rail__item.is-active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 26px;
    border-radius: 0 var(--r-pill) var(--r-pill) 0;
    background: var(--gold);
    box-shadow: 0 0 16px 1px var(--gold-glow);
  }

  .app { padding-left: var(--rail); }

  .app__main {
    padding-top: 34px;
    padding-bottom: 60px;
  }

  .rail-scroll { grid-auto-columns: 260px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .rail-scroll { grid-auto-columns: 40%; }
}

/* --------------------------------------------------------------------------
   14. Mouvement reduit
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   15. Complements
   -------------------------------------------------------------------------- */
.display {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

/* Sur petit ecran, la ligne evenement passe en pile */
@media (max-width: 599px) {
  .event { flex-wrap: wrap; }
  .event__body { flex: 1 1 60%; }
  .event > .btn { flex: 1 0 100%; }

  .pager__title { font-size: 17px; }
  .section { margin-bottom: 32px; }
}

/* Le formulaire de recherche se replie sous 520px */
@media (max-width: 519px) {
  .field { flex-wrap: wrap; padding: 12px; border-radius: var(--r-lg); }
  .field input { flex: 1 1 60%; padding: 4px 0; }
  .field > .btn { flex: 1 0 100%; margin-top: 10px; }
}

/* --------------------------------------------------------------------------
   16. Ambilight du lecteur
   Halo colore diffuse derriere le lecteur, pilote par le son.
   Trois taches lumineuses (graves / mediums / aigus) dont seules l'opacite et
   l'echelle changent : ce sont des proprietes composees, donc pas de repaint
   du flou a chaque image.
   -------------------------------------------------------------------------- */
.player-stage {
  position: relative;
  isolation: isolate;
}

.ambilight {
  position: absolute;
  inset: -16% -11%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s var(--ease);
}

.player-stage.is-lit .ambilight { opacity: 1; }

.ambilight__blob {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  filter: blur(44px) saturate(180%);
  will-change: opacity, transform;
  transform: scale(.9);
}

/* Couleurs poussees : le flou et l'echelle en mangent une bonne partie. */
.ambilight__blob--bass {
  background: radial-gradient(50% 66% at 18% 55%, #ff2a2a, transparent 70%);
}
.ambilight__blob--mid {
  background: radial-gradient(46% 60% at 52% 42%, #ff7a12, transparent 70%);
}
.ambilight__blob--high {
  background: radial-gradient(42% 54% at 84% 55%, #ffc93c, transparent 70%);
}

/* Sans son analysable, le halo respire doucement au lieu de rester fige. */
.player-stage.is-lit.is-simulated .ambilight__blob {
  animation: amb-breathe 1.7s var(--ease) infinite alternate;
}
.player-stage.is-lit.is-simulated .ambilight__blob--mid  { animation-delay: -.55s; }
.player-stage.is-lit.is-simulated .ambilight__blob--high { animation-delay: -1.1s; }

@keyframes amb-breathe {
  from { opacity: .3;  transform: scale(.9); }
  to   { opacity: .95; transform: scale(1.14); }
}

@media (prefers-reduced-motion: reduce) {
  .ambilight__blob {
    animation: none !important;
    opacity: .3 !important;
    transform: none !important;
  }
}
