:root {
  --g: #136A3E; --gd: #0E5230; --y: #F2C414; --au: #C49A2C; --ink: #14301F;
  --cream: #FBF7EA; --w: #FFFDF6; --muted: #4A5D51;
  --o0: #B5533C; --o1: #2E6FB0; --o2: #8F6B10; --o3: #136A3E;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Nunito', Arial, sans-serif; background: var(--cream); color: var(--ink); }
h1, h2, h3, .f { font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; }
button { font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; cursor: pointer; border: 0; }
.hidden { display: none !important; }
.btn { background: var(--g); color: var(--y); border-radius: 999px; padding: .55em 1.4em; font-size: 1.1rem; box-shadow: 0 5px 0 var(--gd); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--gd); }
.btn.ghost { background: transparent; color: var(--g); box-shadow: none; border: 2px solid var(--g); }
.btn.danger { background: #8C2F23; color: #FFF3EC; box-shadow: 0 5px 0 #5E1F17; }
.shape { width: 1em; height: 1em; flex: none; }

/* ---------- rebus tiles (sama seperti slide) ---------- */
.rebus { display: flex; align-items: center; justify-content: center; gap: 2.2vh; }
.tile { width: var(--t); height: var(--t); background: var(--w); border: .6vh solid var(--g); border-radius: calc(var(--t) * .13);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1.4vh 0 var(--y); }
.tile svg { width: 76%; height: 76%; }
.tile.night { background: var(--gd); }
.tile.pil { width: calc(var(--t) * .69); border-radius: calc(var(--t) * .1); }
.tile.pil svg { width: 92%; height: 92%; }
.tile .tt { font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; color: var(--g); margin: 0; line-height: 1; font-size: calc(var(--t) * .4) !important; white-space: nowrap; }
.tile .tt.long { font-size: calc(var(--t) * .22) !important; }
.plus { font-family: 'Fredoka', Arial, sans-serif; font-size: calc(var(--t) * .28); font-weight: 600; color: var(--au); margin: 0; }

/* ---------- HOST ---------- */
body.host { overflow: hidden; }
.host .bar { position: fixed; left: 0; top: 0; bottom: 0; width: 1.4vh; background: var(--g); }
.host header { display: flex; align-items: center; justify-content: space-between; padding: 2.4vh 4vw 0; height: 12vh; }
.host header img { height: 8vh; }
.host .stat { font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; color: var(--g); font-size: 3vh; display: flex; gap: 3vw; align-items: center; }
.host main { height: 76vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 4vw; }
.host footer { position: fixed; bottom: 0; left: 0; right: 0; height: 12vh; display: flex; align-items: center; justify-content: flex-end; gap: 1vw; padding: 0 4vw; }
.host footer .btn { font-size: 2.4vh; }
.host footer .hint { margin-right: auto; color: var(--muted); font-size: 1.9vh; }

/* lobby */
.lobby { display: grid; grid-template-columns: 1fr auto; gap: 5vw; width: 100%; align-items: center; }
.lobby .kicker { color: #8A6A12; letter-spacing: .4em; font-size: 2.4vh; margin: 0; }
.lobby h1 { font-size: 10vh; color: var(--g); margin: 1vh 0 2vh; line-height: 1; }
.lobby .join { font-size: 3.2vh; margin: 0 0 1vh; color: var(--muted); }
.lobby .url { font-family: 'Fredoka', Arial, sans-serif; font-size: 5vh; color: var(--ink); font-weight: 600; word-break: break-all; }
.lobby .qr { background: var(--w); border: .6vh solid var(--g); border-radius: 3vh; padding: 2vh; box-shadow: 0 1.4vh 0 var(--y); }
.lobby .qr canvas, .lobby .qr img { width: 38vh; height: 38vh; display: block; image-rendering: pixelated; }
.names { display: flex; flex-wrap: wrap; gap: 1vh; margin-top: 4vh; max-height: 22vh; overflow: hidden; }
.chip { background: var(--g); color: var(--cream); border-radius: 999px; padding: .6vh 1.6vh; font-size: 2.4vh; font-weight: 700; display: inline-flex; align-items: center; gap: .6vh; }
.chip.off { background: #9FB3A6; }
.chip button { background: none; color: inherit; font-size: 2vh; padding: 0 0 0 .4vh; opacity: .7; }

/* question */
.q { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4vh; }
.q .rebus { --t: 33vh; }
.q.small .rebus { --t: 25vh; }
.q .rebus.tight { gap: 1.4vh; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6vh; width: 100%; }
.opt { display: flex; align-items: center; gap: 2vh; color: #FFF8EA; border-radius: 2vh; padding: 1.8vh 2.6vh; font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; font-size: 4vh; position: relative; overflow: hidden; transition: opacity .3s, transform .3s; }
.opt .shape { width: 4.4vh; height: 4.4vh; }
.opt .cnt { margin-left: auto; font-size: 3.4vh; opacity: .95; }
.opt.o0 { background: var(--o0); } .opt.o1 { background: var(--o1); } .opt.o2 { background: var(--o2); } .opt.o3 { background: var(--o3); }
.opt.dim { opacity: .28; }
.opt.right { outline: .7vh solid var(--y); transform: scale(1.02); }
.timer { width: 9vh; height: 9vh; border-radius: 50%; background: var(--g); color: var(--y); display: flex; align-items: center; justify-content: center; font-size: 4.2vh; }
.timer.low { background: #8C2F23; color: #FFF3EC; }
.answerline { font-size: 3vh; color: var(--muted); margin: 0; text-align: center; max-width: 80vw; }

/* leaderboard / end */
.board { width: min(1100px, 80vw); }
.board h2 { font-size: 7vh; color: var(--g); margin: 0 0 3vh; text-align: center; }
.row { display: flex; align-items: center; gap: 2vh; background: var(--w); border: .4vh solid var(--g); border-radius: 2vh; padding: 1.4vh 2.6vh; margin-bottom: 1.4vh; font-size: 3.6vh; }
.row .rk { font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; color: var(--au); width: 5vh; }
.row .nm { font-weight: 800; flex: 1; }
.row .sc { font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; color: var(--g); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 3vh; margin-top: 2vh; }
.pod { width: 26vh; text-align: center; }
.pod .nm { font-size: 3.4vh; font-weight: 800; margin-bottom: 1vh; word-break: break-word; }
.pod .blk { background: var(--g); color: var(--y); border-radius: 2vh 2vh 0 0; display: flex; flex-direction: column; justify-content: center; font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; }
.pod .blk .n { font-size: 9vh; line-height: 1; }
.pod .blk .s { font-size: 2.8vh; color: var(--cream); }
.pod.p1 .blk { height: 34vh; background: var(--au); color: var(--ink); }
.pod.p1 .blk .s { color: var(--ink); }
.pod.p2 .blk { height: 26vh; }
.pod.p3 .blk { height: 20vh; }

.pin { max-width: 420px; margin: 18vh auto 0; text-align: center; }
.pin img { width: 300px; }
.pin input { font-size: 1.6rem; padding: .5em; border-radius: 14px; border: 3px solid var(--g); width: 100%; text-align: center; margin: 1em 0; font-family: inherit; }
.err { color: #8C2F23; font-weight: 700; }

/* ---------- PLAYER ---------- */
body.player { min-height: 100%; display: flex; flex-direction: column; }
.player header { background: var(--w); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 4px solid var(--g); }
.player header img { height: 40px; }
.player header .me { text-align: right; font-weight: 800; font-size: 15px; line-height: 1.2; }
.player header .me .s { color: var(--g); font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; font-size: 18px; }
.player main { flex: 1; display: flex; flex-direction: column; padding: 20px 16px; gap: 16px; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.player h1 { color: var(--g); font-size: 32px; margin: 0; }
.player p { font-size: 20px; margin: 0; color: var(--muted); line-height: 1.4; }
.player input { font-size: 22px; padding: 14px; border-radius: 14px; border: 3px solid var(--g); width: 100%; text-align: center; font-family: inherit; background: var(--w); }
.player .btn { font-size: 22px; width: 100%; padding: 14px; }
.pgrid { flex: 1; display: grid; grid-template-rows: repeat(4, 1fr); gap: 12px; }
.pbtn { display: flex; align-items: center; gap: 14px; color: #FFF8EA; border-radius: 18px; padding: 12px 18px; font-size: 24px; text-align: left; min-height: 72px; }
.pbtn .shape { width: 30px; height: 30px; }
.pbtn.o0 { background: var(--o0); } .pbtn.o1 { background: var(--o1); } .pbtn.o2 { background: var(--o2); } .pbtn.o3 { background: var(--o3); }
.pbtn:disabled { opacity: .3; }
.pbtn.mine { opacity: 1; outline: 5px solid var(--y); }
.big { font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; font-size: 64px; line-height: 1; }
.ok { color: var(--g); } .no { color: #8C2F23; }
.ptimer { font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; color: var(--g); font-size: 20px; text-align: center; }
.badge { display: inline-block; background: var(--g); color: var(--y); border-radius: 999px; padding: 6px 18px; font-family: 'Fredoka', Arial, sans-serif; font-weight: 600; font-size: 22px; }
.conn { position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); background: #8C2F23; color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 14px; }
