* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* --- POLICES --- */

/* Police par défaut (UI) */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1b2340 0%, #050816 50%, #020617 100%);
  color: #f9fafb;
}

/* Police DYS : OpenDyslexic (fichiers .otf locaux) */
@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.hidden { display: none !important; }

#app { min-height: 100vh; }

/* PROFILS */
#profile-screen {
  min-height: 100vh;
  display: flex;
}
#home-screen {
  min-height: 100vh;
  display: none;
}

.profile-container {
  margin: auto;
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  max-width: 480px;
}
.app-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.app-subtitle {
  font-size: 0.95rem;
  color: #cbd5f5;
  margin-bottom: 2rem;
}
.profile-list {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.profile-card {
  position: relative;
  border: none;
  background: #0b1220;
  border-radius: 1.25rem;
  padding: 1rem 0.75rem 0.9rem;
  width: 105px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #e5e7eb;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.profile-card:hover {
  transform: translateY(-4px);
  background: #111827;
}
.profile-add { border: 1px dashed #4b5563; }

.avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #facc15); /* écrasé par JS */
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: #111827;
}
.avatar-circle.plus {
  background: transparent !important;
  border: 1px dashed #4b5563;
  color: #9ca3af;
}

/* Bouton gear sur le profil */
.profile-gear {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.profile-gear:hover {
  background: #111827;
}

/* HEADER */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(to bottom, rgba(5, 8, 22, 0.95), rgba(5, 8, 22, 0.7));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.logo-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #facc15, #f97316);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.8);
}
.brand-title {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #e5e7eb;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.user-initial {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
}
.user-name {
  font-size: 0.8rem;
  color: #e5e7eb;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* HAMBURGER */
.hamburger-btn {
  width: 36px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}
.hamburger-btn span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #e5e7eb;
}

/* MENU NAV */
.nav-menu {
  position: fixed;
  right: 1.25rem;
  top: 54px;
  background: #020617;
  border-radius: 1rem;
  padding: 0.5rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 30;
  min-width: 190px;
}
.nav-menu.show {
  display: flex;
}
.nav-item {
  border-radius: 999px;
  border: none;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
}
.nav-item:hover {
  background: #111827;
}

/* BOUTONS */
.primary-btn {
  border-radius: 999px;
  border: none;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #111827;
  box-shadow: 0 14px 35px rgba(248, 181, 24, 0.4);
}
.primary-btn.secondary-variant {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: none;
}

.main-content { padding-bottom: 3rem; }

/* HERO */
.hero {
  position: relative;
  min-height: 230px;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem 1.25rem;
  background-image: url("images/hero/hero-eveil-saison-1.jpg?v=2");
  background-size: cover;
  background-position: center;
  border-radius: 1.5rem;
  margin: 1rem 1.25rem 0;
  overflow: hidden;
}

/* HERO OVERLAY */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top,
    rgba(15, 23, 42, 0.25) 0%,
    rgba(3, 7, 18, 0.70) 65%,
    rgba(3, 7, 18, 0.85) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 420px;
}
.hero-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #facc15;
  margin-bottom: 0.5rem;
}
.hero-title {
  font-size: 1.8rem;      /* 🔎 un peu plus grand */
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: #f9fafb;          /* 🔎 toujours blanc, même en mode jour */
}
.hero-text {
  font-size: 0.9rem;
  color: #e5e7eb;
  margin-bottom: 0.9rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* SAISON & ÉPISODES */
.seasons-section {
  margin: 1.5rem 1.25rem 0;
}
.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}
.section-header p {
  font-size: 0.85rem;
  color: #cbd5f5;
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
}
.episodes-row {
  display: flex;
  overflow-x: auto;
  gap: 0.75rem;
  padding-bottom: 0.25rem;
}
.episode-card {
  min-width: 220px;
  max-width: 240px;
  background: #020617;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.episode-thumb {
  height: 110px;
  background-size: cover;
  background-position: center;
}

/* THUMBS EXEMPLE (saisons suivantes) */
.thumb-1 {
  background-image: url("images/episodes/s1-e1.jpg");
}
.thumb-2 {
  background-image: url("images/episodes/s1-e2.jpg");
}
.thumb-3 {
  background-image: url("images/episodes/s1-e3.jpg");
}

.episode-body {
  padding: 0.7rem 0.75rem 0.85rem;
}
.episode-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.episode-body p {
  font-size: 0.8rem;
  color: #cbd5f5;
}

/* MODALES (génériques) */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.88);
  z-index: 50;
  padding: 1.25rem;
}
.modal.show {
  display: flex;
}
.modal-content {
  background: #020617;
  border-radius: 1.25rem;
  padding: 1.25rem 1.1rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}
.modal-text {
  font-size: 0.9rem;
  color: #e5e7eb;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* MODALE AJOUT / ACTION PROFIL */
.profile-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}
.profile-modal-subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.35rem;
  margin-bottom: 0.9rem;
  line-height: 1.4;
}
.profile-input-group {
  margin-bottom: 1rem;
  text-align: left;
}
.profile-input-group label {
  display: block;
  font-size: 0.8rem;
  color: #cbd5f5;
  margin-bottom: 0.3rem;
}
.profile-input-group input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #020617;
  color: #f9fafb;
  font-size: 0.9rem;
  outline: none;
}
.profile-input-group input:focus {
  border-color: #facc15;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.6);
}

