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

:root {
  --bg: #05070d;
  --bg-soft: #070b14;
  --accent: #2563eb;        /* Bleu du logo */
  --accent-soft: #1d4ed8;
  --text: #f9fafb;          /* Blanc cassé */
  --text-muted: #9ca3af;    /* Gris bleuté */
  --border-radius: 12px;
  /* Height of the topbar (used when topbar is overlay) */
  --topbar-h: 72px;
  /* Page horizontal padding (used to allow full-bleed hero without breaking layout) */
  --page-pad: 2rem;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 20% -10%, rgba(255,255,255,0.06), transparent 60%), radial-gradient(900px 500px at 85% 0%, rgba(0,196,108,0.06), transparent 55%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--topbar-h);
  padding: 0.85rem 2rem;
  /* Overlay style: blends into the hero for a true "cinema" header */
  background: linear-gradient(
    to bottom,
    rgba(6, 10, 24, 0.92) 0%,
    rgba(6, 10, 24, 0.62) 55%,
    rgba(6, 10, 24, 0) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}

.logo:hover {
  opacity: 0.9;
}

.logo span {
  color: var(--accent);
}

.search-form {
  display: flex;
  flex: 1;
  max-width: 600px;
  gap: 0.5rem;
}

.search-form input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 8, 20, 0.8);
  color: var(--text);
}

.search-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-form button {
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

main {
  /* Offset all content for the fixed topbar (hero will pull itself back up) */
  padding: calc(1.5rem + var(--topbar-h)) var(--page-pad) 3rem;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.4rem;
}

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

.card {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: linear-gradient(145deg, #12172b, #050814);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.card-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 0.6rem 0.7rem 0.8rem;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sections */
section {
  /* L'overlap des rows gère la transition, on évite une grosse marge */
  margin-bottom: 1.1rem;
}

/* Hidden helper */
.hidden {
  display: none !important;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: #060813;
  border-radius: 18px;
  padding: 1.2rem 1.4rem;
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

.modal-player {
  max-width: 1100px;
}

/* === Cinema player (Movix/Netflix-like) === */
#player-modal.modal-cinema {
  align-items: stretch;
  justify-content: stretch;
}

#player-modal.modal-cinema .modal-content.modal-player {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: #050713;
  box-shadow: none;
}

#player-modal.modal-cinema .modal-backdrop {
  background: rgba(0,0,0,0.85);
}

.cinema-shell {
  display: flex;
  flex-direction: column;
}

.cinema-topbar {
  height: 56px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(10,12,28,0.96), rgba(5,7,19,0.86));
}

.cinema-back {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
}

.cinema-back:hover {
  background: rgba(255,255,255,0.10);
}

.cinema-title {
  overflow: hidden;
}

.cinema-title-text {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cinema-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* Episode buttons: in topbar */
#player-modal .episode-nav {
  margin: 0;
  justify-content: flex-end;
}

.cinema-sources-btn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
}

.cinema-sources-btn:hover {
  background: rgba(255,255,255,0.10);
}

.cinema-open-btn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: #fff;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  cursor: pointer;
  font-weight: 700;
}

.cinema-open-btn:hover {
  background: rgba(255,255,255,0.08);
}

.cinema-fs-btn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: #fff;
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  min-width: 42px;
}

.cinema-fs-btn:hover {
  background: rgba(255,255,255,0.08);
}

/* Fullscreen API: make the cinema shell fill the screen cleanly */
#player-modal .cinema-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: #050713;
}

/* When in fullscreen, hide the entire cinema topbar (keep only the discreet exit button) */
#player-modal .cinema-shell:fullscreen .cinema-topbar,
#player-modal .cinema-shell.is-fullscreen .cinema-topbar {
  display: none;
}

/* Discreet fullscreen-exit button (ONLYUS) */
.cinema-fs-exit {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 9999;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  color: #fff;
  border-radius: 999px;
  padding: 0.34rem 0.55rem;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
  opacity: 0.35;
  display: none;
  backdrop-filter: blur(10px);
}

.cinema-fs-exit:hover {
  opacity: 0.92;
  background: rgba(0,0,0,0.30);
}

#player-modal .cinema-shell:fullscreen .cinema-fs-exit,
#player-modal .cinema-shell.is-fullscreen .cinema-fs-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* In fullscreen, let the video take the maximum space */
#player-modal .cinema-shell:fullscreen .cinema-video,
#player-modal .cinema-shell.is-fullscreen .cinema-video {
  padding: 0;
}

#player-modal .cinema-shell:fullscreen .cinema-player-wrapper {
  border-radius: 0;
}

.cinema-stage {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 0;
}

.cinema-video {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0.8rem 0.8rem 1rem;
}

.cinema-player-wrapper {
  margin-top: 0;
  flex: 1;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  background: #000;
  position: relative;
}

/* Center loading indicator (during sources/options fetch + stream start) */
.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  background:
    radial-gradient(900px 420px at 50% 55%, rgba(255,255,255,0.06), rgba(0,0,0,0.55) 55%, rgba(0,0,0,0.74)),
    rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

.player-loading.hidden {
  display: none;
}

/* Premium loader panel */
.player-loading-panel {
  width: min(620px, calc(100% - 34px));
  padding: 18px 18px 16px;
  border-radius: 22px;
  position: relative;
  background: rgba(10, 12, 24, 0.78);
  box-shadow:
    0 26px 70px rgba(0,0,0,0.62),
    inset 0 1px 0 rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.player-loading-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04), rgba(255,255,255,0.14));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.player-loading-panel::after {
  content: "";
  position: absolute;
  left: -40%;
  top: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.10), rgba(255,255,255,0) 55%);
  transform: rotate(10deg);
  opacity: 0.65;
  pointer-events: none;
}

.player-loading-brand {
  font-weight: 900;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  opacity: 0.7;
  text-transform: uppercase;
}

.player-loading-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-loading-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-loading-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.player-loading-text {
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 1.1rem;
  opacity: 0.98;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-loading-subtext {
  font-weight: 600;
  font-size: 0.88rem;
  opacity: 0.78;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-loading-progress {
  margin-top: 2px;
}

.player-loading-progress-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.26);
  overflow: hidden;
}

.player-loading-progress-bar {
  height: 100%;
  width: 46%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0.85), rgba(255,255,255,0.10));
  filter: blur(0px);
  animation: onlyusIndeterminate 1.05s ease-in-out infinite;
  opacity: 0.86;
}

@keyframes onlyusIndeterminate {
  0% { transform: translateX(-65%); }
  100% { transform: translateX(185%); }
}

.player-loading-sources {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(0,0,0,0.22), rgba(0,0,0,0.10));
}

.player-loading-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.player-loading-source-row.is-active {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.player-loading-source-name {
  font-weight: 750;
  opacity: 0.92;
  letter-spacing: 0.01em;
}

.player-loading-source-status {
  font-weight: 800;
  opacity: 0.92;
  min-width: 36px;
  text-align: right;
}

.player-loading-stage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  opacity: 0.86;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.22);
}

.player-loading-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-loading-tip {
  font-size: 0.78rem;
  opacity: 0.62;
  line-height: 1.25;
}


/* Orbit spinner (more premium than basic border spinner) */
.player-loading-orbit {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: conic-gradient(from 0turn, rgba(255,255,255,0.15), rgba(255,255,255,0.95), rgba(255,255,255,0.15));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0);
  animation: onlyusSpin 0.95s linear infinite;
  box-shadow: 0 8px 22px rgba(0,0,0,0.45);
}

@keyframes onlyusSpin {
  to { transform: rotate(360deg); }
}


#player-modal.modal-cinema #video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  max-height: none;
}

#player-modal.modal-cinema #iframe-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

#player-modal.modal-cinema #iframe-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

#player-modal.modal-cinema .player-status {
  margin-top: 0.6rem;
}

/* Drawer */
.cinema-drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 46vw);
  background: rgba(6, 8, 19, 0.96);
  border-left: 1px solid rgba(255,255,255,0.08);
  transform: translateX(105%);
  transition: transform 220ms ease;
  z-index: 8;
  display: flex;
  flex-direction: column;
}

.cinema-drawer.open {
  transform: translateX(0);
}

.cinema-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cinema-drawer-title {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cinema-drawer-close {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 0;
}

.cinema-drawer-close:hover {
  background: rgba(255,255,255,0.10);
}

.cinema-version-selector {
  padding: 0.9rem 1rem 1.2rem;
  margin: 0;
  overflow: auto;
}

.cinema-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.38);
  z-index: 7;
}

