/* ────────────────────────────────────────────────────────────────
   Vidéothèque — esprit « Club Dorothée » épuré
   Ciel azur + nuages · encarts blancs nets · logo arc-en-ciel
   ──────────────────────────────────────────────────────────────── */

:root {
    --sky-top: #2f93ef;
    --sky-mid: #79bdff;
    --sky-low: #d3ebff;

    --ink:   #1c2b4a;
    --azure: #1f8fff;
    --card:  #ffffff;
    --muted: #5b6b86;

    --pink:#ff2e88; --blue:#2db8ff; --yellow:#ffd000; --green:#34d977; --orange:#ff7a1a; --purple:#a855f7;

    --display: "Lilita One", system-ui, sans-serif;
    --body:    "Fredoka", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

    --radius: 10px;
    --maxw:   1180px;
    --rainbow: linear-gradient(95deg, var(--pink), var(--orange), var(--yellow), var(--green), var(--blue), var(--purple));
    --panel-shadow: 0 14px 30px rgba(20, 45, 90, 0.18);
}

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

body {
    margin: 0;
    font-family: var(--body);
    font-weight: 500;
    color: var(--ink);
    background:
        radial-gradient(58% 38% at 18% 16%, rgba(255,255,255,0.95), rgba(255,255,255,0) 62%),
        radial-gradient(48% 32% at 76% 11%, rgba(255,255,255,0.85), rgba(255,255,255,0) 62%),
        radial-gradient(46% 30% at 52% 30%, rgba(255,255,255,0.70), rgba(255,255,255,0) 62%),
        linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 46%, var(--sky-low) 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, Menlo, monospace; }

/* ── Logo arc-en-ciel ─────────────────────────────────────────── */
.gate__mark,
.topbar__mark {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.01em;
    text-transform: none;
    white-space: nowrap;
    background: var(--rainbow);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 3px var(--ink);
    paint-order: stroke fill;
    filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.18));
}
.gate__mark   { font-size: clamp(2.4rem, 9vw, 4.4rem); -webkit-text-stroke-width: 4px; transform: rotate(-3deg); }
.topbar__mark { font-size: clamp(1.2rem, 4vw, 1.7rem); -webkit-text-stroke-width: 2px; }

