:root{
  --ink:#4a2a12; --paper:#fffaf0; --line:#cfe3f5; --red:#e8402f; --red2:#b72a1d; --yel:#ffcf33; --org:#f6913a;
  --grn:#3cb44b; --blu:#2f86e0; --pur:#8b4fd6; --pink:#f0679e; --mut:#8a6a4f; --ok:#2fa84f; --unk:#f2a516; --bad:#d94b3b;
  --font:"Trebuchet MS","Segoe UI","Arial Rounded MT Bold",Roboto,Arial,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:#e9a35a;color:var(--ink);font-family:var(--font)}
body{background:#e9a35a url(img/bg.jpg) center/cover no-repeat;overscroll-behavior:none}
button{font-family:inherit;cursor:pointer;color:inherit}
#app{position:fixed;inset:0;display:flex;flex-direction:column}
[hidden]{display:none!important}

/* header */
#top{display:flex;align-items:center;gap:8px;padding:8px 10px;z-index:30;pointer-events:none}
#top>*{pointer-events:auto}
.sp{flex:1}
.ib{width:44px;height:44px;border-radius:14px;border:3px solid var(--ink);background:#fff;display:grid;place-items:center;box-shadow:0 3px 0 var(--ink)}
.ib svg{width:24px;height:24px}
.ib .slash{display:none}.ib.off .slash{display:inline}.ib.off .wave{display:none}.ib.off{background:#f3e3d0;color:#9a7a5c}
.chip{background:#fff;border:3px solid var(--ink);border-radius:999px;padding:6px 14px;font-weight:800;box-shadow:0 3px 0 var(--ink);font-size:15px}

.screen{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;padding:0 12px 12px;overflow:auto;-webkit-overflow-scrolling:touch}
.card{background:var(--paper);border:4px solid var(--ink);border-radius:26px;box-shadow:0 8px 0 rgba(74,42,18,.85);
  background-image:repeating-linear-gradient(transparent 0 31px,var(--line) 31px 33px);}

/* menu */
#menu{justify-content:center}
.menu{width:min(560px,100%);padding:16px 18px 14px;text-align:center;margin:auto 0}
.logo{margin:0;display:flex;justify-content:center;gap:4px;flex-wrap:nowrap}
.logo span{display:inline-grid;place-items:center;width:clamp(34px,9vw,54px);height:clamp(40px,10.5vw,62px);font-size:clamp(26px,7vw,42px);font-weight:900;color:#fff;
  border:3px solid var(--ink);border-radius:12px;box-shadow:0 4px 0 var(--ink);text-shadow:0 2px 0 rgba(0,0,0,.25);animation:bob 2.6s ease-in-out infinite}
.logo span:nth-child(8n+1){background:var(--red);transform:rotate(-6deg)}
.logo span:nth-child(8n+2){background:var(--org);transform:rotate(4deg);animation-delay:.15s}
.logo span:nth-child(8n+3){background:var(--yel);color:var(--ink);text-shadow:none;transform:rotate(-3deg);animation-delay:.3s}
.logo span:nth-child(8n+4){background:var(--grn);transform:rotate(5deg);animation-delay:.45s}
.logo span:nth-child(8n+5){background:var(--blu);transform:rotate(-4deg);animation-delay:.6s}
.logo span:nth-child(8n+6){background:var(--pur);transform:rotate(3deg);animation-delay:.75s}
.logo span:nth-child(8n+7){background:var(--pink);transform:rotate(-5deg);animation-delay:.9s}
.logo span:nth-child(8n+8){background:var(--red);transform:rotate(4deg);animation-delay:1.05s}
@keyframes bob{0%,100%{translate:0 0}50%{translate:0 -4px}}
.sub{font-weight:900;font-size:20px;margin:8px 0 4px;color:var(--red2);letter-spacing:.5px}
.intro{margin:4px 6px 10px;font-size:15px;line-height:1.35}
.opp-t{font-weight:800;font-size:14px;color:var(--mut);margin-top:12px}.opp-t small{font-weight:600}
.opp{display:flex;justify-content:center;gap:8px;margin:6px 0 10px}
.bot{position:relative;width:76px;padding:4px 2px 5px;border:3px solid var(--ink);border-radius:16px;background:#fff;box-shadow:0 3px 0 var(--ink);transition:transform .12s}
.bot img{width:52px;height:52px;object-fit:contain;display:block;margin:0 auto}
.bot b{display:block;font-size:13px}.bot small{display:block;font-size:11px;font-weight:700;color:var(--mut)}
.bot.off{opacity:.38;filter:grayscale(.8);box-shadow:0 1px 0 var(--ink);transform:translateY(2px)}
.bot .medal{position:absolute;top:-8px;right:-8px;width:24px;height:24px;border-radius:50%;background:var(--yel);border:2px solid var(--ink);font-size:13px;font-weight:900;display:grid;place-items:center}
.big{display:block;width:100%;font-size:28px;font-weight:900;padding:14px 10px;border-radius:20px;border:4px solid var(--ink);background:var(--grn);color:#fff;
  box-shadow:0 6px 0 var(--ink);text-shadow:0 2px 0 rgba(0,0,0,.25);letter-spacing:1px}
.big:active,.mid:active,.stop:active{transform:translateY(4px);box-shadow:0 2px 0 var(--ink)}
.big.sm{font-size:21px;padding:10px}
.mid{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:17px;font-weight:800;padding:10px 12px;border-radius:16px;border:3px solid var(--ink);background:var(--yel);box-shadow:0 4px 0 var(--ink)}
.mid svg{width:22px;height:22px}
.mid.ghost{background:#fff}
.row2{display:flex;gap:10px;margin-top:12px}.row2>*{flex:1}
.opt{margin-top:12px;background:none;border:0;font-size:15px;font-weight:800;color:var(--blu);display:inline-flex;align-items:center;gap:6px;text-decoration:underline}
.opt svg{width:20px;height:20px}
.best{margin-top:6px;font-size:13px;color:var(--mut);font-weight:700;min-height:16px}
.link{background:none;border:0;color:var(--mut);font-weight:800;font-size:15px;margin-top:10px;text-decoration:underline}

/* modals */
.ov{position:fixed;inset:0;z-index:40;background:rgba(60,30,10,.45);display:flex;align-items:center;justify-content:center;padding:12px;overflow:auto}
.modal{width:min(520px,100%);padding:16px 18px;max-height:100%;overflow:auto;text-align:center}
.modal h2{margin:2px 0 8px;font-size:24px}
.lbl{font-weight:800;margin:10px 0 6px;font-size:15px;color:var(--mut);text-align:left}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chips button{border:3px solid var(--ink);background:#fff;border-radius:999px;padding:7px 12px;font-weight:800;font-size:15px}
.chips.small button{font-size:13px;padding:5px 9px;border-width:2px}
.chips button.on{background:var(--org);color:#fff}
.chips button .x{margin-left:6px;opacity:.8}
.seg{display:flex;border:3px solid var(--ink);border-radius:14px;overflow:hidden}
.seg button{flex:1;border:0;background:#fff;padding:9px 4px;font-weight:800;font-size:16px;border-right:2px solid var(--ink)}
.seg button:last-child{border-right:0}.seg button.on{background:var(--blu);color:#fff}
.tog{display:flex;align-items:center;gap:8px;margin:12px 0;font-weight:700;text-align:left}
.tog input{width:22px;height:22px}
.addrow{display:flex;gap:8px;margin-top:8px}
.addrow input,#ppList input{flex:1;min-width:0;font:inherit;font-size:16px;font-weight:700;padding:9px 10px;border:3px solid var(--ink);border-radius:12px;background:#fff;color:var(--ink)}
.note{font-size:14px;line-height:1.35;margin:6px 0;color:var(--mut)}
.warn{color:var(--bad);font-weight:800}
#ppList .pr{display:flex;gap:8px;align-items:center;margin:6px 0}
#ppList img{width:40px;height:40px;object-fit:contain}
#ppList .rm{width:38px;height:38px;border-radius:10px;border:3px solid var(--ink);background:#fff;font-weight:900}
.hand-l{width:96px;height:96px;margin:4px auto 8px;border-radius:22px;background:var(--red);color:#fff;font-size:64px;font-weight:900;display:grid;place-items:center;border:4px solid var(--ink);box-shadow:0 5px 0 var(--ink)}
.lobby-seats{display:grid;grid-template-columns:repeat(auto-fill,minmax(90px,1fr));gap:8px;margin:8px 0}
.lobby-seats .seat{border:3px solid var(--ink);border-radius:14px;background:#fff;padding:4px;font-weight:800;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lobby-seats .seat img{width:48px;height:48px;object-fit:contain;display:block;margin:0 auto}
.lobby-seats .seat.empty{opacity:.45}

/* roulette */
#spin{justify-content:center}
.spin-wrap{text-align:center;width:min(520px,100%)}
.spin-t{font-size:26px;font-weight:900;color:#fff;text-shadow:0 3px 0 var(--ink),0 0 8px rgba(74,42,18,.6);margin-bottom:6px}
.spin-h{margin-top:10px;font-weight:800;font-size:17px;background:#fff;border:3px solid var(--ink);border-radius:999px;display:inline-block;padding:6px 16px;box-shadow:0 3px 0 var(--ink)}
.wheel-box{position:relative;width:min(80vw,52vh,440px);aspect-ratio:1;margin:0 auto}
#wheel{width:100%;height:100%;display:block}
.pin{position:absolute;left:50%;top:-6px;width:0;height:0;border-left:18px solid transparent;border-right:18px solid transparent;border-top:34px solid var(--red);translate:-50% 0;filter:drop-shadow(0 3px 0 var(--ink))}

/* play */
#play{gap:8px;padding-bottom:0}
.hud{width:min(940px,100%);display:flex;gap:10px;align-items:stretch}
.letter{flex:none;width:76px;height:76px;border-radius:20px;background:var(--red);color:#fff;font-size:54px;font-weight:900;display:grid;place-items:center;border:4px solid var(--ink);box-shadow:0 5px 0 var(--ink);text-shadow:0 3px 0 rgba(0,0,0,.25)}
.letter.sm{width:54px;height:54px;font-size:36px;border-radius:14px}
.letter.pop{animation:pop .45s cubic-bezier(.2,1.6,.4,1)}
@keyframes pop{0%{transform:scale(.3) rotate(-20deg)}100%{transform:scale(1) rotate(0)}}
.hud-mid{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px;justify-content:center}
.you{display:flex;align-items:center;gap:8px;background:#fff;border:3px solid var(--ink);border-radius:14px;padding:3px 10px 3px 4px;box-shadow:0 3px 0 var(--ink);min-width:0}
.you img{width:34px;height:34px;object-fit:contain}
.you b{background:var(--yel);border:2px solid var(--ink);border-radius:8px;padding:1px 7px;font-size:14px;flex:none}
.you span{font-size:14px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.timer{position:relative;height:26px;border:3px solid var(--ink);border-radius:999px;background:#fff;overflow:hidden;box-shadow:0 3px 0 var(--ink)}
.timer .bar{position:absolute;inset:0;right:auto;width:100%;background:linear-gradient(90deg,var(--grn),#7fd35a);transition:width .25s linear}
.timer.low .bar{background:linear-gradient(90deg,var(--red),var(--org))}
.timer span{position:relative;display:block;text-align:center;font-weight:900;line-height:20px}
.rivals{width:min(940px,100%);display:flex;gap:8px;flex-wrap:wrap}
.rv{flex:1;min-width:120px;display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.92);border:3px solid var(--ink);border-radius:14px;padding:3px 8px 3px 3px;position:relative}
.rv img{width:36px;height:36px;object-fit:contain}
.rv .nm{font-weight:800;font-size:14px;line-height:1.1}
.rv .dots{display:flex;gap:3px;margin-top:3px}
.rv .dots i{width:9px;height:9px;border-radius:50%;border:2px solid var(--ink);background:#fff}
.rv .dots i.f{background:var(--grn)}
.rv .bub{position:absolute;right:6px;top:-12px;background:#fff;border:2px solid var(--ink);border-radius:10px;font-size:12px;font-weight:800;padding:0 6px}
#fields{width:min(940px,100%);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;padding:4px 0 6px}
.fld{display:flex;align-items:center;gap:8px;background:#fff;border:3px solid var(--ink);border-radius:16px;padding:5px 8px;box-shadow:0 3px 0 var(--ink);transition:transform .1s}
.fld label{flex:none;width:96px;font-weight:900;font-size:15px;line-height:1.05}
.fld label small{display:block;font-weight:700;font-size:11px;color:var(--mut)}
.fld input{flex:1;min-width:0;width:40px;font:inherit;font-size:19px;font-weight:800;border:0;border-bottom:3px dashed #d9c3a5;background:transparent;padding:6px 2px;color:var(--ink);outline:none}
.fld input:focus{border-bottom-color:var(--blu)}
.fld .st{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-weight:900;font-size:16px;color:#fff;border:2px solid var(--ink);background:#eee;color:#aaa}
.fld .st.ok{background:var(--ok);color:#fff}.fld .st.unk{background:var(--unk);color:#fff}.fld .st.bad{background:var(--bad);color:#fff}
.fld.bump{transform:scale(1.03)}
.fld.lock input{color:#9c8a78}
.stopbar{position:sticky;bottom:0;width:min(940px,100%);padding:6px 0 12px;display:flex;justify-content:center;background:linear-gradient(transparent,rgba(233,163,90,.0))}
.stop{width:min(360px,100%);border:4px solid var(--ink);border-radius:22px;background:var(--red);color:#fff;padding:8px 10px;box-shadow:0 6px 0 var(--ink);line-height:1}
.stop span{display:block;font-size:34px;font-weight:900;letter-spacing:2px;text-shadow:0 3px 0 rgba(0,0,0,.25)}
.stop small{display:block;font-size:14px;font-weight:800;margin-top:3px}
.stop:disabled{background:#c99b8d;box-shadow:0 3px 0 var(--ink);transform:translateY(3px);cursor:default}
.stop.ready{animation:pulse 1s ease-in-out infinite}
@keyframes pulse{50%{transform:scale(1.04)}}

/* review */
#review{gap:8px}
.rev-head{width:min(940px,100%);display:flex;gap:10px;align-items:center;background:var(--paper);border:3px solid var(--ink);border-radius:18px;padding:6px 10px;box-shadow:0 4px 0 var(--ink)}
.rev-head b{display:block;font-size:20px}.rev-head span{font-size:14px;color:var(--mut);font-weight:700}
.totals{width:min(940px,100%);display:flex;gap:6px;flex-wrap:wrap}
.tot{display:flex;align-items:center;gap:5px;background:#fff;border:3px solid var(--ink);border-radius:999px;padding:2px 10px 2px 3px;font-weight:900}
.tot img{width:28px;height:28px;object-fit:contain}.tot.me{background:var(--yel)}
.tot .n{font-size:17px}.tot .g{color:var(--ok);font-size:14px}
.rev-list{width:min(940px,100%);display:grid;grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr));gap:8px}
.tcard{background:var(--paper);border:3px solid var(--ink);border-radius:16px;padding:6px 8px;box-shadow:0 3px 0 var(--ink)}
.tcard h3{margin:0 0 4px;font-size:16px}
.ans{display:flex;align-items:center;gap:6px;padding:3px 0;border-top:2px dotted #e3cfb3;min-height:34px}
.ans:first-of-type{border-top:0}
.ans img{width:26px;height:26px;object-fit:contain;flex:none}
.ans .w{flex:1;min-width:0;font-weight:800;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ans .w.empty{color:#b9a58f;font-weight:600;font-style:italic}
.ans .tag{flex:none;font-size:12px;font-weight:900;border-radius:8px;padding:2px 6px;border:2px solid var(--ink);color:#fff}
.tag.ok{background:var(--ok)}.tag.unk{background:var(--unk)}.tag.bad{background:var(--bad)}.tag.acc{background:var(--blu)}
.ans .pts{flex:none;width:40px;text-align:right;font-weight:900;font-size:17px}
.ans .pts.p10{color:var(--ok)}.ans .pts.p5{color:var(--org)}.ans .pts.p0{color:#bbb}
.ans .pts.pop{animation:pop .35s cubic-bezier(.2,1.6,.4,1)}
.vote{display:flex;gap:4px;flex:none}
.vote button{border:2px solid var(--ink);border-radius:9px;background:#fff;font-weight:900;font-size:12px;padding:4px 7px}
.vote button.y.on{background:var(--ok);color:#fff}.vote button.n.on{background:var(--bad);color:#fff}
.vres{font-size:12px;font-weight:800;color:var(--mut)}
.rev-foot{position:sticky;bottom:0;z-index:2;width:min(940px,100%);display:flex;gap:10px;align-items:center;padding:6px 0 10px}
.rev-foot span{flex:1;font-weight:800;font-size:14px;color:#fff;text-shadow:0 2px 0 var(--ink)}
.rev-foot .big{width:auto;flex:none;min-width:220px}

/* final */
#final{justify-content:center}
.fin{width:min(560px,100%);padding:14px 16px;text-align:center;margin:auto 0}
.fin-t{font-size:30px;font-weight:900;color:var(--red2)}
.podium{display:flex;justify-content:center;align-items:flex-end;gap:8px;margin:10px 0 6px;min-height:150px}
.pod{width:100px;display:flex;flex-direction:column;align-items:center}
.pod img{width:64px;height:64px;object-fit:contain}
.pod .blk{width:100%;border:3px solid var(--ink);border-radius:12px 12px 0 0;display:grid;place-items:center;font-weight:900;font-size:26px;color:#fff;text-shadow:0 2px 0 rgba(0,0,0,.3)}
.pod .nm{font-weight:900;font-size:14px;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pod .sc{font-weight:800;font-size:13px;color:var(--mut)}
.pod.p1 .blk{height:80px;background:var(--yel);color:var(--ink);text-shadow:none}.pod.p2 .blk{height:58px;background:#b9c4cf}.pod.p3 .blk{height:42px;background:#d99a5b}
.fin-list{font-weight:800;font-size:15px;margin:4px 0}
.fin-best{font-size:14px;font-weight:800;color:var(--mut);margin:6px 0 10px}
#finMenuBtn{width:100%;margin-top:10px}

/* stamp, fx, toast */
.stamp{position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;background:rgba(255,255,255,.25)}
.stamp .oct{width:220px;height:220px;background:var(--red);color:#fff;font-size:58px;font-weight:900;display:grid;place-items:center;border:8px solid #fff;outline:5px solid var(--ink);
  clip-path:polygon(29% 0,71% 0,100% 29%,100% 71%,71% 100%,29% 100%,0 71%,0 29%);text-shadow:0 4px 0 rgba(0,0,0,.3);animation:stampin .45s cubic-bezier(.2,1.5,.4,1)}
.stamp .who{margin-top:14px;background:#fff;border:3px solid var(--ink);border-radius:999px;padding:6px 16px;font-weight:900;font-size:20px;animation:pop .5s .1s both}
@keyframes stampin{0%{transform:scale(2.6) rotate(-25deg);opacity:0}100%{transform:scale(1) rotate(-6deg);opacity:1}}
#fx{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:60}
.toast{position:fixed;left:50%;bottom:90px;translate:-50% 0;z-index:70;background:var(--ink);color:#fff;font-weight:800;padding:8px 16px;border-radius:999px;font-size:15px;max-width:90vw;text-align:center}

@media (max-width:640px){
  #fields{grid-template-columns:minmax(0,1fr);gap:6px}
  .fld label{width:84px;font-size:14px}
  .fld input{font-size:18px;padding:4px 2px}
  .letter{width:64px;height:64px;font-size:44px}
  .rv{min-width:0;flex:1 1 30%;padding-right:4px}
  .rv img{width:28px;height:28px}
  .rv .nm{font-size:12px}
  .rv .dots i{width:7px;height:7px}
  .big{font-size:24px}
  .rev-foot .big{min-width:0;flex:1}
  .rev-foot span{display:none}
  .rev-list{grid-template-columns:1fr}
  .bot{width:68px}
  .bot img{width:44px;height:44px}
  .menu{padding:12px 12px 10px}
  .intro{font-size:14px}
}
@media (max-height:560px){ .menu .opp{margin:2px 0 6px} .intro{margin:2px} }
