/* Illustrations et palettes locales : aucun service ni police externe. */
:root{--field:#11121a;--wash:#30243f;--soft:#ffffff07;--shadow:#00000025;--scheme:dark;--gold:#ecc67e}
[data-theme="midnight"]{--bg:#14111e;--surface:#211b2c;--field:#171321;--line:#49374e;--text:#faf1f5;--muted:#b9a7bf;--accent:#e4bad8;--ink:#332039;--wash:#52324e;--soft:#e4bad80b;--gold:#f4d99f}
[data-theme="happy-days"]{--bg:#fff2d1;--surface:#fffaf0;--field:#fffdf7;--line:#b7d3d3;--text:#123e54;--muted:#526c73;--accent:#c90062;--ink:#ffffff;--wash:#ffe579;--soft:#00a8c30b;--shadow:#164d6220;--scheme:light;--gold:#916200;--error:#ab2445}
[data-theme="disco"]{--bg:#21112f;--surface:#321b43;--field:#24112f;--line:#694376;--text:#fff0fc;--muted:#d5afd5;--accent:#f8a5db;--ink:#491743;--wash:#782767;--soft:#f8a5db0c;--gold:#fbd195}
[data-theme="guinguette"]{--bg:#f7efde;--surface:#fff9ed;--field:#fffdf6;--line:#d9cfb7;--text:#344a39;--muted:#63715f;--accent:#557b4f;--ink:#fffbea;--wash:#dfc89c;--soft:#617a5010;--shadow:#7c6c3820;--scheme:light;--gold:#8b6329}
[data-theme="garden"]{--bg:#f8eef0;--surface:#fff9f7;--field:#fffdfb;--line:#e3cdd2;--text:#55364b;--muted:#87657b;--accent:#a24e75;--ink:#fff5ee;--wash:#e6c3d1;--soft:#a24e7509;--shadow:#a24e7518;--scheme:light;--gold:#936b30}
[data-theme="deco"]{--bg:#0e2530;--surface:#16333e;--field:#102a33;--line:#536455;--text:#f6edce;--muted:#b9b99a;--accent:#e7c77f;--ink:#23343a;--wash:#41584d;--soft:#e7c77f0a;--gold:#e7c77f}
[data-theme="seaside"]{--bg:#edf5f2;--surface:#fbfcf5;--field:#ffffff;--line:#c3d8d2;--text:#254f5b;--muted:#557a80;--accent:#227f89;--ink:#fffdf1;--wash:#b5d9d3;--soft:#227f890a;--shadow:#346b7318;--scheme:light;--gold:#9a6b30}
[data-theme="stars"]{--bg:#141a38;--surface:#20274b;--field:#151d3d;--line:#444e77;--text:#f2efff;--muted:#b1b6d9;--accent:#cebcfa;--ink:#29234b;--wash:#3c3e80;--soft:#cebcfa0c;--gold:#f3d99c}
[data-theme="confetti"]{--bg:#fff3e7;--surface:#fffaf3;--field:#ffffff;--line:#edd1bf;--text:#643d4b;--muted:#916874;--accent:#b14871;--ink:#fff9e8;--wash:#f5d48e;--soft:#b1487109;--shadow:#b1487118;--scheme:light;--gold:#956220}
[data-theme="christmas"]{--bg:#142f2a;--surface:#203f36;--field:#17342d;--line:#4d6a54;--text:#fff3dc;--muted:#bdd0b6;--accent:#eeb2a4;--ink:#49312c;--wash:#456c48;--soft:#eeb2a409;--gold:#f0ce83}
body{color-scheme:var(--scheme);background:radial-gradient(ellipse at 90% 0,var(--wash),transparent 55%),var(--bg);color:var(--text)}
body::before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.16;background-image:radial-gradient(var(--accent) .6px,transparent .8px);background-size:28px 28px;z-index:-1}
.hero{position:relative;isolation:isolate;border-bottom:1px solid var(--line);margin-bottom:18px;padding:0 0 20px;min-height:150px}
.hero h1{position:relative;max-width:85%;padding-right:40px}
.event-kicker{font-size:.65rem;text-transform:uppercase;letter-spacing:.15em;font-weight:650;color:var(--accent);margin:0 0 8px}
.hero-description{position:relative;max-width:76%;font-size:.78rem}
.event-art{position:absolute;width:150px;height:112px;right:-12px;bottom:30px;object-fit:contain;opacity:.9;z-index:-1;filter:drop-shadow(0 10px 20px var(--shadow));pointer-events:none}
.profile-row{position:relative;z-index:1;gap:8px;margin-bottom:12px}
[data-theme="happy-days"] .hero h1{max-width:100%;padding-right:0;text-shadow:1px 2px 0 #ffd45e55;font-weight:800;color:#123e54}
[data-theme="happy-days"] .hero{border-bottom:0;padding-bottom:18px}
[data-theme="happy-days"] .hero::after{content:"";position:absolute;bottom:0;left:0;right:0;height:5px;border-radius:8px;background:linear-gradient(90deg,#ed087b 0 46%,#fffaf0 46% 49%,#00afd3 49% 94%,#ffe15b 94%)}
[data-theme="happy-days"] .event-art{position:relative;display:block;width:220px;height:132px;max-width:100%;right:auto;bottom:auto;margin:0 auto 5px;z-index:auto;opacity:1;filter:drop-shadow(0 5px 5px #143e5420)}
[data-theme="happy-days"] .hero-description{max-width:100%}
body[data-theme="happy-days"]{background:radial-gradient(ellipse at 0 0,#06b3d52b,transparent 42%),radial-gradient(ellipse at 100% 20%,#ffe15b60,transparent 55%),#fff2d1}
[data-theme="happy-days"] .tabs{border:1px solid #b7d3d3;border-radius:16px;background:#fffaf0;box-shadow:0 4px 0 #00afd319}
[data-theme="happy-days"] .tabs button[aria-pressed=true]{background:#123e54;color:#fff9e7;box-shadow:inset 0 -3px 0 #f11980}
[data-theme="happy-days"] .score{background:linear-gradient(115deg,#fff0ac,#fffaf0 80%);border-color:#e3cf83}
[data-theme="happy-days"] .card{border-top:3px solid #00a7c4}
[data-theme="happy-days"] .button:not(.ghost){box-shadow:0 3px 0 #8b0649}
[data-theme="happy-days"] .button.ghost{background:#fffdf7;border-color:#89b8c3}
[data-theme="deco"] .card,[data-theme="deco"] .tabs{border-radius:4px;border-color:var(--line)}
[data-theme="deco"] .hero h1{letter-spacing:.025em}
.card{background:linear-gradient(135deg,var(--soft),transparent 70%),var(--surface);box-shadow:0 12px 30px -20px var(--shadow)}
.score{background:linear-gradient(120deg,var(--wash),var(--surface));box-shadow:inset 0 1px 0 var(--soft),0 8px 20px -18px var(--shadow)}
input,select,textarea{background:var(--field);border-color:var(--line);color:var(--text)}
input::file-selector-button{background:var(--wash);color:var(--text)}
.button{background:var(--accent);color:var(--ink)}
.button.danger{background:#b32643;color:#fff}
.button.ghost{background:var(--soft);color:var(--text);border-color:var(--line)}
.tabs{overflow-x:auto;scrollbar-width:none;gap:2px;background:var(--soft);box-shadow:inset 0 1px 0 var(--soft)}
.tabs button{flex:1 0 auto;min-width:0;padding:8px 9px;font-size:.76rem;background:transparent;color:var(--muted)}
.tabs button[aria-pressed=true]{background:var(--wash);color:var(--text);box-shadow:0 2px 8px var(--shadow)}
.status{background:var(--wash);border-color:var(--line);color:var(--text)}
.status.error,.errors{color:var(--error)}
[data-theme="garden"],[data-theme="guinguette"],[data-theme="seaside"],[data-theme="confetti"]{--error:#a32c47}
.photo-count{background:var(--soft);border-color:var(--line)}
progress::-webkit-progress-value{background:linear-gradient(90deg,var(--accent),var(--gold))}
progress::-moz-progress-bar{background:var(--accent)}
.filter-panel,.challenge,.photo-tile{background:var(--surface);border-color:var(--line)}
.filter-panel{box-shadow:0 8px 22px -20px var(--shadow)}
.photo-tile{box-shadow:0 6px 18px -13px var(--shadow)}
.photo-tile>span{color:#fff}
.tile-rating{position:absolute;top:6px;right:6px;padding:2px 6px;border-radius:12px;background:#15121cc4;color:#ffe7ab;font-size:.7rem;backdrop-filter:blur(4px)}
.challenge{position:relative;overflow:hidden;background:linear-gradient(135deg,var(--soft),transparent),var(--surface)}
.challenge::after{content:"✧";position:absolute;right:10px;bottom:-32px;font-size:7rem;line-height:1;color:var(--accent);opacity:.08;pointer-events:none}
.challenge .photo-count{display:inline-block;margin-top:5px;font-size:.62rem;font-weight:450;white-space:nowrap}
.challenge h3{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.challenge h3>span:first-child{min-width:0;overflow-wrap:anywhere}
.challenge h3 .photo-count{flex:none;margin-top:0;margin-left:auto}
.guest-status{position:relative;overflow:hidden;padding-bottom:16px;transition:opacity .3s,transform .3s}
.guest-status.is-timed::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:3px;background:currentColor;transform:scaleX(0);transform-origin:left;animation:notice-fill var(--notice-duration,6000ms) linear forwards;opacity:.65}
.guest-status.is-closing{opacity:0;transform:translateY(-6px)}
@keyframes notice-fill{to{transform:scaleX(1)}}
@media(prefers-reduced-motion:reduce){.guest-status{transition:none}.guest-status.is-closing{transform:none}}
dialog{background:var(--surface);border-color:var(--line)}
.icon-button{background:var(--soft);color:var(--text);border-color:var(--line)}
.photo-arrow{background:#12131abf;color:#fff;border-color:#ffffff30}
.feature-options{border:1px solid var(--line);border-radius:14px;padding:16px;margin:18px 0}
.feature-options legend{color:var(--accent);font-size:.85rem;padding:0 8px}
.feature-options>label:not(.check){display:block;margin:14px 0 7px}
.feature-options>select{width:100%}
.small-copy{font-size:.78rem}
.theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.theme-choice{display:flex;flex-direction:column;position:relative;min-width:0;padding:10px;border:1px solid var(--line);border-radius:14px;background:radial-gradient(ellipse at top,var(--wash),transparent 90%),var(--bg);color:var(--text);text-align:left;cursor:pointer;box-shadow:0 6px 18px -12px var(--shadow)}
.theme-choice:has(input:checked),.theme-choice[aria-pressed=true]{outline:2px solid var(--accent);outline-offset:2px}
.theme-choice img{display:block;height:88px;width:100%;object-fit:contain;margin-bottom:6px}
.theme-choice>span{display:flex;align-items:center;gap:7px}
.theme-choice strong{font-size:.8rem}
.theme-choice small{display:block;color:var(--muted);font-size:.67rem;margin:5px 0 0;line-height:1.4}
.theme-choice input{flex-shrink:0;margin:0}
.participant-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 0;border-bottom:1px solid var(--line)}
.participant-row strong{font-weight:600;overflow-wrap:anywhere}
.participant-row small{display:block;color:var(--muted);font-size:.72rem;margin-top:3px}
.participant-row form{margin-left:auto}
.participant-recovery{flex-basis:100%;min-width:0;padding:10px 0 0}
.participant-recovery>label{font-size:.75rem;color:var(--muted)}
.participant-recovery>.recovery-link{display:block;width:100%;margin:6px 0 10px}
.participant-recovery .row form{margin-left:0}
.section-intro{padding:3px 4px 18px}
.section-intro h2{font-size:1.35rem;letter-spacing:-.035em}
.section-intro>p:last-child{font-size:.8rem;max-width:42em}
.rating-panel,.comments-panel{border-top:1px solid var(--line);padding-top:15px;margin-top:15px}
.rating-panel strong{font-size:.85rem}
.rating-panel small{font-size:.68rem}
.rating-stars{display:flex;gap:5px;margin-top:6px}
.rating-stars button{font:32px/1 system-ui,sans-serif;border:0;background:none;color:var(--muted);opacity:.6;width:44px;height:44px;border-radius:8px;padding:0;cursor:pointer}
.rating-stars button.is-on{color:var(--gold);opacity:1;filter:drop-shadow(0 2px 5px var(--shadow))}
.rating-stars button:disabled{cursor:default}
.rating-stars button:not(:disabled):hover{color:var(--gold);opacity:1;transform:scale(1.08)}
.social-statistics{font-size:.68rem;color:var(--muted);margin:14px 0 0}
.comments-panel h3{font-size:.92rem}
#comment-form textarea{margin:8px 0 0}
#comment-form>.row{margin-bottom:8px}
.character-count{color:var(--muted);font-size:.68rem;font-variant-numeric:tabular-nums}
.comment-item{padding:13px 0;border-top:1px solid var(--line)}
.comment-item p{margin:6px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:.83rem}
.message-signature{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:5px}
.message-signature strong{font-size:.75rem;font-weight:600}
.message-signature small{font-size:.64rem;color:var(--muted)}
.message-actions{display:flex;flex-wrap:wrap;gap:8px}
.message-actions .text-button{font-size:.68rem;padding:4px 0;min-height:36px}
.empty-copy{color:var(--muted);font-size:.8rem;margin:14px 0}
.stationery{background:repeating-linear-gradient(0deg,transparent 0,transparent 27px,var(--soft) 27px,var(--soft) 28px),linear-gradient(130deg,var(--soft),transparent),var(--surface);border:1px solid var(--line);border-radius:18px;position:relative;box-shadow:0 14px 30px -20px var(--shadow)}
.stationery::before{content:"✧";position:absolute;top:8px;right:14px;font-size:2rem;color:var(--accent);opacity:.3;pointer-events:none}
#card-form label{position:relative}
#card-form textarea{background:var(--field);position:relative}
#card-form>.small-copy{margin-top:12px}
.card-messages{display:grid;gap:18px;padding-top:5px}
.card-message{padding:24px 22px 14px}
.card-message:nth-child(even){transform:rotate(.4deg)}
.card-message:nth-child(odd){transform:rotate(-.35deg)}
.card-message-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.96rem;line-height:1.8;padding:8px 12px 16px 0;letter-spacing:.005em}
.podium-section{position:relative;overflow:hidden;padding:22px}
.podium-section::after{content:"✦";position:absolute;right:8px;top:-26px;font-size:8rem;line-height:1.2;color:var(--gold);opacity:.08;pointer-events:none}
.podium-section:first-child{border-top:3px solid var(--gold)}
.podium-section h3{font-size:1.1rem;margin-bottom:14px;position:relative}
.podium-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.podium-photo{padding:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--field);color:var(--text);text-align:left;min-width:0}
.podium-photo img{width:100%;aspect-ratio:4/3;object-fit:cover}
.podium-photo-caption{display:block;padding:10px}
.podium-photo-caption strong{display:block;font-size:.8rem;overflow-wrap:anywhere}
.podium-photo-caption small{display:block;font-size:.68rem;color:var(--gold);margin-top:4px}
.podium-person{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:12px 0;margin:0}
.podium-person strong{font-size:.85rem;overflow-wrap:anywhere}
.podium-person span{color:var(--accent);font-size:.75rem;white-space:nowrap}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(min-width:700px){.theme-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.theme-choice img{height:110px}.event-art{width:220px;height:140px;right:4px;bottom:0}.hero h1{max-width:80%}.podium-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.card-messages{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-row{margin-bottom:5px}.tabs button{font-size:.85rem}}
@media(max-width:380px){.tabs button{padding:8px 6px;font-size:.72rem}.event-art{width:115px;right:-5px}.hero h1{padding-right:20px;max-width:90%}.theme-grid{gap:8px}.theme-choice{padding:8px}.theme-choice img{height:65px}.podium-grid{gap:8px}.podium-section{padding:16px}.podium-photo-caption{padding:8px}}

/* Modales hors du flux et sans couche native inert : clavier mobile et boutons restent synchronisés. */
html.modal-open{overflow:hidden;overscroll-behavior:none}
.modal-overlay{position:fixed;inset:0;width:100%;height:100%;height:100dvh;z-index:1000;display:flex;align-items:center;justify-content:center;padding:12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:#08090fe8;overscroll-behavior:contain;isolation:isolate}
.challenge-best{margin-top:18px;border-top:1px solid var(--line);padding-top:14px}
.challenge-best h4{font-size:.8rem;margin:0 0 10px}
.challenge-best .podium-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.modal-overlay>dialog.modal-surface{position:relative;inset:auto;margin:0;width:min(100%,720px);max-height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;touch-action:pan-y pinch-zoom;box-shadow:0 25px 100px #0006}
.modal-heading,.viewer-top{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--surface)}
.modal-heading{padding:0 0 12px;margin-bottom:8px}
.modal-heading h2{margin:0}
.viewer-top{border-bottom:1px solid var(--line)}
.action-icon{width:18px;height:18px;display:inline-block;vertical-align:middle;flex:none}
.icon-button .action-icon{width:20px;height:20px}
#photo-stage{height:min(52svh,480px);min-height:180px;overflow:hidden;position:relative;display:block;isolation:isolate}
#photo-stage .photo-frame{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;max-height:none;margin:0;will-change:transform;backface-visibility:hidden;-webkit-backface-visibility:hidden;user-select:none;-webkit-user-select:none;pointer-events:none}
.photo-arrow{z-index:3}
#photo-stage[aria-busy=true]::after{content:"";position:absolute;left:calc(50% - 12px);top:calc(50% - 12px);width:24px;height:24px;border:2px solid #fff4;border-top-color:#fff;border-radius:50%;animation:photo-spin .8s linear infinite;z-index:2}
#photo-stage.has-picture[aria-busy=true]::after{display:none}
#photo-save[aria-busy=true] .action-icon,#photo-share[aria-busy=true] .action-icon{opacity:.45}
#album-dialog{max-width:460px}
#album-status{margin:0}
#theme-dialog .theme-grid img{content-visibility:visible;contain:none}
@keyframes photo-spin{to{transform:rotate(360deg)}}
@media(max-width:699px){#guest-app.shell{padding-top:env(safe-area-inset-top,0px)}#guest-app .profile-row{margin-top:0;margin-bottom:6px}#guest-app .profile-button{padding-top:0;padding-bottom:0}}
@media(prefers-reduced-motion:reduce){#photo-stage[aria-busy=true]::after{animation:none}}