/* ── Boutons ──────────────────────────────────────────────────── */
.btn {
    font-family: var(--display);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: var(--azure);
    border: none;
    border-radius: var(--radius);
    padding: 0.85rem 1.9rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(31, 143, 255, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover  { background: #0f7be8; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(31, 143, 255, 0.45); }
.btn:active { transform: translateY(0); }

:focus-visible { outline: 3px solid var(--azure); outline-offset: 3px; border-radius: 8px; }

.link-quiet {
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 6px rgba(20, 45, 90, 0.35);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.link-quiet:hover { color: var(--sky-low); }

.empty {
    color: #fff;
    text-align: center;
    line-height: 1.7;
    max-width: 46ch;
    margin: 2rem auto;
    text-shadow: 0 1px 8px rgba(20, 45, 90, 0.4);
}
.empty code { background: #fff; color: var(--ink); border-radius: 6px; padding: 0.05em 0.4em; text-shadow: none; }

/* ── Pages centrées ───────────────────────────────────────────── */
.screen-center {
    min-height: 100dvh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 2rem; gap: 2rem;
}

/* ── Porte d'entrée ───────────────────────────────────────────── */
.gate { display: flex; flex-direction: column; align-items: center; gap: 2.4rem; }
.gate__form {
    display: flex; flex-direction: column; gap: 1rem;
    width: min(360px, 88vw);
    background: var(--card);
    border-radius: 14px;
    padding: 1.9rem;
    box-shadow: var(--panel-shadow);
}
.gate__label { font-family: var(--display); font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.gate__input {
    font: inherit; font-weight: 500; color: var(--ink);
    background: #fff; border: 1.5px solid #c9d6e8; border-radius: 10px;
    padding: 0.8rem 0.9rem;
}
.gate__input:focus { outline: none; border-color: var(--azure); box-shadow: 0 0 0 3px rgba(31, 143, 255, 0.2); }
.gate__input.is-error { border-color: var(--pink); }
.gate__error { color: var(--pink); font-weight: 600; font-size: 0.9rem; margin: 0; }

/* ── Sélection de profil ──────────────────────────────────────── */
.profiles { display: flex; flex-direction: column; align-items: center; gap: 2.4rem; }
.profiles__title { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 6vw, 3.2rem); margin: 0; color: #fff; text-shadow: 0 2px 14px rgba(20, 45, 90, 0.4); }
.profiles__grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1.4rem, 5vw, 3rem); }
.profile { display: flex; flex-direction: column; align-items: center; gap: 0.85rem; }
.profile__avatar {
    width: clamp(100px, 22vw, 150px); aspect-ratio: 1;
    border-radius: 14px; overflow: hidden;
    background: var(--card); box-shadow: var(--panel-shadow);
    display: grid; place-items: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile__initial { font-family: var(--display); font-size: 3rem; color: var(--azure); }
.profile:hover .profile__avatar, .profile:focus-visible .profile__avatar { transform: translateY(-4px); box-shadow: 0 20px 38px rgba(20, 45, 90, 0.28); }
.profile__name { font-family: var(--display); font-size: 1.1rem; color: #fff; text-shadow: 0 1px 8px rgba(20, 45, 90, 0.4); }

/* ── Barre du haut ────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(20, 45, 90, 0.1);
}
.badge {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.28rem 0.9rem 0.28rem 0.3rem;
    border-radius: 999px; background: #fff;
    border: 1px solid rgba(20, 45, 90, 0.12);
    box-shadow: 0 4px 12px rgba(20, 45, 90, 0.12);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.badge:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(20, 45, 90, 0.18); }
.badge__name { font-family: var(--display); font-size: 0.95rem; color: var(--ink); }
.badge__avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: #eef4fc; display: grid; place-items: center; }
.badge__avatar img { width: 100%; height: 100%; object-fit: cover; }
.badge__avatar .profile__initial { font-size: 1.2rem; }

/* ── Bibliothèque ─────────────────────────────────────────────── */
.library { max-width: var(--maxw); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 4rem; }
.library__title { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 1.6rem; color: #fff; text-shadow: 0 2px 14px rgba(20, 45, 90, 0.4); }
.series-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: clamp(1.2rem, 3vw, 1.8rem); }
.card { display: block; border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--panel-shadow); transition: transform 0.14s ease, box-shadow 0.14s ease; }
.card:hover, .card:focus-visible { transform: translateY(-5px); box-shadow: 0 22px 42px rgba(20, 45, 90, 0.28); }
.card__poster { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(160deg, #9fd0ff, #e0f0ff); }
.card__poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__noposter { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; text-align: center; font-family: var(--display); color: var(--ink); opacity: 0.65; }
.card__play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; color: #fff; background: rgba(28, 43, 74, 0.35); opacity: 0; transition: opacity 0.15s ease; }
.card:hover .card__play, .card:focus-visible .card__play { opacity: 1; }
.card__body { display: block; padding: 0.85rem 1rem 1.1rem; }
.card__name { display: block; font-family: var(--display); font-size: 1.15rem; color: var(--ink); margin-bottom: 0.25rem; }
.card__meta { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 0.6rem; }
.reel { display: block; height: 8px; border-radius: 999px; background: #e6eefa; overflow: hidden; }
.reel__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--azure), #56b0ff); transition: width 0.4s ease; }

/* ── Lecteur ──────────────────────────────────────────────────── */
.player { max-width: 1100px; margin: 0 auto; padding: 0 clamp(0.8rem, 3vw, 2rem) 3rem; }
.player__bar { display: flex; align-items: center; gap: 1rem; padding: 0.9rem 0; }
.player__back { font-family: var(--display); color: #fff; font-size: 1rem; text-shadow: 0 1px 6px rgba(20, 45, 90, 0.4); white-space: nowrap; }
.player__back:hover { color: var(--sky-low); }
.player__series { flex: 1; min-width: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.2rem, 4vw, 1.9rem); margin: 0; color: #fff; text-shadow: 0 2px 12px rgba(20, 45, 90, 0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player__stage { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; box-shadow: var(--panel-shadow); }
.player__video { width: 100%; height: 100%; display: block; background: #000; }
.player__overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; border: none; cursor: pointer; background: radial-gradient(circle at 50% 50%, rgba(31, 143, 255, 0.18), transparent 60%), rgba(0, 0, 0, 0.35); }
.player__overlay.is-hidden { display: none; }
.player__play { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; color: #fff; background: var(--azure); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); padding-left: 6px; transition: transform 0.15s ease; }
.player__overlay:hover .player__play { transform: scale(1.08); }

.player__nav { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.9rem 0 0; color: #fff; font-size: 0.95rem; text-shadow: 0 1px 6px rgba(20, 45, 90, 0.4); }
.player__step { font-weight: 600; }
.player__step:not(.is-off):hover { color: var(--sky-low); }
.player__step.is-off { opacity: 0.4; cursor: default; }
.player__now { flex: 1; text-align: center; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player__now strong { font-weight: 700; }

.episodes { margin-top: 1.8rem; }
.episodes__title { display: flex; align-items: center; gap: 0.5rem; font-family: var(--display); font-weight: 400; font-size: 1.1rem; color: #fff; text-shadow: 0 1px 8px rgba(20, 45, 90, 0.4); margin: 0 0 0.8rem; }
.episodes__count { font-family: var(--body); font-size: 0.75rem; font-weight: 600; background: rgba(255, 255, 255, 0.92); color: var(--ink); border-radius: 999px; padding: 0.05rem 0.55rem; }
.episodes__track { list-style: none; margin: 0; padding: 0 0 0.6rem; display: flex; gap: 0.7rem; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.episodes__track > li { scroll-snap-align: start; flex: 0 0 auto; }
.ep { position: relative; display: block; width: 178px; height: 116px; border-radius: 10px; overflow: hidden; background-color: #33507d; background-size: cover; background-position: center; box-shadow: 0 8px 18px rgba(20, 45, 90, 0.16); border: 2px solid transparent; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.ep::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 16, 34, 0.92), rgba(8, 16, 34, 0.15) 58%, rgba(8, 16, 34, 0) 100%); }
.ep:hover { transform: translateY(-3px); box-shadow: 0 14px 26px rgba(20, 45, 90, 0.28); }
.ep--thumb { background-image: var(--bg); }
.ep--cover { background-image: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)), var(--bg); }
.ep__index { position: absolute; top: 6px; left: 7px; z-index: 2; font-family: var(--display); font-size: 0.9rem; line-height: 1; color: #fff; background: rgba(0, 0, 0, 0.5); padding: 0.12rem 0.42rem; border-radius: 6px; }
.ep__caption { position: absolute; left: 8px; right: 8px; bottom: 7px; z-index: 2; }
.ep__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #fff; font-weight: 600; font-size: 0.82rem; line-height: 1.15; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.ep__status { display: block; margin-top: 0.15rem; font-size: 0.7rem; font-weight: 600; color: #d3e3ff; }
.ep--current { border-color: var(--azure); box-shadow: 0 12px 26px rgba(31, 143, 255, 0.4); }
.ep--current .ep__status { color: #8fd0ff; }
.ep--watched { opacity: 0.72; }
.ep--watched .ep__index { background: rgba(52, 217, 119, 0.85); }
.ep__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 4px; background: rgba(255, 255, 255, 0.25); }
.ep__fill { display: block; height: 100%; background: var(--azure); }

@media (max-width: 560px) {
    .player__series { font-size: 1.15rem; }
    .player__now { display: none; }
    .ep { width: 150px; height: 100px; }
}

/* ── Accessibilité ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── Lecteur : plein écran du conteneur + boutons façon Netflix ──── */
.player__stage:fullscreen,
.player__stage:-webkit-full-screen { aspect-ratio: auto; width: 100vw; height: 100vh; border-radius: 0; }
.player__stage:fullscreen .player__video,
.player__stage:-webkit-full-screen .player__video { object-fit: contain; }

.player__fs {
    position: absolute; top: 10px; right: 10px; z-index: 4;
    width: 40px; height: 40px; border: none; border-radius: 8px;
    display: grid; place-items: center; font-size: 1.15rem; color: #fff;
    background: rgba(0, 0, 0, 0.5); cursor: pointer; transition: background 0.12s ease;
}
.player__fs:hover { background: rgba(0, 0, 0, 0.78); }

.player__actions {
    position: absolute; right: 4%; bottom: 16%; z-index: 4;
    display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end;
    pointer-events: none;
}
.action {
    pointer-events: auto;
    font-family: var(--display); font-size: 0.95rem; letter-spacing: 0.02em;
    color: #fff; background: rgba(18, 18, 26, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 6px;
    padding: 0.6rem 1.15rem; cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}
.action:hover { background: #fff; color: #14131a; transform: translateY(-1px); }
.action--next { background: rgba(31, 143, 255, 0.92); border-color: #fff; }
.action--next:hover { background: #fff; color: var(--azure); }
.action.is-hidden { display: none; }

@media (max-width: 560px) {
    .player__actions { bottom: 12%; right: 3%; }
    .action { font-size: 0.85rem; padding: 0.5rem 0.85rem; }
}
