/* Pellicule — thème « Pop », identique à l'app (mobile/src/theme.js).
   Clair par défaut ; sombre avec <html data-theme="dark"> (bouton de l'accueil, mémorisé). */
:root {
  /* couleurs vives (communes aux deux thèmes) */
  --accent: #3A5BFF;
  --accent-deep: #2440E0;
  --accent-ink: #FFFFFF;
  --danger: #E5243B;
  --ok: #1FB86A;
  --pink: #FF4FA3;
  --yellow: #FFD23F;
  --green: #1FB86A;
  --violet: #7B2FF7;
  --ink: #111114;

  /* thème clair */
  --bg: #FFFFFF;
  --bg2: #FAFAFC;
  --surface: #F4F4F8;
  --surface2: #EAEAF0;
  --card: #FFFFFF;
  --line: #E3E3EA;
  --text: #111114;
  --muted: #5E5E66;
  --faint: #8A8A94;
  --accent-soft: rgba(58, 91, 255, .10);
  --accent-text: #3A5BFF;
  --danger-text: #C81E3A;
  --danger-soft: #FFE3E8;
  --inverse: #111114;
  --on-inverse: #FFFFFF;
  --floating: #111114;

  --radius: 24px;
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', cursive;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'Courier New', monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E0E13;
  --bg2: #15151C;
  --surface: #1B1B23;
  --surface2: #262630;
  --card: #24242E;
  --line: #30303C;
  --text: #F5F5FA;
  --muted: #A6A6B3;
  --faint: #70707C;
  --accent-soft: rgba(91, 120, 255, .20);
  --accent-text: #93A5FF;
  --danger-text: #FF8A97;
  --danger-soft: #3A1A22;
  --inverse: #F5F5FA;
  --on-inverse: #111114;
  --floating: #2A2A35;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--accent-text); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; margin: 0 0 .4em; }
h1 { font-size: 34px; line-height: 38px; letter-spacing: -.8px; }
h2 { font-size: 22px; line-height: 26px; letter-spacing: -.3px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.center { text-align: center; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 20px 48px; }
.wrap-wide { max-width: 1100px; }
.stack > * + * { margin-top: 16px; }
.kicker { color: var(--accent-text); font: 700 12px/1.3 var(--font-body); letter-spacing: 1.2px; text-transform: uppercase; margin: 0 0 6px; }

/* ---- en-tête (comme l'app : retour à gauche, action à droite) ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; padding: 10px 20px; max-width: 1100px; margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); font: 800 28px/1 var(--font-display); letter-spacing: -.5px; }
.logo img { display: none; }
.logo::after { content: ''; width: 18px; height: 18px; background: var(--yellow); -webkit-mask: var(--sparkle) center / contain no-repeat; mask: var(--sparkle) center / contain no-repeat; }
:root { --sparkle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.6 7.4L22 11l-7.4 2.6L12 21l-2.6-7.4L2 11l7.4-2.6z'/%3E%3C/svg%3E"); }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-left: -6px; color: var(--text); text-decoration: none; font: 600 17px var(--font-body); }
.back svg { width: 26px; height: 26px; }

/* ---- boutons ---- */
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 22px; border-radius: 999px;
  font: 700 17px var(--font-body); text-align: center;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 12px rgba(58, 91, 255, .3);
  transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--text); box-shadow: none; }
