/* ==========================================================================
   Portail Gandon Family
   Nuit bleutée + verre dépoli (glassmorphism), accent champagne.
   Plus Jakarta Sans pour l'interface, Cinzel réservé à la carte du mariage.
   ========================================================================== */

:root {
  --bg: #0a0d18;
  --glass: rgba(255, 255, 255, 0.065);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --glass-line: rgba(255, 255, 255, 0.15);
  --glass-highlight: rgba(255, 255, 255, 0.2);
  --text: #f1f3f9;
  --muted: #a8aec2;
  --accent: #b4c0ff;
  --gold: #efd39a;
  --gold-deep: #d2a655;
  --ok: #7fe0ab;
  --danger: #ff9a9a;
  --ink: #17120a;
  --radius: 24px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* Décor fixe derrière le verre : de grandes taches de lumière douces (le flou du verre a de quoi jouer) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(46% 42% at 8% 4%, rgba(79, 91, 214, 0.42), transparent 72%),
    radial-gradient(40% 38% at 96% 14%, rgba(34, 130, 160, 0.3), transparent 72%),
    radial-gradient(48% 36% at 78% 96%, rgba(201, 151, 74, 0.24), transparent 72%),
    radial-gradient(38% 34% at 6% 88%, rgba(94, 70, 170, 0.28), transparent 72%);
  pointer-events: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Verre dépoli (surface commune) ---------- */

.glass {
  border: 1px solid var(--glass-line);
  background: linear-gradient(160deg, var(--glass-strong), var(--glass));
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 24px 48px -30px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

/* Sans support du flou : un fond plus opaque garde le texte lisible */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass,
  .topbar {
    background: rgba(24, 28, 48, 0.94);
  }
}

/* ---------- Barre du haut ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgba(10, 13, 24, 0.55);
  border-bottom: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.brand img {
  width: 40px;
  height: 40px;
}

.brand__name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand__name span {
  color: var(--muted);
  font-weight: 500;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__actions form {
  display: contents;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status--on {
  color: var(--ok);
  background: rgba(127, 224, 171, 0.12);
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.25s,
    background 0.2s,
    border-color 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  color: var(--ink);
  background: linear-gradient(135deg, #f7e5b8, var(--gold-deep));
  box-shadow: 0 12px 28px -14px rgba(210, 166, 85, 0.8);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -14px rgba(210, 166, 85, 0.9);
}

.btn--ghost {
  background: var(--glass);
  border-color: var(--glass-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.btn--ghost:hover {
  background: var(--glass-strong);
  border-color: var(--accent);
}

.btn--small {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.875rem;
}

.btn--block {
  width: 100%;
}

/* ---------- Mise en page ---------- */

main {
  flex: 1;
  width: min(100% - 32px, 1120px);
  margin-inline: auto;
  padding-top: clamp(24px, 5vw, 56px);
}

/* ---------- Le mariage (en accès libre) ---------- */

.wedding {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  padding: clamp(20px, 3vw, 30px) clamp(22px, 4vw, 44px);
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

/* Lueur dorée dans un coin de la carte */
.wedding::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 120% at 0% 0%, rgba(239, 211, 154, 0.2), transparent 62%),
    radial-gradient(60% 100% at 100% 100%, rgba(79, 91, 214, 0.24), transparent 65%);
}

.wedding:hover {
  border-color: rgba(239, 211, 154, 0.55);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 30px 60px -32px rgba(210, 166, 85, 0.5);
}

.wedding__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.wedding__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 4px;
}

