/* =====================================================================
   1. POLICES & VARIABLES (:root)
   ===================================================================== */


@font-face {
  font-family: 'BebasNeue-Regular';
  src: url('../fonts/BebasNeue-Regular.woff2') format('woff2'),
       url('../fonts/BebasNeue-Regular.woff') format('woff'),
       url('../fonts/BebasNeue-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'Nunito-Regular';
  src: url('../fonts/Nunito-Regular.woff2') format('woff2'),
       url('../fonts/Nunito-Regular.woff') format('woff'),
       url('../fonts/Nunito-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}





:root {
  /* Typographie */
  --font-body: 'Nunito-Regular', -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'BebasNeue-Regular', -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Palette de couleurs */
  --plum: #f5f5f5;
  --rose: #f5f5f5;
  --panel: #f5f5f5;
  --text: #262626;
  --textplay: rgba(255, 255, 255, 0.25);
  --bg: #000000;
  --panel2: color-mix(in srgb, #20262E 86%, #E9E8E8);
  --line: rgb(233 232 232 / .09);
  --mute: #a9aeb6;
  --rose-t: #929292;
  --plum-d: #b7b7b7;
  --scrim: rgb(12 15 20 / .55);
  --media: #0d1014;

  --black: #000000;
  --white: #f5f5f5;

  /* Rayons et animations */
  --r: 16px;
  --r-s: 12px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --dur: .2s;

  /* Modales & z-index */
  --z-top: 20;
  --z-side: 30;
  --z-drawer: 60;
  --z-modal: 100;
  --z-toast: 120;

  color-scheme: dark;
  box-sizing: border-box;
}

/* =====================================================================
   2. REZERO & ÉLÉMENTS DE BASE (Reset)
   ===================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  scrollbar-width: thin;
  scrollbar-color: rgb(233 232 232 / .2) transparent;
}

body {
  background: var(--bg);
  color: var(--white);
  font: 400 .9375rem/1.55 var(--font-body);
  min-height: 100dvh;
  caret-color: var(--rose);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgb(205 88 136 / .5);
  color: #fff;
}

button,
textarea,
select {
  font: inherit;
  color: inherit;
}

input{
  color: var(--black);
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.disp {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

#tm {
  font-variant-numeric: tabular-nums;
}

/* Icônes SVG */
.i {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;

}


/* =====================================================================
   3. STRUCTURE ET NAVIGATION (Layout)
   ===================================================================== */

.app {
  display: flex;
  min-height: 100dvh;
}

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  width: 76px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 0;
  border-right: 1px solid var(--line);
  z-index: var(--z-side);
}

.lg {
  width: 40px;
  height: 40px;
  border-radius: var(--r-s);
  display: grid;
  place-items: center;
  font: 800 1.1rem var(--font-display);
  margin-bottom: 20px;
  color: var(--rose-t);
}

.side nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ic {
  width: 46px;
  height: 46px;
  border-radius: var(--r-s);
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 1.15rem;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform .12s var(--ease);
}

.ic[aria-current] {
  background: var(--plum);
  color: #000000;
}

.side .bt {
  margin-top: auto;
}

.col {
  flex: 1;
  min-width: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: var(--z-top);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 32px;
  background: rgba(0, 0, 0, 0.831);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

/* Recherche */
.sr {
  position: relative;
  flex: 1 1 240px;
  max-width: 400px;
}

.sr .i {
  position: absolute;
  left: 14px;
  top: 50%;
  translate: 0 -50%;
  color: var(--mute);
  pointer-events: none;
}

.sr input {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px 10px 42px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--white);
  outline: 0;
  transition: border-color var(--dur) var(--ease);
}

.sr input::placeholder {
  color: var(--black);
}

.sr input:focus {
  border-color: var(--rose);
}

/* Filtres & Pills */
.pills {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.pills button,
.sn button {
  min-height: 38px;
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--black);
  background: #b7b7b7;
  font-size: .85rem;
  font-weight: 500;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform .12s var(--ease);
}

.pills button[aria-pressed=true],
.sn button[aria-pressed=true] {
  background: var(--plum);
  color: var(--black);
}

main {
  padding: 28px 32px 72px;
}




/* Fil d'ariane & Titres */
.crumbs {
  font-size: .8rem;
  color: var(--mute);
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.crumbs span + span::before {
  content: "/";
  margin-right: 8px;
  opacity: .5;
}

.crumbs span:last-child {
  color: var(--white);
}

h1.pg {
  font-size: 1.9rem;
  margin-bottom: 22px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

h1.pg small,
h2.sec small {
  color: var(--mute);
  font: 500 .8rem var(--font-body);
  letter-spacing: 0;
}

h2.sec {
  font-size: 1.2rem;
  margin: 40px 0 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

/* =====================================================================
   4. BOUTONS & INTERACTIONS
   ===================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 22px;
  border-radius: var(--r-s);
  background: var(--plum);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--plum);
  transition: background-color var(--dur) var(--ease), transform .12s var(--ease);
}

.btn.o {
  background: transparent;
  color: var(--white);
}

.btn:disabled {
  opacity: .5;
  pointer-events: none;
}

.btn:active,
.ic:active,
.pills button:active,
.sn button:active,
.ck:active {
  transform: scale(.97);
}

/* =====================================================================
   5. BANNIÈRE HERO (Hero Section)
   ===================================================================== */

.hero {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  min-height: clamp(280px, 44dvh, 400px);
  display: flex;
  align-items: center;
  padding: 40px;
  background: #0000006d;
  border: 1px solid #ffffff10;
}

.hero > img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 64%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 55%);
  mask-image: linear-gradient(to right, transparent, #000 55%);
}

.hero .tx {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: 10px;
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--text);
  color: var(--white);
  font-size: .78rem;
  font-weight: 700;
}

.tag.p {
  background: var(--plum);
  color: var(--text);
}

.mt {
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: .85rem;
  margin-top: 10px;
}

.mt > :not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
  margin: 0 10px;
  vertical-align: middle;
}

.rt {
  color: var(--rose-t);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.syn {
  color: #cfd0d3;
  margin: 14px 0 22px;
  max-width: 60ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.acts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =====================================================================
   6. RANGÉES, GRILLES ET CARTES DE MÉDIAS
   ===================================================================== */

.rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail > * {
  scroll-snap-align: start;
  flex: none;
}

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

.pc {
  display: block;
  width: 100%;
  cursor: pointer;
}

.rail .pc {
  width: 160px;
}

.pos,
.th {
  position: relative;
  overflow: hidden;
  background: var(--panel);
}

.pos {
  aspect-ratio: 2/3;
  border-radius: var(--r);
  transition: transform .3s var(--ease);
}

.pos .art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  font: 800 1rem/1.1 var(--font-display);
}

.pos img,
.wc img,
.th img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pos::before,
.wc::before,
.ec .th::before,
.er .th::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  z-index: 1;
  pointer-events: none;
}

.pl {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  z-index: 2;
  pointer-events: none;
}

.pl b {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--black);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.pc:focus-visible .pl,
.wc:focus-visible .pl,
.ec:focus-visible .pl,
.er:focus-visible .pl {
  opacity: 1;
}

.pc:focus-visible .pos::before,
.wc:focus-visible::before {
  opacity: 1;
}

.bd {
  position: absolute;
  top: 9px;
  left: 9px;
  display: flex;
  gap: 4px;
  z-index: 3;
}

.bd span {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--text);
  color: var(--panel);
}

.bd .q {
  background: var(--white);
  color: var(--black);
}

/* Barres de progression */
.seg {
  height: 4px;
  background: linear-gradient(90deg, rgb(233 232 232 / .2) calc(100% - 3px), transparent 0) 0 0 / 10% 100%;
}

.seg i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rose) calc(100% - 3px), transparent 0) 0 0 / 10% 100%;
  clip-path: inset(0 calc(100% - var(--p)) 0 0);
}