.cinema-drawer-backdrop.hidden {
  display: none;
}

/* Better chips in drawer */
#player-modal.modal-cinema .version-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#player-modal.modal-cinema .version-item {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  background: rgba(255,255,255,0.05);
}

#player-modal.modal-cinema .version-item:hover {
  transform: none;
}

#player-modal.modal-cinema .version-item.active {
  background: rgba(229, 9, 20, 0.14);
  border-color: rgba(229, 9, 20, 0.65);
}

/* === Sources drawer: Movix-like grouped list === */
.sources-tree {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.source-group {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  overflow: hidden;
}

.source-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: space-between;
  padding: 0.85rem 0.9rem;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(255,255,255,0.04);
}

.source-group-toggle:hover {
  background: rgba(255,255,255,0.06);
}

.source-group-title {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.source-group-count {
  opacity: 0.75;
  font-weight: 700;
  margin-left: auto;
}

.source-group-chevron {
  opacity: 0.75;
  font-size: 1.15rem;
  transform: rotate(90deg);
}

.source-group-toggle[aria-expanded="false"] .source-group-chevron {
  transform: rotate(0deg);
}

.source-group-content {
  padding: 0.8rem 0.85rem 0.95rem;
}

.source-group-content.hidden {
  display: none;
}

.source-section {
  margin-top: 0.85rem;
}

.source-section:first-child {
  margin-top: 0;
}

.source-section-title {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.70);
  margin: 0 0 0.45rem 0.15rem;
}

.source-section-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.source-option {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.source-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.source-option-label {
  font-weight: 700;
}

.source-option-badge {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  opacity: 0.95;
}

.source-option-meta {
  font-size: 0.78rem;
  opacity: 0.75;
}

/* Auto-next overlay: keep it inside video area */
#player-modal.modal-cinema .autonext-overlay {
  top: 0.9rem;
  left: 0.9rem;
  right: 0.9rem;
}

@media (max-width: 720px) {
  .cinema-topbar {
    height: auto;
    padding: 0.8rem 0.8rem;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .cinema-topbar-right {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .cinema-drawer {
    width: min(92vw, 420px);
  }
}

/* Episode navigation (Series player) */
.episode-nav {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-end;
  margin: 0.4rem 0 0.8rem;
  flex-wrap: wrap;
}

.episode-nav.hidden {
  display: none;
}

.episode-nav button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Auto-next overlay */
.autonext-overlay {
  position: absolute;
  z-index: 5;
  top: 4.2rem;
  right: 1.4rem;
  left: 1.4rem;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.autonext-overlay.hidden {
  display: none;
}

.autonext-card {
  pointer-events: auto;
  background: rgba(6, 8, 19, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.autonext-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.autonext-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}

.autonext-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* Details layout */
.details-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1rem;
}

.details-poster {
  width: 100%;
  border-radius: 12px;
  aspect-ratio: 2/3;
  object-fit: cover;
}

.details-main h1 {
  margin-top: 0;
  font-size: 1.4rem;
}

.details-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}

.details-overview {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.details-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-primary,
.btn-secondary {
  border-radius: 999px;
  padding: 0.55rem 1rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: #171b2d;
  color: #fff;
}

/* Seasons & episodes */
.seasons-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.seasons-list button {
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
}

.seasons-list button.active {
  border-color: var(--accent);
  background: rgba(229, 9, 20, 0.12);
}

.episodes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4rem;
}

.episode-item {
  border-radius: 10px;
  background: #101322;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.episode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.episode-title {
  font-weight: 500;
}

.episode-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.episode-item button {
  align-self: flex-start;
  margin-top: 0.25rem;
  border-radius: 999px;
  border: none;
  padding: 0.3rem 0.7rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Player */
.player-wrapper {
  margin-top: 0.6rem;
  border-radius: 14px;
  overflow: hidden;
  background: black;
}

#video-player {
  width: 100%;
  max-height: 70vh;
  background: black;
}

.player-status {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --page-pad: 1rem;
  }

  main {
    padding: 1rem var(--page-pad) 2.5rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .details-layout {
    grid-template-columns: 1fr;
  }

  /* Sur mobile, on réduit l'overlap pour éviter de masquer le 1er titre de row */
  .home-rows {
    margin-top: -80px;
    padding-top: 80px;
  }
}


/* Sélection des versions (modal lecteur) */
.version-selector {
  margin: 1rem 0;
}

.version-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.version-item {
  background: #222;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.version-item:hover {
  background: #e50914;
  border-color: #e50914;
  transform: translateY(-1px);
}

.version-empty {
  font-size: 0.9rem;
  opacity: 0.8;
}


/* === Branding ONLY US TV === */
.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.1rem;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: contain;
}

.logo-text {
  color: var(--text);
}

/* === Hero section (inspiré de Netflix) === */
.hero-section {
  position: relative;
  /* Full-bleed : le hero prend toute la largeur même si <main> est paddé */
  width: calc(100% + (var(--page-pad) * 2));
  margin-left: calc(var(--page-pad) * -1);
  margin-right: calc(var(--page-pad) * -1);
  /* Pull the hero up so it starts at the very top of the viewport */
  margin-top: calc((var(--topbar-h) + 1.5rem) * -1);
  margin-bottom: 2.5rem;
  overflow: hidden;
  /* Cinématique : un poil plus compact (≈5–8%) pour voir le catalogue plus vite */
  height: min(84vh, 810px);
  min-height: 500px;
  background: #000;
  --hero-glow: rgba(0, 160, 255, 0.65);

}

/* Bas du hero : transition "cinéma" (sans ligne visible)
   Objectif : l'image se dissout doucement dans le fond, et les rows émergent. */
.hero-section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: clamp(240px, 34vh, 360px);
  pointer-events: none;
  /* Dégradé long et progressif (premium, quasi invisible) */
  background: linear-gradient(
    to bottom,
    rgba(5, 7, 13, 0) 0%,
    rgba(5, 7, 13, 0.15) 35%,
    rgba(5, 7, 13, 0.35) 55%,
    rgba(5, 7, 13, 0.60) 75%,
    rgba(5, 7, 13, 0.85) 90%,
    rgba(5, 7, 13, 1) 100%
  );
}

.hero-backdrop {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* === Hero premium: Ken Burns + Crossfade layers (ne casse rien) === */
/*
  - Ken Burns : léger zoom + déplacement lent du backdrop (CSS only)
  - Crossfade : 2 layers superposées pour fondre quand on change l'image
  - Respecte prefers-reduced-motion
*/
.hero-backdrop-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 900ms ease;
  will-change: transform, opacity, background-position;
}

.hero-backdrop-layer.is-active {
  opacity: 1;
}

.hero-backdrop-layer.hero-kenburns {
  animation: heroKenBurns 22s ease-in-out infinite alternate;
}

@keyframes heroKenBurns {
  0% {
    transform: scale(1.04) translate3d(0, 0, 0);
    background-position: 45% 20%;
  }
  100% {
    transform: scale(1.12) translate3d(0, 0, 0);
    background-position: 55% 30%;
  }
}

/* Petit fade-in du contenu quand hero-loaded s'active */
.hero-content {
  opacity: 0;
  transition: opacity 700ms ease;
}

.hero-section.hero-loaded .hero-content {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .hero-backdrop-layer,
  .hero-content {
    transition: none !important;
  }
  .hero-backdrop-layer.hero-kenburns,
  .hero-content {
    animation: none !important;
  }
}

.hero-gradient {
  position: absolute;
  inset: 0;
  /* Zone de lecture sombre à gauche (40–50%), transparence à droite */
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.98) 0%,
    rgba(0, 0, 0, 0.90) 18%,
    rgba(0, 0, 0, 0.68) 38%,
    rgba(0, 0, 0, 0.25) 55%,
    rgba(0, 0, 0, 0.00) 72%
  );
}

.hero-content {
  position: relative;
  /* Structure en F : contenu lisible à gauche */
  /* Leave room for the overlay topbar */
  padding-top: calc(var(--topbar-h) + 1.2rem);
  padding-left: clamp(18px, 5vw, 64px);
  padding-right: 24px;
  max-width: min(50%, 720px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  color: var(--text);
}

@media (max-width: 860px) {
  .hero-section {
    height: min(76vh, 720px);
    min-height: 460px;
  }
  .hero-content {
    max-width: 92vw;
    padding-top: calc(var(--topbar-h) + 0.85rem);
    padding-right: 18px;
  }
  .hero-title-display {
    font-size: clamp(2rem, 9vw, 3.2rem);
  }
  .hero-logo {
    width: min(360px, 86vw);
  }
}

.hero-tagline {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.72);
}