:is(.card, .join-card) .btn-ghost { background: var(--bg); }
.btn-dark { background: var(--inverse); color: var(--on-inverse); box-shadow: none; }
.btn-light { background: #FFFFFF; color: var(--accent); box-shadow: none; }
.btn-outline { background: transparent; color: #FFFFFF; border: 2px solid #FFFFFF; box-shadow: none; }
.btn-danger { background: var(--danger-soft); color: var(--danger-text); box-shadow: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.icon-btn {
  appearance: none; border: 0; cursor: pointer; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--surface); color: var(--text); text-decoration: none;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.dark { background: rgba(0, 0, 0, .38); color: #FFFFFF; backdrop-filter: blur(8px); }
.theme-toggle { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--text); font: 600 13px var(--font-body); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ---- cartes, formulaires ---- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.card > * + * { margin-top: 14px; }
.card h2 { margin: 0; }
label { display: block; font: 700 15px var(--font-body); margin-bottom: 8px; }
.hint { display: block; font: 400 13px/1.4 var(--font-body); color: var(--muted); margin-top: 8px; }
input[type=text], input[type=email], input[type=datetime-local], textarea, select {
  width: 100%; padding: 13px 16px; border-radius: 16px;
  background: var(--surface); color: var(--text); border: 2px solid var(--surface);
  font: 17px var(--font-body);
}
/* dans une carte grise : champ de la couleur du fond (comme dans l'app) */
:is(.card, .join-card) :is(input[type=text], input[type=email], input[type=datetime-local], textarea) { background: var(--bg); border-color: var(--bg); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); background: var(--card); }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
textarea { min-height: 140px; resize: vertical; font-size: 15px !important; line-height: 1.6; }
.error { color: var(--danger-text); font: 600 14px var(--font-body); margin: 8px 0 0; min-height: 1.2em; }
.error:empty { min-height: 0; margin: 0; }
.consent { color: var(--muted); font-size: 12px; line-height: 17px; text-align: center; margin: 8px 0 0; }
.consent a, .footer a { color: var(--text); }

/* sections numérotées (création) */
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: -6px; }
.section-head .num { color: var(--accent-text); font: 700 12px var(--font-mono); }
.section-head label { margin: 0; }

/* puces */
.segmented { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  appearance: none; cursor: pointer; border: 0; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 15px; border-radius: 999px; max-width: 260px;
  background: var(--surface); color: var(--text); font: 700 14px var(--font-body); white-space: nowrap;
}
.card .chip { background: var(--card); }
.chip[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
/* poses : grandes cases comme dans l'app */
#shots { flex-wrap: nowrap; }
#shots .chip { flex: 1; height: auto; flex-direction: column; justify-content: center; gap: 0; padding: 12px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font: 800 24px/1.1 var(--font-display); }
#shots .chip::after { content: 'poses'; font: 600 12px var(--font-body); color: var(--muted); }
#shots .chip[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#shots .chip[aria-pressed=true]::after { color: var(--accent-ink); }

/* choix de la pellicule */
.stocks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stock { position: relative; margin: 0; }
.stock input { position: absolute; opacity: 0; inset: 0; }
.stock span { display: block; height: 100%; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 400; }
.stock b { display: block; font: 700 15px var(--font-body); color: var(--text); }
.stock small { color: var(--muted); font-size: 12px; }
.stock .swatch { display: block; height: 44px; border-radius: 10px; margin-bottom: 10px; }
.stock input:checked + span { border: 2px solid var(--accent); padding: 11px; background: var(--accent-soft); }
.stock input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.sw-doree  { background: linear-gradient(90deg, #3b1d0e, #b5652b, #f1c27d, #fbe7c2); }
.sw-douce  { background: linear-gradient(90deg, #4a5650, #9fb3a8, #e9d6c6, #f6eee6); }
.sw-argent { background: linear-gradient(90deg, #0d0d0d, #575757, #b5b5b5, #f2f2f2); }
.sw-flash  { background: linear-gradient(90deg, #05070d, #1d2a44, #7c6fa8, #e8e3f2); }

/* pastilles d'info */
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); color: var(--text); font: 600 13px var(--font-body); }
.pill svg { width: 14px; height: 14px; }
.pill.c0 { background: var(--pink); color: var(--ink); }
.pill.c1 { background: var(--yellow); color: var(--ink); }
.pill.c2 { background: var(--green); color: var(--ink); }
.pill.c3 { background: var(--violet); color: #FFFFFF; }

/* polaroïds décoratifs (deux aplats de couleur, ou une vraie photo) */
.polaroid { display: inline-block; background: #FFFFFF; border-radius: 4px; padding: 7px 7px 18px; box-shadow: 0 8px 14px rgba(0, 0, 0, .18); }
.polaroid .ph { display: block; width: 92px; height: 92px; border-radius: 2px; background: linear-gradient(var(--a, var(--accent)) 60%, var(--b, var(--violet)) 60%); object-fit: cover; }
.polaroid .cap { display: block; font: 700 18px/1.1 var(--font-hand); color: var(--ink); text-align: center; margin-top: 4px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.polaroid.captioned { padding-bottom: 7px; }
.deco { position: relative; height: 150px; width: 230px; margin: 4px auto 6px; }
.deco .polaroid { position: absolute; }
.deco .p1 { left: 8px; top: 14px; transform: rotate(-9deg); }
.deco .p2 { right: 8px; top: 0; transform: rotate(8deg); }
.deco .spark { position: absolute; left: 104px; top: -4px; width: 20px; height: 20px; background: var(--yellow); -webkit-mask: var(--sparkle) center / contain no-repeat; mask: var(--sparkle) center / contain no-repeat; }

/* compte à rebours en tuiles colorées */
.tiles { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tile { min-width: 66px; padding: 14px 6px; border-radius: 18px; text-align: center; color: var(--ink); }
.tile b { display: block; font: 800 32px/36px var(--font-display); }
.tile small { font: 700 12px var(--font-body); }
.tile:nth-child(4n+1) { background: var(--pink); }
.tile:nth-child(4n+2) { background: var(--yellow); }
.tile:nth-child(4n+3) { background: var(--green); }
.tile:nth-child(4n+4) { background: var(--violet); color: #FFFFFF; }

/* une barre par pose */
.ticks { display: flex; flex-wrap: wrap; gap: 3px; }
.ticks i { width: 4px; height: 12px; border-radius: 2px; background: rgba(0, 0, 0, .16); }
.ticks i.on { background: currentColor; }

/* ---- accueil (comme l'écran d'accueil de l'app) ---- */
.question { font: 800 30px/34px var(--font-display); letter-spacing: -.6px; margin: 14px 0 18px; }
.action { position: relative; border-radius: 28px; padding: 18px; overflow: hidden; margin-bottom: 16px; }
.action > * + * { margin-top: 16px; }
.action-head { display: flex; align-items: center; gap: 14px; }
.action-icon { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; flex: none; }
.action-icon svg { width: 26px; height: 26px; }
.action-kicker { font: 700 12px var(--font-body); letter-spacing: 1.2px; }
.action-title { font: 800 24px/27px var(--font-display); letter-spacing: -.4px; margin-top: 2px; }
.action-join { background: var(--accent); color: #FFFFFF; }
.action-join .action-icon { background: rgba(255, 255, 255, .18); }
.action-join .action-kicker { color: rgba(255, 255, 255, .85); }
.action-join .spark { position: absolute; top: 18px; right: 20px; width: 18px; height: 18px; background: var(--yellow); -webkit-mask: var(--sparkle) center / contain no-repeat; mask: var(--sparkle) center / contain no-repeat; }
.action-join p { color: rgba(255, 255, 255, .9); font-size: 14px; margin: 0; }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; min-width: 0; background: #FFFFFF !important; border-color: #FFFFFF !important; color: var(--ink) !important; font: 700 18px var(--font-body); letter-spacing: 2px; text-transform: uppercase; }
.code-row input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 16px; }
.code-row button { width: 54px; flex: none; border: 0; border-radius: 16px; background: #FFFFFF; color: var(--accent); cursor: pointer; display: grid; place-items: center; }
.code-err { background: var(--card); border-radius: 12px; padding: 10px; }
.action-create { display: block; background: var(--yellow); color: var(--ink); text-decoration: none; }
.action-create:active { transform: scale(.99); }
.action-create .action-icon { background: var(--ink); color: var(--yellow); }
.action-create .polaroid { position: absolute; right: 18px; top: 16px; transform: rotate(10deg); padding: 4px 4px 12px; }
.action-create .polaroid .ph { width: 56px; height: 56px; --a: var(--pink); --b: var(--violet); }
.action-create .head-text { padding-right: 64px; }
.action-create p { font: 500 14px/20px var(--font-body); margin: 0; }
.create-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 999px; background: var(--ink); color: #FFFFFF; font: 700 16px var(--font-body); }
.section-title { font: 800 24px var(--font-display); letter-spacing: -.4px; margin: 14px 0 12px; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px 20px 12px; margin: 0 -20px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.live-card { flex: 0 0 232px; height: 158px; border-radius: 26px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; color: var(--ink); }
.live-card.c3 { color: #FFFFFF; }
.live-card .nm { font: 700 15px var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-card small { font: 600 12px var(--font-body); opacity: .85; display: block; }
.live-card .cd { font: 800 30px/33px var(--font-display); letter-spacing: -.5px; }
.live-card .left { display: flex; align-items: center; gap: 10px; font: 700 13px var(--font-body); }
.c0 { background: var(--pink); } .c1 { background: var(--yellow); } .c2 { background: var(--green); } .c3 { background: var(--violet); }
.polaroid-row { gap: 22px; padding: 12px 26px 16px; margin: 0 -20px; }
.polaroid-row a { text-decoration: none; flex: none; }
.polaroid-row a:nth-child(4n+1) .polaroid { transform: rotate(-6deg); }
.polaroid-row a:nth-child(4n+2) .polaroid { transform: rotate(4deg); }
.polaroid-row a:nth-child(4n+3) .polaroid { transform: rotate(-3deg); }
.polaroid-row a:nth-child(4n+4) .polaroid { transform: rotate(5deg); }
.list { background: var(--surface); border-radius: 22px; overflow: hidden; }
.list a { display: flex; align-items: center; gap: 12px; padding: 13px 16px; text-decoration: none; color: var(--text); }
.list a + a { border-top: 1px solid var(--line); }
.list .row-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--ink); }
.list .row-icon svg { width: 16px; height: 16px; }
.list .row-name { font: 600 16px var(--font-body); }
.list .row-sub { color: var(--muted); font-size: 13px; }
.list .chev { margin-left: auto; color: var(--faint); }
.empty-home { text-align: center; color: var(--muted); padding-top: 12px; }
.recover-link { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin-top: 12px; color: var(--muted); font: 600 13px var(--font-body); }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 32px; line-height: 2.4; }

/* pages légales (confidentialité, conditions) */
.legal { max-width: 720px; line-height: 1.6; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { font-size: 20px; margin: 32px 0 8px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 6px; }

/* ---- organisateur ---- */
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.status .dot.ok { background: var(--ok); }
.orga-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--yellow); color: var(--ink); font: 600 13px var(--font-body); }
.ticket { position: relative; background: var(--accent); border-radius: 28px; padding: 22px 24px; text-align: center; color: #FFFFFF; overflow: hidden; }
.ticket .t-kicker { font: 700 12px var(--font-body); letter-spacing: 1.6px; margin-bottom: 14px; }
.qr-box { background: #FFFFFF; border-radius: 20px; padding: 10px; width: 240px; max-width: 100%; margin: 0 auto; }
.qr-box img { width: 100%; height: auto; }
.perforation { position: relative; height: 28px; margin: 10px -24px; display: flex; align-items: center; }
.perforation::before, .perforation::after { content: ''; position: absolute; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); top: 0; }
.perforation::before { left: -14px; } .perforation::after { right: -14px; }
.perforation i { flex: 1; margin: 0 24px; border-top: 2px dashed rgba(255, 255, 255, .45); }
.ticket .t-label { font: 700 12px var(--font-body); letter-spacing: 1.6px; color: rgba(255, 255, 255, .85); }
.code-badge { font: 800 38px var(--font-display); letter-spacing: 6px; margin-top: 2px; color: #FFFFFF; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { border-radius: 20px; padding: 14px 8px; text-align: center; color: var(--ink); }
.stat:nth-child(1) { background: var(--pink); } .stat:nth-child(2) { background: var(--yellow); } .stat:nth-child(3) { background: var(--green); }
.stat b { display: block; font: 800 26px/30px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat small { font: 400 12px var(--font-body); }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font: 13px var(--font-mono); padding: 10px 12px; }
.guest-list { list-style: none; padding: 0; margin: 0; }
.guest-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.guest-list .g-name { font: 500 15px var(--font-body); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 700 15px var(--font-body); }
.bar { height: 5px; background: var(--surface2); border-radius: 3px; margin-top: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.link-danger { background: none; border: 0; padding: 6px 0; color: var(--danger-text); font: 600 13px var(--font-body); text-decoration: underline; cursor: pointer; }
.danger-text { color: var(--danger-text); font: 600 13px var(--font-body); }
.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.report-list img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; flex: none; background: var(--surface2); }
.report-list .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.warning { padding: 12px 14px; background: var(--accent-soft); border-radius: 14px; font-size: 14px; color: var(--text); }
.danger-card h2 { display: flex; align-items: center; gap: 10px; }
.danger-card h2 svg { color: var(--danger); }

/* ---- appareil photo (écran volontairement sombre, comme dans l'app) ---- */
.camera-page { background: #000; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; color: #FFFFFF; }
.cam-top { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: linear-gradient(rgba(0, 0, 0, .75), transparent); }
.cam-top .name { font: 800 18px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-top .countdown { display: flex; align-items: center; gap: 5px; font: 400 12px var(--font-mono); color: #FFFFFF; opacity: .85; white-space: nowrap; margin-top: 2px; }
.cam-top .countdown::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.viewfinder { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; background: #000; overflow: hidden; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; }
.viewfinder video.mirror { transform: scaleX(-1); }
.grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.6s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-6%, 4%); } 50% { transform: translate(4%, -6%); } 75% { transform: translate(-3%, -2%); } }
.vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 140px rgba(0, 0, 0, .6); }
.flash { position: absolute; inset: 0; background: #FFFFFF; opacity: 0; pointer-events: none; z-index: 4; }
.flash.on { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }

/* aperçus CSS des pellicules (le rendu final est calculé à la prise de vue) */
.pv-doree  { filter: sepia(.28) saturate(1.25) contrast(1.06) brightness(1.02); }
.pv-douce  { filter: saturate(.78) contrast(.9) brightness(1.08) hue-rotate(-6deg); }
.pv-argent { filter: grayscale(1) contrast(1.25); }
.pv-flash  { filter: contrast(1.3) saturate(1.1) brightness(.95); }

.challenge {
  position: absolute; left: 12px; right: 12px; top: 12px; z-index: 3; color: #FFFFFF;
  background: rgba(17, 17, 20, .78); backdrop-filter: blur(12px);
  border-radius: 20px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
}
.challenge .nav { appearance: none; border: 0; background: rgba(255, 255, 255, .12); color: #FFFFFF; font-size: 1.3rem; width: 36px; height: 36px; cursor: pointer; border-radius: 50%; }
.challenge .label { font: 700 11px var(--font-body); text-transform: uppercase; letter-spacing: 1.2px; color: var(--yellow); }
.challenge .text { font: 600 15px/1.3 var(--font-body); }
.challenge .done { color: var(--green); }
.challenge .toggle { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font: 500 14px var(--font-body); margin: 0; cursor: pointer; }
.challenge .toggle input { width: 20px; height: 20px; accent-color: var(--accent); }

.cam-bottom { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 28px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .85)); }
.counter { line-height: 1.1; }
.counter b { display: block; font: 800 34px var(--font-display); color: #FFFFFF; }
.counter small { color: rgba(255, 255, 255, .75); font: 600 12px var(--font-body); }
.shutter { appearance: none; cursor: pointer; width: 80px; height: 80px; border-radius: 50%; border: 4px solid #FFFFFF; background: transparent; padding: 5px; }
.shutter::after { content: ''; display: block; width: 100%; height: 100%; border-radius: 50%; background: #FFFFFF; transition: transform .1s; }
.shutter:active::after { transform: scale(.88); }
.shutter:disabled { opacity: .4; }
.cam-bottom .right { justify-self: end; }
.fallback { text-align: center; padding: 24px; max-width: 360px; color: #FFFFFF; }
.fallback .muted { color: rgba(255, 255, 255, .7); }

.toast {
  position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%); z-index: 30; /* au-dessus de la visionneuse */
  background: var(--floating); color: #FFFFFF; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  padding: 12px 18px; border-radius: 999px; font: 600 14px var(--font-body); white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  transition: opacity .3s;
}

/* écrans centrés (rejoindre, pellicule finie, attente) */
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px 20px; }
.center-screen .inner { width: 100%; max-width: 440px; text-align: center; }
.wrap .center-screen { padding-inline: 0; }
.join-card { background: var(--surface); border-radius: 26px; padding: 20px; text-align: left; }
.join-card > * + * { margin-top: 12px; }
.big-count { font: 800 clamp(2rem, 10vw, 3rem) var(--font-display); color: var(--accent-text); }
.canister { display: none; }

/* ---- galerie ---- */
.avatars { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 8px; margin-bottom: 12px; scrollbar-width: none; }
.avatars::-webkit-scrollbar { display: none; }
.avatars button { appearance: none; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 62px; flex: none; color: var(--text); font: 600 12px var(--font-body); padding: 0; }
.avatars .ring { padding: 2.5px; border-radius: 50%; border: 2.5px solid transparent; }
.avatars .av { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 800 20px var(--font-display); }
.avatars .av svg { width: 22px; height: 22px; }
.avatars button span:last-child { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatars button[aria-pressed=true] .ring { border-color: var(--accent); }
.avatars button[aria-pressed=true] span:last-child { color: var(--accent-text); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery figure { margin: 0; position: relative; aspect-ratio: 1; cursor: zoom-in; border-radius: 14px; overflow: hidden; background: var(--surface); }
.gallery img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s; }
.gallery img.loaded { opacity: 1; }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font: 600 11px var(--font-body); color: #FFFFFF; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

.lightbox { position: fixed; inset: 0; z-index: 20; background: #000; color: #FFFFFF; display: flex; flex-direction: column; }
.lightbox .lb-top, .lightbox .lb-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; }
.lightbox .lb-img { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 8px; }
.lightbox .lb-img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.lightbox .meta { font: 700 16px var(--font-body); }
.lightbox .meta small { display: block; color: rgba(255, 255, 255, .65); font: 400 13px var(--font-body); }
.lightbox .icon-btn { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.lightbox .btn-ghost { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.lightbox .btn-danger { background: rgba(255, 255, 255, .14); color: #FF6B7D; }

@media (min-width: 720px) {
  .stocks { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-template-columns: repeat(5, 1fr); gap: 10px; }
}
@media (min-width: 1000px) {
  .gallery { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .flash.on { animation-duration: .01s; }
  .btn:active { transform: none; }
}

/* ---- ambiance appareil photo jetable (mêmes détails que l'app) ---- */
:root { --stamp: #FF9A3C; }

/* grain de pellicule très léger sur tout l'écran */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::after { opacity: .07; }

/* date orange lumineuse, comme celle imprimée sur les photos */
.stamp { font: 700 11px/1 var(--font-mono); color: var(--stamp); letter-spacing: .5px; text-shadow: 0 0 5px rgba(255, 120, 30, .9); white-space: nowrap; }
.polaroid { position: relative; }
.polaroid .stamp { position: absolute; right: 11px; bottom: 22px; font-size: 9px; }
.polaroid.captioned .stamp { bottom: 38px; }
/* fuite de lumière dans le coin des polaroïds décoratifs */
.polaroid span.ph { background: radial-gradient(circle at 88% 10%, rgba(255, 150, 60, .7), rgba(255, 90, 40, .25) 28%, transparent 52%), linear-gradient(var(--a, var(--accent)) 60%, var(--b, var(--violet)) 60%); }

/* bande de pellicule : perforations et inscriptions de bord */
.film-edge {
  position: relative; height: 40px; border-radius: 6px; overflow: hidden; background: #141416;
  display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 18px;
  font: 700 10px var(--font-mono); letter-spacing: 2px; color: var(--stamp); text-shadow: 0 0 4px rgba(255, 120, 30, .6); white-space: nowrap;
}
.film-edge::before, .film-edge::after {
  content: ''; position: absolute; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 255, 255, .88) 7px 15px, transparent 15px 22px);
  -webkit-mask: linear-gradient(#000, #000); border-radius: 2px;
}
.film-edge::before { top: 4px; }
.film-edge::after { bottom: 4px; }

/* compteur de poses : petite fenêtre sombre aux chiffres orange */
.counter b { display: inline-block; min-width: 64px; padding: 2px 10px; border-radius: 10px; background: #0B0B0D; border: 2px solid #2A2A30; color: var(--stamp); font: 700 30px/1.15 var(--font-mono); text-align: center; text-shadow: 0 0 8px rgba(255, 120, 30, .8); }
.counter small { display: block; margin-top: 4px; font: 700 10px var(--font-mono); letter-spacing: 2px; color: rgba(255, 255, 255, .6); }