.pos .seg,
.wc .seg,
.ec .th .seg {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
}

.pc .t {
  font-weight: 600;
  margin-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc .s {
  color: var(--mute);
  font-size: .8rem;
}

/* Carte Horizon / Continuer la lecture */
.wc {
  position: relative;
  display: block;
  width: 290px;
  aspect-ratio: 16/9;
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  background: var(--panel);
}

.wc .wt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 38px 14px 24px;
  background: linear-gradient(transparent, rgb(13 16 20 / .9));
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.wc .wt b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc .wt span {
  color: var(--mute);
  font-size: .8rem;
}

/* =====================================================================
   7. SECTIONS SÉRIES & ÉPISODES
   ===================================================================== */

.show {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.show:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.show h3 {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.sn {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.ec {
  position: relative;
  width: 210px;
  cursor: pointer;
  display: block;
}

.ec .th {
  aspect-ratio: 16/9;
  border-radius: var(--r-s);
}

.ec .n {
  font-weight: 600;
  margin-top: 8px;
  font-size: .875rem;
}

.ec .s {
  color: var(--mute);
  font-size: .78rem;
}

.ck {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgb(13 16 20 / .7);
  display: grid;
  place-items: center;
  border: 1px solid rgb(233 232 232 / .3);
  font-size: .85rem;
  color: rgb(233 232 232 / .7);
  transition: background-color var(--dur) var(--ease), transform .12s var(--ease);
}

.ck[aria-pressed=true] {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--text);
}

/* =====================================================================
   8. PANNEAU DE DÉTAILS (Drawer)
   ===================================================================== */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  z-index: var(--z-drawer);
  background: var(--black);
  display: flex;
  flex-direction: column;
  transform: translateX(104%);
  transition: transform .32s var(--ease);
}

.drawer.open {
  transform: none;
  box-shadow: -24px 0 60px rgb(5 8 12 / .5);
}

#dclose {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(13 16 20 / .72);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

#dbody {
  flex: 1;
  overflow: auto;
  padding: 0 24px 24px;
  scrollbar-width: thin;
}

.dmedia {
  position: relative;
  margin: 0 -24px;
  aspect-ratio: 16/9;
  background: var(--panel2);
  overflow: hidden;
}

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

.dmedia::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 50%;
  background: linear-gradient(transparent, var(--black));
}