.hero-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Premium hero title area: TMDB logo PNG (preferred) + Display font fallback */
.hero-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 3.2rem; /* reduces layout shift when swapping logo/text */
}

.hero-title-display {
  font-family: "Bebas Neue", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 400;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 0.95;
  text-shadow: 0 0 16px var(--hero-glow, rgba(0, 160, 255, 0.65)),
    0 0 42px var(--hero-glow, rgba(0, 160, 255, 0.35));
}

.hero-title.is-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-logo {
  width: min(420px, 85vw);
  max-height: 140px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 0 14px var(--hero-glow, rgba(0, 160, 255, 0.65)))
    drop-shadow(0 0 36px var(--hero-glow, rgba(0, 160, 255, 0.45)))
    drop-shadow(0 10px 24px rgba(0, 0, 0, 0.25));
}

.hero-meta {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.78);
}

.hero-overview {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #ddd;
  /* Clamp propre (évite les coupes “au hasard” dues à un max-height fixe) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Sur écrans larges, on laisse un peu plus de texte */
@media (min-width: 1100px) {
  .hero-overview {
    -webkit-line-clamp: 4;
  }
}


.hero-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.hero-actions .btn {
  padding: 0.72rem 1.35rem;
  border-radius: 12px;
  font-size: 0.95rem;
  gap: 0.55rem;
}

.hero-actions .btn .btn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-actions .btn svg {
  fill: currentColor;
}

/* Bouton Lecture : blanc, texte noir (Netflix-like) */
.hero-actions .btn-primary {
  background: #fff;
  color: #0b0f1a;
  border-color: transparent;
}

.hero-actions .btn-primary:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

/* Bouton Plus d'infos : glassmorphism */
.hero-actions .btn-ghost {
  background: rgba(109, 109, 110, 0.7);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.hero-actions .btn-ghost:hover {
  background: rgba(109, 109, 110, 0.85);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease,
    border-color 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #0b1120;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--accent-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.6);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.7);
}

/* === Home rows === */
.home-rows {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  /* Fait "remonter" les rows dans l'ombre du hero pour une transition plus ciné */
  margin-top: -120px;
  padding-top: 120px;
}

/* Needed for row navigation overlay (arrows) */
section.home-row {
  position: relative;
}

.row-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 32px; /* below title */
  bottom: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.row-nav.show {
  opacity: 1;
}

.row-nav.is-scrollable {
  opacity: 1;
}

.row-nav-btn {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 92px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.45);
  color: rgba(226, 232, 240, 0.95);
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.row-nav-btn.left {
  left: 8px;
}

.row-nav-btn.right {
  right: 8px;
}

.row-nav-btn:hover {
  transform: translateY(-50%) scale(1.03);
  background: rgba(2, 6, 23, 0.6);
}

.row-nav-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.row-nav-btn:disabled {
  opacity: 0.18;
  cursor: default;
}

/*
  Respiration verticale (stratégique)
  - Le HTML actuel empile des <section class="home-row ..."> directement dans <main>
  - On ajoute des micro-espaces comme Netflix : juste assez pour reposer l'œil
*/
main > section.home-row + section.home-row {
  margin-top: 10px; /* +8–12px */
}

/* Les sections principales : légèrement plus d'air entre elles */
main > section.home-row-main + section.home-row-main {
  margin-top: 14px;
}

/* Plus d'air entre blocs "importants" */
main > section.home-row-priority + section.home-row,
main > section.home-row-main + section.home-row-genre {
  margin-top: 18px;
}

/* Les genres : un peu plus serrés entre eux */
main > section.home-row-genre + section.home-row-genre {
  margin-top: 10px;
}

/* Après ONLYFOOT : laisse respirer l'entrée du catalogue */
#onlyfoot-section + section.home-row-main {
  margin-top: 22px;
}

.home-row h2,
#search-section h2,
#onlyfoot-section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

/* === Filament accent (subtle, organic, activates on scroll) === */
.filament-title {
  position: relative;
  padding-left: 18px;
  line-height: 1.15;
}

/* Right micro-filament (chapter punctuation) */
.filament-title .filament-text {
  position: relative;
  display: inline-block;
  padding-right: 68px; /* room for the right filament */
}

.filament-title .filament-text::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 52px; /* readable premium */
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56,189,248,0.85) 0%, rgba(56,189,248,0.35) 45%, rgba(56,189,248,0) 100%);
  filter: blur(1px);
  opacity: 0.16; /* faint but visible at rest */
  transform: translateY(-50%) scaleX(0.82);
  pointer-events: none;
}

section.is-visible .filament-title .filament-text::after {
  animation: filamentRightPulse 420ms cubic-bezier(0.22, 1, 0.36, 1) 140ms forwards;
}

@keyframes filamentRightPulse {
  0% {
    opacity: 0;
    transform: translateY(-50%) scaleX(0.35);
  }
  55% {
    opacity: 0.55;
    transform: translateY(-50%) scaleX(1);
  }
  100% {
    opacity: 0.18;
    transform: translateY(-50%) scaleX(1);
  }
}

.filament-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.05em;
  bottom: 0.05em;
  width: 3px;
  border-radius: 999px;
  /* organic fiber-like gradient */
  background: linear-gradient(
    180deg,
    rgba(56, 189, 248, 0) 0%,
    rgba(56, 189, 248, 0.55) 12%,
    rgba(34, 211, 238, 0.20) 28%,
    rgba(56, 189, 248, 0.65) 44%,
    rgba(14, 165, 233, 0.22) 62%,
    rgba(56, 189, 248, 0.60) 78%,
    rgba(56, 189, 248, 0) 100%
  );
  filter: blur(1px);
  opacity: 0.14; /* faint at rest */
  transform: scaleY(1);
  transform-origin: top;
}

/* Add a tiny moving highlight only during the reveal */
.filament-title::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.05em;
  bottom: 0.05em;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56,189,248,0.85) 0%, rgba(56,189,248,0.35) 45%, rgba(56,189,248,0) 100%);
  filter: blur(1.2px);
  opacity: 0;
  transform: translateY(-30%) scaleY(0.25);
  pointer-events: none;
}

section.is-visible .filament-title::before {
  animation: filamentCharge 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

section.is-visible .filament-title::after {
  animation: filamentSpark 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes filamentCharge {
  0% {
    opacity: 0;
    transform: scaleY(0.08);
  }
  55% {
    opacity: 0.95;
    transform: scaleY(1);
  }
  100% {
    opacity: 0.18; /* settles to faint */
    transform: scaleY(1);
  }
}

@keyframes filamentSpark {
  0% {
    opacity: 0;
    transform: translateY(-35%) scaleY(0.20);
  }
  35% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    transform: translateY(30%) scaleY(0.30);
  }
}

@media (prefers-reduced-motion: reduce) {
  section.is-visible .filament-title::before,
  section.is-visible .filament-title::after,
  section.is-visible .filament-title .filament-text::after {
    animation: none !important;
  }
  .filament-title::after {
    display: none;
  }
  .filament-title::before {
    opacity: 0.18;
  }
}

.row-scroller {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.4rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
  scroll-behavior: smooth;
}

.row-scroller::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.row-scroller::-webkit-scrollbar {
  height: 6px;
}

.row-scroller::-webkit-scrollbar-track {
  background: transparent;
}

.row-scroller::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}

/* cartes dans les rangées horizontales */
.row-scroller .card {
  flex: 0 0 150px;
}

/* Top 10 style (simple pour l'instant) */
.top-row .card {
  position: relative;
}

.top-row .card::before {
  content: attr(data-rank);
  position: absolute;
  left: -4px;
  bottom: 4px;
  font-size: 2rem;
  font-weight: 900;
  color: rgba(148, 163, 184, 0.18);
  z-index: 1;
}


/* TOP 10 NETFLIX EFFECT */
.top10-row .card { position: relative; transform: scale(0.95);}
.top10-row .card:hover { transform: scale(1.05);}
.top10-row .card::before {
  content: attr(data-rank);
  position: absolute;
  left: -14px;
  bottom: -26px;
  font-size: 5.8rem;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 4px rgba(255, 255, 255, 0.85);
  text-stroke: 4px rgba(255, 255, 255, 0.85);
  opacity: 0.9;
  z-index: 2;
  pointer-events: none;
}

