/* LARP RuleOfCool — base theme (dark, photography-forward) */
:root{
  --bg:#0d0f12; --bg-2:#14171c; --surface:#181c22; --surface-2:#1f242c;
  --border:#2a313b; --text:#eef1f5; --muted:#9aa4b2; --primary:#e7b15a;
  --primary-2:#f0c479; --danger:#e5645c; --ok:#56c98a; --warn:#e7b15a;
  --radius:14px; --radius-sm:9px; --shadow:0 10px 30px rgba(0,0,0,.45);
  --maxw:1320px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
/* Any stray overflowing row must not widen the page on phones (kills side margins). */
html{overflow-x:clip}
body{
  background:var(--bg); color:var(--text);
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  line-height:1.55; -webkit-font-smoothing:antialiased;
  display:flex; flex-direction:column; min-height:100vh;
}
a{color:var(--primary); text-decoration:none}
a:hover{color:var(--primary-2)}
img{max-width:100%; display:block}
h1,h2,h3{font-family:'Fraunces',Georgia,serif; font-weight:600; line-height:1.15; margin:0 0 .4em}
.muted{color:var(--muted)}
.mt-2{margin-top:.75rem}

.container{width:100%; max-width:var(--maxw); margin:0 auto; padding:0 22px}
.container--narrow{max-width:600px}
.layout-toggle{background:none; border:1px solid var(--border); color:var(--text); width:34px; height:34px; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; font-size:.82rem; flex-shrink:0}
.layout-toggle:hover{border-color:var(--primary); color:var(--primary)}
.layout-full .container{max-width:none; padding-left:32px; padding-right:32px}
@media (min-width:1700px){.layout-full .masonry{column-count:5}}
@media (min-width:2200px){.layout-full .masonry{column-count:6}}

/* Header / nav */
.site-header{position:sticky; top:0; z-index:50; background:rgba(13,15,18,.86);
  backdrop-filter:blur(10px); border-bottom:1px solid var(--border)}
.site-header--admin{background:rgba(20,16,12,.9)}
.site-header__inner{display:flex; align-items:center; justify-content:space-between; height:64px; gap:16px}
.brand{display:flex; align-items:center; gap:9px; color:var(--text); font-weight:600}
.brand__mark{color:var(--primary)}
.brand__text strong{color:var(--primary)}
.brand__logo{height:38px; width:auto; display:block}
.brand__tag{font-size:.7rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--primary); border:1px solid var(--primary); border-radius:4px; padding:1px 6px; line-height:1.3}
.site-footer__brand{display:flex; align-items:center; gap:12px}
.footer-logo{height:48px; width:auto; opacity:.85}
.site-nav{display:flex; align-items:center; gap:22px}
.site-nav a{color:var(--muted); font-weight:500; font-size:.95rem}
.site-nav a:hover{color:var(--text)}
.nav-admin{color:var(--primary)!important}
.nav-toggle{display:none; background:none; border:0; color:var(--text); font-size:1.3rem; cursor:pointer}

/* Buttons */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border:1px solid transparent; border-radius:999px; padding:.62rem 1.25rem;
  font:inherit; font-weight:600; cursor:pointer; transition:.15s; white-space:nowrap}