.wedding__eyebrow {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.wedding h1 {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #fff6dc 0%, var(--gold) 55%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wedding__tagline {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-style: italic;
  line-height: 1.2;
  color: var(--text);
}

.wedding__side {
  display: grid;
  justify-items: center;
  gap: 14px;
  flex: none;
}

/* Toute la carte est cliquable via le bouton */
.wedding__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.wedding__cta svg {
  transition: transform 0.25s var(--ease);
}

.wedding:hover .wedding__cta svg {
  transform: translateX(4px);
}

.wedding__crests {
  display: flex;
  gap: 16px;
}

.wedding__crests img {
  width: 40px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  transition: transform 0.35s var(--ease);
}

.wedding:hover .wedding__crests img {
  transform: translateY(-3px);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge--open {
  color: var(--ok);
  background: rgba(127, 224, 171, 0.14);
}

.badge--on {
  color: var(--accent);
  background: rgba(180, 192, 255, 0.14);
}

.badge--locked {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.09);
}

/* ---------- Sites privés ---------- */

.apps {
  display: grid;
  gap: 18px;
  padding-block: clamp(40px, 7vw, 72px) clamp(48px, 8vw, 88px);
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.apps__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px;
  border-radius: var(--radius);
  transition:
    transform 0.3s var(--ease),
    border-color 0.3s,
    box-shadow 0.3s;
}

.app:hover {
  transform: translateY(-4px);
  border-color: rgba(180, 192, 255, 0.55);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 26px 48px -26px rgba(120, 140, 255, 0.5);
}

.app__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  color: var(--accent);
  background: rgba(180, 192, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  flex: none;
}

.app__body {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.app__title {
  font-size: 1.25rem;
  font-weight: 800;
}

.app__text {
  color: var(--muted);
  font-size: 0.95rem;
}

.app__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
}

.app__cta svg {
  transition: transform 0.25s var(--ease);
}

.app:hover .app__cta svg {
  transform: translateX(4px);
}

.app--locked .app__icon {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.app--locked .app__cta {
  color: var(--text);
}

/* Carte à plusieurs versions (ludothèque : version 1 / version 2) */

.app--versions:hover {
  transform: none;
}

.app__versions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.version {
  display: inline-flex;
  flex: 1 1 130px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass);
  font-size: 0.92rem;
  font-weight: 700;
  transition:
    transform 0.2s var(--ease),
    background 0.2s,
    border-color 0.2s;
}

.version:hover {
  transform: translateY(-2px);
  background: var(--glass-strong);
  border-color: rgba(180, 192, 255, 0.6);
}

.version--new {
  border-color: rgba(239, 211, 154, 0.5);
}

.version__tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(239, 211, 154, 0.18);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Accès famille ---------- */

.access {
  display: grid;
  place-items: center;
  padding: 0 0 clamp(56px, 9vw, 110px);
}

.access__card {
  display: grid;
  gap: 14px;
  justify-items: center;
  width: min(100%, 460px);
  padding: clamp(26px, 5vw, 40px);
  border-radius: 30px;
  text-align: center;
}

.access__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  color: var(--gold);
  background: rgba(239, 211, 154, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.access__icon--on {
  color: var(--ok);
  background: rgba(127, 224, 171, 0.13);
}

.access__title {
  font-size: 1.5rem;
  font-weight: 800;
}

.access__text {
  color: var(--muted);
  font-size: 0.95rem;
}

.access__card form {
  width: 100%;
}

.login {
  display: grid;
  gap: 14px;
  margin-top: 6px;
  text-align: left;
}

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field__control {
  position: relative;
  display: block;
}

.field__control input {
  width: 100%;
  min-height: 52px;
  padding: 0 52px 0 18px;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: rgba(6, 8, 18, 0.45);
  font-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.field__control input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(239, 211, 154, 0.25);
}

.field__control input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field__toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  transform: translateY(-50%);
}

.field__toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.form-error {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 154, 154, 0.12);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Page « Livres dont vous êtes le héros » ---------- */

.page-head {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding-bottom: clamp(24px, 4vw, 40px);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text);
}

.page-head h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-head p {
  max-width: 60ch;
  color: var(--muted);
}

.books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  padding-bottom: clamp(48px, 8vw, 96px);
  list-style: none;
  padding-left: 0;
}

.book {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  transition:
    transform 0.3s var(--ease),
    border-color 0.3s,
    box-shadow 0.3s;
}

.book:hover {
  transform: translateY(-4px);
  border-color: rgba(239, 211, 154, 0.55);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 26px 48px -26px rgba(210, 166, 85, 0.45);
}