/* === ONLY US TV v3 – Card & hero refinement === */ === */

/* Cards : poster-first, overlay text, badges "FILM / SÉRIE" */

.card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at top, #111827 0, #05070d 55%);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75);
  transform: translateY(0) scale(1);
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    filter 0.18s ease-out;
}

.row-scroller .card {
  flex: 0 0 170px;
  max-width: 170px;
}

.card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  filter: brightness(1.05);
}

.card-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}


/* Barre de progression pour "Reprendre la lecture" */

.card-progress-track {
  margin-top: 0.45rem;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  overflow: hidden;
}

.card-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(to right, #22c55e, #eab308);
}


/* Overlay d'infos en bas du poster */

.card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.65rem 0.75rem 0.8rem;
}

.card-title {
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: #f9fafb;
}

.card-meta {
  font-size: 0.74rem;
  color: #cbd5f5;
}

/* Badges FILM / SÉRIE */

.card::after {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.card[data-type="movie"]::after {
  content: "FILM";
}

.card[data-type="series"]::after {
  content: "SÉRIE";
}

/* Top 10 : garder les gros numéros derrière la carte */

.top-row .card::before,
.top10-row .card::before {
  content: attr(data-rank);
  position: absolute;
  left: -18px;
  bottom: -24px;
  font-size: 6.4rem;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 4px rgba(255, 255, 255, 0.9);
  text-stroke: 4px rgba(255, 255, 255, 0.9);
  opacity: 0.9;
  z-index: 2;
  pointer-events: none;
}

/* Hero : léger boost de présence (sans casser le layout cinématique) */

.hero-section {
  border-radius: 0;
}

.hero-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(56, 189, 248, 0.25), transparent 55%),
              radial-gradient(circle at 80% 90%, rgba(239, 68, 68, 0.25), transparent 55%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero-content {
  transform: translateY(0);
  animation: heroFloat 12s ease-in-out infinite;
}

@keyframes heroFloat {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}



.version-empty {
  margin-top: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,64,175,0.45));
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.version-empty::before {
  content: "⚠";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.12);
  color: var(--text);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* === Auth & Profils === */

.screen-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.35), rgba(15, 23, 42, 0.95));
  backdrop-filter: blur(16px);
  z-index: 80;
}

.screen-overlay.hidden {
  display: none;
}

.screen-panel {
  width: 100%;
  max-width: 520px;
  padding: 2.2rem 2.4rem;
  border-radius: 24px;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.25), rgba(15, 23, 42, 0.98));
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text);
}

.auth-panel h2,
.profiles-panel h2 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.auth-panel p,
.profiles-panel p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-form {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-group input {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  padding: 0.55rem 1rem;
  color: var(--text);
  outline: none;
  font-size: 0.95rem;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6);
}

.field-hint {
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.95);
  margin-left: 0.25rem;
}

.form-error {
  min-height: 1.2rem;
  font-size: 0.8rem;
  color: #fecaca;
}

.auth-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(to right, var(--accent), var(--accent-soft));
  color: #f9fafb;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(37, 99, 235, 0.55);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.btn-secondary:hover {
  background: rgba(31, 41, 55, 0.95);
  color: var(--text);
}

/* Toggle login / register */

.auth-toggle {
  display: inline-flex;
  padding: 0.2rem;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.auth-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
}

.auth-toggle-btn-active {
  background: linear-gradient(to right, var(--accent), var(--accent-soft));
  color: #f9fafb;
}

/* Profils */

.profiles-panel {
  max-width: 680px;
  text-align: center;
}

.profiles-grid {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  justify-items: center;
}

.profile-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid transparent;
  background: radial-gradient(circle at top, #22c55e, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: #e5e7eb;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.9);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card:hover .profile-avatar {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.95);
  border-color: rgba(250, 250, 250, 0.9);
}

.profile-name {
  font-size: 0.9rem;
  color: var(--text);
}

.profiles-actions {
  margin-top: 1.6rem;
  display: flex;
  justify-content: center;
}

/* Popup création profil */

.profile-create-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.9));
}

.profile-create-modal.hidden {
  display: none;
}

.profile-create-content {
  width: 100%;
  max-width: 520px;
  padding: 2rem 2.3rem;
  border-radius: 24px;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.95);
  text-align: left;
}

.avatar-legend {
  margin-top: 0.75rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 72px);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.avatar-option {
  border-radius: 20px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-option-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.8);
  transform: translateY(-2px);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Responsif */

@media (max-width: 640px) {
  .screen-panel {
    margin: 1rem;
    padding: 1.6rem 1.4rem;
  }

  .profile-create-content {
    margin: 1rem;
    padding: 1.6rem 1.4rem;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, minmax(56px, 1fr));
  }
}


/* ===== User profile menu (header, isolé) ===== */

.topbar-mylist-btn {
  border-radius: 999px;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease,
    border-color 0.2s ease;
}

.topbar-mylist-btn:hover {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  border-color: rgba(248, 250, 252, 0.6);
  transform: translateY(-1px);
}

.user-menu-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  font-size: 0.9rem;
}

.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 8, 20, 0.85);
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.user-menu-toggle:hover {
  background: rgba(15, 23, 42, 0.95);
}

.user-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a, var(--accent-soft));
  flex-shrink: 0;
}

.user-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-menu-avatar-fallback {
  font-weight: 600;
  letter-spacing: 0.05em;
}

.user-menu-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-caret {
  font-size: 0.8rem;
  opacity: 0.8;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 180px;
  padding: 0.4rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 80;
}

.user-menu-item {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.user-menu-item:hover {
  background: rgba(37, 99, 235, 0.16);
}

/* ONLYFOOT – UI (Live / Today / Upcoming + filtres + favoris) */
#onlyfoot-section {
  margin-top: 1.75rem;
}

#onlyfoot-section .onlyfoot-shell {
  position: relative;
  padding: 1.2rem 1.25rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: radial-gradient(1200px 420px at 18% 0%, rgba(16, 185, 129, 0.14), transparent 60%),
    radial-gradient(900px 380px at 82% 20%, rgba(37, 99, 235, 0.12), transparent 55%),
    rgba(2, 6, 23, 0.62);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

/* Subtle “turf” texture in OnlyFoot mode */
body.mode-foot #onlyfoot-section .onlyfoot-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    radial-gradient(900px 320px at 30% 0%, rgba(16, 185, 129, 0.8), transparent 60%),
    radial-gradient(850px 280px at 75% 10%, rgba(34, 197, 94, 0.55), transparent 65%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 8px);
  filter: blur(0.2px);
}

#onlyfoot-section .onlyfoot-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

#onlyfoot-section .onlyfoot-title h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

#onlyfoot-section .onlyfoot-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

#onlyfoot-section .onlyfoot-filters {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

#onlyfoot-section .onlyfoot-search input {
  width: min(360px, 72vw);
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.55);
  color: var(--text);
  outline: none;
}

#onlyfoot-section .onlyfoot-search input:focus {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

#onlyfoot-section .onlyfoot-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#onlyfoot-section .of-chip {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}

#onlyfoot-section .of-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.35);
}

#onlyfoot-section .of-chip.is-active {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.55);
}

#onlyfoot-section .onlyfoot-selects {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#onlyfoot-section .onlyfoot-select {
  padding: 0.5rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.55);
  color: var(--text);
}

#onlyfoot-section .onlyfoot-view {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.55);
}

#onlyfoot-section .of-view {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
}

#onlyfoot-section .of-view.is-active {
  background: rgba(148, 163, 184, 0.14);
}

#onlyfoot-section .onlyfoot-content {
  position: relative;
  z-index: 1;
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#onlyfoot-section .onlyfoot-block {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.55);
  padding: 0.85rem;
}

#onlyfoot-section .onlyfoot-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

#onlyfoot-section .onlyfoot-block-head h3 {
  margin: 0;
  font-size: 1rem;
}

#onlyfoot-section .onlyfoot-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* List containers: default = cards grid */
#onlyfoot-section[data-view="cards"] .onlyfoot-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

#onlyfoot-section[data-view="compact"] .onlyfoot-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Match cards */
#onlyfoot-section .of-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.65), rgba(2, 6, 23, 0.75));
  overflow: hidden;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

#onlyfoot-section .of-card:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.28);
}

