:root{
  --word:#185ABD; --word-dark:#103F80; --text:#1E293B; --muted:#64748B;
  --bg1:#E0F2FE; --bg2:#F0F9FF; --card:#fff;
  --t0:#EF4444; --t1:#3B82F6; --t2:#22C55E; --t3:#EAB308;
  --t0d:#B91C1C; --t1d:#1D4ED8; --t2d:#15803D; --t3d:#A16207;
  --r:28px;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;user-select:none}
html,body{height:100%}
body{font-family:'Fredoka',system-ui,sans-serif;color:var(--text);
  background:radial-gradient(circle at 15% 10%,#fff 0,transparent 40%),linear-gradient(160deg,var(--bg1),var(--bg2) 60%,#FEF9C3);
  display:flex;flex-direction:column;overflow:hidden}
input{user-select:text;font-family:inherit}

/* ---------- header ---------- */
header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:clamp(8px,1.2vh,12px) 24px;
  background:var(--word);color:#fff;box-shadow:0 6px 0 var(--word-dark);z-index:5;flex-shrink:0}
.hdr-left,.hdr-right{display:flex;align-items:center;gap:14px}
.logo{width:56px;height:56px;border-radius:14px;background:#fff;color:var(--word);font-weight:700;font-size:36px;
  display:grid;place-items:center;box-shadow:0 5px 0 var(--word-dark);cursor:pointer}
.hdr-title h1{font-size:clamp(20px,2.2vw,32px);line-height:1.1}
.hdr-title p{opacity:.85;font-size:clamp(13px,1.2vw,18px)}
.hdr-btn{min-height:60px;font-size:clamp(15px,1.3vw,20px)!important;padding:0 20px!important}
#btnHome{display:none;background:#fff;color:var(--word);--sh:#94A3B8}

/* ---------- 3D buttons ---------- */
.btn-3d{--sh:#1D4ED8;border:none;cursor:pointer;font-family:inherit;font-weight:600;color:#fff;
  border-radius:20px;padding:14px 26px;font-size:clamp(17px,1.5vw,24px);
  box-shadow:0 8px 0 var(--sh),0 12px 20px rgba(0,0,0,.15);transition:transform .08s,box-shadow .08s;
  display:inline-flex;align-items:center;justify-content:center;gap:10px}
.btn-3d:active,.btn-3d.pressed{transform:translateY(6px);box-shadow:0 2px 0 var(--sh),0 4px 8px rgba(0,0,0,.15)}
.btn-3d:disabled{filter:grayscale(.8);opacity:.45;cursor:not-allowed}
.btn-word{background:var(--word);--sh:var(--word-dark)}
.btn-blue{background:#3B82F6;--sh:#1D4ED8}
.btn-green{background:#22C55E;--sh:#15803D}
.btn-red{background:#EF4444;--sh:#B91C1C}
.btn-yellow{background:#F59E0B;--sh:#B45309}
.btn-purple{background:#8B5CF6;--sh:#6D28D9}
.btn-white{background:#fff;color:var(--text);--sh:#CBD5E1}
.btn-big{min-height:100px;font-size:clamp(24px,2.4vw,40px);padding:18px 44px;border-radius:26px}
.btn-block{width:100%}

/* ---------- layout ---------- */
#stage{flex:1;overflow:auto;padding:clamp(12px,2vh,24px) clamp(16px,3vw,48px) clamp(12px,3vh,32px);position:relative}
.view{max-width:1700px;margin:0 auto;animation:pop .35s ease}
@keyframes pop{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:none}}
.card{background:var(--card);border-radius:var(--r);box-shadow:0 10px 0 #CBD5E1,0 18px 40px rgba(15,23,42,.08);padding:28px}
.muted{color:var(--muted)}
.center{text-align:center}

/* ---------- lobby ---------- */
.lobby-top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;margin-bottom:clamp(10px,2vh,20px)}
.lobby-top h2{font-size:clamp(26px,2.6vw,44px);color:var(--word-dark)}
.class-pick{display:flex;gap:14px;flex-wrap:wrap}
.class-btn{min-width:170px;min-height:clamp(64px,10vh,90px);flex-direction:column;gap:0;line-height:1.1}
.class-btn small{font-size:15px;font-weight:500;opacity:.85}
.class-btn.active{outline:6px solid #FDE047;outline-offset:3px}
.topic-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:clamp(10px,2.4vh,26px)}
.topic-row b{font-size:20px;margin-right:4px}
.chip{border:3px solid #CBD5E1;background:#fff;border-radius:999px;padding:10px 20px;font:600 18px 'Fredoka';color:var(--text);cursor:pointer;min-height:54px}
.chip.active{background:var(--word);border-color:var(--word);color:#fff}
.section-title{font-size:clamp(22px,2vw,32px);margin:clamp(4px,1vh,10px) 0 clamp(6px,1.4vh,14px);display:flex;align-items:center;gap:12px}
.section-title span{font-size:16px;font-weight:500;background:#fff;border-radius:999px;padding:4px 14px;color:var(--muted)}
.game-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:clamp(8px,1.6vh,22px);margin-bottom:clamp(4px,1.2vh,20px)}
.game-grid.solo{grid-template-columns:repeat(7,minmax(0,1fr))}
.game-grid.team{grid-template-columns:repeat(6,minmax(0,1fr))}
.game-card{border:none;border-radius:var(--r);cursor:pointer;color:#fff;text-align:center;font-family:inherit;
  box-shadow:0 10px 0 var(--sh),0 16px 28px rgba(0,0,0,.12);transition:transform .1s;min-height:clamp(96px,14vh,220px);padding:clamp(8px,1.6vh,22px) 14px;gap:clamp(2px,0.8vh,8px);
  display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;overflow:hidden}
.game-card::after{content:'';position:absolute;inset:0;background:radial-gradient(circle at 80% 0,rgba(255,255,255,.35),transparent 50%)}
.game-card:active{transform:translateY(8px);box-shadow:0 2px 0 var(--sh)}
.game-card .gi{font-size:clamp(44px,7vh,76px);line-height:1;filter:drop-shadow(0 4px 0 rgba(0,0,0,.15))}
.game-card h3{font-size:clamp(16px,2.4vh,30px)}
.game-card p{font-size:clamp(12px,1.8vh,16px);opacity:.95;line-height:1.25}
.game-card .tag{position:absolute;top:12px;right:12px;background:rgba(255,255,255,.9);color:var(--text);font-size:14px;font-weight:600;border-radius:999px;padding:4px 10px;z-index:1}

/* ---------- question / answers ---------- */
.qbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.badge{background:#fff;border-radius:999px;padding:10px 20px;font-weight:600;font-size:clamp(17px,1.5vw,24px);box-shadow:0 5px 0 #CBD5E1}
.qtext{font-size:clamp(26px,2.8vw,46px);font-weight:600;line-height:1.25;text-align:center;padding:10px 6px 22px}
.answers{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.ans{min-height:110px;font-size:clamp(20px,2vw,32px);justify-content:flex-start;text-align:left;padding:16px 22px;line-height:1.2}
.ans .k{flex:0 0 58px;height:58px;border-radius:16px;background:rgba(255,255,255,.3);display:grid;place-items:center;font-size:30px;font-weight:700}
.ans.c0{background:#EF4444;--sh:#B91C1C}.ans.c1{background:#3B82F6;--sh:#1D4ED8}
.ans.c2{background:#F59E0B;--sh:#B45309}.ans.c3{background:#22C55E;--sh:#15803D}
.ans.right{background:#16A34A!important;--sh:#14532D!important;animation:bounce .5s}
.ans.wrong{background:#94A3B8!important;--sh:#64748B!important;animation:shake .4s;text-decoration:line-through}
.ans.dim{opacity:.35}
@keyframes shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-12px)}40%,80%{transform:translateX(12px)}}
@keyframes bounce{0%,100%{transform:scale(1)}50%{transform:scale(1.05)}}
.feedback{margin-top:20px;border-radius:22px;padding:18px 24px;font-size:clamp(20px,1.8vw,28px);display:flex;align-items:center;gap:18px;justify-content:space-between;flex-wrap:wrap}
.feedback.ok{background:#DCFCE7;color:#14532D}
.feedback.no{background:#FEE2E2;color:#7F1D1D}
.timerbar{height:16px;border-radius:999px;background:#E2E8F0;overflow:hidden;margin-bottom:14px}
.timerbar i{display:block;height:100%;background:linear-gradient(90deg,#22C55E,#F59E0B,#EF4444);transition:width 1s linear}

/* ---------- team race (panjat pinang / mobil) ---------- */
.race-wrap{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:24px;align-items:stretch}
.arena{border-radius:var(--r);position:relative;overflow:hidden;min-height:560px}
.arena.pinang{background:linear-gradient(#7DD3FC,#BAE6FD 55%,#86EFAC 55%,#4ADE80);display:grid;grid-template-columns:repeat(var(--n),1fr);padding:20px 10px 0}
.pole{position:relative;display:flex;flex-direction:column;align-items:center}
.prize{font-size:44px;animation:swing 2s ease-in-out infinite;transform-origin:top center;height:64px}
@keyframes swing{0%,100%{transform:rotate(-8deg)}50%{transform:rotate(8deg)}}
.pole .stick{position:relative;width:34px;flex:1;margin-bottom:46px;border-radius:12px 12px 0 0;
  background:repeating-linear-gradient(170deg,#92400E 0 22px,#B45309 22px 44px);box-shadow:inset -6px 0 0 rgba(0,0,0,.18),0 0 18px rgba(255,255,255,.6)}
.pole .stick::before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent 20%,rgba(255,255,255,.45) 40%,transparent 55%);border-radius:inherit}
.climber{position:absolute;left:50%;transform:translate(-50%,50%);transition:bottom .7s cubic-bezier(.3,1.6,.5,1);
  width:72px;height:72px;border-radius:50%;display:grid;place-items:center;font-size:42px;border:5px solid #fff;box-shadow:0 6px 12px rgba(0,0,0,.25);z-index:2}
.climber.slip{transition:bottom .5s ease-in}
.pole .tname{position:absolute;bottom:4px;left:50%;transform:translateX(-50%);white-space:nowrap;color:#fff;font-weight:700;font-size:18px;padding:6px 14px;border-radius:999px}
.pole.turn .tname{outline:4px solid #FDE047;animation:bounce 1s infinite}
.arena.mobil{background:#334155;display:flex;flex-direction:column;justify-content:space-around;padding:16px 24px}
.lane{position:relative;height:calc((100% - 32px)/var(--n));min-height:100px;border-bottom:6px dashed rgba(255,255,255,.4);display:flex;align-items:center}
.lane:last-child{border-bottom:none}
.lane .finish{position:absolute;right:0;top:0;bottom:0;width:36px;background:repeating-conic-gradient(#fff 0 25%,#111 0 50%) 0 0/18px 18px}
.car{position:absolute;left:calc(var(--p) * (100% - 140px) / var(--max));transition:left .8s cubic-bezier(.3,1.4,.5,1);
  font-size:64px;display:flex;align-items:center;gap:4px;transform:scaleX(-1)}
.car .plate{transform:scaleX(-1);font-size:16px;font-weight:700;color:#fff;border-radius:10px;padding:4px 10px}
.lane.turn{background:rgba(253,224,71,.18)}
.lane .lname{position:absolute;left:8px;top:6px;color:#fff;font-weight:600;font-size:16px;opacity:.9}
.puff{position:absolute;font-size:44px;animation:puff 1s forwards;pointer-events:none}
@keyframes puff{to{transform:translateY(-60px) scale(1.6);opacity:0}}
.turn-banner{border-radius:22px;padding:14px 20px;color:#fff;font-size:clamp(22px,2vw,32px);font-weight:700;text-align:center;margin-bottom:14px}
.steal{font-size:20px;font-weight:600;color:#B45309;text-align:center;margin-bottom:6px}
.race-wrap .qtext{font-size:clamp(22px,2.1vw,36px)}
.race-wrap .answers{grid-template-columns:1fr}
.race-wrap .ans{min-height:88px}

/* ---------- duel (tarik tambang / roket) ---------- */
.duel{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.duel .side{border-radius:var(--r);padding:20px;position:relative;min-height:440px}
.duel .side.s0{background:#FEE2E2}.duel .side.s1{background:#DBEAFE}
.duel .side h3{font-size:30px;text-align:center;margin-bottom:6px}
.duel .side .qtext{font-size:clamp(20px,1.9vw,32px);padding:6px 0 14px}
.duel .side .answers{grid-template-columns:1fr 1fr;gap:14px}
.duel .side .ans{min-height:92px;font-size:clamp(17px,1.6vw,26px)}
.frozen{position:absolute;inset:0;border-radius:inherit;background:rgba(186,230,253,.85);display:grid;place-items:center;font-size:42px;font-weight:700;color:#0C4A6E;z-index:3;text-align:center}
.rope-field{height:170px;border-radius:var(--r);background:linear-gradient(#BAE6FD,#86EFAC 70%);margin-bottom:20px;position:relative;overflow:hidden}
.rope-field .mid{position:absolute;left:50%;top:0;bottom:0;width:6px;background:#fff;transform:translateX(-50%)}
.rope-field .zone{position:absolute;top:0;bottom:0;width:6px;background:rgba(0,0,0,.25)}
.rope{position:absolute;top:50%;left:0;width:100%;transition:transform .6s cubic-bezier(.3,1.5,.5,1)}
.rope .line{position:absolute;left:-10%;right:-10%;height:14px;top:-7px;background:repeating-linear-gradient(45deg,#A16207 0 10px,#CA8A04 10px 20px);border-radius:7px}
.rope .flag{position:absolute;left:50%;top:-46px;transform:translateX(-50%);font-size:48px}
.rope .pul{position:absolute;top:-44px;font-size:64px}
.rocket-field{height:200px;border-radius:var(--r);background:linear-gradient(#0F172A,#1E3A8A);margin-bottom:20px;position:relative;overflow:hidden}
.rocket-field::before{content:'✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦';position:absolute;inset:0;color:#fff;opacity:.4;font-size:22px;letter-spacing:38px;padding:20px}
.rk{position:absolute;font-size:60px;transition:left .8s cubic-bezier(.3,1.4,.5,1);transform:rotate(45deg)}
.rk-planet{position:absolute;right:16px;top:50%;transform:translateY(-50%);font-size:90px}

/* ---------- true/false ---------- */
.tf-btns{display:grid;grid-template-columns:1fr 1fr;gap:28px}
.tf-btns .btn-3d{min-height:180px;font-size:clamp(34px,3.4vw,56px);border-radius:32px}

/* ---------- bomb ---------- */
.bomb{font-size:150px;text-align:center;line-height:1;transition:transform .2s}
.bomb.tick{animation:tick .5s infinite}
@keyframes tick{0%,100%{transform:scale(1)}50%{transform:scale(1.08) rotate(-4deg)}}
.boom{font-size:220px;text-align:center;animation:boom .6s}
@keyframes boom{from{transform:scale(.2)}to{transform:scale(1)}}
.fuse{font-size:64px;font-weight:700;text-align:center;color:#DC2626}

/* ---------- mystery boxes ---------- */
.score-row{display:grid;grid-template-columns:repeat(var(--n),1fr);gap:14px;margin-bottom:18px}
.score-pill{border-radius:20px;color:#fff;padding:12px 16px;text-align:center;font-weight:700;font-size:22px;transition:transform .2s}
.score-pill b{display:block;font-size:40px}
.score-pill.turn{outline:6px solid #FDE047;outline-offset:3px;transform:scale(1.04)}
.boxes{display:grid;grid-template-columns:repeat(6,1fr);gap:18px}
.box{aspect-ratio:1.15;border:none;border-radius:24px;font:700 clamp(36px,3.4vw,60px) 'Fredoka';color:#fff;cursor:pointer;
  background:linear-gradient(135deg,#A855F7,#6D28D9);box-shadow:0 10px 0 #4C1D95;display:grid;place-items:center}
.box:active{transform:translateY(8px);box-shadow:0 2px 0 #4C1D95}
.box.used{background:#E2E8F0;box-shadow:0 6px 0 #CBD5E1;color:#94A3B8;font-size:40px;cursor:default}
.surprise{font-size:110px;text-align:center;animation:boom .5s}

/* ---------- wheel ---------- */
.wheel-wrap{display:flex;gap:30px;align-items:center;justify-content:center;flex-wrap:wrap}
.wheel-box{position:relative;width:min(540px,80vw);aspect-ratio:1}
.wheel-box canvas{width:100%;height:100%;transition:transform 4s cubic-bezier(.15,.85,.25,1)}
.wheel-box .pointer{position:absolute;top:-14px;left:50%;transform:translateX(-50%);font-size:60px;z-index:2;filter:drop-shadow(0 4px 2px rgba(0,0,0,.3))}

/* ---------- memory ---------- */
.mem-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
.mcard{perspective:900px;aspect-ratio:1.5;cursor:pointer}
.mcard .in{position:relative;width:100%;height:100%;transition:transform .5s;transform-style:preserve-3d}
.mcard.open .in,.mcard.done .in{transform:rotateY(180deg)}
.mcard .f,.mcard .b{position:absolute;inset:0;border-radius:20px;backface-visibility:hidden;display:grid;place-items:center;padding:10px;text-align:center}
.mcard .f{background:linear-gradient(135deg,var(--word),#2B7CD3);color:#fff;font-size:60px;box-shadow:0 8px 0 var(--word-dark)}
.mcard .b{background:#fff;transform:rotateY(180deg);font-size:clamp(17px,1.6vw,26px);font-weight:600;box-shadow:0 8px 0 #CBD5E1;border:4px solid #BFDBFE}
.mcard .b.term{background:#FEF3C7;border-color:#FCD34D}
.mcard.done .b{background:#DCFCE7;border-color:#22C55E}

/* ---------- mole / balloon ---------- */
.mole-field{display:grid;grid-template-columns:repeat(3,1fr);gap:26px 30px;padding:20px;border-radius:var(--r);background:linear-gradient(#86EFAC,#22C55E)}
.hole{position:relative;height:190px;overflow:hidden;display:flex;align-items:flex-end;justify-content:center}
.hole::after{content:'';position:absolute;bottom:0;left:6%;right:6%;height:56px;border-radius:50%;background:radial-gradient(#3F2A14 50%,#5B3A1A);z-index:2}
.mole{position:absolute;bottom:-170px;width:78%;height:170px;border:none;cursor:pointer;transition:bottom .25s;z-index:1;
  background:#A16207;border-radius:90px 90px 20px 20px;color:#fff;font:600 clamp(16px,1.4vw,22px) 'Fredoka';
  display:flex;flex-direction:column;align-items:center;padding-top:10px;gap:4px;box-shadow:inset 0 -10px 0 rgba(0,0,0,.2)}
.mole::before{content:'🐹';font-size:52px;line-height:1}
.mole.up{bottom:18px}
.mole.hit::before{content:'😵'}
.mole span{background:rgba(0,0,0,.35);border-radius:10px;padding:2px 8px;max-width:95%}
.sky{position:relative;height:min(62vh,640px);border-radius:var(--r);overflow:hidden;background:linear-gradient(#38BDF8,#BAE6FD)}
.balloon{position:absolute;bottom:-220px;width:190px;cursor:pointer;border:none;background:none;font-family:'Fredoka';
  display:flex;flex-direction:column;align-items:center}
.balloon .bb{width:170px;height:200px;border-radius:50% 50% 48% 48%;display:grid;place-items:center;padding:16px;color:#fff;font-weight:600;
  font-size:clamp(16px,1.4vw,22px);text-align:center;box-shadow:inset -14px -14px 0 rgba(0,0,0,.12),inset 12px 12px 0 rgba(255,255,255,.25)}
.balloon .str{width:2px;height:60px;background:#475569}
.balloon.popped .bb{animation:popb .3s forwards}
@keyframes popb{to{transform:scale(1.6);opacity:0}}

/* ---------- result / modal ---------- */
.overlay{position:fixed;inset:0;background:rgba(15,23,42,.55);display:grid;place-items:center;z-index:50;padding:20px}
.modal{background:#fff;border-radius:32px;padding:32px;max-width:760px;width:100%;max-height:92vh;overflow:auto;box-shadow:0 14px 0 #CBD5E1;animation:pop .3s}
.modal-wide{max-width:1150px}
.modal h2{font-size:clamp(26px,2.4vw,40px);margin-bottom:6px}
.modal .actions{display:flex;gap:16px;justify-content:center;flex-wrap:wrap;margin-top:24px}
.trophy{font-size:120px;text-align:center;line-height:1}
.stars{font-size:64px;text-align:center;letter-spacing:6px}
.rank{display:flex;flex-direction:column;gap:10px;margin-top:16px}
.rank div{display:flex;justify-content:space-between;align-items:center;border-radius:18px;padding:12px 20px;color:#fff;font-size:24px;font-weight:600}
.team-setup{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:16px 0}
.team-setup label{display:flex;align-items:center;gap:10px;border-radius:18px;padding:10px 14px;color:#fff;font-weight:600;font-size:18px}
.team-setup input{flex:1;min-width:0;border:none;border-radius:12px;padding:12px;font-size:20px;color:var(--text)}

/* ---------- teacher ---------- */
.t-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:16px}
.t-row{display:flex;align-items:center;gap:14px;margin-bottom:14px;flex-wrap:wrap}
.t-label{font-weight:600;font-size:20px}
.pill-group{display:flex;gap:10px;flex-wrap:wrap}
.pill{border:3px solid #CBD5E1;background:#fff;border-radius:999px;padding:10px 24px;font:600 20px 'Fredoka';cursor:pointer;min-height:54px;color:var(--text)}
.pill.active{background:var(--word);color:#fff;border-color:var(--word)}
.t-tabs{display:flex;gap:14px;margin-bottom:16px;flex-wrap:wrap}
.t-input{width:100%;border:3px solid #CBD5E1;border-radius:16px;padding:14px 16px;font-size:20px;margin:6px 0 12px;color:var(--text)}
.t-input:focus{outline:none;border-color:var(--word)}
.t-list{display:flex;flex-direction:column;gap:12px;max-height:52vh;overflow:auto;padding-right:6px}
.t-item{border:3px solid #E2E8F0;border-radius:20px;padding:14px 18px;display:flex;gap:16px;align-items:flex-start}
.t-item.custom{border-color:#86EFAC;background:#F0FDF4}
.t-item .num{flex:0 0 44px;height:44px;border-radius:12px;background:#EFF6FF;color:var(--word);font-weight:700;display:grid;place-items:center}
.t-item .body{flex:1}
.t-item .q{font-weight:600;font-size:19px;margin-bottom:8px}
.t-item .opts{display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;font-size:17px;color:var(--muted)}
.t-item .opts .ok{color:#15803D;font-weight:700}
.t-item .del{border:none;background:#FEE2E2;color:#B91C1C;border-radius:14px;padding:10px 14px;font:600 16px 'Fredoka';cursor:pointer;min-height:48px}
.t-foot{margin-top:16px;display:flex;justify-content:flex-end}
.t-ask{background:#FEF3C7;border:3px solid #F59E0B;border-radius:20px;padding:16px 18px;margin-bottom:14px}
.t-ask p{font-size:20px;font-weight:600;margin-bottom:12px}
.t-ask-btns{display:flex;gap:12px;flex-wrap:wrap}
.t-form label{font-weight:600;font-size:18px;display:block}
.t-grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}
.toast{position:fixed;left:50%;bottom:30px;transform:translateX(-50%);background:#0F172A;color:#fff;padding:16px 28px;border-radius:999px;font-size:22px;z-index:99;animation:pop .3s}

@media (max-width:900px){
  .answers,.race-wrap,.duel,.tf-btns,.team-setup,.t-grid2{grid-template-columns:1fr}
  .boxes{grid-template-columns:repeat(4,1fr)}
  .mem-grid{grid-template-columns:repeat(3,1fr)}
  .hdr-title p,.hdr-btn .lbl{display:none}
}

/* ---------- fit-to-screen (TV/IFP: semua game muat 1 layar tanpa scroll) ---------- */
.race-wrap{height:calc(100dvh - 140px);min-height:520px}
#qpanel{display:flex;flex-direction:column;overflow:auto;padding:20px}
.arena{min-height:0;height:100%}
.race-wrap .answers{grid-template-columns:1fr 1fr;gap:14px}
.race-wrap .ans{min-height:clamp(64px,10vh,100px);font-size:clamp(17px,2.4vh,26px)}
.race-wrap .ans .k{flex-basis:46px;height:46px;font-size:24px}
.race-wrap .qtext{font-size:clamp(20px,3.4vh,36px);padding:4px 4px 14px}
.turn-banner{padding:10px 16px;margin-bottom:10px}
.arena.mobil{height:100%}
.lane{height:auto;flex:1;min-height:0}
.car{font-size:clamp(40px,7vh,64px)}
.climber{width:clamp(52px,7vh,72px);height:clamp(52px,7vh,72px);font-size:clamp(30px,4.2vh,42px)}
.prize{font-size:clamp(32px,5vh,44px);height:clamp(44px,6.5vh,64px)}
.pole .stick{margin-bottom:clamp(38px,6vh,46px)}
.rope-field{height:clamp(110px,17vh,170px)}
.rocket-field{height:clamp(120px,19vh,200px)}
.duel .side{min-height:0;padding:14px 18px}
.duel .side h3{font-size:clamp(20px,3vh,30px)}
.duel .side .qtext{font-size:clamp(18px,3vh,32px)}
.duel .side .ans{min-height:clamp(60px,9vh,92px)}
.qtext{font-size:clamp(24px,4.4vh,46px)}
.ans{min-height:clamp(72px,11vh,110px)}
.hole{height:clamp(120px,21vh,190px)}
.mole{height:calc(clamp(120px,21vh,190px) - 20px);bottom:-200px;width:70%;border-radius:50% 50% 18px 18px;padding-top:6px}
.mole::before{font-size:clamp(44px,8vh,72px)}
.mole span{font-size:clamp(14px,2.1vh,20px);line-height:1.15}
.mole-field{gap:10px 30px;padding:14px 20px}
.sky{height:clamp(210px,calc(100dvh - 345px),640px)}

.boxes{gap:14px}
.box{aspect-ratio:auto;height:clamp(90px,16vh,170px)}
.score-pill{padding:8px 12px;font-size:clamp(16px,2.2vh,22px)}
.score-pill b{font-size:clamp(26px,4vh,40px)}
.balloon .bb{width:clamp(130px,11vw,170px);height:clamp(110px,16vh,200px);font-size:clamp(14px,1.6vh,22px);line-height:1.15;overflow:hidden}
.race-wrap{height:calc(100dvh - 150px);min-height:380px}
.pole .tname{font-size:clamp(14px,2vh,18px);max-width:96%;overflow:hidden;text-overflow:ellipsis;padding:5px 10px}
.pole.turn .tname{animation:none;outline-offset:2px}
.mcard{aspect-ratio:auto;height:clamp(90px,calc((100dvh - 260px)/3),220px)}

/* ---------- Pintu Ajaib ---------- */
.door-wrap{height:calc(100dvh - 140px);min-height:480px;display:flex;flex-direction:column;gap:clamp(8px,1.4vh,16px)}
.door-teams{display:grid;grid-template-columns:repeat(var(--n),1fr);gap:12px}
.dt{display:flex;align-items:center;gap:10px;color:#fff;border-radius:18px;padding:clamp(6px,1vh,12px) 16px;font-size:clamp(16px,2.2vh,22px);transition:transform .2s}
.dt.turn{outline:5px solid #FDE047;transform:translateY(-2px)}
.dt .dav{font-size:clamp(26px,4vh,38px)}
.dt b{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dt .droom{background:rgba(0,0,0,.25);border-radius:999px;padding:4px 12px;font-weight:700}
.dt.pop{animation:bounce .5s}
.door-hall{flex:1;min-height:0;display:flex;flex-direction:column;padding:clamp(10px,1.6vh,20px);
  background:linear-gradient(#EDE9FE 0 62%,#C4B5FD 62%,#A78BFA)}
.door-hall .qtext{background:#78350F;color:#FEF3C7;border-radius:16px;border:6px solid #B45309;margin:0 auto clamp(8px,1.4vh,14px);
  max-width:1100px;width:100%;font-size:clamp(20px,3.4vh,36px);padding:clamp(8px,1.4vh,14px) 18px}
.doors{flex:1;min-height:0;display:grid;grid-template-columns:repeat(4,1fr);gap:clamp(12px,2vw,36px);padding:0 clamp(4px,2vw,40px);perspective:900px}
.door-hall .ans.door{position:relative;min-height:0;height:100%;padding:0;border-radius:90px 90px 8px 8px;background:radial-gradient(#FEF9C3,#FDE047);
  box-shadow:0 8px 0 #57534E,inset 0 0 0 8px #57534E;overflow:visible;display:block}
.door .leaf{position:absolute;inset:8px;border-radius:82px 82px 4px 4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(4px,1vh,10px);
  padding:clamp(8px,1.4vh,16px) 10px;color:#fff;transform-origin:left center;transition:transform .55s cubic-bezier(.4,1.4,.6,1);background:var(--dc);box-shadow:inset 0 -10px 0 rgba(0,0,0,.18)}
.door .leaf::after{content:'';position:absolute;right:14px;top:55%;width:14px;height:14px;border-radius:50%;background:#FDE68A;box-shadow:0 2px 0 #92400E}
.door.c0{--dc:#EF4444}.door.c1{--dc:#3B82F6}.door.c2{--dc:#F59E0B}.door.c3{--dc:#22C55E}
.door .k{flex:0 0 auto;width:clamp(40px,6vh,58px);height:clamp(40px,6vh,58px);border-radius:50%;background:rgba(255,255,255,.3);display:grid;place-items:center;font-size:clamp(22px,3.4vh,30px);font-weight:700}
.door .dtx{font-size:clamp(15px,2.3vh,24px);line-height:1.2;text-align:center;overflow-wrap:anywhere}
.door.open .leaf{transform:rotateY(-70deg)}
.door-hall .ans.door.right{background:radial-gradient(#FEFCE8,#FDE047)!important;box-shadow:0 8px 0 #15803D,inset 0 0 0 8px #16A34A!important}
.door-hall .ans.door.wrong{text-decoration:none}
.door-hall .ans.door.wrong .leaf{--dc:#64748B}
.floor{position:relative;height:clamp(44px,7vh,70px)}
.walker{position:absolute;left:50%;bottom:0;transform:translateX(-50%);font-size:clamp(36px,6vh,58px);transition:left .45s ease-in-out,transform .4s,opacity .4s}
.walker.enter{transform:translate(-50%,-40px) scale(.4);opacity:0}
.walker.bonk{animation:bonk .6s}
@keyframes bonk{0%{transform:translate(-50%,0)}30%{transform:translate(-50%,-26px) rotate(-20deg)}60%{transform:translate(-50%,0) rotate(12deg)}100%{transform:translate(-50%,0)}}
.door-hall .feedback{margin-top:8px;padding:10px 18px}

/* ============ FRIV GAME SUITE STYLING (Zero-Scroll TV Optimized) ============ */

/* --- 1. Penalty Shootout --- */
.penalty-wrap {
  height: calc(100dvh - 140px);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
}
.penalty-pitch {
  position: relative;
  background: radial-gradient(circle at center, #15803d 0%, #14532d 100%);
  border: 4px solid #166534;
  height: clamp(210px, 32vh, 310px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 12px;
  overflow: hidden;
}
.penalty-goal {
  position: absolute;
  top: 10px;
  width: min(92%, 760px);
  height: clamp(140px, 22vh, 200px);
  border: 8px solid #ffffff;
  border-bottom: none;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.06), rgba(255,255,255,0.06) 10px, transparent 10px, transparent 20px),
              repeating-linear-gradient(-45deg, rgba(255,255,255,0.06), rgba(255,255,255,0.06) 10px, transparent 10px, transparent 20px);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.gk {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(38px, 5.5vh, 52px);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 5;
}
.gk.dive-tl { transform: translate(-140px, -45px) rotate(-35deg); }
.gk.dive-tr { transform: translate(70px, -45px) rotate(35deg); }
.gk.dive-bl { transform: translate(-140px, 0px) rotate(-65deg); }
.gk.dive-br { transform: translate(70px, 0px) rotate(65deg); }

.goal-targets {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  z-index: 10;
}
.target-zone {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  border: 2px dashed rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s, background 0.15s;
}
.target-zone:hover:not(:disabled) {
  background: rgba(234, 179, 8, 0.7);
  border-color: #fef08a;
  transform: scale(1.02);
}
.target-zone .t-key {
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: clamp(14px, 2vh, 18px);
}
.target-zone .t-txt {
  font-size: clamp(13px, 1.8vh, 18px);
  font-weight: 600;
  line-height: 1.2;
}
.target-zone.right {
  background: #16a34a !important;
  border-color: #bbf7d0 !important;
  animation: pulse 0.5s infinite alternate;
}
.target-zone.wrong {
  background: #dc2626 !important;
  border-color: #fecaca !important;
}
.target-zone.dim {
  opacity: 0.35;
}

.penalty-spot {
  position: relative;
  z-index: 15;
}
.ball {
  font-size: clamp(32px, 4.5vh, 44px);
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.ball.shot-tl { transform: translate(-180px, -140px) scale(0.65) rotate(-360deg); }
.ball.shot-tr { transform: translate(180px, -140px) scale(0.65) rotate(360deg); }
.ball.shot-bl { transform: translate(-180px, -65px) scale(0.7) rotate(-360deg); }
.ball.shot-br { transform: translate(180px, -65px) scale(0.7) rotate(360deg); }

.penalty-qpanel {
  padding: clamp(10px, 1.5vh, 16px) 18px;
}

/* --- 2. Raft Wars --- */
.raft-wrap {
  height: calc(100dvh - 140px);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
}
.raft-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.raft-score-card {
  flex: 1;
  background: #ffffff;
  padding: 10px 16px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.raft-score-card.turn {
  outline: 4px solid #f59e0b;
}
.raft-vs {
  font-weight: 800;
  font-size: clamp(18px, 2.5vh, 26px);
  color: #64748b;
}
.r-crew {
  display: flex;
  gap: 8px;
  font-size: 26px;
  margin-top: 4px;
}
.crew-alive { transform: scale(1.1); display: inline-block; }
.crew-dead { filter: grayscale(1); opacity: 0.5; }

.raft-sea {
  position: relative;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 65%, #0369a1 100%);
  height: clamp(170px, 24vh, 230px);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 40px 16px 40px;
}
.raft-boat {
  position: relative;
  font-size: 34px;
  text-align: center;
  transition: transform 0.2s;
  z-index: 5;
}
.raft-boat .raft-wood {
  font-size: 28px;
  line-height: 0.9;
}
.raft-boat .cannon {
  font-size: 32px;
}
.raft-boat .cannon.flip {
  transform: scaleX(-1);
}
.raft-boat.hit-shake {
  animation: shake 0.5s ease-in-out;
}
.water-bullet {
  position: absolute;
  font-size: 30px;
  bottom: 45px;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}
.water-bullet.shoot-right {
  animation: arcRight 0.6s ease-in-out forwards;
}
.water-bullet.shoot-left {
  animation: arcLeft 0.6s ease-in-out forwards;
}
@keyframes arcRight {
  0% { opacity: 1; left: 15%; bottom: 45px; transform: scale(1); }
  50% { opacity: 1; left: 50%; bottom: 120px; transform: scale(1.4); }
  100% { opacity: 1; left: 85%; bottom: 35px; transform: scale(0.9); }
}
@keyframes arcLeft {
  0% { opacity: 1; left: 85%; bottom: 45px; transform: scale(1); }
  50% { opacity: 1; left: 50%; bottom: 120px; transform: scale(1.4); }
  100% { opacity: 1; left: 15%; bottom: 35px; transform: scale(0.9); }
}
.raft-qpanel {
  padding: clamp(10px, 1.5vh, 16px) 18px;
}

/* --- 3. Papa Burgeria --- */
.burger-wrap {
  height: calc(100dvh - 140px);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
}
.burger-kitchen {
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  border: 4px solid #f59e0b;
  height: clamp(180px, 26vh, 250px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-bottom: 12px;
}
.chef-avatar {
  position: absolute;
  left: 24px;
  bottom: 12px;
  font-size: clamp(48px, 7vh, 68px);
}
.burger-plate {
  width: min(85%, 360px);
  border-bottom: 8px solid #94a3b8;
  display: flex;
  justify-content: center;
}
.b-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  width: 100%;
}
.b-layer {
  width: 90%;
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(12px, 1.6vh, 16px);
  padding: 4px 10px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  animation: wobble 0.3s ease-in-out;
}
.b-layer.bun-bottom {
  background: #b45309;
  border-radius: 4px 4px 16px 16px;
  width: 96%;
}
.b-layer.drop-in {
  animation: dropIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes dropIn {
  from { transform: translateY(-40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.burger-qpanel {
  padding: clamp(10px, 1.5vh, 16px) 18px;
}

/* --- 4. Bob The Robber --- */
.robber-wrap {
  height: calc(100dvh - 140px);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
}
.robber-corridor {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 4px solid #334155;
  height: clamp(180px, 26vh, 250px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 18px;
  position: relative;
  transition: background 0.3s;
}
.robber-corridor.alarm-red {
  background: linear-gradient(180deg, #7f1d1d 0%, #450a0a 100%);
  border-color: #ef4444;
}
.robber-progress {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.gate-icon {
  font-size: clamp(20px, 3vh, 28px);
  filter: grayscale(1);
  opacity: 0.4;
  transition: all 0.2s;
}
.gate-icon.cleared {
  filter: none;
  opacity: 0.8;
}
.gate-icon.current {
  filter: none;
  opacity: 1;
  transform: scale(1.25);
}
.robber-stage-view {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 10px;
}
.robber-char {
  font-size: clamp(44px, 6.5vh, 60px);
  transition: transform 0.4s ease;
}
.robber-char.bob-sneak {
  transform: translateX(40px) scale(1.1);
}
.laser-gate {
  background: rgba(239, 68, 68, 0.2);
  border: 3px dashed #ef4444;
  color: #f87171;
  font-weight: 800;
  font-size: clamp(14px, 2vh, 18px);
  padding: 10px 18px;
  border-radius: 10px;
  animation: pulse 1s infinite alternate;
}
.laser-gate.deactivated {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #4ade80;
  border-style: solid;
}
.cctv-cam {
  font-size: clamp(32px, 4.5vh, 44px);
  animation: cctvScan 3s infinite ease-in-out;
}
@keyframes cctvScan {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-30deg); }
  100% { transform: rotate(0deg); }
}
.robber-qpanel {
  padding: clamp(10px, 1.5vh, 16px) 18px;
}