.dmedia .pl {
  z-index: 3;
  opacity: 1;
}

.dmedia button {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.dt {
  font-size: 2rem;
  margin: 18px 0 12px;
}

.dsyn {
  color: #cfd0d3;
  margin-top: 16px;
}

.dsyn.e {
  color: var(--mute);
}

.dact {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  background: var(--black);
}

.dact .btn {
  flex: 1 1 auto;
}

/* Rangée d'épisodes dans le panneau */
.er {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px;
  border-radius: var(--r-s);
  cursor: pointer;
  width: 100%;
  transition: background-color var(--dur) var(--ease);
}

.er .th {
  width: 120px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  flex: none;
}

.er .i2 {
  flex: 1;
  min-width: 0;
}

.er .i2 b {
  display: block;
}

.er .i2 span {
  color: var(--mute);
  font-size: .8rem;
}

.er .ck {
  position: static;
  flex: none;
}

.er .th .seg {
  left: 6px;
  right: 6px;
  bottom: 6px;
}

#scrim {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-drawer) - 1);
  background: rgb(8 10 14 / .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}

#scrim.on {
  opacity: 1;
  pointer-events: auto;
}

/* =====================================================================
   9. ÉTATS ET NOTIFICATIONS (Skeleton, Toast, Back-to-top)
   ===================================================================== */

.sk {
  border-radius: var(--r);
  aspect-ratio: 2/3;
  background: linear-gradient(100deg, #20262E 30%, #2a313b 50%, #20262E 70%);
  background-size: 300% 100%;
  animation: sh 1.3s linear infinite;
}

@keyframes sh {
  to {
    background-position: -150% 0;
  }
}

.empty {
  max-width: 520px;
  margin: 72px auto;
  text-align: center;
  color: var(--mute);
}

.empty h2 {
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.empty code {
  background: var(--panel);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--text);
  word-break: break-all;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  translate: -50% 0;
  max-width: min(92vw, 460px);
  padding: 12px 18px;
  border-radius: var(--r-s);
  background: var(--text);
  color: var(--panel);
  font-weight: 600;
  font-size: .875rem;
  z-index: var(--z-toast);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

#toast.on {
  opacity: 1;
  transform: none;
}

/* =====================================================================
   10. MODALES (Lecteur Vidéo & Édition de Métadonnées)
   ===================================================================== */

.ov {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgb(8 10 14 / .86);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3vw;
}

.ov.open {
  display: flex;
  animation: fade .22s var(--ease);
}

.pl2,
.ed {
  animation: pop .28s var(--ease);
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }
}