#onlyfoot-section .of-card.of-hero {
  grid-column: 1 / -1;
  padding: 1rem;
  background:
    radial-gradient(900px 220px at 25% 0%, rgba(34, 197, 94, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.65), rgba(2, 6, 23, 0.8));
}

#onlyfoot-section .of-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

#onlyfoot-section .of-comp {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#onlyfoot-section .of-fav-btn {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.6);
  color: rgba(226, 232, 240, 0.9);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}

#onlyfoot-section .of-fav-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.35);
}

#onlyfoot-section .of-fav-btn.is-on {
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.35);
}

#onlyfoot-section .of-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

#onlyfoot-section .of-team {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

#onlyfoot-section .of-team.of-team-away {
  justify-content: flex-end;
}

#onlyfoot-section .of-team-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#onlyfoot-section .of-team-badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

#onlyfoot-section .of-team-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#onlyfoot-section .of-team-initials {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

#onlyfoot-section .of-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

#onlyfoot-section .of-vs-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#onlyfoot-section .of-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

#onlyfoot-section .of-time {
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.92);
}

#onlyfoot-section .of-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#onlyfoot-section .of-badge {
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
}

#onlyfoot-section .of-badge.live {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.16);
}

#onlyfoot-section .of-actions {
  display: flex;
  justify-content: flex-end;
}

#onlyfoot-section .of-watch {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  background: rgba(34, 197, 94, 0.2);
  color: var(--text);
  border: 1px solid rgba(34, 197, 94, 0.32);
  cursor: pointer;
}

#onlyfoot-section .of-watch:hover {
  background: rgba(34, 197, 94, 0.28);
}

/* Compact rows */
#onlyfoot-section .of-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.55);
}

#onlyfoot-section .of-row-right {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Favorite button in compact rows: slightly smaller */
#onlyfoot-section .of-row .of-fav-btn {
  width: 30px;
  height: 30px;
  font-size: 0.95rem;
}

#onlyfoot-section .of-row-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

/* Compact rows: dual team logos */
#onlyfoot-section .of-team-badges {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

#onlyfoot-section .of-row .of-team-badge {
  width: 28px;
  height: 28px;
}

/* Slight overlap for a more "match" look */
#onlyfoot-section .of-team-badges .of-team-badge + .of-team-badge {
  margin-left: -10px;
  border: 2px solid rgba(2, 6, 23, 0.85);
}

#onlyfoot-section .of-row-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#onlyfoot-section .of-row-title .line1 {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#onlyfoot-section .of-row-title .line2 {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#onlyfoot-section .onlyfoot-empty {
  padding: 1rem;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  color: var(--text-muted);
  text-align: center;
}

#onlyfoot-section .onlyfoot-comps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#onlyfoot-section .of-comp-group {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.5);
  padding: 0.75rem;
}

#onlyfoot-section .of-comp-group h4 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}


.stream-btn {
  padding: 10px 14px;
  background: #1d1f2b;
  border: 1px solid #444;
  color: white;
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  border-radius: 6px;
  cursor: pointer;
}

.stream-btn:hover {
  background: #2a2d3a;
}


/* ONLYFOOT modal + player */
.onlyfoot-modal-content {
  max-width: 1100px;
  width: 95%;
}

.onlyfoot-modal-title {
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.onlyfoot-modal-layout {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: stretch;
}

.onlyfoot-streams-container {
  flex: 1;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.onlyfoot-player-wrapper {
  flex: 2;
  min-height: 320px;
}

.onlyfoot-player-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.onlyfoot-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0.75rem;
  background-color: #000;
}

.onlyfoot-open-btn {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.onlyfoot-open-btn:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* Responsive: pile streams + player on small screens */
@media (max-width: 768px) {
  .onlyfoot-modal-layout {
    flex-direction: column;
  }

  .onlyfoot-player-wrapper {
    min-height: 260px;
  }
}



/* --- Améliorations hiérarchie des sections home --- */

.home-row-priority h2 {
  font-size: 1.2rem;
}

.home-row-priority .row-scroller .card {
  flex: 0 0 170px;
}

.home-row-main h2 {
  font-size: 1.15rem;
}

.home-row-genre h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ONLYFOOT: legacy wrapper styles kept minimal (new UI is inside .onlyfoot-shell) */
.home-row-onlyfoot {
  margin-top: 2.5rem;
  padding: 0;
  background: transparent;
  border: none;
}

/* Keep old rules only when the old markup exists (direct child title/subtitle) */
.home-row-onlyfoot > h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
}

.home-row-onlyfoot > h2::before {
  content: "⚽";
  font-size: 1.1rem;
}

.home-row-onlyfoot > .onlyfoot-subtitle {
  margin-bottom: 0.75rem;
}

/* Résultats de recherche : bloc encadré */
#search-section {
  margin-top: 2.2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 18px;
  background: radial-gradient(ellipse at top, rgba(15, 23, 42, 0.95), transparent 65%);
  border: 1px solid rgba(31, 41, 55, 0.9);
}

#search-section h2 {
  font-size: 1.2rem;
  margin-bottom: 0.9rem;
}


/* === Reprise intelligente (overlay) === */
.resume-overlay{
  position:absolute;
  left:24px;
  bottom:86px;
  padding:10px 14px;
  border-radius:12px;
  background:rgba(0,0,0,0.55);
  border:1px solid rgba(255,255,255,0.15);
  color:#fff;
  font-weight:600;
  font-size:14px;
  letter-spacing:0.2px;
  z-index:9999;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  pointer-events:none;
}
.resume-overlay.hidden{ display:none; }

@media (max-width: 720px){
  .resume-overlay{
    left:14px;
    bottom:72px;
    font-size:13px;
    padding:9px 12px;
  }
}


.search-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.search-results-count {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}


/* === HERO TRANSITION FIX (cinema stable) === */
.hero {
  position: relative;
  height: 100vh;
  max-height: 900px;
  overflow: hidden;
  margin-top: 0;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  transform: scale(1.02);
  will-change: transform;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 240px;
  background: linear-gradient(
    to bottom,
    rgba(5,10,30,0) 0%,
    rgba(5,10,30,0.5) 45%,
    rgba(5,10,30,0.85) 70%,
    rgba(5,10,30,1) 100%
  );
  pointer-events: none;
  z-index: 3;
}

/* =========================
   ONLYUS HUB (Modes)
   Scoped to #hub-section / body.mode-hub
   ========================= */
#hub-section.hub-section {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 72px);
  padding: 96px 24px 72px;
  display: none;
}

body.mode-hub #hub-section.hub-section { display: block; }

/* Hide app sections while in Hub */
body.mode-hub main > section:not(#hub-section) { display: none !important; }

/* Hub keeps topbar but simplifies it */
body.mode-hub .search-form,
body.mode-hub #my-list-button,
body.mode-hub #onlyfoot-button {
  display: none !important;
}

#hub-section .hub-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 30% 25%, rgba(64, 88, 255, 0.18), transparent 60%),
    radial-gradient(920px 560px at 70% 30%, rgba(0, 196, 108, 0.14), transparent 60%),
    radial-gradient(980px 640px at 70% 80%, rgba(255, 160, 80, 0.10), transparent 60%),
    linear-gradient(to bottom, rgba(0,0,0,0.62), rgba(0,0,0,0.92));
  filter: saturate(110%);
}

#hub-section .hub-shell {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
}

#hub-section .hub-header {
  text-align: center;
  margin-bottom: 24px;
}

#hub-section .hub-title {
  font-size: clamp(44px, 4.2vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  text-shadow: 0 14px 40px rgba(0,0,0,0.65);
}

#hub-section .hub-subtitle {
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.68);
}

#hub-section .hub-modes {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 26px auto 22px;
  padding: 0;
  flex-wrap: nowrap;
}

@media (max-width: 1080px) {
  #hub-section .hub-modes { flex-wrap: wrap; }
}

#hub-section .hub-card {
  --hub-accent: rgba(64, 88, 255, 0.55);
  --hub-accent2: rgba(64, 88, 255, 0.20);
  --hub-bg: none;

  position: relative;
  width: min(220px, calc((100% - 4*22px) / 5));
  height: 278px;
  border: 0;
  padding: 0;
  border-radius: 28px;
  background: rgba(10, 12, 18, 0.52);
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.48),
    0 8px 26px rgba(0,0,0,0.35);
  transition:
    transform 240ms cubic-bezier(0.22,0.61,0.36,1),
    filter 240ms cubic-bezier(0.22,0.61,0.36,1);
}