.book__cover {
  aspect-ratio: 2 / 3;
  background: linear-gradient(160deg, rgba(79, 91, 214, 0.35), rgba(201, 151, 74, 0.25));
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
}

.book__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 22px;
}

.book__title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
}

.book__summary {
  color: var(--muted);
  font-size: 0.93rem;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.book__meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.book__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 700;
}

.book__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.book--soon .book__cta {
  color: var(--muted);
}

.book--soon:hover {
  transform: none;
  border-color: var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 24px 48px -30px rgba(0, 0, 0, 0.7);
}

.empty {
  padding: 40px 24px;
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

/* ---------- Pied de page ---------- */

.footer {
  padding: 28px 16px 36px;
  border-top: 1px solid var(--glass-line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Petits écrans ---------- */

@media (max-width: 900px) {
  .wedding {
    flex-direction: column;
    align-items: flex-start;
  }
  .wedding__side {
    width: 100%;
    justify-items: start;
  }
  .wedding__cta {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .brand__name {
    font-size: 1rem;
  }
  .wedding {
    border-radius: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Livres : cartes de séries et Hall of Fame ---------- */
.series__card {
  text-decoration: none;
  color: inherit;
}

.hof {
  padding-bottom: clamp(48px, 8vw, 96px);
}

.hof__title {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--gold);
}

.hof__lead,
.hof__note {
  margin: 0 0 18px;
  color: var(--muted);
}

.hof__note {
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.hof__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  align-items: start;
}

.hof__card {
  padding: 22px 24px;
  border-radius: var(--radius);
}

.hof__card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--accent);
}

.hof__card--dead h3 {
  color: var(--danger);
}

.hof__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hof__list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--glass-line);
}

.hof__list li:first-child {
  border-top: 0;
}

.hof__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hof__who small {
  color: var(--muted);
  font-size: 0.8rem;
}

.hof__score {
  flex: none;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.hof__card--dead .hof__score {
  color: var(--muted);
}

/* ---------- Hall of Fame : podium ---------- */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 24px;
}

.podium__step {
  position: relative;
  flex: 1 1 0;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px 12px;
  text-align: center;
  border: 1px solid var(--glass-line);
  border-radius: 18px 18px 6px 6px;
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
}

.podium__step--1 {
  min-height: 210px;
  border-color: rgba(245, 197, 66, 0.6);
  box-shadow: 0 0 40px -12px rgba(245, 197, 66, 0.55);
}

.podium__step--2 {
  min-height: 170px;
  border-color: rgba(207, 214, 228, 0.5);
}

.podium__step--3 {
  min-height: 140px;
  border-color: rgba(205, 127, 50, 0.55);
}

.podium__name {
  margin-top: 6px;
  font-weight: 800;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.podium__pts {
  color: var(--gold);
  font-weight: 700;
}

.podium__books {
  color: var(--muted);
  font-size: 0.8rem;
}

.podium__rank {
  margin-top: auto;
  padding-top: 8px;
  font-size: 1.6rem;
  font-weight: 800;
  opacity: 0.35;
}

.hof__top {
  margin-bottom: 22px;
}

@media (max-width: 520px) {
  .podium {
    gap: 6px;
  }
  .podium__step {
    padding: 12px 4px 10px;
  }
  .podium__name {
    font-size: 0.9rem;
  }
}

/* Tuile avec bouton d'administration (visible seulement une fois connecté avec le mot de passe famille) */
.app-cell { position: relative; display: flex; }
.app-cell > .app { flex: 1; min-width: 0; }
.app__admin {
  position: absolute;
  top: 26px;
  left: 92px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  background: rgba(180, 192, 255, 0.14);
  border: 1px solid rgba(180, 192, 255, 0.35);
  z-index: 2;
  transition: background 0.2s, border-color 0.2s;
}
.app__admin:hover { background: rgba(180, 192, 255, 0.28); border-color: rgba(180, 192, 255, 0.7); }

.app__admin--hof { left: 196px; }
