/* Films indep · style « océan » (même univers que la page d'accueil chezspil.tv) */
:root {
  --surface: #7fe3f0; --shallow: #1a8fb5; --mid: #0b4f7c; --deep: #062a4d; --abyss: #020b1a;
  --glass: rgba(255,255,255,.07); --glass-2: rgba(255,255,255,.12); --glass-line: rgba(255,255,255,.18);
  --text: #eaf8ff; --muted: rgba(234,248,255,.66); --faint: rgba(234,248,255,.42);
  --aqua: #7fe3f0; --aqua-2: #bff3ff; --amber: #ffc24b; --amber-glow: rgba(255,194,75,.55);
  --amiens: #ff9f7a; --amsterdam: #8fb8ff; --lodi: #9be7a8;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; overflow-x: hidden; color: var(--text); background: var(--abyss);
  font: 400 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--aqua-2); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- océan en fond */
.ocean { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, #0f6f93 0%, var(--mid) 18%, var(--deep) 46%, #03142a 72%, var(--abyss) 100%); }
.ocean .rays { position: absolute; inset: -10% -30% 35%; opacity: .32; mix-blend-mode: screen;
  background: repeating-conic-gradient(from 180deg at 50% -10%, rgba(255,255,255,0) 0deg 4deg,
    rgba(255,255,255,.16) 5deg 7deg, rgba(255,255,255,0) 8deg 13deg);
  -webkit-mask: linear-gradient(180deg, #000, transparent 80%); mask: linear-gradient(180deg, #000, transparent 80%);
  animation: sway 16s ease-in-out infinite alternate; transform-origin: 50% 0; }
@keyframes sway { from { transform: rotate(-4deg) scaleX(1.05); } to { transform: rotate(4deg) scaleX(.95); } }
.ocean canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------------------------------------------------------------- verre */
.glass { background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 18px 50px -24px rgba(0,8,24,.8), inset 0 1px 0 rgba(255,255,255,.14); }

/* ---------------------------------------------------------------- en-tête */
.top { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 12px 20px; border-width: 0 0 1px; border-radius: 0; background: rgba(4,21,43,.55); }
.brand { font: 300 24px/1 Fraunces, Georgia, serif; letter-spacing: -.01em; text-decoration: none; color: var(--text);
  white-space: nowrap; }
.brand b { font-weight: 600; background: linear-gradient(180deg, #fff, var(--aqua)); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.brand i { font-style: normal; color: var(--faint); margin: 0 6px; }
.tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 1px solid transparent; background: none; color: var(--muted); padding: 8px 16px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; font-weight: 500; transition: color .25s, background .25s, box-shadow .25s; }
.tabs button:hover { color: var(--text); background: var(--glass); }
.tabs button.active { color: #04152b; background: linear-gradient(180deg, #e9fdff, var(--aqua));
  box-shadow: 0 0 22px rgba(127,227,240,.55), inset 0 1px 0 #fff; }
.user { font-size: 13px; color: var(--muted); white-space: nowrap; }
.user #who { color: var(--text); font-weight: 600; }
.user a { color: var(--aqua-2); text-decoration: none; }
.user a:hover { text-decoration: underline; }
@media (max-width: 760px) {
  .top { padding: 10px 14px; gap: 8px 12px; }
  .brand { font-size: 20px; }
  .tabs { order: 3; flex-basis: 100%; }
  .user { margin-left: auto; }
}

/* ---------------------------------------------------------------- filtres */
.wrap { width: min(1400px, 100%); margin: 0 auto; padding: 0 20px; }
@media (max-width: 760px) { .wrap { padding: 0 12px; } }
#filters { margin: 18px auto 0; padding: 14px; border-radius: var(--radius); display: grid; gap: 12px; }
.searchrow { display: flex; gap: 10px; flex-wrap: wrap; }
.searchrow select { flex: 1 1 150px; min-width: 0; }
@media (min-width: 761px) { .searchrow select { flex: 0 1 220px; } }
.search { flex: 1 1 280px; position: relative; }
.search input, #addq { width: 100%; padding: 13px 16px 13px 44px; font-size: 16px; border-radius: 14px;
  border: 1px solid var(--glass-line); background: rgba(2,11,26,.45); color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s; }
.search input:focus, #addq:focus { border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(127,227,240,.15); }
.search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; stroke: var(--muted);
  fill: none; stroke-width: 2; }
select { padding: 11px 12px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(2,11,26,.45);
  color: var(--text); cursor: pointer; }
select option { background: #062a4d; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--glass-line); background: var(--glass); color: var(--muted);
  padding: 6px 13px; border-radius: 999px; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: all .2s; }
.chip:hover { color: var(--text); border-color: rgba(191,243,255,.5); }
.chip.on { color: #04152b; background: var(--aqua-2); border-color: var(--aqua-2); box-shadow: 0 0 16px rgba(127,227,240,.4); }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--glass-line); user-select: none; }
.toggle input { accent-color: var(--aqua); margin: 0; }
.toggle:has(input:checked) { color: var(--text); border-color: var(--aqua); background: rgba(127,227,240,.12); }

/* ---------------------------------------------------------------- titres de section */
#summary { color: var(--muted); margin: 22px 0 12px; font-size: 14px; }
#summary b { color: var(--text); font-weight: 600; }
#profile { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
#profile span { font-size: 12.5px; padding: 5px 12px; border-radius: 999px; color: var(--aqua-2);
  background: rgba(127,227,240,.08); border: 1px solid rgba(127,227,240,.35);
  box-shadow: 0 0 14px rgba(127,227,240,.18), inset 0 0 10px rgba(127,227,240,.08); }

/* ---------------------------------------------------------------- héros « Pour moi » */
#hero { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 16px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding: 4px 2px 18px; margin-bottom: 8px; scrollbar-width: thin; }
@media (max-width: 760px) { #hero { grid-auto-columns: 86%; } }
.heroc { position: relative; scroll-snap-align: start; min-height: 260px; border-radius: 24px; overflow: hidden;
  border: 1px solid var(--glass-line); cursor: pointer; isolation: isolate; display: flex; align-items: flex-end;
  box-shadow: 0 26px 60px -24px rgba(0,8,24,.9); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.heroc:hover { transform: translateY(-6px); }
.heroc .bg { position: absolute; inset: -20px; z-index: -2; background-size: cover; background-position: center;
  filter: blur(22px) saturate(130%) brightness(.7); transform: scale(1.1); }
.heroc::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(2,11,26,.85) 0%, rgba(2,11,26,.35) 70%, transparent); }
.heroc .pos { width: 120px; flex: none; margin: 18px 0 18px 18px; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.6); align-self: center; }
.heroc .txt { padding: 18px; min-width: 0; }
.heroc .rank { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--aqua); }
.heroc h3 { font: 600 24px/1.1 Fraunces, Georgia, serif; margin: 6px 0 4px; }
.heroc .sub { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.heroc .because { font-size: 13.5px; color: var(--aqua-2); margin: 0; }

/* ---------------------------------------------------------------- grille d'affiches */
#grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(178px, 100%), 1fr)); gap: 26px 20px; padding-bottom: 30px; }
@media (max-width: 760px) { #grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; } }
.tile { position: relative; min-width: 0; cursor: pointer; outline: none; animation: rise .7s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
.frame { position: relative; aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; background: #0a2440;
  box-shadow: 0 16px 34px -16px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.06);
  transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s; transform-style: preserve-3d; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .6s; }
.frame img.ok { opacity: 1; }
.tile:hover .frame, .tile:focus-visible .frame {
  transform: translateY(-8px) rotateX(4deg) rotateY(var(--ry, -3deg)) scale(1.02);
  box-shadow: 0 30px 50px -18px rgba(0,0,0,.9), 0 0 0 1px rgba(191,243,255,.35), 0 0 34px rgba(127,227,240,.18); }
.frame .rated { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px; font-size: 12px;
  font-weight: 600; color: #2a1800; background: var(--amber); box-shadow: 0 0 14px var(--amber-glow); }
.frame .ext { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; font-size: 11px;
  background: rgba(2,11,26,.7); border: 1px solid var(--glass-line); color: var(--aqua-2); }
.overlay { position: absolute; inset: auto 0 0 0; padding: 40px 12px 12px; transform: translateY(101%);
  background: linear-gradient(180deg, transparent, rgba(2,11,26,.82) 32%, rgba(2,11,26,.95));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform .45s cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) { .tile:hover .overlay, .tile:focus-within .overlay { transform: none; } }
.overlay p { margin: 0 0 8px; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4;
  -webkit-box-orient: vertical; overflow: hidden; }
.overlay .g { color: var(--aqua-2); font-size: 11.5px; margin-bottom: 6px; }
.info { padding: 10px 2px 0; }
.info h3 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.info .sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cities { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.city { font-size: 10.5px; font-weight: 600; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px;
  color: #04152b; background: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); }
.city.Amiens { --c: var(--amiens); } .city.Amsterdam { --c: var(--amsterdam); } .city.Lodi { --c: var(--lodi); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--glass-line); color: var(--aqua-2); }
.badge.in { color: #04152b; background: var(--aqua-2); border-color: var(--aqua-2); }

/* affiche générée quand il n'y en a pas */
.ph { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px;
  background: linear-gradient(160deg, var(--a), var(--b)); }
.ph::before { content: ""; position: absolute; inset: 0; opacity: .35;
  background: radial-gradient(120px 80px at 75% 20%, rgba(255,255,255,.5), transparent 70%),
              repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 2px, transparent 2px 12px); }
.ph span { position: relative; font: 600 19px/1.12 Fraunces, Georgia, serif; color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,.45); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.ph small { position: relative; margin-top: 6px; font-size: 11px; color: rgba(255,255,255,.75); letter-spacing: .08em; text-transform: uppercase; }

/* ---------------------------------------------------------------- étoiles */
.stars { display: inline-flex; gap: 2px; }
.stars button { background: none; border: 0; padding: 2px; font-size: 22px; line-height: 1; cursor: pointer;
  color: rgba(234,248,255,.25); transition: color .15s, text-shadow .15s, transform .15s; }
.stars:hover button { color: var(--amber); text-shadow: 0 0 12px var(--amber-glow); }
.stars button:hover ~ button { color: rgba(234,248,255,.25); text-shadow: none; }
.stars button.on { color: var(--amber); text-shadow: 0 0 12px var(--amber-glow); }
.stars button:active { transform: scale(.85); }
.stars.lg button { font-size: 34px; padding: 3px; }
.stars.pulse { animation: pulse .6s ease-out; }
@keyframes pulse { 0% { filter: drop-shadow(0 0 0 var(--amber-glow)); transform: scale(1); }
  40% { filter: drop-shadow(0 0 14px var(--amber-glow)); transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------- fiche film (modale / feuille) */
dialog.sheet { width: min(920px, calc(100% - 32px)); max-height: calc(100svh - 48px); padding: 0; border-radius: 26px;
  color: var(--text); background: rgba(6,32,60,.72); overflow: auto; }
dialog.sheet::backdrop { background: rgba(1,6,16,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.sheet[open] { animation: pop .45s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(30px) scale(.97); } }
.sheet .in { display: grid; grid-template-columns: 300px 1fr; gap: 28px; padding: 28px; }
.sheet .big { aspect-ratio: 2/3; border-radius: 16px; overflow: hidden; position: relative; background: #0a2440;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.9); }
.sheet .big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet h2 { font: 600 clamp(26px, 4vw, 38px)/1.05 Fraunces, Georgia, serif; margin: 4px 0 6px; }
.sheet .orig { color: var(--muted); font-style: italic; margin: 0 0 12px; }
.sheet .facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.sheet .facts span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-line); }
.sheet .ovv { color: rgba(234,248,255,.86); margin: 0 0 16px; }
.sheet dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: 13.5px; }
.sheet dt { color: var(--faint); }
.sheet dd { margin: 0; }
.sheet .why { color: var(--aqua-2); font-size: 14px; margin: 0 0 12px; }
.sheet .scr { display: grid; gap: 6px; margin: 0 0 18px; }
.sheet .scr div { display: flex; gap: 8px; align-items: center; font-size: 13.5px; flex-wrap: wrap; }
.sheet .act { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--glass-line); }
.btn { border: 1px solid var(--glass-line); background: var(--glass); color: var(--text); padding: 9px 16px;
  border-radius: 999px; cursor: pointer; transition: all .2s; }
.btn:hover { border-color: var(--aqua); }
.close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--glass-line); background: rgba(2,11,26,.6); color: var(--text); font-size: 20px; cursor: pointer; z-index: 2; }
@media (max-width: 760px) {
  dialog.sheet { width: 100%; max-width: 100%; max-height: 92svh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  dialog.sheet[open] { animation: up .45s cubic-bezier(.2,.8,.2,1); }
  @keyframes up { from { transform: translateY(100%); } }
  .sheet .in { grid-template-columns: 1fr; padding: 8px 18px 28px; gap: 16px; }
  .sheet .big { width: 52%; margin: 0 auto; }
}

/* ---------------------------------------------------------------- ajouter un film */
#add { margin: 22px auto 40px; max-width: 820px; padding: 22px; border-radius: 24px; }
#add h2 { font: 600 28px/1.1 Fraunces, Georgia, serif; margin: 0 0 6px; }
#add .hint { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
#addres { margin-top: 16px; display: grid; gap: 10px; }
#addres .group { margin: 12px 0 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--aqua); }
.addrow { display: flex; gap: 14px; padding: 12px; border-radius: 16px; background: rgba(2,11,26,.35);
  border: 1px solid var(--glass-line); animation: rise .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 40ms); }
.addrow .p { width: 64px; flex: none; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; position: relative; background: #0a2440; }
.addrow .p img { width: 100%; height: 100%; object-fit: cover; display: block; }
.addrow .p .ph span { font-size: 11px; } .addrow .p .ph small { display: none; } .addrow .p .ph { padding: 6px; }
.addrow .body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.addrow h3 { margin: 0; font-size: 16px; }
.addrow .meta { margin: 0; font-size: 13px; color: var(--muted); }
.year { color: var(--muted); font-weight: 400; }
.saved { font-size: 12px; color: var(--aqua-2); min-height: 1em; }

/* ---------------------------------------------------------------- divers */
#sentinel { height: 1px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty b { display: block; font: 300 30px/1.2 Fraunces, Georgia, serif; color: var(--text); margin-bottom: 8px; }

/* ---------------------------------------------------------------- pages connexion / mot de passe */
.center { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.card { width: min(400px, 100%); padding: 34px 28px 28px; border-radius: 28px; animation: rise .9s cubic-bezier(.2,.8,.2,1) both; }
.card .eyebrow { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin: 0; text-align: center; }
.card h1 { font: 300 46px/1 Fraunces, Georgia, serif; text-align: center; margin: 10px 0 6px; }
.card h1 b { font-weight: 600; background: linear-gradient(180deg, #fff, var(--aqua)); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.card .sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.card input { width: 100%; padding: 13px 14px; font-size: 16px; border-radius: 14px; border: 1px solid var(--glass-line);
  background: rgba(2,11,26,.45); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s; }
.card input:focus { border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(127,227,240,.15); }
.card .go { width: 100%; margin-top: 24px; padding: 14px; font-size: 16px; font-weight: 600; border: 0; border-radius: 14px;
  color: #04152b; background: linear-gradient(180deg, #e9fdff, var(--aqua)); cursor: pointer;
  box-shadow: 0 0 26px rgba(127,227,240,.45); transition: transform .2s, box-shadow .2s; }
.card .go:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(127,227,240,.65); }
.card .go:disabled { opacity: .6; transform: none; cursor: default; }
.card .err { color: #ffb4a8; font-size: 14px; margin: 14px 0 0; min-height: 1.2em; text-align: center; }
.card .ok { color: var(--aqua-2); }
.card .back { display: block; text-align: center; margin-top: 16px; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