@media (max-width: 1080px) {
  #hub-section .hub-card { width: 220px; }
}

#hub-section .hub-card:focus-visible {
  outline: 2px solid rgba(64, 88, 255, 0.55);
  outline-offset: 4px;
}

/* Background image layer (blurred) */
#hub-section .hub-card-bg {
  position: absolute;
  inset: -14%;
  background-image: var(--hub-bg);
  background-size: cover;
  background-position: center;
  filter: blur(10px) saturate(120%);
  transform: scale(1.15);
  opacity: 0.62;
  z-index: 0;
}

/* Dark overlay (cinema) */
#hub-section .hub-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(160px 120px at 50% 28%, rgba(255,255,255,0.10), rgba(255,255,255,0.00) 60%),
    linear-gradient(to bottom, rgba(0,0,0,0.15), rgba(0,0,0,0.78));
  z-index: 1;
}

/* Soft neon border + glow */
#hub-section .hub-card-border {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.20) inset,
    0 0 24px var(--hub-accent2),
    0 0 52px rgba(0,0,0,0.35);
  z-index: 2;
}

#hub-section .hub-card-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background:
    radial-gradient(220px 160px at 50% 18%, var(--hub-accent), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.00));
  opacity: 0.55;
  pointer-events: none;
}

#hub-section .hub-card-inner {
  position: relative;
  z-index: 3;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 18px;
  text-align: center;
}

#hub-section .hub-card-ico {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: rgba(8,10,14,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 10px 22px rgba(0,0,0,0.40),
    0 0 26px var(--hub-accent2);
  backdrop-filter: blur(10px);
}

#hub-section .hub-card-name {
  font-size: 28px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.96);
  text-shadow: 0 10px 30px rgba(0,0,0,0.72);
}

#hub-section .hub-card-desc {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  text-shadow: 0 10px 26px rgba(0,0,0,0.70);
}

#hub-section .hub-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  background: rgba(0,0,0,0.36);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
}

/* Hover (premium) */
@media (hover: hover) and (pointer: fine) {
  #hub-section .hub-card:hover {
    transform: translateY(-6px) scale(1.02);
    filter: brightness(1.05);
  }
  #hub-section .hub-card:hover .hub-card-border::before {
    opacity: 0.78;
  }
}

/* Disabled cards */
#hub-section .hub-card-disabled {
  cursor: default;
  filter: saturate(70%);
  opacity: 0.66;
}

#hub-section .hub-card-disabled .hub-card-bg { opacity: 0.40; }
#hub-section .hub-card-disabled:hover { transform: none; }

/* Card themes (color + background image) */
#hub-section .hub-card-cine {
  --hub-accent: rgba(255, 90, 90, 0.62);
  --hub-accent2: rgba(255, 90, 90, 0.22);
  --hub-bg: url("./assets/hub/cine.jpg");
}
#hub-section .hub-card-zik {
  --hub-accent: rgba(120, 255, 160, 0.55);
  --hub-accent2: rgba(120, 255, 160, 0.20);
  --hub-bg: url("./assets/hub/zik.jpg");
}
#hub-section .hub-card-book {
  --hub-accent: rgba(186, 140, 255, 0.60);
  --hub-accent2: rgba(186, 140, 255, 0.22);
  --hub-bg: url("./assets/hub/book.jpg");
}
#hub-section .hub-card-foot {
  --hub-accent: rgba(90, 255, 170, 0.52);
  --hub-accent2: rgba(90, 255, 170, 0.20);
  --hub-bg: url("./assets/hub/foot.jpg");
}
#hub-section .hub-card-games {
  --hub-accent: rgba(255, 180, 95, 0.62);
  --hub-accent2: rgba(255, 180, 95, 0.22);
  --hub-bg: url("./assets/hub/games.jpg");
}

/* Preferences panel */
#hub-section .hub-prefs {
  margin: 22px auto 0;
  max-width: 980px;
  border-radius: 18px;
  background: rgba(12, 14, 18, 0.44);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 46px rgba(0,0,0,0.40);
  padding: 16px 18px;
  backdrop-filter: blur(12px);
}

#hub-section .hub-pref-title {
  font-weight: 800;
  font-size: 14px;
  color: rgba(255,255,255,0.92);
  margin-bottom: 10px;
}

#hub-section .hub-pref-options {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

#hub-section .hub-radio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
  user-select: none;
}

#hub-section .hub-radio input { accent-color: #4c78ff; }

#hub-section .hub-radio span {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
}

#hub-section .hub-pref-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #hub-section .hub-card { transition: none; }
}


/* =========================
   MODE FOOT (OnlyFoot as a true mode)
   ========================= */
body.mode-foot main > section:not(#onlyfoot-section) { display: none !important; }
body.mode-foot #onlyfoot-section { display: block !important; }

/* Reduce Cine-specific topbar controls in foot mode */
body.mode-foot .search-form,
body.mode-foot #my-list-button { display: none !important; }

/* Allow ONLYFOOT button to stay visible (optional). */


/* =========================
   Universe switch + transitions (Ciné-first)
   ========================= */

/* Background crossfade layers */
body {
  background: #000; /* base, real atmosphere comes from .universe-bg layers */
}

.universe-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1000ms ease;
  filter: saturate(112%);
}

.universe-bg.is-active { opacity: 1; }

/* Themes */
.universe-bg.theme-cine {
  background:
    radial-gradient(1100px 600px at 22% 8%, rgba(64, 88, 255, 0.22), transparent 58%),
    radial-gradient(900px 540px at 78% 12%, rgba(0, 196, 108, 0.10), transparent 60%),
    radial-gradient(1000px 680px at 70% 82%, rgba(255, 160, 80, 0.10), transparent 62%),
    linear-gradient(to bottom, rgba(0,0,0,0.62), rgba(0,0,0,0.92));
}

.universe-bg.theme-foot {
  background:
    radial-gradient(1100px 620px at 30% 10%, rgba(0, 196, 108, 0.20), transparent 60%),
    radial-gradient(980px 560px at 78% 18%, rgba(64, 88, 255, 0.12), transparent 62%),
    radial-gradient(980px 680px at 65% 82%, rgba(255, 200, 80, 0.10), transparent 62%),
    linear-gradient(to bottom, rgba(0,0,0,0.62), rgba(0,0,0,0.92));
}

.universe-bg.theme-games {
  background:
    radial-gradient(1100px 620px at 24% 10%, rgba(170, 90, 255, 0.18), transparent 60%),
    radial-gradient(980px 560px at 80% 18%, rgba(64, 88, 255, 0.14), transparent 62%),
    radial-gradient(980px 680px at 65% 82%, rgba(0, 196, 108, 0.08), transparent 62%),
    linear-gradient(to bottom, rgba(0,0,0,0.62), rgba(0,0,0,0.92));
}

/* Universe switch pills */
.universe-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
  flex: 0 0 auto;
}

.universe-pill {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.universe-pill:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}

.universe-pill.is-active {
  background: rgba(255,255,255,0.10);
  border-color: rgba(120,160,255,0.38);
  box-shadow:
    0 0 0 1px rgba(120,160,255,0.20) inset,
    0 12px 30px rgba(40,80,255,0.12);
}

.universe-pill:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.16),
    0 0 0 4px rgba(120,160,255,0.25);
}

.universe-pill.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.universe-soon {
  font-weight: 800;
  font-size: 0.75em;
  opacity: 0.85;
}

/* Mode chip */
.mode-chip {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  left: 24px;
  z-index: 90;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(10, 14, 30, 0.55);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.94);
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.mode-chip.is-show {
  opacity: 1;
  transform: translateY(0);
}

/* Content transition on universe switch */
main {
  transform-origin: 50% 12%;
  transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
}

body.mode-transition-out main {
  transition-duration: 180ms;
  opacity: 0;
  transform: scale(0.985);
  filter: blur(6px);
}

body.mode-transition-in main {
  transition-duration: 420ms;
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* Foot mode keeps the universe switch visible (to allow returning to Ciné) */
body.mode-foot .search-form { display: none !important; }
body.mode-foot #my-list-button { display: none !important; }

/* Small screens */
@media (max-width: 720px) {
  .universe-switch { gap: 8px; }
  .universe-pill { padding: 7px 10px; font-size: 0.82rem; }
  .universe-soon { display: none; }
  .mode-chip { left: 14px; right: 14px; width: fit-content; max-width: calc(100vw - 28px); }
}


/* ONLYFOOT — TV Live (Netflix row) */
#onlyfoot-section .tv-row-scroller .card.tv-card {
  flex: 0 0 150px;
  padding: 0.65rem 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#onlyfoot-section .tv-card-top {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 86px;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.06);
  overflow: hidden;
}