/* Lecteur vidéo */
.pl2 {
  position: relative;
  width: min(1200px, 100%);
  background: var(--media);
  border-radius: var(--r);
  overflow: hidden;
}

.pl2:fullscreen {
  width: 100%;
  border-radius: 0;
}

video {
  width: 100%;
  max-height: 78dvh;
  display: block;
  background: var(--media);
}

.pl2:fullscreen video {
  max-height: 100dvh;
  height: 100dvh;
}

video::cue {
  font-weight: 600;
  background: rgb(13 16 20 / .75);
}

#x {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.ttl {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 70px 36px 22px;
  background: linear-gradient(rgb(13 16 20 / .85), transparent);
  font-weight: 600;
  transition: opacity .3s var(--ease);
  pointer-events: none;
  color: var(--white);
}

.ctrl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 16px 12px;
  background: linear-gradient(transparent, rgb(13 16 20 / .92));
  transition: opacity .3s var(--ease);
}

.pl2.idle .ctrl,
.pl2.idle .ttl {
  opacity: 0;
}

.pl2.idle {
  cursor: none;
}

/* Contrôles du lecteur */
.seek {
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.tr {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgb(233 232 232 / .22);
  border-radius: 2px;
  transition: height .15s var(--ease);
}

.seek:hover .tr {
  height: 7px;
}

.bf,
.fl {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 2px;
}

.bf {
  background: rgb(233 232 232 / .3);
}

.fl {
  background: var(--rose);
}

.fl::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  translate: 0 -50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--rose);
}

.row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: .82rem;
}

.row button {
  width: 40px;
  height: 40px;
  border-radius: var(--r-s);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  transition: background-color var(--dur) var(--ease), transform .12s var(--ease);
}

.row button:hover {
  background: rgb(233 232 232 / .14);
}

.row button:active {
  transform: scale(.94);
}

.sp {
  flex: 1;
}

.vol {
  width: 80px;
  accent-color: var(--rose);
}

.row select {
  min-height: 34px;
  background: rgb(250, 255, 255, .05);
  color: var(--white);
  border: 0;
  border-radius: 8px;
  padding: 5px 8px;
  max-width: 150px;
}

.row select option {
  background: var(--panel);
  color: var(--text);
}

.chip {
  font-size: .75rem;
  color: var(--mute);
}

#err {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  text-align: center;
  padding: 30px;
  background: rgb(13 16 20 / .94);
  line-height: 1.5;
}

#err.on {
  display: grid;
}

#err small {
  color: var(--mute);
}

/* Éditeur de métadonnées */
.ed {
  width: min(560px, 100%);
  max-height: 92dvh;
  overflow: auto;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
}

.ed h2 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.ed label {
  display: block;
  font-size: .8rem;
  color: var(--mute);
  margin: 16px 0 6px;
  font-weight: 600;
}

.ed input[type=text],
.ed textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--bg);
  outline: 0;
  transition: border-color var(--dur) var(--ease);
  color: var(--white);
}

.ed textarea {
  min-height: 120px;
  resize: vertical;
}

.ed input[type=text]:focus,
.ed textarea:focus {
  border-color: var(--rose);
}

.hint {
  font-size: .78rem;
  color: #8f959e;
  margin-top: 5px;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.fi input {
  max-width: 260px;
  font-size: .8rem;
}

.fi button {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel2);
  font-size: .8rem;
}

.ed .acts {
  margin-top: 24px;
  justify-content: flex-end;
}

/* =====================================================================
   11. SURVOLS & MEDIA QUERIES (Hover & Responsive)
   ===================================================================== */

