:root{--navy:#14284a;--navy2:#0d1b33;--red:#c8323f;--red2:#9e1f2c;--green:#2e7a4b;--green2:#1f5a37;--cream:#fff7ea;--cream2:#f6e8d0;--gold:#f2b836;--ink:#3b2418;--ok:#2f9a58;--bad:#d2493f}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:var(--navy2);color:var(--ink);font-family:"Trebuchet MS","Segoe UI",system-ui,-apple-system,Roboto,sans-serif;touch-action:manipulation;user-select:none;-webkit-user-select:none}
#bg{position:fixed;inset:0;background:url(img/gracht.webp) center 30%/cover no-repeat}
#bg::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(13,27,51,.25) 0%,rgba(13,27,51,.45) 45%,rgba(13,27,51,.8) 100%)}
#snow,#fx{position:fixed;inset:0;width:100%;height:100%;pointer-events:none}
#snow{z-index:1}#fx{z-index:50}
#app{position:relative;z-index:2;height:100%;display:flex;flex-direction:column;max-width:760px;margin:0 auto;padding:0 12px env(safe-area-inset-bottom)}
.hidden{display:none!important}
button{font:inherit;cursor:pointer;border:0;color:inherit}
kbd{font:700 .8em/1 inherit;background:#fff;border:2px solid #c9b493;border-bottom-width:3px;border-radius:6px;padding:2px 6px;color:var(--ink)}
body.touch .keyOnly{display:none}body:not(.touch) .touchOnly{display:none}
/* header */
#top{display:flex;align-items:center;gap:8px;padding:10px 0 6px;color:#fff}
.ib{width:42px;height:42px;border-radius:50%;background:rgba(255,247,234,.16);border:2px solid rgba(255,247,234,.45);display:grid;place-items:center;color:#fff;flex:none}
.ib svg{width:22px;height:22px}
.ib:hover{background:rgba(255,247,234,.3)}
#where{flex:1;display:flex;flex-direction:column;line-height:1.1;min-width:0}
#where b{font-size:20px;text-shadow:0 2px 0 rgba(0,0,0,.35);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#where span{font-size:13px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#scoreBox{background:var(--gold);color:var(--ink);border-radius:14px;padding:3px 12px;text-align:center;border:3px solid #fff3c9;box-shadow:0 3px 0 #b07c12}
#scoreBox small{display:block;font-size:10px;font-weight:700;letter-spacing:.08em}
#scoreBox b{font-size:19px}
/* knitted card */
.knit{background:var(--cream);border-radius:22px;position:relative;box-shadow:0 8px 0 rgba(0,0,0,.25),0 18px 40px rgba(0,0,0,.35);border:3px solid #fff}
.knit::before{content:"";position:absolute;left:0;right:0;top:0;height:16px;border-radius:19px 19px 0 0;background:
 linear-gradient(135deg,var(--red) 25%,transparent 25%) -8px 0/16px 16px,linear-gradient(225deg,var(--red) 25%,transparent 25%) -8px 0/16px 16px,
 linear-gradient(315deg,#fff 25%,transparent 25%) 0 0/16px 16px,linear-gradient(45deg,#fff 25%,transparent 25%) 0 0/16px 16px,var(--green)}
.view{flex:1;min-height:0;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding-bottom:12px}
/* start */
#start{justify-content:center;align-items:center}
.startCard{width:100%;max-width:520px;padding:28px 20px 16px;text-align:center;margin-top:46px}
#startPep{width:132px;height:auto;position:absolute;left:50%;top:-74px;transform:translateX(-50%);filter:drop-shadow(0 6px 6px rgba(0,0,0,.3));animation:bob 2.6s ease-in-out infinite}
@keyframes bob{50%{transform:translate(-50%,-6px) rotate(-2deg)}}
.logo{margin:44px 0 4px;font-size:52px;line-height:1;color:var(--red);letter-spacing:.01em;text-shadow:0 3px 0 #f3c9a0,0 5px 0 rgba(0,0,0,.12)}
.logo span{color:var(--green)}
.intro{margin:6px 4px 14px;font-size:15px;line-height:1.4;color:#5b3b2a}
.btn{background:var(--green);color:#fff;font-weight:800;border-radius:16px;padding:12px 18px;box-shadow:0 5px 0 var(--green2);transition:transform .08s;font-size:17px}
.btn:active{transform:translateY(3px);box-shadow:0 2px 0 var(--green2)}
.btn.big{font-size:22px;padding:16px 26px;background:var(--red);box-shadow:0 6px 0 var(--red2);width:100%;max-width:380px}
.btn.big:active{box-shadow:0 2px 0 var(--red2)}
.modes{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:16px 0 8px}
.btn.mode{background:#fff;color:var(--ink);box-shadow:0 4px 0 #d8c4a3;border:2px solid #ead9bd;font-size:14px;padding:8px 4px;display:flex;flex-direction:column;align-items:center;gap:3px;line-height:1.15}
.btn.mode img{width:40px;height:40px;object-fit:contain}
.hint{font-size:13px;color:#7a5a45;margin:8px 0 2px}
.rank{font-size:13px;margin:4px 0 0;color:#7a5a45}
.rank b{color:var(--red)}
/* themes */
.vh{color:#fff;text-align:center;margin:6px 0 10px;text-shadow:0 2px 0 rgba(0,0,0,.4)}
#themeGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.theme{background:var(--cream);border-radius:18px;padding:12px 6px 10px;display:flex;flex-direction:column;align-items:center;gap:4px;box-shadow:0 5px 0 rgba(0,0,0,.28);border:3px solid #fff;color:var(--ink)}
.theme img{width:64px;height:64px;object-fit:contain}
.theme b{font-size:16px}
.theme small{font-size:12px;color:#7a5a45}
.stars{color:#d6c3a2;font-size:16px;letter-spacing:2px}.stars i{font-style:normal}.stars i.on{color:var(--gold);text-shadow:0 1px 0 #9a6a00}
.note{color:#fff;opacity:.85;font-size:13px;text-align:center;margin:10px 4px;text-shadow:0 1px 2px rgba(0,0,0,.6)}
/* panel */
.panel{padding:24px 18px 18px;max-width:520px;width:100%;margin:8px auto;text-align:center}
.panel h2{margin:4px 0;color:var(--red)}
.sub{margin:0 0 8px;font-size:14px;color:#6a4a36}
.lbl{font-weight:800;margin:12px 0 6px;font-size:14px;color:var(--green2)}
.seg{display:flex;gap:6px;justify-content:center}
.seg.wrap{flex-wrap:wrap}
.seg button{background:#fff;border:2px solid #e2cfae;border-radius:12px;padding:8px 14px;font-weight:700;min-width:48px}
.seg button.on{background:var(--green);color:#fff;border-color:var(--green2)}
#teamNames{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
#teamNames input{font:inherit;font-weight:700;border:3px solid;border-radius:12px;padding:8px 10px;width:100%;background:#fff;color:var(--ink);user-select:text}
#pStart{margin-top:16px}
/* quiz */
#teams{display:flex;gap:6px;margin-bottom:6px}
.tm{flex:1;border-radius:12px;padding:4px 6px;background:rgba(255,247,234,.85);text-align:center;border:3px solid transparent;font-size:13px;line-height:1.15;min-width:0;opacity:.75}
.tm b{display:block;font-size:17px}.tm span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm.on{opacity:1;transform:scale(1.04);background:#fff;box-shadow:0 4px 0 rgba(0,0,0,.3)}
#hud{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.chip{background:var(--cream);border-radius:20px;padding:4px 11px;font-weight:800;font-size:13px}
.chip.ghost{background:rgba(255,247,234,.2);color:#fff;border:2px solid rgba(255,255,255,.4)}
.chip.gold{background:var(--gold);animation:pop .3s}
@keyframes pop{0%{transform:scale(.6)}70%{transform:scale(1.15)}}
#dots{display:flex;gap:4px;margin:8px 0 4px}
#dots i{flex:1;height:7px;border-radius:4px;background:rgba(255,255,255,.25)}
#dots i.ok{background:#57d18a}#dots i.bad{background:#ff7a6e}#dots i.cur{background:#fff}
#hostRow{display:flex;align-items:flex-end;gap:8px;margin:4px 0 -6px;position:relative;z-index:2}
#hostImg{width:86px;height:auto;filter:drop-shadow(0 4px 4px rgba(0,0,0,.35));transition:transform .2s}
#hostImg.jump{animation:jump .5s}
@keyframes jump{40%{transform:translateY(-14px) scale(1.05)}}
#bubble{background:#fff;border-radius:16px 16px 16px 4px;padding:8px 12px;font-weight:700;font-size:15px;margin-bottom:34px;box-shadow:0 3px 0 rgba(0,0,0,.2);position:relative;max-width:70%}
#qCard{padding:24px 16px 12px;margin-bottom:10px}
#qWho{font-weight:800;font-size:14px;margin-bottom:4px}
#qText{margin:0 0 10px;font-size:21px;font-weight:800;line-height:1.3;min-height:2.6em}
#timer{height:8px;background:#ecdcc0;border-radius:4px;overflow:hidden}
#timer i{display:block;height:100%;width:100%;background:linear-gradient(90deg,var(--green),#5cbf6f);transform-origin:left}
#answers{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.ans{background:#fff;border-radius:16px;padding:12px 10px;min-height:62px;display:flex;align-items:center;gap:8px;text-align:left;font-weight:700;font-size:16px;line-height:1.2;box-shadow:0 5px 0 rgba(0,0,0,.3);border:3px solid #fff;transition:transform .1s,background .2s}
.ans:hover{border-color:var(--gold)}
.ans kbd{flex:none}
.ans.ok{background:#d9f5e3;border-color:var(--ok);animation:pop .35s}
.ans.bad{background:#ffe0dc;border-color:var(--bad);animation:shake .35s}
.ans.dim{opacity:.55}
@keyframes shake{20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}
#after{margin-top:10px;background:rgba(255,247,234,.95);border-radius:16px;padding:10px 12px;display:flex;align-items:center;gap:10px;box-shadow:0 4px 0 rgba(0,0,0,.25)}
#fact{margin:0;flex:1;font-size:14px;line-height:1.35}
#next{flex:none}
.playHint{margin-top:8px}
/* bingo */
#caller{padding:22px 14px 12px;margin:2px 0 10px}
.callTop{display:flex;gap:10px;align-items:center}
.callTop img{width:54px;height:auto}
.callTop small{font-weight:800;color:var(--green2)}
#clue{margin:2px 0 0;font-size:19px;font-weight:800;line-height:1.25}
#bTimer{height:7px;background:#ecdcc0;border-radius:4px;overflow:hidden;margin:8px 0}
#bTimer i{display:block;height:100%;width:100%;background:var(--red);transform-origin:left}
.callBtns{display:flex;justify-content:center}
.ghostBtn{background:#fff;color:var(--ink);box-shadow:0 4px 0 #cdb894;border:2px solid #e2cfae}
.ghostBtn:active{box-shadow:0 1px 0 #cdb894}
#card{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;background:var(--red);padding:8px;border-radius:18px;border:4px solid #fff;box-shadow:0 8px 0 rgba(0,0,0,.3);width:min(100%,560px,calc(100vh - 300px));min-width:300px;margin:0 auto;flex:none}
.cell{background:var(--cream);border-radius:10px;aspect-ratio:1/1;display:flex;flex-direction:column;align-items:center;justify-content:center;font-weight:800;font-size:12px;line-height:1.05;position:relative;padding:2px;color:var(--ink);overflow:hidden}
.cell em{font-style:normal;font-size:26px;line-height:1.1}
.cell span{max-width:100%;overflow-wrap:anywhere;hyphens:auto;text-align:center}
.cell.stamp::after{content:"";position:absolute;inset:6%;border-radius:50%;background:radial-gradient(circle,rgba(46,122,75,.72) 55%,rgba(46,122,75,.5) 70%,transparent 72%);animation:stamp .3s}
.cell.free{background:var(--gold)}
.cell.miss{outline:3px dashed var(--bad);outline-offset:-4px}
.cell.bad{animation:shake .35s;background:#ffe0dc}
.cell.win{background:#fff2b8}
@keyframes stamp{0%{transform:scale(1.8);opacity:0}100%{transform:scale(1);opacity:1}}
/* result overlay */
.overlay{position:fixed;inset:0;z-index:40;background:rgba(10,20,40,.6);display:flex;align-items:center;justify-content:center;padding:16px;overflow-y:auto}
.res{position:relative;margin-top:60px}
#resImg{width:120px;height:auto;position:absolute;left:50%;top:-80px;transform:translateX(-50%)}
#resTitle{margin-top:34px;font-size:28px}
#resStars{font-size:40px;letter-spacing:6px;color:#d6c3a2}
#resStars i{font-style:normal}#resStars i.on{color:var(--gold);text-shadow:0 2px 0 #9a6a00}
#resText{font-size:16px;line-height:1.4;margin:6px 0 12px}
#podium{display:flex;flex-direction:column;gap:5px;margin-bottom:12px}
.pod{display:flex;justify-content:space-between;background:#fff;border-radius:12px;padding:8px 12px;font-weight:800;border-left:8px solid}
.row{display:flex;justify-content:center;margin-top:8px}
@media (max-width:520px){
  .logo{font-size:44px}
  .btn.mode{font-size:12.5px}
  #qText{font-size:18px}
  .ans{font-size:14.5px;min-height:56px;padding:10px 8px}
  .ans kbd{display:none}
  #themeGrid{grid-template-columns:repeat(2,1fr)}
  .cell{font-size:9.5px}.cell em{font-size:20px}
  #clue{font-size:16.5px}
  #bubble{font-size:13.5px}
  #hostImg{width:70px}
  #after{flex-direction:column;align-items:stretch}
}
@media (max-height:700px){#startPep{width:104px;top:-58px}.startCard{margin-top:34px}.logo{margin-top:30px;font-size:40px}.intro{font-size:13.5px}}
/* embed fit: small store-page frame (794x447, 640x360) */
@media (max-height:560px){
  #top{padding:5px 0 3px;gap:6px}
  .ib{width:34px;height:34px}.ib svg{width:18px;height:18px}
  #where b{font-size:17px}#where span{font-size:11.5px}
  #scoreBox{padding:1px 10px;border-width:2px;border-radius:11px}#scoreBox small{font-size:9px}#scoreBox b{font-size:16px}
  .knit{box-shadow:0 5px 0 rgba(0,0,0,.25),0 10px 24px rgba(0,0,0,.3)}
  .knit::before{height:10px}
  .view{padding-bottom:6px}
  /* start */
  .startCard{margin-top:0;padding:16px 16px 10px;max-width:560px}
  #startPep{width:64px;top:auto;bottom:auto;left:10px;top:12px;transform:none;animation:none}
  .logo{margin:0 0 2px;font-size:36px}
  .intro,.hint{display:none}
  .btn.big{font-size:19px;padding:11px 20px;box-shadow:0 5px 0 var(--red2)}
  .modes{margin:12px 0 4px;gap:6px}
  .btn.mode{font-size:13px;padding:5px 4px;flex-direction:row;justify-content:center;gap:5px}
  .btn.mode img{width:26px;height:26px}
  .rank{font-size:12px}
  /* themes */
  .vh{margin:2px 0 6px;font-size:18px}
  #themeGrid{gap:7px}
  .theme{padding:6px 6px 6px;gap:1px;border-radius:14px}
  .theme img{width:36px;height:36px}.theme b{font-size:14px}.theme small{font-size:11px}.stars{font-size:13px}
  .note{margin:6px 4px;font-size:12px}
  /* party */
  .panel{padding:16px 14px 0;margin:2px auto}
  .panel h2{font-size:19px;margin:2px 0}
  .sub{font-size:12px;margin-bottom:2px}
  .lbl{margin:6px 0 4px;font-size:12.5px}
  .seg button{padding:5px 12px}
  #teamNames{margin-top:6px;gap:6px}#teamNames input{padding:5px 8px;border-width:2px}
  #party .panel{max-width:640px}
  #pStart{position:sticky;bottom:0;margin:10px 0 0;z-index:3;box-shadow:0 5px 0 var(--red2),0 -10px 12px 6px var(--cream)}
  #party .panel{padding-bottom:12px;display:grid;grid-template-columns:auto 1fr;column-gap:12px;align-items:center}
  #party .panel>*{grid-column:1/-1}
  #party .lbl{grid-column:1;text-align:right;margin:4px 0}
  #party #pStart{justify-self:center}
  #party .seg{grid-column:2;justify-content:flex-start;margin:3px 0}
  /* quiz */
  #teams{margin-bottom:3px}.tm{font-size:11.5px;padding:2px 6px}.tm b{font-size:14px}
  .chip{padding:2px 9px;font-size:12px}
  #dots{margin:5px 0 2px}#dots i{height:5px}
  #hostRow{margin:0 0 -4px}
  #hostImg{width:46px}
  #bubble{font-size:13px;padding:5px 10px;margin-bottom:14px}
  #qCard{padding:14px 12px 8px;margin-bottom:7px}
  #qText{font-size:17px;min-height:0;margin-bottom:6px;line-height:1.25}
  #answers{gap:7px}
  .ans{min-height:42px;padding:6px 10px;font-size:15px;border-radius:13px;box-shadow:0 4px 0 rgba(0,0,0,.3)}
  #after{margin-top:7px;padding:6px 10px}
  #fact{font-size:13px;line-height:1.3}
  #next{padding:9px 14px;font-size:15px}
  .playHint{display:none}
  /* bingo: clue panel left, card right */
  #bingo{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr;column-gap:12px;align-content:start}
  #caller{grid-column:1;grid-row:1;margin:4px 0 6px;padding:16px 12px 10px;align-self:start}
  #clue{font-size:16px}
  #card{grid-column:2;grid-row:1/span 2;width:calc(100vh - 66px);min-width:0;max-width:100%;padding:5px;gap:4px;border-width:3px;margin:2px 0 0}
  #bingo .note{grid-column:1;grid-row:2;margin:0 4px;text-align:left;align-self:start}
  .cell{font-size:10px;border-radius:7px}.cell em{font-size:19px}
  /* result */
  .overlay{padding:8px}
  .res{margin-top:0;padding-top:16px}
  #resImg{width:60px;top:12px;left:14px;transform:none}
  #resTitle{margin-top:0;font-size:22px}
  #resStars{font-size:30px;line-height:1.1}
  #resText{font-size:14px;margin:2px 0 6px;line-height:1.3}
  #podium{gap:3px;margin-bottom:4px}.pod{padding:4px 10px;font-size:13px}
  .res .row{display:inline-flex;margin:6px 4px 0;vertical-align:top}
  .res .btn.big{width:auto;font-size:18px;padding:10px 22px}
  .res .ghostBtn{padding:10px 22px;font-size:17px}
  .res{padding-bottom:14px}
}
@media (max-height:560px) and (max-width:520px){#bingo{display:flex}#card{width:min(100%,calc(100vh - 170px));margin:0 auto}}
@media (max-height:420px){
  #top{padding:3px 0 2px}
  #startPep{display:none}
  .startCard{padding:14px 14px 8px}
  .logo{font-size:30px}
  .modes{margin:9px 0 2px}
  .btn.big{font-size:17px;padding:9px 18px}
  .theme img{width:28px;height:28px}.theme small{display:none}
  #themes .note{display:none}
  .sub{display:none}
  #quiz{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:start;column-gap:8px}
  #quiz>*{grid-column:1/-1}
  #teams{grid-row:1}#hud{grid-row:2;grid-column:1}#dots{grid-row:3}#qCard{grid-row:4}#answers{grid-row:5}#after{grid-row:6}#quiz .playHint{grid-row:7}
  .seg{gap:5px}.seg button{padding:4px 9px;font-size:14px;min-width:40px}#party .lbl{font-size:12px}
  #hostRow{grid-row:2;grid-column:2;margin:0;justify-content:flex-end;min-width:0}
  #hostImg{display:none}
  #bubble{margin:0;font-size:12px;padding:3px 9px;border-radius:12px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #dots{margin:4px 0 3px}
  #qCard{padding:12px 10px 6px;margin-bottom:6px}
  #qText{font-size:15.5px;margin-bottom:5px}
  .ans{min-height:36px;padding:5px 8px;font-size:14px}
  .ans kbd{padding:1px 5px}
  #after{margin-top:6px;padding:5px 8px}
  #fact{font-size:12px}
  #next{padding:7px 12px;font-size:14px}
  #resImg{width:44px}
  #resStars{font-size:24px}
  #resText{font-size:13px}
  #caller{padding:13px 10px 8px}
  .callTop img{width:38px}
  #clue{font-size:14.5px}
  #bingo .note{font-size:11px}
}