#onlyfoot-section .tv-card-top img {
  max-width: 90%;
  max-height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.45));
}

#onlyfoot-section .tv-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* TV Modal */
.tv-modal-content {
  max-width: 980px;
  width: min(980px, 92vw);
}

.tv-modal-title {
  margin: 0.25rem 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.tv-player-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.75rem;
}

.tv-player-controls .btn-secondary.active {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.tv-iframe {
  width: 100%;
  height: min(62vh, 560px);
  border: 0;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.85);
}


/* =========================================================
   ONLYFOOT v2 — Streamed-like schedule layout
   Top: TV Live carousel — Bottom: Matches grouped by day
   ========================================================= */
#onlyfoot-section .of2-shell{
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.35);
  box-shadow: 0 20px 80px rgba(0,0,0,.55);
  overflow: hidden;
}

#onlyfoot-section .of2-topbar{
  position: sticky;
  top: 0;
  z-index: 5;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,.55);
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
}

#onlyfoot-section .of2-left{display:flex;align-items:center;gap:12px;min-width:0}
#onlyfoot-section .of2-right{display:flex;align-items:center;gap:10px;min-width:0}

#onlyfoot-section .of2-brand{display:flex;align-items:center;gap:10px;min-width:0}
#onlyfoot-section .of2-dot{
  width:10px;height:10px;border-radius:999px;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.16);
}
#onlyfoot-section .of2-title{display:flex;flex-direction:column;line-height:1.05;min-width:0}
#onlyfoot-section .of2-title-main{font-weight:700;font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#onlyfoot-section .of2-title-sub{font-size:.75rem;color:rgba(255,255,255,.65)}

#onlyfoot-section .of2-tabs{display:flex;align-items:center;gap:8px}
#onlyfoot-section .of2-tab{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.85);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .8rem;
  cursor: pointer;
}
#onlyfoot-section .of2-tab.is-active{
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.35);
  color: #fff;
}
#onlyfoot-section .of2-pill{
  display:inline-flex;align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  font-size:.8rem;
  color: rgba(255,255,255,.85);
}

#onlyfoot-section .of2-select-wrap{display:flex;align-items:center}
#onlyfoot-section .of2-select{
  height: 34px;
  border-radius: 10px;
  padding: 0 10px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.9);
  outline: none;
}

#onlyfoot-section .of2-ghost{
  height:34px;
  border-radius:10px;
  padding:0 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.9);
  cursor:pointer;
}

#onlyfoot-section .of2-search input{
  height: 34px;
  width: 220px;
  max-width: 32vw;
  border-radius: 10px;
  padding: 0 10px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.9);
  outline:none;
}
#onlyfoot-section .of2-search input:focus{
  border-color: rgba(239,68,68,.35);
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

#onlyfoot-section .of2-content{padding: 10px 12px 14px}
#onlyfoot-section .of2-block{margin-top: 8px}
#onlyfoot-section .of2-block-head{
  display:flex;align-items:center;justify-content:space-between;
  padding: 8px 2px;
}
#onlyfoot-section .of2-block-head h3{
  margin:0;
  font-size: .95rem;
  letter-spacing: .2px;
}

#onlyfoot-section .of2-tv-row{
  padding-bottom: 6px;
}

#onlyfoot-section .of2-schedule{display:flex;flex-direction:column;gap: 18px; padding-top: 6px;}

#onlyfoot-section .of2-day{display:block}
#onlyfoot-section .of2-day-head{
  display:flex;align-items:center;justify-content:space-between;
  padding: 0 2px 10px;
}
#onlyfoot-section .of2-day-label{
  color: rgba(255,255,255,.75);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .12em;
}
#onlyfoot-section .of2-day-title{
  display:flex;align-items:baseline;gap:6px;
  color: rgba(255,255,255,.92);
}
#onlyfoot-section .of2-day-num{font-weight:800;font-size: 1.35rem; line-height:1}
#onlyfoot-section .of2-day-mon{font-weight:700;font-size:.78rem; opacity:.85; letter-spacing:.12em}

#onlyfoot-section .of2-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1200px){
  #onlyfoot-section .of2-grid{grid-template-columns: repeat(4, minmax(0,1fr));}
}
@media (max-width: 980px){
  #onlyfoot-section .of2-right{display:none;}
  #onlyfoot-section .of2-grid{grid-template-columns: repeat(3, minmax(0,1fr));}
}
@media (max-width: 680px){
  #onlyfoot-section .of2-grid{grid-template-columns: repeat(2, minmax(0,1fr));}
}

#onlyfoot-section .of2-card{
  border:0;
  padding:0;
  background: transparent;
  text-align:left;
  cursor:pointer;
}
#onlyfoot-section .of2-card-media{
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  aspect-ratio: 16 / 9;
}
#onlyfoot-section .of2-card-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
  transform: scale(1.02);
  filter: saturate(1.05) contrast(1.02);
}
#onlyfoot-section .of2-card:hover .of2-card-media{
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 16px 50px rgba(0,0,0,.45);
}
#onlyfoot-section .of2-time{
  position:absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  font-size: .72rem;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(59,130,246,.18);
  border: 1px solid rgba(59,130,246,.28);
  color: rgba(255,255,255,.95);
}
#onlyfoot-section .of2-live{
  position:absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: .72rem;
  font-weight: 900;
  border-radius: 999px;
  background: rgba(239,68,68,.20);
  border: 1px solid rgba(239,68,68,.35);
  color: rgba(255,255,255,.98);
}
#onlyfoot-section .of2-meta{
  padding: 8px 2px 0;
}
#onlyfoot-section .of2-match{
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#onlyfoot-section .of2-vs{opacity:.65;font-weight:600}
#onlyfoot-section .of2-comp{
  margin-top: 2px;
  font-size: .72rem;
  color: rgba(255,255,255,.60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



/* ===========================
   ONLYFOOT (Streamed-like) — TV Live carousel
   =========================== */
#onlyfoot-section .of2-carousel{
  position: relative;
  display:flex;
  align-items:center;
}
#onlyfoot-section .of2-carousel::before,
#onlyfoot-section .of2-carousel::after{
  content:"";
  position:absolute;
  top:0; bottom:0;
  width:46px;
  pointer-events:none;
  z-index:1;
}
#onlyfoot-section .of2-carousel::before{
  left:0;
  background: linear-gradient(90deg, rgba(8,10,16,0.95), rgba(8,10,16,0));
}
#onlyfoot-section .of2-carousel::after{
  right:0;
  background: linear-gradient(270deg, rgba(8,10,16,0.95), rgba(8,10,16,0));
}

#onlyfoot-section .of2-car-btn{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  width:34px; height:54px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(12,16,26,0.65);
  color: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  cursor:pointer;
  z-index:2;
  display:flex;align-items:center;justify-content:center;
  font-size: 26px;
  line-height: 1;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
  opacity: .85;
}
#onlyfoot-section .of2-car-btn:hover{ transform: translateY(-50%) scale(1.05); background: rgba(16,22,36,0.85); opacity: 1; }
#onlyfoot-section .of2-car-btn:active{ transform: translateY(-50%) scale(.98); }
#onlyfoot-section .of2-car-btn[disabled]{ opacity:.25; cursor: default; }
#onlyfoot-section .of2-car-btn-left{ left: 6px; }
#onlyfoot-section .of2-car-btn-right{ right: 6px; }

#onlyfoot-section .of2-tv-row{
  scroll-snap-type: x mandatory;
  padding-left: 38px;
  padding-right: 38px;
}
#onlyfoot-section .of2-tv-row .tv-card{
  scroll-snap-align: start;
  min-width: 110px;
  width: 110px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(18,22,34,0.35);
  box-shadow: 0 14px 34px rgba(0,0,0,0.35);
  overflow:hidden;
}
#onlyfoot-section .of2-tv-row .tv-card-top{
  height: 62px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}
#onlyfoot-section .of2-tv-row .tv-card-top img{
  max-width: 74px;
  max-height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.55));
}
#onlyfoot-section .of2-tv-row .tv-card-name{
  padding: 8px 10px 10px;
  font-size: .78rem;
  opacity: .9;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
#onlyfoot-section .of2-tv-row .tv-card:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.14);
}