@media (hover: hover) and (pointer: fine) {
  .ic:hover {
    color: var(--text);
    background: var(--panel);
  }

  .ic[aria-current]:hover {
    background: var(--plum);
  }

  .pills button:hover:not([aria-pressed=true]),
  .sn button:hover:not([aria-pressed=true]) {
    color: var(--text);
    background: var(--panel2);
  }

  .btn:hover {
    background: var(--plum-d);
    border-color: var(--plum-d);
  }

  .btn.o:hover {
    background: #35353590;
    border-color: var(--plum);
  }

  .pc:hover .pos {
    transform: translateY(-4px);
  }

  .pc:hover .pos::before,
  .wc:hover::before,
  .ec:hover .th::before,
  .er:hover .th::before {
    opacity: 1;
  }

  

  .pc:hover .pl,
  .wc:hover .pl,
  .ec:hover .pl,
  .er:hover .pl,
  .dmedia:hover .pl {
    opacity: 1;
  }

  .er:hover {
    background: #353535;
  }

  .show h3 a:hover {
    color: var(--rose-t);
  }
}

@media (pointer: coarse) {
  .pills button,
  .sn button {
    min-height: 44px;
  }

  .row button {
    width: 44px;
    height: 44px;
  }

  .ck::after {
    content: "";
    position: absolute;
    inset: -10px;
  }
}

@media (max-width: 860px) {
  .app {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  .side {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: calc(66px + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    justify-content: space-around;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--bg);
  }

  .lg {
    display: none;
  }

  .side nav {
    flex-direction: row;
  }

  .side .bt {
    margin: 0;
  }

  main {
    padding: 20px 18px;
  }

  .top {
    padding: 12px 18px;
  }

  .hero {
    padding: 24px;
    min-height: 300px;
  }

  .hero > img {
    width: 100%;
    opacity: .45;
  }

  .vol,
  .chip {
    display: none;
  }

  .pills {
    margin-left: 0;
  }

  .wc {
    width: 250px;
  }

  .er .th {
    width: 100px;
  }
}

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

/* =====================================================================
   12. ANIMATIONS
   ===================================================================== */

#view.enter > * {
  animation: rise .38s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* =====================================================================
   13. DIFFUSION (AirPlay & Chromecast)
   ===================================================================== */

.row button[hidden] {
  display: none;
}

.row button[aria-pressed="true"] {
  color: var(--rose);
  background: rgb(233 232 232 / .14);
}

.ttl,
.ctrl {
  z-index: 2;
}

#cstat {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px;
  text-align: center;
  background: var(--media);
}

.pl2.casting {
  aspect-ratio: 16 / 9;
  min-height: 340px;
  max-height: 78dvh;
}

.pl2.casting #cstat {
  display: flex;
  padding: 64px 30px 120px;
}

.pl2.casting video {
  visibility: hidden;
}

#cstat .i {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  color: var(--rose);
  animation: cast-pulse 2.4s ease-in-out infinite;
}

#cstat p {
  color: var(--mute);
}

#cstat strong {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--white);
}

@keyframes cast-pulse {
  50% {
    opacity: .45;
  }
}


/* =====================================================================
   14. INTERACTIONS DU LECTEUR (aperçu, reprise, double-tap, épisode suivant)
   ===================================================================== */

.seek {
  position: relative;
}

/* Aperçu au survol de la barre de progression */
.pv {
  position: absolute;
  bottom: 26px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translateX(-50%);
  pointer-events: none;
}

.pv[hidden] {
  display: none;
}

.pv img {
  width: 168px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-s);
  background: var(--panel);
  border: 1px solid var(--line);
}

.pv img:not([src]) {
  visibility: hidden;
}

.pv span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgb(13 16 20 / .92);
  color: var(--white);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

/* Marqueur de reprise */
.rmk {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--white);
  opacity: .85;
  transform: translate(-50%, -50%);
}

.rmk[hidden] {
  display: none;
}

/* Double-tap : indicateurs -10 s / +10 s */
.sk2 {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgb(13 16 20 / .62);
  color: var(--white);
  font-size: .75rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(.9);
}

.sk2 .i {
  width: 26px;
  height: 26px;
}

.sk2.l {
  left: 12%;
}