/* MODALE OCH PLEIN ÉCRAN */
.modal-och-root {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(15, 23, 42, 0.95);
}
.modal-och {
  border-radius: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}
.modal-och-header {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: #020617;
}
.och-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.och-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #facc15;
}
.och-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.och-title {
  font-size: 1rem;
  font-weight: 700;
}

/* 🔎 Toujours lisible dans le bandeau OCH (même en mode jour) */
.modal-och-header .brand-title {
  color: #e5e7eb;
}

.och-return-btn {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  line-height: 1.2;
}
.och-return-btn:hover {
  background: #111827;
}
.close-btn {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.3rem;
  cursor: pointer;
}
.och-body {
  flex: 1;
  background: #020617;
  overflow: hidden;
}
.och-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* MODE JOUR (light-mode) */
body.light-mode {
  background: radial-gradient(circle at top, #e5e7eb 0%, #f9fafb 40%, #e5e7eb 100%);
  color: #0f172a;
}
body.light-mode .main-header {
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.9));
  border-bottom-color: rgba(148, 163, 184, 0.4);
}
body.light-mode .brand-title {
  color: #0f172a;
}
/* 🔎 Mais dans la modale OCH on garde du clair */
body.light-mode .modal-och-header .brand-title {
  color: #e5e7eb;
}

body.light-mode .user-name {
  color: #111827;
}
body.light-mode .app-subtitle {
  color: #4b5563;
}
body.light-mode .hamburger-btn {
  background: #e5e7eb;
  border-color: #cbd5f5;
}
body.light-mode .hamburger-btn span {
  background: #0f172a;
}
body.light-mode .nav-menu {
  background: #f9fafb;
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.8);
}
body.light-mode .nav-item {
  background: #e5e7eb;
  color: #0f172a;
}
body.light-mode .nav-item:hover {
  background: #d1d5db;
}
body.light-mode .profile-card {
  background: #f9fafb;
  color: #0f172a;
  box-shadow: 0 12px 30px rgba(148, 163, 184, 0.6);
}
body.light-mode .profile-add {
  border-color: #cbd5f5;
}
body.light-mode .modal-content {
  background: #f9fafb;
  color: #0f172a;
}
body.light-mode .modal-text,
body.light-mode .profile-modal-subtitle {
  color: #4b5563;
}
body.light-mode .profile-input-group label {
  color: #4b5563;
}
body.light-mode .profile-input-group input {
  background: #f9fafb;
  color: #0f172a;
  border-color: #cbd5f5;
}

/* Rails de saisons en mode jour : fond clair, plus de bloc sombre */
body.light-mode .seasons-section {
  background: transparent;
  border-radius: 0;
  padding: 1.5rem 1.25rem 0;
}

/* Titres & textes de saison lisibles sur fond clair */
body.light-mode .section-header h2 {
  color: #0f172a;
}
body.light-mode .section-header p {
  color: #4b5563;
}

/* Cartes d'épisodes : léger gris + ombre douce */
body.light-mode .episode-card {
  background: #f9fafb;
  border-color: #e5e7eb;
  box-shadow: 0 10px 22px rgba(148, 163, 184, 0.6);
}

body.light-mode .hero-text {
  color: #e5e7eb;
}
body.light-mode .episode-body p {
  color: #4b5563;
}
body.light-mode .primary-btn.secondary-variant {
  background: #ffffff;
  color: #111827;
  border-color: #cbd5f5;
}
body.light-mode .och-return-btn {
  background: #e5e7eb;
  color: #0f172a;
  border-color: #cbd5f5;
}
body.light-mode .och-return-btn:hover {
  background: #d1d5db;
}

/* MODE DYS : police & lisibilité renforcée (OpenDyslexic) */
body.dys-mode {
  font-family: "OpenDyslexic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
}

body.dys-mode .app-title,
body.dys-mode .hero-title {
  letter-spacing: 0.06em;
}

body.dys-mode .hero-text,
body.dys-mode .modal-text,
body.dys-mode .profile-modal-subtitle,
body.dys-mode .episode-body p,
body.dys-mode .section-header p,
body.dys-mode .app-subtitle {
  line-height: 1.6;
}

body.dys-mode .modal-text,
body.dys-mode .episode-body p {
  font-size: 0.95rem;
}

/* Sur écrans larges, on réduit un peu la taille DYS (sans toucher au mobile) */
@media (min-width: 768px) {
  body.dys-mode .modal-text,
  body.dys-mode .episode-body p,
  body.dys-mode .section-header p,
  body.dys-mode .app-subtitle,
  body.dys-mode .hero-text {
    font-size: 0.9rem;
  }
}

/* Fin mode DYS */

@media (min-width: 768px) {
  .hero {
    min-height: 280px;
    margin-top: 1.5rem;
  }
  .hero-title { font-size: 2.1rem; }
  .episodes-row { gap: 1rem; }
}