/* === Soutien / Dons (Footer + Settings) === */

/* Reserve some space so the fixed footer never overlaps the last row */
body {
  padding-bottom: 64px;
}

.global-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  background: linear-gradient(180deg, rgba(6,10,24,0.22), rgba(6,10,24,0.86));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-donate-link {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(249,250,251,0.86);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease-out, background 0.12s ease-out, border-color 0.12s ease-out;
}

.footer-donate-link:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

.footer-donate-link:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.75);
  outline-offset: 3px;
}

.donate-modal-content,
.settings-modal-content {
  max-width: 560px;
}

.donate-modal-title,
.settings-title {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
}

.donate-modal-text,
.settings-help {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  line-height: 1.35;
}

.donate-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.donate-amount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(37, 99, 235, 0.45);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  min-width: 92px;
  transition: transform 0.12s ease-out, background 0.12s ease-out, border-color 0.12s ease-out;
}

.donate-amount:hover {
  background: rgba(37, 99, 235, 0.26);
  border-color: rgba(37, 99, 235, 0.62);
  transform: translateY(-1px);
}

.donate-amount-other {
  flex: 1 1 170px;
}

.donate-secure,
.settings-secure {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.settings-block {
  margin-top: 1.1rem;
  padding: 1rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.settings-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.settings-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.settings-value {
  font-weight: 700;
}

.settings-subtitle {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.settings-actions {
  margin-top: 0.9rem;
}

/* =========================================================
   MOBILE POLISH (Android + iOS Safari) — CSS ONLY
   Objectif : rendu "app" propre sans changer la logique JS.
   ========================================================= */

/* Fix iOS address-bar viewport + notch safe areas */
@supports (height: 100dvh) {
  body { min-height: 100dvh; }
  /* Fullscreen-like modals */
  #player-modal.modal-cinema .modal-content.modal-player { height: 100dvh; }
}

@media (max-width: 820px) {
  :root {
    --page-pad: 0.9rem;
  }

  /* ---------- Header: compact, multi-line, touch-first ---------- */
  .topbar {
    position: sticky;
    height: auto;
    padding:
      calc(env(safe-area-inset-top) + 10px)
      calc(env(safe-area-inset-right) + 12px)
      10px
      calc(env(safe-area-inset-left) + 12px);
    gap: 10px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(6, 10, 24, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }


  /* Collapsing topbar on scroll (mobile only) */
  .topbar {
    transition: padding 180ms ease, gap 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    will-change: padding, gap;
  }

  .logo-mark,
  .user-menu-avatar {
    transition: width 180ms ease, height 180ms ease, transform 180ms ease;
    will-change: width, height, transform;
  }

  .search-form,
  #my-list-button,
  .universe-switch {
    overflow: hidden;
    transform-origin: top;
    transition: max-height 180ms ease, opacity 150ms ease, transform 180ms ease;
    max-height: 220px;
  }

  .topbar.is-compact {
    padding:
      calc(env(safe-area-inset-top) + 6px)
      calc(env(safe-area-inset-right) + 12px)
      6px
      calc(env(safe-area-inset-left) + 12px);
    gap: 6px;
    background: rgba(6, 10, 24, 0.96);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  }

  .topbar.is-compact .logo-mark {
    width: 24px;
    height: 24px;
  }

  .topbar.is-compact .user-menu-avatar {
    width: 30px;
    height: 30px;
  }

  .topbar.is-compact .search-form,
  .topbar.is-compact #my-list-button,
  .topbar.is-compact .universe-switch {
    max-height: 0;
    min-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
  }

  .topbar.is-compact #my-list-button {
    padding: 0;
    border-width: 0;
  }

  .topbar.is-compact .universe-switch {
    padding-bottom: 0;
  }

  /* Accessibility: if user focuses inside the header, expand it */
  .topbar:focus-within {
    padding:
      calc(env(safe-area-inset-top) + 10px)
      calc(env(safe-area-inset-right) + 12px)
      10px
      calc(env(safe-area-inset-left) + 12px);
    gap: 10px;
  }

  .topbar:focus-within .search-form,
  .topbar:focus-within #my-list-button,
  .topbar:focus-within .universe-switch {
    max-height: 220px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .logo {
    flex: 1 1 auto;
    font-size: 1.15rem;
  }

  .logo-text { display: none; }

  .logo-mark {
    width: 28px;
    height: 28px;
  }

  /* User menu: avatar-first */
  .user-menu-container {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .user-menu-name,
  .user-menu-caret {
    display: none;
  }

  .user-menu-toggle {
    padding: 0.28rem 0.55rem;
  }

  .user-menu-avatar {
    width: 34px;
    height: 34px;
  }

  .search-form {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
    order: 10;
  }

  .search-form input {
    font-size: 16px; /* prevents iOS zoom */
    padding: 0.75rem 0.95rem;
  }

  .search-form button {
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
  }

  #my-list-button {
    flex: 1 1 100%;
    order: 20;
    padding: 0.75rem 1rem;
    min-height: 44px;
  }

  .universe-switch {
    flex: 1 1 100%;
    order: 30;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    padding-bottom: 2px;
  }
  .universe-switch::-webkit-scrollbar { display: none; }
  .universe-pill { flex: 0 0 auto; }

  /* Main padding: header is no longer fixed overlay on mobile */
  main {
    padding: 0.9rem var(--page-pad) 4.5rem;
  }

  /* ---------- Hero: shorter + text readable ---------- */
  .hero-section {
    margin-top: 0;
    height: min(62vh, 640px);
    min-height: 420px;
    margin-bottom: 1.4rem;
  }

  .hero-content {
    padding-top: 1rem;
    max-width: 92vw;
  }

  .hero-overview {
    font-size: 0.95rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-actions {
    gap: 0.6rem;
    flex-wrap: wrap;
  }

  .btn,
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
  }

  /* ---------- Rows & cards: swipe-first, no hover-jank ---------- */
  .row-scroller {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 0.65rem;
    padding-bottom: 0.25rem;
  }

  .row-scroller .card {
    flex: 0 0 132px;
    max-width: 132px;
    scroll-snap-align: start;
  }

  .top10-row .card::before {
    font-size: 4.6rem;
    left: -12px;
    bottom: -22px;
    -webkit-text-stroke: 3px rgba(255, 255, 255, 0.85);
  }

  /* Grid results: avoid tiny columns */
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  h2 {
    font-size: 1.15rem;
  }

  /* ---------- Modals: full-height on mobile, safe-area aware ---------- */
  .modal-content {
    max-height: calc(100vh - 18px);
  }

  .onlyfoot-modal-content,
  .tv-modal-content,
  .settings-modal-content,
  .donate-modal-content {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    padding:
      calc(env(safe-area-inset-top) + 14px)
      12px
      calc(env(safe-area-inset-bottom) + 14px)
      12px;
  }

  .modal-close {
    top: calc(env(safe-area-inset-top) + 8px);
    right: calc(env(safe-area-inset-right) + 12px);
    font-size: 2rem;
  }

  /* iOS: prevent "zoom" on smaller inputs in modals */
  input,
  select {
    font-size: 16px;
  }

  /* OnlyFoot/TV iframes: maximize visible area */
  .onlyfoot-iframe,
  .tv-iframe {
    height: calc(100vh - 210px);
    min-height: 320px;
  }

  /* Footer: keep accessible without being intrusive */
  .global-footer {
    padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
  }
}

@media (max-width: 480px) {
  /* Extra-small devices */
  .row-scroller .card {
    flex-basis: 122px;
    max-width: 122px;
  }

  .hero-section {
    height: min(58vh, 600px);
    min-height: 400px;
  }
}

/* Cinema player safe areas on mobile */
@media (max-width: 820px) {
  /* iOS/Android: avoid 100vh jumps when the browser UI shows/hides */
  #player-modal.modal-cinema .modal-content.modal-player { height: 100vh; }
  @supports (height: 100dvh) {
    #player-modal.modal-cinema .modal-content.modal-player { height: 100dvh; }
  }

  .cinema-topbar {
    padding-top: calc(env(safe-area-inset-top) + 8px);
    height: auto;
  }

  .cinema-video {
    padding: 0.6rem 0.6rem calc(env(safe-area-inset-bottom) + 0.9rem);
  }

  .cinema-fs-exit {
    top: calc(env(safe-area-inset-top) + 10px);
    right: calc(env(safe-area-inset-right) + 12px);
  }
}