.sk2.r {
  right: 12%;
}

.sk2.on {
  animation: skip-pop .65s var(--ease);
}

@keyframes skip-pop {
  0% {
    opacity: 0;
    transform: translateY(-50%) scale(.85);
  }
  25% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) scale(1);
  }
}

/* Épisode suivant */
.nextc {
  position: absolute;
  right: 20px;
  bottom: 112px;
  z-index: 3;
  display: flex;
  gap: 14px;
  width: min(420px, calc(100% - 40px));
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgb(13 16 20 / .94);
  animation: pop .28s var(--ease);
}

.nextc[hidden] {
  display: none;
}

.nextc > img {
  width: 128px;
  aspect-ratio: 16 / 9;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
  background: var(--panel);
}

.nxb {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.nxb small {
  color: var(--mute);
}

.nxb b {
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.nxb strong {
  overflow: hidden;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nxa {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.nxa .btn {
  min-height: 38px;
  padding: 6px 14px;
  font-size: .85rem;
}

.nextc::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--rose);
  transform-origin: left;
}

.nextc.go::after {
  animation: nx-count 10s linear forwards;
}

@keyframes nx-count {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.pl2.casting #pip {
  display: none;
}

@media (max-width: 860px) {
  .nextc {
    right: 12px;
    bottom: 104px;
  }

  .nextc > img {
    width: 96px;
  }
}

/* Les zones vides des contrôles laissent passer les taps vers la vidéo (double-tap, pause) */
.ctrl,
.row {
  pointer-events: none;
}

.ctrl > .seek,
.row > * {
  pointer-events: auto;
}


/* =====================================================================
   15. PLEIN ÉCRAN SIMULÉ & CONTRÔLES TÉLÉPHONE
   ===================================================================== */

/* Plein écran simulé (application épinglée sur iPhone, navigateurs sans API plein écran) */
.pl2.pfs {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  border-radius: 0;
}

.pl2.pfs video {
  max-height: none;
  height: 100dvh;
}

.pl2:fullscreen .ttl,
.pl2.pfs .ttl {
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
  padding-left: calc(22px + env(safe-area-inset-left, 0px));
}

.pl2:fullscreen #x,
.pl2.pfs #x {
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
}

.pl2:fullscreen .ctrl,
.pl2.pfs .ctrl {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
}

.row button[aria-pressed="true"] {
  color: var(--rose);
}

/* Téléphone, hors plein écran : seulement lecture/pause, précédent, suivant, volume, AirPlay/Chromecast et plein écran */
@media (max-width: 860px), (pointer: coarse) and (max-height: 500px) {
  .pl2:not(:fullscreen):not(.pfs) #tm,
  .pl2:not(:fullscreen):not(.pfs) #mode,
  .pl2:not(:fullscreen):not(.pfs) #audSel,
  .pl2:not(:fullscreen):not(.pfs) #subSel,
  .pl2:not(:fullscreen):not(.pfs) #spd,
  .pl2:not(:fullscreen):not(.pfs) #pip,
  .pl2:not(:fullscreen):not(.pfs) .vol {
    display: none;
  }

  /* En plein écran, tout revient (sur plusieurs lignes si besoin) */
  .pl2:fullscreen .row,
  .pl2.pfs .row {
    flex-wrap: wrap;
  }

  .pl2:fullscreen .vol,
  .pl2.pfs .vol {
    display: block;
  }

  .pl2:fullscreen .chip,
  .pl2.pfs .chip {
    display: inline;
  }
}


/* =====================================================================
   16. COMPTE (identifiant simple)
   ===================================================================== */

/* Bas de la barre latérale : compte au-dessus du bouton Actualiser */
.sidebot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.acc {
  width: min(460px, 100%);
}

.acc form {
  display: block;
}

.hint.err {
  color: var(--white);
  font-weight: 600;
}

@media (max-width: 860px) {
  .sidebot {
    margin: 0;
    flex-direction: row;
  }
}

.btn[hidden] {
  display: none;
}

/* Sur téléphone, les notifications passent au-dessus de la barre de navigation */
@media (max-width: 860px) {
  #toast {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}
