:root{--ink:#161412;--ink2:#4a443e;--muted:#6a625a;--cream:#EDE8E0;--paper:#F7F4EE;--red:#B8232B;--sans:"Archivo",system-ui,-apple-system,"Segoe UI",sans-serif}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{overflow:hidden;font-family:var(--sans);color:var(--ink);background:var(--cream);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer}
button:focus-visible,canvas:focus-visible,img:focus-visible,.card:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
[hidden]{display:none!important}

/* ---------- glavni ekran ---------- */
#page{position:relative;height:100vh;height:100dvh;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:clamp(24px,4vw,70px);padding:20px clamp(20px,4vw,64px);transition:opacity .5s}
body.done #page{opacity:0;pointer-events:none}
.intro{display:flex;flex-direction:column;gap:16px;justify-self:end;width:min(100%,340px);padding-bottom:4vh}
.brand{display:flex;align-items:center;gap:10px;font-size:13px;letter-spacing:.02em;color:var(--muted)}
.lang{border:0;background:transparent;padding:3px 8px;border-radius:99px;font-size:11px;font-weight:800;letter-spacing:.08em;box-shadow:inset 0 0 0 1px rgba(22,20,18,.25);color:var(--muted)}
h1{margin:0;font-stretch:72%;font-weight:800;font-size:clamp(38px,4.3vw,68px);line-height:.88;letter-spacing:-.01em;text-transform:uppercase}
h1 .star{display:block;font-size:.9em;line-height:1;margin-bottom:.12em}
h1 .l{display:block;white-space:nowrap}
h1.long{font-size:clamp(32px,3.4vw,54px)}
.sub{margin:0;font-size:15px;line-height:1.5;color:var(--ink2);max-width:32ch}
.sub:empty{display:none}
.controls{display:flex;align-items:center;gap:10px 12px;flex-wrap:wrap}
.btn{border:0;border-radius:999px;padding:13px 26px 12px;font-stretch:80%;font-weight:800;font-size:17px;letter-spacing:.04em;text-transform:uppercase;background:var(--ink);color:#F6F2EA}
.btn:active,.pill:active{transform:translateY(2px)}
.btn[disabled],.pill[disabled]{opacity:.35;cursor:default}
.btn.ghost{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--ink)}
.btn.link{background:transparent;color:var(--ink);text-decoration:underline;text-underline-offset:4px;padding-left:6px;padding-right:6px}
.hg{display:inline-block;height:.85em;width:auto;margin-left:.25em;vertical-align:-.1em;fill:currentColor}
.textbtn{align-self:flex-start;border:0;background:transparent;padding:0;font-size:14px;color:var(--ink2);text-decoration:underline;text-underline-offset:3px;text-align:left}
#hint{margin:0;font-size:13px;line-height:1.4;color:var(--muted);min-height:18px}
#linkTxt{margin:0;font-size:13px;line-height:1.4;color:var(--ink2);word-break:break-all;-webkit-user-select:text;user-select:text;max-width:38ch}
.membtn{position:relative;align-self:flex-start;display:inline-flex;align-items:center;gap:4px;border:0;border-radius:999px;padding:9px 16px 8px;background:rgba(251,249,244,.75);box-shadow:inset 0 0 0 1px rgba(22,20,18,.18);font-stretch:85%;font-weight:800;font-size:14px;letter-spacing:.05em;text-transform:uppercase}
.membtn .mstar{font-size:12px}
#memCount{color:var(--muted);font-weight:500}
#memDot{position:absolute;right:2px;top:2px;width:10px;height:10px;border-radius:50%;background:var(--red);box-shadow:0 0 0 2px var(--cream)}

/* ---------- traka u kojoj se slika ---------- */
.booth{display:flex;align-items:center;justify-content:center;height:100%;min-height:0}
.strip{--sw:min(calc((100vh - 40px) / 2.22), 46vw);--sw:min(calc((100dvh - 40px) / 2.22), 46vw);width:var(--sw);padding:calc(var(--sw) * .055);display:flex;flex-direction:column;gap:calc(var(--sw) * .035);background:#F6F4EF;
  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='.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow:0 1px 1px rgba(40,30,20,.22),0 14px 24px rgba(40,30,20,.16);border-radius:2px}
.slot{position:relative;aspect-ratio:2/1;background:#141210;box-shadow:0 0 0 1px rgba(20,18,16,.35);overflow:hidden}
.slot>canvas{position:absolute;inset:0;width:100%;height:100%;transition:filter 1.6s ease-out}
.slot>canvas.fresh{filter:brightness(2.4) contrast(.25)}

.frame{position:absolute;inset:0;z-index:2;background:#1B1917;overflow:hidden}
.half{position:absolute;top:0;bottom:0;width:50%;overflow:hidden}
.half.l{left:0}.half.r{right:0}
.half .still{position:absolute;inset:0;width:100%;height:100%;display:none}
.half.has-still .still{display:block}
#cam{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transform:scaleX(-1);filter:grayscale(1) contrast(1.15) brightness(.95);display:none}
.half.live #cam{display:block}
.half.has-still #cam{display:none}
.empty{position:absolute;inset:calc(var(--sw,300px) * .03);border:1.5px dashed rgba(244,239,230,.38);display:flex;align-items:flex-end;justify-content:center;padding:0 4px 8px;text-align:center;color:rgba(244,239,230,.85);font-size:clamp(10px,calc(var(--sw,300px) * .042),13px);letter-spacing:.02em;line-height:1.2}
.half.live .empty,.half.has-still .empty{display:none}
.frame.waiting .half.r .empty{animation:breathe 2.4s ease-in-out infinite}
@keyframes breathe{50%{opacity:.4}}
.seam{position:absolute;left:50%;top:0;bottom:0;width:2px;margin-left:-1px;background:rgba(246,242,234,.5);z-index:3;pointer-events:none}
.vig{position:absolute;inset:0;z-index:3;pointer-events:none;background:radial-gradient(80% 75% at 50% 45%,transparent 60%,rgba(30,15,5,.3) 100%)}
#guide{position:absolute;left:50%;top:calc(var(--gy,.6) * 100%);height:calc(var(--gs,.32) * 100%);aspect-ratio:1;translate:-50% -50%;z-index:4;opacity:0;transition:opacity .25s;pointer-events:none;filter:drop-shadow(0 1px 2px rgba(0,0,0,.5))}
#guide.on{opacity:1}
#guide svg{width:100%;height:100%;overflow:visible}
#count{position:absolute;right:8px;top:6px;z-index:5;font-stretch:72%;font-weight:800;font-size:clamp(12px,calc(var(--sw,300px) * .065),20px);color:rgba(255,255,255,.85);opacity:0;transition:opacity .3s}
.frame.live #count{opacity:1}
#bar{position:absolute;left:0;bottom:0;z-index:5;height:3px;width:0;background:#F6F2EA;opacity:0}
.frame.live #bar{opacity:.9}
#big{position:absolute;inset:0;z-index:6;display:grid;place-items:center;font-stretch:72%;font-weight:800;font-size:calc(var(--sw,300px) * .4);color:#fff;opacity:0;pointer-events:none;text-shadow:0 6px 30px rgba(0,0,0,.5)}
#big.pop{animation:pop .78s ease-out}
@keyframes pop{0%{opacity:0;transform:scale(1.25)}22%{opacity:1;transform:scale(1)}78%{opacity:1}100%{opacity:0}}
#sflash{position:absolute;inset:0;z-index:7;background:#fff;opacity:0;pointer-events:none}
#sflash.go{animation:fl .45s ease-out}
@keyframes fl{0%{opacity:0}10%{opacity:1}100%{opacity:0}}
#flash{position:fixed;inset:0;z-index:30;background:#FFFCF6;opacity:0;pointer-events:none}
#flash.go{animation:fl2 .5s ease-out}
@keyframes fl2{0%{opacity:0}10%{opacity:.55}100%{opacity:0}}

/* srce koje se spoji preko sredine */
#join{position:absolute;left:50%;top:calc(var(--gy,.6) * 100%);height:calc(var(--gs,.32) * 100%);aspect-ratio:1;translate:-50% -50%;z-index:8;pointer-events:none;display:none;filter:drop-shadow(0 6px 8px rgba(0,0,0,.35))}
#join.on{display:block}
#join svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
#join.on .jl{animation:jl 1.5s cubic-bezier(.3,.7,.2,1) both}
#join.on .jr{animation:jr 1.5s cubic-bezier(.3,.7,.2,1) both}
#join.on{animation:jbeat 1.9s ease-in-out both}
@keyframes jl{0%{transform:translateX(-130%) rotate(-14deg);opacity:0}15%{opacity:1}60%,100%{transform:none;opacity:1}}
@keyframes jr{0%{transform:translateX(130%) rotate(14deg);opacity:0}15%{opacity:1}60%,100%{transform:none;opacity:1}}
@keyframes jbeat{0%,62%{scale:1}72%{scale:1.18}82%{scale:.96}90%,100%{scale:1}}

.side{justify-self:start;width:min(100%,320px)}
.track{display:flex;flex-direction:column;align-items:flex-start;gap:12px;width:100%}
.track.hide{display:none}
.tl{font-stretch:72%;font-weight:800;font-size:clamp(26px,2.8vw,44px);line-height:1;text-transform:uppercase;max-width:100%}
.segs{display:flex;gap:6px;width:min(100%,260px)}
.segs i{flex:1;height:9px;border-radius:5px;background:rgba(22,20,18,.13);overflow:hidden}
.segs i b{display:block;height:100%;width:0;background:var(--ink)}

/* ---------- gotova traka ---------- */
#results{position:fixed;inset:0;z-index:20;display:grid;grid-template-columns:minmax(220px,1fr) auto minmax(0,.4fr);align-items:center;gap:clamp(24px,4vw,70px);padding:28px clamp(20px,4vw,64px);opacity:0;transition:opacity .6s;background:var(--cream)}
#results.show{opacity:1}
.rl{display:flex;flex-direction:column;gap:18px;justify-self:end;width:min(100%,360px)}
.rl h2{margin:0;font-stretch:72%;font-weight:800;font-size:clamp(46px,5.4vw,84px);line-height:.88;text-transform:uppercase}
.rl h2 .l{display:block}
.pnote{margin:0;font-size:14px;line-height:1.4;color:var(--ink2);min-height:20px}
.acts{display:flex;gap:10px;flex-wrap:wrap;transition:opacity .6s}
#results:not(.printed) .acts{opacity:0;pointer-events:none}
.pill{border:0;border-radius:999px;padding:12px 20px 11px;font-stretch:80%;font-weight:800;font-size:15px;letter-spacing:.04em;text-transform:uppercase;background:transparent;box-shadow:inset 0 0 0 1.5px var(--ink);white-space:nowrap}
.pill.dark{background:var(--ink);color:#F6F2EA;box-shadow:none}
.pill.link{box-shadow:none;text-decoration:underline;text-underline-offset:4px;padding-left:8px;padding-right:8px}
#shareNote{margin:0;font-size:13px;color:var(--ink2);min-height:18px}

.printer{position:relative;height:min(86vh,calc(100dvh - 56px));aspect-ratio:.56;display:flex;flex-direction:column;align-items:center}
.printer .head{position:relative;z-index:3;width:100%;height:8.5%;border-radius:12px;flex:none;
  background:repeating-linear-gradient(90deg,rgba(255,255,255,.08) 0 1px,rgba(0,0,0,.035) 1px 2px,transparent 2px 4px),linear-gradient(180deg,#F7F8F9 0%,#DCDFE2 34%,#C3C7CB 60%,#E2E4E6 80%,#B4B9BE 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95),inset 0 -2px 0 rgba(0,0,0,.18),0 2px 4px rgba(40,30,20,.16),0 14px 26px rgba(40,30,20,.13)}
.printer .slit{position:absolute;left:50%;bottom:22%;width:78%;height:12%;translate:-50% 0;border-radius:99px;background:linear-gradient(180deg,#09090a,#222426 70%,#3a3d40);box-shadow:inset 0 2px 3px rgba(0,0,0,.85),0 1px 0 rgba(255,255,255,.9)}
.printer .mark{position:absolute;left:5%;top:16%;font-size:clamp(9px,1.3vh,13px);font-weight:500;letter-spacing:.04em;color:#868B91;text-shadow:0 1px 0 rgba(255,255,255,.9)}
.printer .led{position:absolute;right:5%;top:20%;width:9px;height:9px;border-radius:50%;background:radial-gradient(circle at 40% 35%,#d9dcde,#8d9297)}
.printing .led{background:radial-gradient(circle at 40% 35%,#fff,#dcf6e5 45%,#86d6a0);box-shadow:0 0 8px 2px rgba(140,230,170,.55);animation:led 1.1s ease-in-out infinite}
@keyframes led{50%{opacity:.45}}
.feed{position:relative;z-index:2;width:86%;flex:1;min-height:0;margin-top:-3.2%;overflow:hidden;padding:0 4% 20px}
.feed canvas{display:block;width:100%;height:auto;max-height:100%;object-fit:contain;transform:translateY(-101%);filter:drop-shadow(0 8px 10px rgba(30,30,30,.2));cursor:wait}
.feed canvas.landed{cursor:zoom-in}

/* ---------- uspomene ---------- */
.sheet{position:fixed;inset:0;z-index:35;overflow:auto;-webkit-overflow-scrolling:touch;background:var(--cream);padding:22px clamp(16px,4vw,56px) 40px;opacity:0;transition:opacity .3s;-webkit-user-select:text;user-select:text}
.sheet.show{opacity:1}
#detail{z-index:36}
.sh{display:flex;align-items:center;justify-content:space-between;gap:14px;max-width:1200px;margin:0 auto 6px;padding-right:50px}
.sh h2{margin:0;font-stretch:72%;font-weight:800;font-size:clamp(34px,5vw,64px);line-height:.9;text-transform:uppercase}
.sheetsub{max-width:1200px;margin:6px auto 22px;font-size:14px;color:var(--ink2);line-height:1.45}
.cards{max-width:1200px;margin:0 auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:22px 18px}
.card{position:relative;display:flex;flex-direction:column;gap:8px;border:0;padding:0;background:transparent;text-align:left}
.card .ph{position:relative;width:100%;aspect-ratio:.62;background:#F6F4EF;box-shadow:0 1px 1px rgba(40,30,20,.2),0 10px 18px rgba(40,30,20,.14);overflow:hidden;transition:transform .2s}
.card:hover .ph{transform:translateY(-3px) rotate(-.6deg)}
.card img{width:100%;height:100%;object-fit:cover;object-position:top;display:block}
.card.pending img{filter:grayscale(1) brightness(.75)}
.card .badge{position:absolute;left:8px;top:8px;padding:4px 8px 3px;border-radius:99px;background:rgba(22,20,18,.82);color:#F6F2EA;font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}
.card .new{position:absolute;right:8px;top:8px;padding:4px 8px 3px;border-radius:99px;background:var(--red);color:#fff;font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}
.card .cd{font-size:13px;font-weight:800;letter-spacing:.02em}
.card .cs{font-size:12px;color:var(--muted);margin-top:-6px}
.empty-note{max-width:1200px;margin:30px auto;font-size:15px;color:var(--ink2)}
.sf{max-width:1200px;margin:40px auto 0;padding-top:18px;border-top:1px solid rgba(22,20,18,.12)}
.small{margin:6px 0 0;font-size:13px;line-height:1.45;color:var(--muted)}
#deviceNote{word-break:break-all}

.dmeta{font-size:13px;color:var(--muted);text-align:right}
.dbody{max-width:1200px;margin:18px auto 0;display:grid;grid-template-columns:auto minmax(0,1fr);gap:clamp(24px,4vw,60px);align-items:start}
.dstrip{position:relative;display:flex;flex-direction:column;align-items:center;gap:14px;position:sticky;top:0}
#detStrip{display:block;height:min(74vh,880px);width:auto;max-width:42vw;object-fit:contain;filter:drop-shadow(0 12px 18px rgba(40,30,20,.2));cursor:zoom-in;background:#F6F4EF}
.dwait{position:absolute;left:50%;top:10px;translate:-50% 0;padding:6px 12px 5px;border-radius:99px;background:rgba(22,20,18,.85);color:#F6F2EA;font-size:12px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap}
.dacts{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.dstrip .small{text-align:center;max-width:36ch}
.album h3{margin:0 0 14px;font-stretch:72%;font-weight:800;font-size:clamp(28px,3vw,42px);line-height:.95;text-transform:uppercase}
.sendbox{display:flex;flex-direction:column;gap:10px;padding:14px;border-radius:14px;background:rgba(251,249,244,.8);box-shadow:inset 0 0 0 1px rgba(22,20,18,.12);margin-bottom:22px}
.sendbox textarea{width:100%;resize:vertical;border:0;border-radius:10px;padding:10px 12px;font:inherit;font-size:15px;background:#fff;box-shadow:inset 0 0 0 1px rgba(22,20,18,.15);color:var(--ink)}
.sendrow{display:flex;gap:10px;flex-wrap:wrap}
.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:16px}
.photo{margin:0;display:flex;flex-direction:column;gap:6px}
.photo .pw{position:relative;aspect-ratio:1;background:#ddd6cb;overflow:hidden;border-radius:4px;box-shadow:0 1px 1px rgba(40,30,20,.18),0 6px 12px rgba(40,30,20,.1)}
.photo img{width:100%;height:100%;object-fit:cover;display:block;cursor:zoom-in}
.photo .who{position:absolute;left:6px;bottom:6px;padding:3px 7px 2px;border-radius:99px;font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;background:rgba(251,249,244,.92);color:var(--ink)}
.photo.theirs .who{background:var(--red);color:#fff}
.photo figcaption{font-size:13px;line-height:1.35;color:var(--ink2);white-space:pre-wrap;word-break:break-word}
.photo figcaption time{display:block;font-size:11px;color:var(--muted)}
.photo.sending .pw{opacity:.5}

#light{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;gap:24px;padding:24px;background:rgba(237,232,224,.97);opacity:0;transition:opacity .25s}
#light.show{opacity:1}
#lightImg{max-height:calc(100dvh - 48px);max-width:min(78vw,1400px);width:auto;height:auto;object-fit:contain;filter:drop-shadow(0 20px 26px rgba(40,30,20,.28));cursor:zoom-out}
.lacts{display:flex;flex-direction:column;gap:10px;max-width:260px}
#lightCap{margin:0 0 6px;font-size:14px;line-height:1.4;color:var(--ink2);white-space:pre-wrap;word-break:break-word}
#lightCap:empty{display:none}

.music{position:fixed;right:max(14px,env(safe-area-inset-right));top:max(14px,env(safe-area-inset-top));z-index:45;width:42px;height:42px;border:0;border-radius:50%;display:grid;place-items:center;padding:0;background:rgba(251,249,244,.88);box-shadow:inset 0 0 0 1px rgba(22,20,18,.18),0 2px 8px rgba(40,30,20,.08);color:var(--ink)}
.music svg{width:20px;height:20px}
.music.off{color:var(--muted)}
.music.off::after{content:"";position:absolute;width:26px;height:2px;border-radius:2px;background:currentColor;rotate:-45deg;box-shadow:0 0 0 1.5px rgba(251,249,244,.9)}
.music.wait{animation:mwait 1.6s ease-in-out infinite}
@keyframes mwait{50%{box-shadow:inset 0 0 0 1px rgba(22,20,18,.18),0 0 0 7px rgba(184,35,43,.18)}}
#toast{position:fixed;left:50%;bottom:22px;z-index:60;translate:-50% 20px;max-width:min(92vw,480px);padding:11px 18px 10px;border-radius:99px;background:var(--ink);color:#F6F2EA;font-size:14px;line-height:1.35;text-align:center;opacity:0;pointer-events:none;transition:opacity .25s,translate .25s}
#toast.show{opacity:1;translate:-50% 0}

/* ---------- telefon ---------- */
@media (max-width:860px),(max-aspect-ratio:1/1){
  body{overflow:auto}
  #page{grid-template-columns:1fr;grid-template-rows:auto auto auto;gap:12px;padding:16px 16px 18px;align-content:start;align-items:stretch;min-height:100dvh;height:auto}
  .intro{gap:10px;padding:0;justify-self:stretch;width:auto}
  h1,h1.long{font-size:24px;line-height:.95}
  h1 .l{display:inline;margin-right:.25em;white-space:normal}
  h1 .star{display:inline;margin:0 6px 0 0}
  .sub{font-size:13px;max-width:none}
  .btn{padding:11px 20px 10px;font-size:15px}
  .strip{--sw:min(calc((100dvh - 250px) / 2.22), 88vw)}
  .booth{height:auto}
  .side{justify-self:stretch;width:auto}
  .track{align-items:center}
  .tl{text-align:center;font-size:22px}
  #results{grid-template-columns:1fr;grid-template-rows:auto 1fr;gap:12px;padding:16px;align-items:stretch;overflow:auto}
  .rl{justify-self:stretch;width:auto;gap:10px}
  .rl h2{font-size:30px}.rl h2 .l{display:inline;margin-right:.25em}
  .pill{padding:10px 16px 9px;font-size:14px}
  .printer{height:auto;width:min(100%,calc((100dvh - 230px) * .56));justify-self:center;aspect-ratio:auto}
  .printer .head{height:auto;aspect-ratio:7.5}
  .feed{flex:none}
  .dbody{grid-template-columns:1fr}
  .dstrip{position:relative}
  #detStrip{height:auto;max-height:52dvh;max-width:100%}
  #light{flex-direction:column;gap:12px}
  #lightImg{max-height:calc(100dvh - 150px);max-width:100%}
  .lacts{flex-direction:row;flex-wrap:wrap;justify-content:center;max-width:none}
  #lightCap{width:100%;text-align:center}
}
@media (max-height:560px) and (min-aspect-ratio:1/1){.sub{display:none}h1{font-size:40px}}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition:none!important}}
