/* Card 657: Sten, sax, påse at /rps/ (SPEC.md §4): setup, play, result. */
:root{--t-beat:380ms;--t-snap:260ms;--t-stick:360ms}
.app{position:relative;z-index:1;max-width:1200px;margin:0 auto;height:100vh;height:100dvh;display:flex;flex-direction:column;gap:var(--gap);padding:calc(var(--pad) + env(safe-area-inset-top)) calc(var(--pad) + env(safe-area-inset-right)) calc(var(--pad) + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left))}
header{display:flex;align-items:center;justify-content:space-between;gap:10px}
header .logo{font-size:40px;text-align:center}
.screen{flex:1;min-height:0;display:flex;flex-direction:column;gap:var(--gap)}
/* <main> (L7) wraps the screens; keep the .app flex chain intact. */
#main{flex:1;min-height:0;display:flex;flex-direction:column}
.screen[hidden]{display:none}
.row h2{font:400 24px/1 var(--font-display);letter-spacing:.04em}
/* ---------- setup ---------- */
.bubble h1{font-size:44px}
.opps{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;flex:1;min-height:0}
label.opt{position:relative;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;background:var(--paper);border:var(--stroke) solid var(--ink);border-radius:var(--r-panel);box-shadow:var(--pop);padding:12px;min-height:44px;transition:transform .12s var(--ease-pop),box-shadow .12s,background .12s}
label.opt img,label.opt .ico{width:min(150px,70%);aspect-ratio:1;object-fit:contain}
label.opt b{font:400 30px/1 var(--font-display);letter-spacing:.04em}
label.opt small{font:900 13px var(--font-body);text-transform:uppercase;letter-spacing:.05em}
label.opt .lvl{display:flex;gap:4px}.lvl i{width:12px;height:12px;border:2px solid var(--ink);border-radius:50%;background:#fff}.lvl i.on{background:var(--red)}
label.opt:has(input:checked){background:var(--mint);transform:translate(-2px,-2px) rotate(-1deg);box-shadow:8px 8px 0 var(--ink)}
label.opt:has(input:checked):after{content:'✓';position:absolute;top:-12px;right:-12px;width:36px;height:36px;display:grid;place-items:center;font:900 20px var(--font-body);background:var(--bg);border:3px solid var(--ink);border-radius:50%}
label.opt:has(input:focus-visible){outline:4px solid var(--purple);outline-offset:3px}
.row{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.bo{display:flex;gap:12px}
.bo label.opt{flex-direction:row;padding:0 18px;min-width:64px;min-height:56px;border-radius:999px;box-shadow:var(--pop-sm)}
.bo label.opt b{font-size:26px}
.bo label.opt:has(input:checked){background:var(--ink);color:var(--bg);transform:none;box-shadow:var(--pop-sm)}
.bo label.opt:has(input:checked):after{display:none}
.go{margin-left:auto;min-width:240px;font-size:32px;min-height:72px}
/* ---------- play ---------- */
.score{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px}
.chip{display:flex;align-items:center;gap:10px;background:#fff;border:var(--stroke) solid var(--ink);border-radius:999px;box-shadow:var(--pop-sm);padding:4px 16px 4px 4px;min-width:0}
.chip.r{flex-direction:row-reverse;padding:4px 4px 4px 16px;justify-self:end}.chip.l{justify-self:start}
.chip .av{width:48px;height:48px;border-radius:50%;border:3px solid var(--ink);display:grid;place-items:center;font:400 20px var(--font-display);flex:none;overflow:hidden}
.chip .av img{width:100%;height:100%;object-fit:cover;transform:scale(1.15)}
.chip.l .av{background:var(--blue);color:#fff}.chip.r .av{background:var(--red-ink);color:#fff}
.chip .nm{font:900 14px var(--font-body);text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chip .pts{font:400 40px/1 var(--font-display);margin-left:auto}.chip.r .pts{margin-left:0;margin-right:auto}
.chip.bump .pts{animation:bump 300ms var(--ease-pop)}
@keyframes bump{40%{transform:scale(1.5) rotate(-8deg);color:var(--red)}}
.mid{text-align:center}.mid .rd{font:400 26px/1 var(--font-display);letter-spacing:.05em}
.pips{display:flex;gap:4px;justify-content:center;margin-top:4px}.pips i{width:12px;height:12px;border-radius:50%;border:2px solid var(--ink);background:#fff}.pips i.b{background:var(--blue)}.pips i.r{background:var(--red)}
.arena{position:relative;flex:1;min-height:0;display:flex;flex-direction:row;align-items:center;justify-content:space-between;border:var(--stroke) solid var(--ink);border-radius:var(--r-panel);background:var(--paper);box-shadow:var(--pop);overflow:hidden}
.arena:before{content:'';position:absolute;inset:-40%;background:repeating-conic-gradient(from 0deg,rgba(255,210,63,.45) 0 8deg,transparent 8deg 20deg)}
.slot{position:relative;flex:1;height:100%;display:grid;place-items:center}
.slot.opp{order:3}.slot.me{order:1}
.hs{filter:drop-shadow(6px 6px 0 var(--ink));height:min(78%,300px);aspect-ratio:200/220;display:grid;place-items:center}
.rot{width:100%;height:100%}
.me .rot{transform:rotate(90deg)}.opp .rot{transform:rotate(-90deg) scaleX(-1)}
.hand{width:100%;height:100%;overflow:visible;display:block}
.me .hand{color:var(--blue)}.opp .hand{color:var(--red)}
.who{position:absolute;bottom:12px;font:400 20px var(--font-display);letter-spacing:.05em;background:#fff;border:3px solid var(--ink);border-radius:10px;padding:0 10px}
.me .who{left:14px}.opp .who{right:14px}
.vs{order:2;position:relative;z-index:2;width:110px;flex:none;display:grid;place-items:center}
.vs .boom{font:400 44px/1 var(--font-display);color:#fff;-webkit-text-stroke:2px var(--ink);background:var(--purple);border:var(--stroke) solid var(--ink);border-radius:50%;width:84px;height:84px;display:grid;place-items:center;transform:rotate(-8deg);box-shadow:var(--pop-sm)}
.call{position:absolute;left:50%;top:50%;z-index:4;transform:translate(-50%,-50%);font:400 clamp(48px,9vw,96px)/1 var(--font-display);letter-spacing:.04em;color:var(--bg);-webkit-text-stroke:3px var(--ink);text-shadow:5px 5px 0 var(--ink);pointer-events:none;white-space:nowrap}
.call.pop{animation:callpop 220ms var(--ease-pop)}
@keyframes callpop{0%{transform:translate(-50%,-50%) scale(.6) rotate(-6deg)}70%{transform:translate(-50%,-50%) scale(1.15)}100%{transform:translate(-50%,-50%) scale(1)}}
.think{position:absolute;top:10px;right:12px;width:84px;opacity:0;transform:scale(.4);transition:opacity .2s,transform .3s var(--ease-pop);z-index:3}
.arena.shaking .think{opacity:1;transform:scale(1)}
.arena.shaking .hand{animation:shake var(--t-beat) var(--ease-shake) 3}
@keyframes shake{50%{transform:translateY(-28px)}}
.arena.revealed .hand{animation:snap var(--t-snap) var(--ease-pop)}
@keyframes snap{0%{transform:scale(1.25)}}
.slot.won .hs{animation:bob 600ms ease-in-out 260ms 2}
@keyframes bob{50%{transform:translateY(-10px) scale(1.06)}}
.slot.lost .hs{animation:nope 420ms ease-in-out 260ms;opacity:.75}
@keyframes nope{20%,60%{transform:translateX(-8px)}40%,80%{transform:translateX(8px)}}
.arena.draw .hs{animation:dbump 240ms ease-in-out 260ms}
@keyframes dbump{50%{transform:scale(.92)}}
.impact{position:absolute;left:50%;top:50%;width:260px;height:260px;margin:-130px 0 0 -130px;z-index:1;opacity:0;pointer-events:none}
.arena.revealed .impact{animation:impact 300ms var(--ease-out)}
@keyframes impact{0%{opacity:1;transform:scale(.2)}100%{opacity:0;transform:scale(1.4)}}
.react{position:absolute;left:50%;top:50%;z-index:5;width:min(300px,70%);aspect-ratio:1;transform:translate(-50%,-50%) rotate(-4deg);display:grid;place-items:center;pointer-events:none}
.react[hidden]{display:none}
.react svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;filter:drop-shadow(6px 6px 0 var(--ink))}
.react span{position:relative;font:400 clamp(40px,7vw,64px)/1 var(--font-display);letter-spacing:.04em;color:#fff;-webkit-text-stroke:2.5px var(--ink);text-shadow:4px 4px 0 var(--ink);text-align:center}
.react img{position:absolute;inset:-6%;width:112%;height:112%;display:block}
.react.gen svg{display:none}.react.gen span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.react:not(.gen) img{display:none}
.react.in{animation:stick var(--t-stick) var(--ease-pop) both}
/* Phones (L9): rps.js adds .fade 0.7 s after the sticker lands so the hands
   underneath stay readable; the sticker is smaller there too. */
.react.fade{animation:rfade .3s ease forwards}
@keyframes rfade{from{opacity:1}to{opacity:0}}
@media (max-width:640px){.react{width:min(210px,56%)}}
@keyframes stick{0%{transform:translate(-50%,-50%) scale(.3) rotate(-12deg);opacity:0}100%{transform:translate(-50%,-50%) scale(1) rotate(-4deg);opacity:1}}
.status{text-align:center;font:900 16px var(--font-body);min-height:22px}
.choices{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;max-width:720px;width:100%;margin:0 auto}
.choice{display:flex;align-items:center;justify-content:center;gap:10px;min-height:88px;background:#fff;border:var(--stroke) solid var(--ink);border-radius:var(--r-btn);box-shadow:var(--pop);font:400 24px var(--font-display);letter-spacing:.04em;color:var(--ink);cursor:pointer;transition:transform 80ms,box-shadow 80ms,background .15s}
.choice svg{width:52px;height:57px;color:var(--blue);flex:none;filter:drop-shadow(2px 2px 0 var(--ink))}
/* Hover only where it is real: on touch it sticks and gave away P1's pick. */
@media (hover:hover){.choice:hover{background:#FFF3C4}}
/* Key hint (keyboard + mouse devices only). */
.keys{display:none;text-align:center;font:800 13px var(--font-body);opacity:.75;margin:-4px 0 0}
@media (hover:hover) and (pointer:fine){.keys{display:block}}
.choice:active,.choice.picked{transform:translate(4px,4px);box-shadow:2px 2px 0 var(--ink)}
.choice.picked{background:var(--mint)}
.choice:disabled{cursor:default}
.choices.locked .choice:not(.picked){opacity:.55}
/* ---------- result ---------- */
.overlay{position:fixed;inset:0;z-index:20;display:grid;place-items:center;background:rgba(20,20,20,.55);padding:20px}
.overlay[hidden]{display:none}
.res{position:relative;width:min(520px,100%);text-align:center;padding:28px 24px 24px;animation:stick2 420ms var(--ease-pop) both}
@keyframes stick2{0%{transform:scale(.5) rotate(-8deg);opacity:0}}
.res .rb{width:150px;height:150px;margin:-100px auto 4px;position:relative}
.res .rb img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(4px 4px 0 var(--ink))}
.res h2{font:400 54px/1 var(--font-display);letter-spacing:.03em;color:var(--red);-webkit-text-stroke:2px var(--ink);text-shadow:4px 4px 0 var(--ink)}
.res.won h2{color:var(--mint)}
.res .fs{font:400 76px/1 var(--font-display);margin:8px 0 4px}
.res .fs .b{color:var(--blue)}.res .fs .r{color:var(--red)}
.res p{font-weight:800}
.res .acts{display:grid;gap:12px;margin-top:18px}
.res .acts .two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.confetti{position:fixed;inset:0;pointer-events:none;z-index:21;overflow:hidden}
.confetti i{position:absolute;top:-20px;width:12px;height:18px;border:2px solid var(--ink);animation:fall 2.6s var(--ease-out) both}
@keyframes fall{to{transform:translateY(110vh) rotate(720deg)}}
/* ---------- phone / portrait ---------- */
@media (orientation:portrait),(max-width:640px){
  .arena{flex-direction:column}
  .slot{width:100%;height:auto;flex:1;min-height:0}
  .slot.opp{order:1}.slot.me{order:3}
  .me .rot{transform:none}.opp .rot{transform:rotate(180deg)}
  .vs{width:auto;height:0}
  .hs{height:92%;max-height:300px}
  .who{bottom:auto;top:10px}.me .who{left:12px;top:auto;bottom:10px}.opp .who{right:12px}
  .think{right:auto;left:12px;top:8px}
}
@media (max-width:640px){
  header .logo{font-size:22px}
  #back .bt{display:none}#back{padding:0 14px;font-size:20px}
  .chip .nm{display:none}
  .res .pill{font-size:14px;padding:0 8px}
  .bubble h1{font-size:28px}.bubble{padding:8px 14px 10px}.bubble:after{left:24px;bottom:-16px;width:20px;height:16px}
  .opps{grid-template-columns:1fr 1fr;gap:12px;margin-top:6px}
  label.opt{padding:6px;gap:2px;box-shadow:var(--pop-sm)}
  label.opt img,label.opt .ico{width:auto;height:min(76px,9.5vh)}
  label.opt b{font-size:22px}label.opt small{font-size:10.5px}
  label.opt:has(input:checked){box-shadow:5px 5px 0 var(--ink)}
  label.opt:has(input:checked):after{width:28px;height:28px;font-size:15px;top:-9px;right:-9px}
  .row{gap:10px}.row h2{font-size:20px;width:100%}
  .bo{gap:8px;flex:1}.bo label.opt{flex:1;min-width:0;min-height:48px;padding:0 6px}.bo label.opt b{font-size:22px}
  .go{width:100%;margin:0;min-height:60px;font-size:28px}
  .chip{padding:3px 10px 3px 3px;gap:6px}.chip.r{padding:3px 3px 3px 10px}
  .chip .av{width:38px;height:38px;font-size:16px;border-width:2px}
  .chip .nm{font-size:11px}.chip .pts{font-size:30px}
  .mid .rd{font-size:18px}.pips i{width:9px;height:9px}
  .score{gap:6px}
  .choices{gap:10px}
  .choice{flex-direction:column;gap:2px;min-height:84px;font-size:18px;box-shadow:var(--pop-sm)}
  .choice svg{width:40px;height:44px}
  .vs .boom{width:60px;height:60px;font-size:30px}
  .think{width:60px}
  .who{font-size:15px;padding:0 6px;border-width:2px}
  .status{font-size:13px;min-height:18px}
  .res h2{font-size:40px}.res .fs{font-size:60px}.res .rb{width:120px;height:120px;margin-top:-80px}
}
@media (max-width:640px) and (max-height:760px){
  .choice{min-height:72px}.choice svg{width:34px;height:37px}
  label.opt small{display:none}
}
@media (min-width:641px) and (orientation:portrait){
  .opps{grid-template-columns:1fr 1fr}
  .hs{max-height:360px}
}
@media (min-width:641px) and (max-height:820px) and (orientation:landscape){
  .bubble h1{font-size:36px}header .logo{font-size:34px}
  label.opt img{width:min(120px,60%)}
  .choice{min-height:80px}
}
@media (prefers-reduced-motion:reduce){.arena.shaking .hand{animation:none}}
.reduce-motion .arena.shaking .hand{animation:none}
.arena.revealed .vs{opacity:0;transition:opacity .15s}
.hs{max-width:72%}
header .logo{white-space:nowrap}
.still *,.still *:before,.still *:after{animation-delay:0s!important;animation-duration:1ms!important;animation-iteration-count:1!important}
@media (min-width:641px) and (orientation:portrait){label.opt img,label.opt .ico{width:min(220px,62%)}label.opt b{font-size:36px}}
/* Card 657 port: what the mockup did with style= attributes and innerHTML. */
label.opt .ico.pop-shadow{filter:drop-shadow(4px 4px 0 #141414)}
label.opt .lvl.ghost{visibility:hidden}
.pips .gap{width:8px}
.think[hidden],.res .rb[hidden]{display:none}
/* 2 players: Player 1's pick is hidden behind a short flash of all three buttons. */
.choices.flash .choice{background:var(--mint);transform:translate(4px,4px);box-shadow:2px 2px 0 var(--ink)}
/* Phones under 375 px: "ROCK PAPER SCISSORS" is much longer than "STEN SAX
   PÅSE" and squeezed the SV/EN pill off-screen, so the English logo is
   set smaller there. */
@media (max-width:374px){html[lang="en"] header .logo{font-size:15px}}