.btn-sm{padding:.4rem .9rem; font-size:.88rem}
.btn-block{display:flex; width:100%; margin-top:.5rem}
.btn-primary{background:var(--primary); color:#1a1206; border-color:var(--primary)}
.btn-primary:hover{background:var(--primary-2); color:#1a1206}
.btn-ghost{background:transparent; color:var(--text); border-color:var(--border)}
.btn-ghost:hover{border-color:var(--primary); color:var(--primary)}

/* Hero */
.hero{padding:84px 0 56px; background:
  radial-gradient(1200px 380px at 70% -10%, rgba(231,177,90,.16), transparent 60%), var(--bg)}
.hero__eyebrow{text-transform:uppercase; letter-spacing:.22em; font-size:.74rem; color:var(--primary); margin:0 0 14px}
.hero__title{font-size:clamp(2rem,5vw,3.4rem); margin:0 0 .35em}
.hero__lead{max-width:560px; color:var(--muted); font-size:1.08rem}

/* Sections */
.section{padding:46px 0}
.section__head{display:flex; align-items:center; justify-content:space-between; margin-bottom:22px}
.section__head h2{margin:0; font-size:1.5rem}

/* Grid / cards */
.grid{display:grid; gap:18px}
.grid--cards{grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
.card-event{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; color:var(--text); transition:.18s}
.card-event:hover{transform:translateY(-3px); border-color:var(--primary)}
.card-event__cover{aspect-ratio:3/2; background:linear-gradient(135deg,var(--surface-2),#10131a)}
.card-event__body{padding:14px 16px}
.card-event__body h3{font-size:1.12rem; margin:0 0 2px}
.card-event__camp{display:block; font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; margin-bottom:2px}

/* Home: creation tools */
.tools-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px}
.tool-card{display:block; padding:20px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface-2); transition:.15s}
.tool-card:hover{border-color:var(--primary); transform:translateY(-2px)}
.tool-card__icon{font-size:1.6rem; color:var(--primary); margin-bottom:8px}
.tool-card h3{margin:0 0 4px; font-size:1.1rem}
.tool-card p{margin:0; font-size:.9rem}

/* Event page: create-from-selection CTA */
.make-cta{display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:14px}
.make-cta__label{font-size:.9rem; color:var(--muted)}

/* Legal pages (privacy / cookie policy) */
.legal h1{margin:0 0 4px}
.legal h2{font-size:1.2rem; margin:28px 0 8px}
.legal h3{font-size:1rem; margin:16px 0 6px; color:var(--text)}
.legal p, .legal li{line-height:1.65}
.legal ul{padding-left:20px; margin:8px 0}
.legal hr{border:0; border-top:1px solid var(--border); margin:24px 0}
.legal-table{overflow-x:auto; margin:10px 0}
.legal-table table{width:100%; border-collapse:collapse; font-size:.9rem}
.legal-table th, .legal-table td{border:1px solid var(--border); padding:8px 10px; text-align:left; vertical-align:top}
.legal-table thead th{background:var(--surface-2)}
.legal code{background:var(--surface-2); padding:1px 5px; border-radius:4px; font-size:.85em}

/* Composer source picker */
.source-picker{display:flex; align-items:center; gap:8px; margin:10px 0 4px}
.source-picker select{background:var(--surface-2); border:1px solid var(--border); color:inherit; border-radius:8px; padding:6px 10px; font:inherit; font-size:.9rem}

/* Empty state */
.empty{text-align:center; padding:70px 20px; color:var(--muted);
  border:1px dashed var(--border); border-radius:var(--radius); background:var(--bg-2)}
.empty__icon{font-size:2.4rem; color:var(--surface-2); display:block; margin-bottom:12px}

/* Auth + forms */
.auth-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:30px 28px; box-shadow:var(--shadow); margin-top:40px}
.auth-card__title{font-size:1.7rem; margin-bottom:.5em}
.auth-card__foot{display:flex; flex-direction:column; gap:8px; margin-top:18px; font-size:.92rem}
.form{display:flex; flex-direction:column; gap:14px}
.field{display:flex; flex-direction:column; gap:6px}
.field label{font-size:.88rem; color:var(--muted); font-weight:500}
.input{width:100%; background:var(--bg-2); border:1px solid var(--border); color:var(--text);
  border-radius:var(--radius-sm); padding:.72rem .85rem; font:inherit; transition:.15s}
.input:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(231,177,90,.15)}
.input.is-invalid{border-color:var(--danger)}
.field__error{color:var(--danger); font-size:.84rem}
.check{display:flex; align-items:center; gap:10px; color:var(--muted); font-size:.92rem; cursor:pointer}
.check input{width:18px; height:18px; accent-color:var(--primary)}

/* Alerts / flash */
.alert{border:1px solid var(--border); border-radius:var(--radius-sm); padding:.8rem 1rem; margin:.4rem 0}
.alert--warning,.warningMessage{border-color:rgba(231,177,90,.5); background:rgba(231,177,90,.1)}
.errorMessage,.alert--error{border-color:rgba(229,100,92,.5); background:rgba(229,100,92,.12); color:#ffd9d6}
.successMessage,.alert--ok{border-color:rgba(86,201,138,.5); background:rgba(86,201,138,.12)}
.noticeMessage{border-color:var(--border); background:var(--bg-2)}

/* Footer */
.site-main{flex:1 0 auto}
.site-footer{border-top:1px solid var(--border); background:var(--bg-2); margin-top:40px; padding-bottom:env(safe-area-inset-bottom,0)}
.site-footer__inner{display:flex; align-items:center; justify-content:space-between; gap:14px; padding-block:22px; color:var(--muted); font-size:.9rem}

@media (max-width:760px){
  .nav-toggle{display:block}
  .site-nav{position:fixed; inset:64px 0 auto 0; flex-direction:column; align-items:flex-start;
    gap:4px; background:var(--bg-2); border-bottom:1px solid var(--border); padding:14px 22px; display:none}
  .site-nav.is-open{display:flex}
  .site-nav a{padding:8px 0; width:100%}
  .site-footer__inner{flex-direction:column; align-items:flex-start; padding-block:22px 36px}
  .layout-full .container{padding-left:22px; padding-right:22px}
  .section{padding:34px 0}
  .hero{padding:56px 0 40px}
  .gallery-head{padding:28px 0 6px}
  .reg-cta{padding:16px 18px}
  .reg-cta__actions{width:100%}
  .reg-cta__actions .btn{flex:1 1 auto; min-width:0}
}

/* ── Galleries ─────────────────────────────────────────────────────────────── */
.gallery-head{padding:40px 0 6px; border-bottom:1px solid var(--border); background:var(--bg-2)}
.gallery-head h1{font-size:clamp(1.6rem,4vw,2.6rem); margin:.1em 0}
.gallery-head__desc{max-width:640px}
.crumb{display:inline-block; color:var(--muted); font-size:.9rem; margin-bottom:6px}
.crumb:hover{color:var(--primary)}
.section__title{font-size:1.3rem; margin-bottom:14px}
.share{display:flex; align-items:center; gap:8px; margin-top:14px; flex-wrap:wrap}
.share__label{color:var(--muted); font-size:.85rem; margin-right:2px}
.share__btn{width:36px; height:36px; border-radius:50%; border:1px solid var(--border); background:var(--surface);
  color:var(--text); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; transition:.15s; text-decoration:none; font-size:.9rem}
.share__btn:hover{border-color:var(--primary); color:var(--primary)}
.share__btn.is-copied{background:var(--ok); color:#06210f; border-color:var(--ok)}
.photo-share{margin-top:16px}
.reg-cta{display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
  background:linear-gradient(135deg, rgba(231,177,90,.12), var(--surface)); border:1px solid var(--border);
  border-radius:var(--radius); padding:18px 22px; margin-bottom:22px}
.reg-cta__text strong{font-size:1.05rem}
.reg-cta__text p{margin:.2em 0 0; max-width:560px}
.reg-cta__actions{display:flex; gap:10px; flex-wrap:wrap; min-width:0}
.pill{display:inline-block; font-size:.8rem; padding:.3rem .7rem; border-radius:999px; border:1px solid var(--border)}
.pill--preview{border-color:rgba(231,177,90,.5); background:rgba(231,177,90,.12); color:var(--primary)}
.card-event__cover img{width:100%; height:100%; object-fit:cover}

/* Masonry photo grid */
.masonry{column-count:4; column-gap:14px}
@media (max-width:1100px){.masonry{column-count:3}}
@media (max-width:740px){.masonry{column-count:2}}
@media (max-width:480px){.masonry{column-count:1}}
.ph{display:block; break-inside:avoid; margin:0 0 14px; border-radius:10px; overflow:hidden; background:var(--surface-2); position:relative}
.ph img{width:100%; height:auto; display:block; transition:transform .35s, filter .35s}
.ph:hover img{transform:scale(1.04); filter:brightness(1.08)}
.ph::after{content:""; position:absolute; inset:0; box-shadow:inset 0 0 0 1px rgba(255,255,255,.04); border-radius:10px}
.ph-item{position:relative; break-inside:avoid; margin:0 0 14px}
.ph-item .ph{margin:0}
.ph-fav{position:absolute; top:8px; right:8px; width:38px; height:38px; border:0; border-radius:50%; z-index:2;
  background:rgba(8,10,13,.55); color:#fff; cursor:pointer; opacity:0; transition:.15s; display:flex; align-items:center; justify-content:center}
.ph-item:hover .ph-fav{opacity:1}
.ph-fav:hover{background:rgba(8,10,13,.85); transform:scale(1.08)}
.ph-fav.is-fav{opacity:1; color:var(--primary)}
.ph-album{position:absolute; top:8px; right:52px; width:38px; height:38px; border:0; border-radius:50%; z-index:2;
  background:rgba(8,10,13,.55); color:#fff; cursor:pointer; opacity:0; transition:.15s; display:flex; align-items:center; justify-content:center}
.ph-item:hover .ph-album{opacity:1}
.ph-album:hover{background:rgba(8,10,13,.85); transform:scale(1.08)}
@media (hover:none){.ph-fav,.ph-album{opacity:.92}}
.fav-btn.is-fav{color:var(--primary); border-color:var(--primary)}
#cur-cover.is-cover{color:var(--primary); border-color:var(--primary)}

/* Lightbox */
.lightbox{position:fixed; inset:0; z-index:200; background:rgba(6,7,9,.96); display:none;
  align-items:center; justify-content:center; padding:30px}
.lightbox.is-open{display:flex}
.lb-stage{margin:0; width:min(1400px,94vw); max-height:90vh; display:flex; flex-direction:column; align-items:center}
/* Fill the available area and upscale small photos while preserving ratio. */
.lb-img{width:100%; height:82vh; object-fit:contain; border-radius:6px}
.lb-bar{display:flex; align-items:center; justify-content:space-between; gap:18px; width:100%; margin-top:12px; flex-wrap:wrap}
.lb-caption:empty{display:none}
/* Active-album picker + save button */
.album-bar{display:inline-flex; align-items:center; gap:6px}
.album-select{max-width:200px; background:rgba(255,255,255,.06); border:1px solid var(--border); color:inherit;
  border-radius:8px; padding:6px 8px; font:inherit; font-size:.85rem}
.lb-actions .album-select{max-width:170px}
.lb-caption{color:var(--muted); font-size:.92rem}
.lb-actions{display:flex; gap:10px; margin-left:auto; flex-wrap:wrap; justify-content:flex-end}
.lb-close{position:absolute; top:18px; right:22px; font-size:1.4rem}
.lb-nav,.lb-close{background:rgba(255,255,255,.06); border:1px solid var(--border); color:#fff;
  width:46px; height:46px; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:.15s}
.lb-nav:hover,.lb-close:hover{background:var(--primary); color:#1a1206; border-color:var(--primary)}
.lb-nav{position:absolute; top:50%; transform:translateY(-50%)}
.lb-prev{left:18px}
.lb-next{right:18px}
/* Mobile lightbox: full-screen column, action bar pinned (and reachable) at the bottom.
   NB: height 100% of the fixed inset:0 overlay, NOT 100vh/dvh — on iOS Safari 100vh
   is taller than the visible area and pushes the last button row under the toolbar. */
@media (max-width:700px){
  .lightbox{padding:0}
  .lb-stage{width:100%; height:100%; max-height:none}
  .lb-img{flex:1 1 0%; min-height:0; height:auto; width:100%; border-radius:0}
  .lb-bar{flex-shrink:0}
  .lb-bar{margin:0; gap:8px; justify-content:center; padding:10px 12px calc(10px + env(safe-area-inset-bottom));
    background:#0b0d11; border-top:1px solid var(--border)}
  .lb-caption{width:100%; text-align:center; font-size:.85rem}
  .lb-actions{margin:0; width:100%; justify-content:center; gap:8px}
  .lb-actions .btn{flex:1 1 calc(50% - 4px); padding:.5rem .4rem; font-size:.85rem}
  .lb-actions .album-bar{flex:1 1 100%; display:flex}
  .lb-actions .album-select{flex:1; max-width:none}
  .lb-actions .album-bar .btn{flex:0 1 auto}
  .lb-close{top:10px; right:10px; z-index:3; background:rgba(8,10,13,.65)}
  .lb-nav{width:38px; height:38px; top:40%; background:rgba(8,10,13,.5); opacity:.8}
  .lb-prev{left:8px} .lb-next{right:8px}
}

/* Single photo page */
.photo-page{padding:24px 0 60px}
.photo-stage{position:relative; display:flex; align-items:center; justify-content:center; margin:14px 0}
.photo-main{max-width:100%; max-height:78vh; object-fit:contain; border-radius:8px; box-shadow:var(--shadow)}
.photo-nav{position:absolute; top:50%; transform:translateY(-50%); width:46px; height:46px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.06); border:1px solid var(--border); color:#fff}
.photo-nav:hover{background:var(--primary); color:#1a1206}
.photo-prev{left:8px}
.photo-next{right:8px}
.photo-meta{display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap; margin-top:10px}
.photo-caption{font-size:1.05rem; margin:0}
.photo-actions{display:flex; gap:10px; flex-wrap:wrap}
@media (max-width:600px){
  .photo-page{padding:12px 0 44px}
  .photo-stage{margin:10px 0}
  .photo-main{max-height:64vh}
  .photo-meta{flex-direction:column; align-items:stretch; gap:12px}
  .photo-actions{width:100%; gap:8px}
  .photo-actions .btn{flex:1 1 calc(50% - 4px); padding:.55rem .5rem; font-size:.88rem}
  .photo-actions .album-bar{flex:1 1 100%; display:flex}
  .photo-actions .album-select{flex:1; max-width:none}
  .photo-actions .album-bar .btn{flex:0 1 auto}
  .photo-nav{width:38px; height:38px; background:rgba(8,10,13,.6)}
  .photo-prev{left:4px} .photo-next{right:4px}
}

/* ── Manage / curation ─────────────────────────────────────────────────────── */
.mtable-wrap{overflow-x:auto; margin-top:18px}
.mtable{width:100%; border-collapse:collapse; font-size:.94rem}
.mtable th,.mtable td{padding:12px 14px; text-align:left; border-bottom:1px solid var(--border); vertical-align:middle}
.mtable th{color:var(--muted); font-weight:600; font-size:.82rem; text-transform:uppercase; letter-spacing:.04em}
.mactions{display:flex; gap:8px; justify-content:flex-end}
.mactions form{margin:0}
.badge{display:inline-block; font-size:.76rem; padding:.22rem .6rem; border-radius:999px; border:1px solid var(--border); text-transform:capitalize}
.badge--published{border-color:rgba(86,201,138,.5); background:rgba(86,201,138,.14); color:var(--ok)}
.badge--curating{border-color:rgba(231,177,90,.5); background:rgba(231,177,90,.12); color:var(--primary)}
.badge--draft{color:var(--muted)}
.badge--archived{color:var(--muted); opacity:.7}
kbd{display:inline-block; font:600 .72rem/1 ui-monospace,monospace; background:var(--bg); border:1px solid var(--border);
  border-bottom-width:2px; border-radius:5px; padding:2px 6px; margin-left:4px; color:var(--muted)}

.cur-head{display:flex; align-items:flex-start; justify-content:space-between; gap:18px; flex-wrap:wrap; padding-top:24px}
.cur-head h1{font-size:1.6rem; margin:.1em 0}
.cur-counts{display:flex; align-items:center; gap:14px; flex-wrap:wrap}
.cc{display:inline-flex; align-items:center; gap:6px; font-size:.95rem; color:var(--muted)}
.cc--liked{color:var(--primary)}
.cc--disc{color:var(--danger)}
.cur-counts form{margin:0}

.cur-stage{position:relative; display:flex; align-items:center; justify-content:center; gap:10px;
  background:#070809; padding:18px; margin-top:14px}
.cur-imgwrap{position:relative; display:flex; align-items:center; justify-content:center; max-width:1500px; width:100%}
#cur-img{max-width:100%; max-height:72vh; object-fit:contain; border-radius:6px}

/* Fullscreen culling mode (reuses all the curation JS) */
.cur-fsclose{display:none}
.curation.is-fs{position:fixed; inset:0; z-index:400; background:#0b0d11; display:flex; flex-direction:column; overflow:hidden}
.curation.is-fs > .container{display:none}
.curation.is-fs .cur-stage{flex:1; min-height:0; margin:0; padding:8px 8px 0}
.curation.is-fs .cur-imgwrap{max-width:none; height:100%}
.curation.is-fs #cur-img{max-height:90vh}
.curation.is-fs .cur-toolbar{padding:12px; background:linear-gradient(transparent,rgba(0,0,0,.5))}
.curation.is-fs .cur-film{max-height:96px}
.curation.is-fs .cur-help{display:none}
.curation.is-fs .cur-fsclose{display:flex; position:absolute; top:12px; right:16px; z-index:3; width:42px; height:42px; border-radius:50%; border:0; background:rgba(255,255,255,.1); color:#fff; font-size:1.4rem; cursor:pointer; align-items:center; justify-content:center}
.curation.is-fs .cur-fsclose:hover{background:rgba(255,255,255,.22)}
.cur-nav{flex-shrink:0; width:46px; height:46px; border-radius:50%; background:rgba(255,255,255,.06);
  border:1px solid var(--border); color:#fff; cursor:pointer; transition:.15s}
.cur-nav:hover{background:var(--primary); color:#1a1206; border-color:var(--primary)}
.cur-badge{position:absolute; top:14px; left:14px; padding:.3rem .7rem; border-radius:999px; font-size:.85rem; font-weight:600}
.cur-badge--liked{background:var(--primary); color:#1a1206}
.cur-badge--discarded{background:var(--danger); color:#fff}

.cur-toolbar{display:flex; gap:10px; justify-content:center; padding:16px 0}
.cur-film{display:flex; gap:8px; overflow-x:auto; padding:12px; background:var(--bg-2); border-top:1px solid var(--border)}
.cf{flex:0 0 auto; width:96px; height:64px; padding:0; border:2px solid transparent; border-radius:6px; overflow:hidden;
  background:var(--surface-2); cursor:pointer; opacity:.55; transition:.15s}
.cf img{width:100%; height:100%; object-fit:cover}
.cf.is-current{opacity:1; box-shadow:0 0 0 2px var(--text)}
.cf--liked{border-color:var(--primary); opacity:1}
.cf--discarded{border-color:var(--danger); opacity:.4}
.cf--undecided{border-color:transparent}
.cur-help{text-align:center; padding:14px 0 30px}
.pub-split{display:inline-flex; gap:6px; margin:0; flex-wrap:wrap}

/* ── Studio (post editor) + share ──────────────────────────────────────────── */
.studio{padding:24px 0 60px}
.studio h1{font-size:1.6rem; margin:.1em 0 0}
.studio-layout{display:grid; grid-template-columns:1fr 320px; gap:26px; margin-top:18px; align-items:start}
@media (max-width:780px){.studio-layout{grid-template-columns:1fr}}
.studio-stage{display:flex; justify-content:center; align-items:flex-start; background:#070809; border:1px solid var(--border); border-radius:var(--radius); padding:16px}
#studio-canvas{border-radius:6px; touch-action:none; cursor:grab; max-width:100%; box-shadow:var(--shadow)}
#studio-canvas:active{cursor:grabbing}
.studio-controls{display:flex; flex-direction:column; gap:10px}
.field__label{font-size:.82rem; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em}
.format-tabs{display:flex; gap:6px}
.fmt{flex:1; padding:.55rem; border:1px solid var(--border); background:var(--surface); color:var(--text); border-radius:8px; cursor:pointer; font:inherit; font-size:.88rem; transition:.15s}
.fmt.is-active{border-color:var(--primary); color:var(--primary)}
#studio-zoom{width:100%; accent-color:var(--primary)}
.studio-hint{font-size:.85rem}

.post-images{display:flex; flex-direction:column; gap:12px; align-items:center; margin:14px 0}
.post-image{max-width:100%; max-height:72vh; border-radius:8px; box-shadow:var(--shadow)}
.caption-box{margin:14px 0; display:flex; flex-direction:column; gap:8px; align-items:flex-start}
.caption-box textarea{resize:vertical; width:100%}
.post-actions{display:flex; gap:10px; flex-wrap:wrap; margin:8px 0}
.ig-note{display:flex; gap:12px; align-items:flex-start; background:var(--bg-2); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; margin-top:16px}
.ig-note i{font-size:1.5rem; color:var(--primary)}
.ig-note p{margin:.2em 0 0}

/* ── Film-strip composer ───────────────────────────────────────────────────── */
.fs-composer{display:grid; grid-template-columns:1fr 300px; gap:24px; margin-top:18px; align-items:start}
@media (max-width:780px){.fs-composer{grid-template-columns:1fr}}
.fs-pool{display:grid; grid-template-columns:repeat(auto-fill,minmax(86px,1fr)); gap:8px; margin-top:8px}
.fs-thumb{padding:0; border:0; border-radius:8px; overflow:hidden; cursor:pointer; background:var(--surface-2); aspect-ratio:1}
.fs-thumb img{width:100%; height:100%; object-fit:cover}
.fs-thumb.is-used{opacity:.4; outline:2px solid var(--primary); outline-offset:-2px}
.fs-right{display:flex; flex-direction:column; gap:10px}
.fs-slots{display:flex; flex-direction:column; gap:8px}
.fs-previews{display:flex; flex-wrap:wrap; gap:10px}
.fs-preview{border-radius:6px; box-shadow:var(--shadow); background:#0b0b0b}
.fs-slot{position:relative; height:64px; border:1px dashed var(--border); border-radius:8px; display:flex; align-items:center; justify-content:center; overflow:hidden; background:var(--bg-2)}
.fs-slot.is-filled{border-style:solid; cursor:pointer}
.fs-slot img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover}
.fs-slot__n{position:absolute; left:6px; top:6px; z-index:2; background:rgba(0,0,0,.6); color:#fff; width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.8rem; font-weight:600}
.fs-slot__empty{color:var(--muted); font-size:.85rem}
.fs-slot__x{position:absolute; right:6px; top:6px; z-index:2; color:#fff; background:rgba(0,0,0,.55); width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; opacity:0; transition:.15s}
.fs-slot.is-filled:hover .fs-slot__x{opacity:1}

/* ── Admin dashboard ───────────────────────────────────────────────────────── */
.stat-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px 20px; display:flex; flex-direction:column; gap:4px}
.stat-card__n{font-family:'Fraunces',serif; font-size:2rem; color:var(--primary); line-height:1}
.stat-card__l{color:var(--muted); font-size:.9rem}
.admin-tiles{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:14px; margin-top:14px}
.admin-tile{display:flex; flex-direction:column; gap:6px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px; color:var(--text)}
.admin-tile i{font-size:1.4rem; color:var(--primary)}
.admin-tile strong{font-size:1.05rem}
.admin-tile:not(.admin-tile--soon):hover{border-color:var(--primary); transform:translateY(-2px); transition:.15s}
.admin-tile--soon{opacity:.55}
.admin-tile--soon i{color:var(--muted)}
code{background:var(--bg-2); border:1px solid var(--border); border-radius:6px; padding:2px 7px; font-size:.86em}
.admin-head{display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:14px}
.admin-form{max-width:560px}
.row2{display:grid; grid-template-columns:1fr 1fr; gap:14px}
@media (max-width:560px){.row2{grid-template-columns:1fr}}
.inline-form{display:flex; gap:8px; margin:10px 0; flex-wrap:wrap}
.inline-form .input{flex:1; min-width:200px}
.member-row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 0; border-bottom:1px solid var(--border)}
.member-row form{margin:0}
.logo-preview{max-height:64px; width:auto; background:#1b1b1b; border:1px solid var(--border); border-radius:6px; padding:6px; margin-bottom:8px; display:block}
.danger-btn{color:var(--danger); border-color:rgba(229,100,92,.4)}
.danger-btn:hover{border-color:var(--danger); color:#fff; background:var(--danger)}
.uploader{margin:12px 0}
.upload-drop{display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:34px 20px; border:2px dashed var(--border); border-radius:var(--radius); background:var(--bg-2); cursor:pointer; text-align:center; transition:.15s}
.upload-drop:hover,.upload-drop.is-drag{border-color:var(--primary); background:rgba(231,177,90,.06)}
.upload-drop i{font-size:1.8rem; color:var(--primary)}
.upload-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:10px; margin-top:14px}
.up-thumb{aspect-ratio:1; border-radius:8px; overflow:hidden; background:var(--surface-2)}
.up-thumb img{width:100%; height:100%; object-fit:cover}
.up-thumb{position:relative}
.up-thumb.is-hidden{opacity:.45}
.up-thumb.is-hidden::after{content:"nascosta"; position:absolute; left:4px; bottom:4px; background:rgba(0,0,0,.72); color:#fff; font-size:.6rem; padding:1px 5px; border-radius:4px}
.up-actions{position:absolute; top:4px; right:4px; display:flex; gap:4px; opacity:0; transition:.15s}
.up-thumb:hover .up-actions{opacity:1}
.up-btn{width:26px; height:26px; border:0; border-radius:6px; background:rgba(8,10,13,.72); color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:.76rem}
.up-btn:hover{background:rgba(8,10,13,.95)}
.up-btn--del:hover{background:var(--danger)}
.wm-editor{display:grid; grid-template-columns:1fr 320px; gap:26px; margin-top:18px; align-items:start}
@media (max-width:780px){.wm-editor{grid-template-columns:1fr}}
.wm-stage{display:flex; justify-content:center; align-items:flex-start; background:#070809; border:1px solid var(--border); border-radius:var(--radius); padding:16px}
#wm-canvas{border-radius:6px; touch-action:none; cursor:crosshair; max-width:100%; box-shadow:var(--shadow)}
.wm-controls{display:flex; flex-direction:column; gap:10px}
.wm-controls input[type=range]{width:100%; accent-color:var(--primary)}
.anchor-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:5px; max-width:128px}
.anchor-grid button{aspect-ratio:1; border:1px solid var(--border); background:var(--bg-2); border-radius:6px; cursor:pointer; position:relative; padding:0}
.anchor-grid button::after{content:""; position:absolute; width:6px; height:6px; border-radius:50%; background:var(--muted); transform:translate(-50%,-50%)}
.anchor-grid [data-anchor^="t"]::after{top:24%}
.anchor-grid [data-anchor^="m"]::after{top:50%}
.anchor-grid [data-anchor^="b"]::after{top:76%}
.anchor-grid [data-anchor$="l"]::after{left:24%}
.anchor-grid [data-anchor$="c"]::after{left:50%}
.anchor-grid [data-anchor$="r"]::after{left:76%}
.anchor-grid button:hover{border-color:var(--primary)}
.anchor-grid button.is-active{border-color:var(--primary); background:rgba(231,177,90,.12)}
.anchor-grid button.is-active::after{background:var(--primary)}
.car-strip{display:flex; gap:8px; overflow-x:auto; padding:12px 0; margin-top:8px}
.car-thumb{position:relative; flex:0 0 auto; width:72px; height:72px; padding:0; border:2px solid transparent; border-radius:8px; overflow:hidden; cursor:pointer; background:var(--surface-2)}
.car-thumb img{width:100%; height:100%; object-fit:cover}
.car-thumb.is-selected{border-color:rgba(245,180,90,.65)}
.car-thumb.is-current{border-color:var(--primary)}
.car-thumb:not(.is-selected) img{opacity:.55}
.car-thumb__n{position:absolute; left:4px; top:4px; background:var(--primary); color:#1a1206; width:18px; height:18px; border-radius:50%; font-size:.7rem; font-weight:700; display:flex; align-items:center; justify-content:center}
.car-thumb__n:empty{display:none}
.photo-filter{display:flex; gap:8px; flex-wrap:wrap; margin:10px 0}
.photo-filter .input{flex:1; min-width:140px; padding:.5rem .6rem; font-size:.88rem}
.fs-slot--add{border-style:dashed; opacity:.7}

/* ── Albums (manager) ──────────────────────────────────────────────────────── */
.album-list{display:flex; flex-wrap:wrap; gap:12px; margin:16px 0 22px}
.album-card{display:flex; gap:10px; border:1px solid var(--border); border-radius:var(--radius); padding:8px; background:var(--surface); min-width:280px}
.album-card__cover{width:78px; height:78px; border-radius:8px; overflow:hidden; background:var(--bg-2); flex-shrink:0}
.album-card__cover img{width:100%; height:100%; object-fit:cover}
.album-card__body{display:flex; flex-direction:column; gap:3px; justify-content:center}
.album-card__actions{display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; align-items:center}
.album-card__actions form{display:inline}
.album-toolbar{position:sticky; top:8px; z-index:20; display:flex; gap:10px; align-items:center; flex-wrap:wrap; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:10px 14px; margin:14px 0}
.album-toolbar .input{flex:1; min-width:180px}
.album-toolbar #sel-count{font-weight:600; white-space:nowrap}
.album-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px}
.album-pick{position:relative; aspect-ratio:1; border:2px solid transparent; border-radius:8px; overflow:hidden; padding:0; cursor:pointer; background:var(--bg-2)}
.album-pick img{width:100%; height:100%; object-fit:cover; display:block}
.album-pick__check{position:absolute; top:6px; right:6px; width:24px; height:24px; border-radius:50%; background:rgba(8,10,13,.55); color:#fff; display:flex; align-items:center; justify-content:center; opacity:0; transform:scale(.6); transition:.12s}
.album-pick.is-sel{border-color:var(--primary)}
.album-pick.is-sel .album-pick__check{opacity:1; transform:scale(1); background:var(--primary)}
.album-pick.is-sel img{filter:brightness(.85)}

/* ── Album full-screen viewer ──────────────────────────────────────────────── */
.aviewer{position:fixed; inset:0; z-index:400; background:rgba(6,7,9,.96); display:none; flex-direction:column}
.aviewer.is-open{display:flex}
.aviewer__close{position:absolute; top:12px; right:18px; background:none; border:0; color:#fff; font-size:2rem; cursor:pointer; line-height:1; z-index:2}
.aviewer__stage{flex:1; display:flex; align-items:center; justify-content:center; width:100%; padding:14px 14px 78px; box-sizing:border-box}
.aviewer__img{max-width:100%; max-height:100%; object-fit:contain; border-radius:6px; box-shadow:var(--shadow)}
.aviewer__nav{position:absolute; top:50%; transform:translateY(-50%); width:52px; height:52px; border-radius:50%; border:0; background:rgba(255,255,255,.1); color:#fff; font-size:1.1rem; cursor:pointer; display:flex; align-items:center; justify-content:center}
.aviewer__nav:hover{background:rgba(255,255,255,.22)}
.aviewer__prev{left:16px} .aviewer__next{right:16px}
.aviewer__bar{position:absolute; bottom:0; left:0; right:0; display:flex; gap:16px; align-items:center; justify-content:center; padding:14px; background:linear-gradient(transparent,rgba(0,0,0,.65)); flex-wrap:wrap}
.aviewer__pos{color:#fff; font-weight:600; min-width:64px; text-align:center}
#aviewer-mark.is-on{background:#2e7d46; border-color:#2e7d46; color:#fff}
.aviewer__hint{font-size:.78rem}
@media (max-width:640px){.aviewer__stage{padding:40px 10px 96px} .aviewer__hint{display:none}}
.fs-group{margin-bottom:12px}
.fs-group__h{font-size:.76rem; color:var(--muted); margin-bottom:5px; text-transform:uppercase; letter-spacing:.05em}
.fs-group__row{display:flex; gap:6px}
.fs-group__row .fs-slot{flex:1; height:56px}

/* Maintenance log tail (admin storage page) */
.log-tail{background:var(--bg-2); border:1px solid var(--border); border-radius:9px; padding:12px 14px;
  font:400 .8rem/1.6 ui-monospace,monospace; color:var(--muted); overflow-x:auto; white-space:pre-wrap}

/* ── Toast hint (e.g. iOS: how to save into the camera roll) ───────────────── */
#larp-toast{position:fixed; top:calc(14px + env(safe-area-inset-top)); left:50%; transform:translate(-50%,-10px);
  z-index:600; background:var(--surface-2); border:1px solid var(--primary); color:var(--text);
  padding:10px 16px; border-radius:12px; font-size:.9rem; box-shadow:var(--shadow);
  max-width:min(92vw,420px); text-align:center; opacity:0; pointer-events:none; transition:.25s}
#larp-toast.is-on{opacity:1; transform:translate(-50%,0)}

/* ── Busy overlay (post generation) ────────────────────────────────────────── */
/* NB: no backdrop-filter here — blur + text repaint left ghost text on iOS. */
#larp-busy{position:fixed; inset:0; z-index:700; background:rgba(8,10,13,.96);
  display:none; align-items:center; justify-content:center; text-align:center; padding:24px}
#larp-busy.is-on{display:flex}
.busy-box{display:flex; flex-direction:column; align-items:center; gap:12px; max-width:340px}
.busy-spin{position:relative; width:74px; height:74px; margin-bottom:6px}
.busy-ring{position:absolute; inset:0; border-radius:50%; border:4px solid rgba(231,177,90,.18);
  border-top-color:var(--primary); animation:busy-rot .9s linear infinite}
.busy-emoji{position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:1.9rem}
@keyframes busy-rot{to{transform:rotate(360deg)}}
.busy-title{font-family:'Fraunces',Georgia,serif; font-size:1.35rem}
.busy-msg{color:var(--primary); font-size:.98rem; min-height:1.5em}
.busy-note{color:var(--muted); font-size:.85rem; line-height:1.5}

/* ── Modal (board picker) ──────────────────────────────────────────────────── */
.modal{position:fixed; inset:0; z-index:300; background:rgba(6,7,9,.8); display:none; align-items:center; justify-content:center; padding:20px}
.modal.is-open{display:flex}
.modal__panel{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px; width:100%; max-width:390px; position:relative; box-shadow:var(--shadow)}
.modal__panel h3{margin:0 0 14px}
.modal__close{position:absolute; top:8px; right:14px; background:none; border:0; color:var(--muted); font-size:1.7rem; cursor:pointer; line-height:1}
.board-list{display:flex; flex-direction:column; gap:6px; max-height:320px; overflow-y:auto; margin-bottom:12px}
.board-row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid var(--border); border-radius:9px; background:var(--bg-2); color:var(--text); cursor:pointer; font:inherit; text-align:left}
.board-row:hover{border-color:var(--primary)}
.board-row.is-active{border-color:var(--primary); color:var(--primary)}

/* ── Share choice sheet: the image itself, or the permalink to reach it ────── */
#larp-sheet{position:fixed; inset:0; z-index:650; background:rgba(8,10,13,.62); display:none;
  align-items:flex-end; justify-content:center; padding:16px;
  padding-bottom:calc(16px + env(safe-area-inset-bottom))}
#larp-sheet.is-on{display:flex}
.sheet-box{width:min(440px,100%); display:flex; flex-direction:column; gap:8px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:12px; box-shadow:var(--shadow); animation:sheet-up .18s ease-out}
@keyframes sheet-up{from{transform:translateY(16px); opacity:.4}}
.sheet-opt{display:flex; align-items:center; gap:10px; width:100%; padding:.85rem 1rem; font:inherit;
  background:var(--bg-2); border:1px solid var(--border); border-radius:var(--radius-sm);
  color:var(--text); cursor:pointer; text-align:left; transition:.15s}
.sheet-opt:hover{border-color:var(--primary)}
.sheet-opt i{color:var(--primary); width:1.2em; text-align:center}
.sheet-cancel{width:100%; padding:.6rem; font:inherit; background:none; border:0; color:var(--muted); cursor:pointer}
.sheet-cancel:hover{color:var(--text)}
