/* Lewu Ilmu: game UI. Carved-wood boards with gold trim and Dayak bands, chunky pressable buttons. */
@font-face { font-family: 'Bricolage Grotesque'; src: url(../assets/fonts/bricolage-grotesque-latin.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url(../assets/fonts/plus-jakarta-sans-latin.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
:root {
  --ink: #2a1f17; --wood: #5e3b22; --wood2: #8a5a32; --wood3: #3d2616; --cream: #fbf3e2; --paper: #fff8ea; --gold: #f2c14e; --gold2: #d99a1e;
  --red: #c0392b; --green: #2fa36b; --blue: #2f7fd8; --shadow: 0 6px 0 rgba(0, 0, 0, .28);
  --band: repeating-linear-gradient(90deg, #7a2418 0 14px, #231c18 14px 18px, #f2c14e 18px 22px, #231c18 22px 26px);
  --f: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif; --fu: 'Plus Jakarta Sans', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d1712; color: var(--cream); font-family: var(--fu); }
body { -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
#app { position: fixed; inset: 0; }
#stage, #stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

/* ---------- loading ---------- */
#loading { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; gap: 22px; text-align: center; background: radial-gradient(circle at 50% 40%, #3a2a1c, #120d09); transition: opacity .5s; }
#loading.done { opacity: 0; pointer-events: none; }
.ld-logo b { display: block; font: 900 clamp(48px, 12vw, 96px)/.85 var(--f); letter-spacing: .02em; color: var(--gold); text-shadow: 0 6px 0 #7a2418; }
.ld-logo b + b { color: var(--cream); text-shadow: 0 6px 0 var(--wood); }
.ld-bar { width: min(320px, 70vw); height: 14px; margin: 0 auto; border-radius: 9px; background: #000a; border: 2px solid #f2c14e55; overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold2), var(--gold)); transition: width .25s; }
#loading p { margin: 0; color: #fff9; font-weight: 600; }

/* ---------- buttons ---------- */
.tb { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 22px; border: 0; border-radius: 16px;
  background: linear-gradient(#fff8ea, #f0dfbd); color: var(--ink); font: 800 19px/1.1 var(--f); box-shadow: 0 5px 0 #b48a52, 0 10px 18px rgba(0, 0, 0, .3); transition: transform .08s, box-shadow .08s, filter .15s; text-align: center; }
.tb:hover { filter: brightness(1.05); transform: translateY(-1px); }
.tb:active { transform: translateY(4px); box-shadow: 0 1px 0 #b48a52, 0 4px 8px rgba(0, 0, 0, .3); }
.tb i { font-style: normal; }
.tb small { display: block; font: 600 12px var(--fu); opacity: .75; }
.tb.gold { background: linear-gradient(#ffe08a, #f2b636); box-shadow: 0 5px 0 #b06f12, 0 10px 18px rgba(0, 0, 0, .3); }
.tb.gold:active { box-shadow: 0 1px 0 #b06f12; }
.tb.red { background: linear-gradient(#ff8a7a, #d9452f); color: #fff; box-shadow: 0 5px 0 #8b2416, 0 10px 18px rgba(0, 0, 0, .3); }
.tb.green { background: linear-gradient(#7ee0a6, #2fa36b); color: #fff; box-shadow: 0 5px 0 #1b6a44, 0 10px 18px rgba(0, 0, 0, .3); }
.tb.blue { background: linear-gradient(#7fb8ff, #2f7fd8); color: #fff; box-shadow: 0 5px 0 #1b4f8f, 0 10px 18px rgba(0, 0, 0, .3); }
.tb.big { min-height: 64px; font-size: 24px; flex-direction: column; gap: 2px; }
.tb.small { min-height: 42px; font-size: 15px; padding: 8px 14px; border-radius: 12px; }
.tb:disabled { filter: grayscale(.8) brightness(.8); cursor: default; transform: none; }
.chip { border: 2px solid #ffffff40; background: #00000066; color: #fff; padding: 8px 14px; border-radius: 999px; font: 700 14px var(--fu); backdrop-filter: blur(6px); }
.chip[aria-pressed=false] { opacity: .55; text-decoration: line-through; }
.back { position: absolute; left: 14px; top: 14px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--wood); color: var(--gold); font: 900 22px var(--f); box-shadow: 0 4px 0 var(--wood3); }

/* ---------- screens + boards ---------- */
.screen { position: fixed; inset: 0; z-index: 40; }
.sheet { display: grid; place-items: center; padding: 16px; background: rgba(15, 10, 6, .55); backdrop-filter: blur(3px); overflow: auto; }
.board { position: relative; width: min(440px, 100%); padding: 26px 22px 22px; border-radius: 26px; color: var(--ink); background: linear-gradient(#fff8ea, #f3e3c2);
  border: 6px solid var(--wood); box-shadow: 0 0 0 3px var(--gold) inset, 0 14px 0 var(--wood3), 0 24px 50px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 12px; animation: boardIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.board::before { content: ''; position: absolute; left: 18px; right: 18px; top: -6px; height: 10px; background: var(--band); border-radius: 0 0 6px 6px; }
.board.wide { width: min(760px, 100%); }
.board h2 { margin: 0 0 0 52px; font: 900 30px/1 var(--f); color: var(--wood); }
.board .sub { margin: -6px 0 4px 52px; font-weight: 600; color: #6a5440; }
@keyframes boardIn { from { transform: translateY(40px) scale(.92); opacity: 0; } }
.fld { display: flex; flex-direction: column; gap: 4px; font: 700 14px var(--fu); color: #6a5440; }
.fld input, .gin { border: 3px solid #d8c09a; background: #fff; border-radius: 14px; padding: 12px 14px; font: 800 20px var(--f); color: var(--ink); outline: none; }
.fld input:focus, .gin:focus { border-color: var(--gold2); }
.fld.small input { width: 120px; }
.err { min-height: 18px; margin: 0; color: var(--red); font-weight: 700; }
.muted { color: #8b745c; font-size: 14px; }
.t-row { display: flex; gap: 10px; } .t-row > * { flex: 1; }

/* ---------- title ---------- */
#title { display: grid; grid-template-columns: 1fr minmax(280px, 380px); align-items: center; gap: 24px; padding: calc(24px + var(--safe-t)) calc(32px + var(--safe-r)) calc(24px + var(--safe-b)) calc(32px + var(--safe-l));
  background: linear-gradient(90deg, rgba(10, 6, 2, .55), rgba(10, 6, 2, 0) 55%), linear-gradient(0deg, rgba(10, 6, 2, .5), transparent 35%); }
.t-logo { align-self: center; }
.t-logo h1 { margin: 0; font: 900 clamp(56px, 11vw, 140px)/.8 var(--f); letter-spacing: .01em; }
.t-logo h1 span { display: block; color: var(--gold); text-shadow: 0 7px 0 #7a2418, 0 14px 30px rgba(0, 0, 0, .5); animation: logoIn .8s cubic-bezier(.2, 1.5, .4, 1) both; }
.t-logo h1 span + span { color: #fff8ea; text-shadow: 0 7px 0 var(--wood), 0 14px 30px rgba(0, 0, 0, .5); animation-delay: .12s; }
.t-logo p { margin: 18px 0 0; font: 700 clamp(16px, 2.2vw, 22px) var(--fu); color: #fff; text-shadow: 0 2px 8px #000; }
.t-horn { width: 120px; height: 14px; margin-bottom: 14px; background: var(--band); border-radius: 7px; box-shadow: 0 3px 0 #0006; }
@keyframes logoIn { from { transform: translateY(-60px) scale(1.3); opacity: 0; } }
.t-menu { display: flex; flex-direction: column; gap: 14px; animation: boardIn .6s .2s both; }
.t-set { position: absolute; left: calc(32px + var(--safe-l)); bottom: calc(22px + var(--safe-b)); display: flex; gap: 8px; flex-wrap: wrap; }
.t-ver { position: absolute; right: 14px; bottom: calc(10px + var(--safe-b)); font-size: 12px; color: #fff8; }

/* ---------- join ---------- */
.code-in { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-in input { width: 100%; aspect-ratio: .85; text-align: center; font: 900 30px var(--f); border: 3px solid #d8c09a; border-radius: 14px; background: #fff; color: var(--ink); outline: none; padding: 0; }
.code-in input:focus { border-color: var(--gold2); box-shadow: 0 0 0 4px #f2c14e55; }
.me-prev { display: flex; align-items: center; gap: 12px; }
#join-face { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 3px solid var(--wood); }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.pk { text-align: left; border: 0; border-radius: 18px; padding: 14px; background: #fff; color: var(--ink); box-shadow: 0 5px 0 #d8c09a; display: flex; flex-direction: column; gap: 6px; border-left: 10px solid var(--c, var(--gold)); }
.pk b { font: 800 18px var(--f); } .pk span { font-size: 13px; color: #6a5440; } .pk small { font-weight: 700; color: var(--c, #b06f12); }
.pk:active { transform: translateY(3px); box-shadow: 0 2px 0 #d8c09a; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud.dim { visibility: hidden; }
#pcard { position: absolute; left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t)); display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 40px; background: rgba(25, 18, 12, .78); border: 2px solid #f2c14e66; backdrop-filter: blur(6px); }
#pc-face { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold); }
#pc-face svg, #join-face svg, .du-face svg { width: 100%; height: 100%; display: block; }
.pc-txt b { display: block; font: 800 17px var(--f); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-xp { width: 120px; height: 9px; margin-top: 5px; border-radius: 5px; background: #000a; overflow: hidden; }
.pc-xp i { display: block; height: 100%; background: linear-gradient(90deg, #7ee0a6, #2fa36b); transform-origin: left; transition: transform .5s; }
.pc-koin { margin-top: 3px; font: 800 12.5px var(--fu); color: #ffe08a; }
#btn-misi { position: absolute; right: calc(28px + var(--safe-r)); top: calc(196px + var(--safe-t)); font-size: 14px; }
#btn-misi b { color: var(--gold); }
#pc-lv { position: absolute; left: 38px; top: 38px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--ink); font: 900 13px var(--f); border: 2px solid var(--wood); }
#room { position: absolute; left: calc(12px + var(--safe-l)); top: calc(80px + var(--safe-t)); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 260px; padding: 6px 12px; border-radius: 14px; background: rgba(25, 18, 12, .7); font-size: 13px; font-weight: 700; }
#room b { font: 900 16px var(--f); letter-spacing: .12em; color: var(--gold); }
#room .dot { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 50%; background: #5be38c; box-shadow: 0 0 8px #5be38c; }
#room.bad .dot { background: #ff6b5a; box-shadow: 0 0 8px #ff6b5a; animation: blink .6s infinite alternate; }
#room small { width: 100%; color: #fff9; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes blink { to { opacity: .3; } }
#minimap { position: absolute; right: calc(14px + var(--safe-r)); top: calc(14px + var(--safe-t)); width: 172px; height: 172px; border-radius: 50%; border: 4px solid rgba(20, 14, 10, .85); box-shadow: 0 0 0 2px #f2c14e99, 0 8px 20px rgba(0, 0, 0, .45); background: #3f8f5a; }
#minimap.big { width: min(92vw, 520px); height: min(83vw, 468px); border-radius: 22px; right: 50%; transform: translateX(50%); top: 70px; z-index: 5; }
#btn-menu { position: absolute; right: calc(200px + var(--safe-r)); top: calc(14px + var(--safe-t)); width: 46px; height: 46px; font-size: 16px; }
.hb { border: 0; border-radius: 50%; width: 56px; height: 56px; display: grid; place-items: center; font: 900 22px var(--f); color: #fff; background: rgba(25, 18, 12, .72); border: 2px solid #ffffff38; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); backdrop-filter: blur(6px); }
.hb:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.hb.big { width: 74px; height: 74px; font-size: 28px; }
.hb.act { background: linear-gradient(#ffe08a, #f2b636); color: var(--ink); border-color: #fff8; font-size: 13px; line-height: 1; }
.hb.act span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb.act:not(.ready) { filter: grayscale(.7) brightness(.75); }
.hb.act.ready { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px #f2c14e40, 0 4px 0 rgba(0, 0, 0, .35); } }
#hbtns { position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 10px; align-items: end; justify-items: center; }
#btn-emote { grid-area: 1 / 1; } #btn-chat { grid-area: 1 / 2; } #btn-jump { grid-area: 2 / 1; } #btn-act { grid-area: 2 / 2; }
#joy { position: absolute; left: calc(26px + var(--safe-l)); bottom: calc(26px + var(--safe-b)); width: 136px; height: 136px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05)); border: 3px solid rgba(255, 255, 255, .28); touch-action: none; }
#joy-k { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #f2c14e 60%, #c98a1c); box-shadow: 0 4px 10px rgba(0, 0, 0, .4); pointer-events: none; }
body:not(.touch) #joy { display: none; }
body.touch #keys { display: none; }
#keys.gone { opacity: 0; transition: opacity 1s; }
#keys { position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); padding: 6px 14px; border-radius: 12px; background: rgba(25, 18, 12, .55); font-size: 12.5px; font-weight: 600; color: #fffc; white-space: nowrap; pointer-events: none; }
#feed { position: absolute; left: calc(12px + var(--safe-l)); top: calc(150px + var(--safe-t)); display: flex; flex-direction: column; gap: 6px; width: min(340px, 60vw); pointer-events: none; }
.fd { padding: 7px 12px; border-radius: 12px; background: rgba(25, 18, 12, .72); font-size: 14px; font-weight: 600; animation: fdIn .35s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .5s, transform .5s; border-left: 4px solid var(--gold); }
.fd.good { border-color: #5be38c; } .fd.chat { border-color: #7fb8ff; } .fd.guru { border-color: #e0629b; background: rgba(60, 20, 40, .82); }
.fd.out { opacity: 0; transform: translateX(-20px); }
@keyframes fdIn { from { transform: translateX(-30px); opacity: 0; } }
#banner { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -20px) scale(.8); opacity: 0; pointer-events: none; text-align: center; transition: all .35s cubic-bezier(.2, 1.4, .4, 1); }
#banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#banner b { display: block; padding: 10px 28px; border-radius: 18px; background: var(--c); color: #fff; font: 900 clamp(26px, 5vw, 46px)/1.05 var(--f); text-shadow: 0 3px 0 rgba(0, 0, 0, .25); box-shadow: 0 6px 0 rgba(0, 0, 0, .3), 0 0 0 4px #fff8 inset; white-space: nowrap; }
#banner span { display: inline-block; margin-top: 8px; padding: 5px 14px; border-radius: 12px; background: rgba(25, 18, 12, .8); font: 700 16px var(--fu); }
#prompt { position: absolute; left: 50%; bottom: calc(118px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; padding: 10px 18px; border-radius: 16px; background: rgba(25, 18, 12, .85); font: 800 17px var(--f); transition: all .2s; pointer-events: none; white-space: nowrap; border: 2px solid #f2c14e88; }
#prompt.show { opacity: 1; transform: translate(-50%, 0); }
#prompt kbd { display: inline-block; min-width: 28px; margin-right: 6px; padding: 2px 7px; border-radius: 7px; background: var(--gold); color: var(--ink); font: 900 15px var(--f); text-align: center; box-shadow: 0 3px 0 var(--gold2); }
body.touch #prompt kbd { display: none; }
#wheel { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 4; }
#wheel::before { content: ''; position: absolute; left: -165px; top: -165px; width: 330px; height: 330px; border-radius: 50%; background: radial-gradient(circle, rgba(25, 18, 12, .82) 30%, rgba(25, 18, 12, .55)); }
.we { position: absolute; left: var(--x); top: var(--y); width: 70px; height: 70px; margin: -35px; border: 0; border-radius: 50%; background: #fff8ea; color: var(--ink); display: grid; place-items: center; align-content: center; box-shadow: 0 4px 0 #b48a52; animation: weIn .3s cubic-bezier(.2, 1.5, .4, 1) both; }
.we span { font-size: 28px; line-height: 1; } .we small { font: 800 10px var(--fu); }
.we:hover { transform: scale(1.1); }
.we-x { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font: 900 20px var(--f); }
@keyframes weIn { from { transform: scale(0); } }
#chatlist { position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(190px + var(--safe-b)); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: min(420px, 92vw); max-height: 52vh; overflow: auto; padding: 10px; border-radius: 18px; background: rgba(25, 18, 12, .85); z-index: 4; }
.cs { border: 0; border-radius: 12px; padding: 10px; background: #fff8ea; color: var(--ink); font: 700 14px var(--fu); text-align: left; box-shadow: 0 3px 0 #b48a52; }
#invite { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); width: min(360px, 92vw); padding: 16px; border-radius: 20px; background: linear-gradient(#fff8ea, #f3e3c2); color: var(--ink); border: 5px solid var(--red); box-shadow: 0 10px 0 #7a2418, 0 20px 40px #0008; text-align: center; animation: boardIn .35s cubic-bezier(.2, 1.4, .4, 1); z-index: 6; }
.inv-ic { font-size: 40px; } #invite p { margin: 6px 0 10px; font: 700 17px var(--fu); }
.inv-bar { height: 8px; border-radius: 4px; background: #0002; overflow: hidden; margin-bottom: 12px; } .inv-bar i { display: block; height: 100%; background: var(--red); transform-origin: left; }
.inv-b { display: flex; gap: 10px; } .inv-b button { flex: 1; border: 0; border-radius: 14px; padding: 12px; font: 800 17px var(--f); }
.inv-b .ok { background: var(--green); color: #fff; box-shadow: 0 4px 0 #1b6a44; } .inv-b .no { background: #e8dcc4; box-shadow: 0 4px 0 #b48a52; }
#toast { position: fixed; left: 50%; bottom: calc(30px + var(--safe-b)); z-index: 95; transform: translate(-50%, 30px); opacity: 0; padding: 12px 20px; border-radius: 16px; background: rgba(25, 18, 12, .92); color: #fff; font: 700 15px var(--fu); transition: all .25s; pointer-events: none; max-width: 92vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#conn { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 60; padding: 8px 16px; border-radius: 12px; background: #c0392bdd; font-weight: 800; }

/* ---------- quiz ---------- */
#quiz { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: calc(14px + var(--safe-t)) 14px calc(14px + var(--safe-b));
  background: radial-gradient(ellipse at 50% 30%, rgba(30, 20, 12, .55), rgba(10, 6, 2, .88)); overflow: auto; }
#quiz.qz-in { animation: fadeIn .25s; } #quiz.qz-out { animation: fadeOut .25s forwards; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.qz-top { width: min(820px, 100%); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qz-plaque { display: flex; flex-direction: column; padding: 8px 18px; border-radius: 16px; background: var(--c); box-shadow: 0 5px 0 rgba(0, 0, 0, .35), 0 0 0 3px #fff6 inset; }
.qz-kind { font: 800 11px var(--fu); letter-spacing: .14em; text-transform: uppercase; opacity: .85; } .qz-title { font: 900 22px/1.1 var(--f); }
.qz-hearts { font-size: 24px; letter-spacing: 2px; } .qz-hearts span { color: #4a3a30; filter: grayscale(1); } .qz-hearts span.on { color: #ff4d5e; filter: none; text-shadow: 0 2px 0 #8b1a24; }
.qz-hearts.hit { animation: shake .4s; } @keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.qz-dots { display: flex; gap: 5px; flex: 1; } .qz-dots i { width: 14px; height: 14px; border-radius: 50%; background: #ffffff30; } .qz-dots i.now { background: var(--gold); box-shadow: 0 0 0 3px #f2c14e55; } .qz-dots i.ok { background: #5be38c; } .qz-dots i.no { background: #ff6b5a; }
.qz-x { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #ffffff22; color: #fff; font: 900 20px var(--f); }
.qz-card { width: min(820px, 100%); position: relative; padding: 22px 24px 26px; border-radius: 24px; background: linear-gradient(#fff8ea, #f3e3c2); color: var(--ink); border: 6px solid var(--wood); box-shadow: 0 0 0 3px var(--gold) inset, 0 10px 0 var(--wood3); }
.qz-card.pop { animation: boardIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.qz-num { font: 800 13px var(--fu); letter-spacing: .1em; text-transform: uppercase; color: #8b745c; }
.qz-q { margin-top: 6px; font: 800 clamp(19px, 2.6vw, 26px)/1.35 var(--fu); white-space: pre-wrap; }
.qz-timer { position: absolute; left: 20px; right: 20px; bottom: 9px; height: 7px; border-radius: 4px; background: #0001; overflow: hidden; } .qz-timer i { display: block; height: 100%; background: var(--green); transform-origin: left; transition: transform .1s linear; } .qz-timer.low i { background: var(--red); }
.qz-ans { width: min(820px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; transition: opacity .2s; }
.qz-ans.wait { opacity: .7; pointer-events: none; } .qz-ans.err { animation: shake .4s; }
.qz-ans.t-n { grid-template-columns: 1fr; justify-items: center; }
.qz-tile, .lb-a, .du-a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 12px 16px; border: 0; border-radius: 18px; background: var(--t); color: #fff; font: 800 clamp(16px, 2vw, 20px)/1.25 var(--fu); text-align: left; box-shadow: 0 6px 0 rgba(0, 0, 0, .35); transition: transform .1s, filter .2s; }
.qz-tile b, .lb-a b, .du-a b { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(0, 0, 0, .22); font: 900 20px var(--f); }
.qz-tile:hover, .lb-a:hover, .du-a:hover { filter: brightness(1.08); } .qz-tile:active, .lb-a:active, .du-a:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.qz-tile.sel { outline: 5px solid #fff; outline-offset: -5px; }
.qz-tile.multi b { border: 3px solid #fff8; } .qz-tile.multi.sel b::after { content: '✔'; }
.qz-tile:disabled { filter: saturate(.4) brightness(.75); }
.qz-tile.key, .du-a.key { filter: none !important; outline: 5px solid #ffe48a; outline-offset: -5px; box-shadow: 0 0 24px #ffe48a, 0 6px 0 rgba(0, 0, 0, .35); }
.qz-tile.ok, .du-a.ok { filter: none !important; animation: okPop .5s; } .qz-tile.ok::after, .du-a.ok::after { content: '✔'; position: absolute; right: 14px; font-size: 26px; }
.qz-tile.no, .du-a.no { filter: none !important; background: #6b5a52; animation: shake .4s; } .qz-tile.no::after, .du-a.no::after { content: '✕'; position: absolute; right: 14px; font-size: 26px; }
@keyframes okPop { 40% { transform: scale(1.06); } }
.qz-go { grid-column: 1 / -1; min-height: 56px; border: 0; border-radius: 16px; background: linear-gradient(#ffe08a, #f2b636); color: var(--ink); font: 900 19px var(--f); box-shadow: 0 5px 0 #b06f12; }
.qz-go:disabled { filter: grayscale(.8) brightness(.7); }
.qz-numdisp, .du-num { min-width: min(360px, 90%); padding: 12px 18px; border-radius: 16px; background: #fff; color: var(--ink); font: 900 34px var(--f); text-align: center; border: 4px solid var(--gold); }
.qz-numdisp i { animation: blink .5s infinite alternate; font-style: normal; color: var(--gold2); }
.qz-numdisp.ok { border-color: #2fa36b; background: #dff7e8; } .qz-numdisp.no { border-color: var(--red); background: #fde3df; animation: shake .4s; }
.qz-pad, .du-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 8px; }
.qz-pad button, .du-pad button { height: 56px; border: 0; border-radius: 14px; background: #fff8ea; color: var(--ink); font: 900 24px var(--f); box-shadow: 0 4px 0 #b48a52; }
.qz-pad .del, .du-pad .del { background: #f0c9c0; } .qz-pad .go, .du-pad .go { grid-column: span 2; background: linear-gradient(#ffe08a, #f2b636); box-shadow: 0 4px 0 #b06f12; font-size: 20px; }
.qz-combo { min-height: 30px; font: 900 22px var(--f); color: var(--gold); text-shadow: 0 3px 0 #7a2418; opacity: 0; transform: scale(.5); transition: all .3s cubic-bezier(.2, 1.6, .4, 1); }
.qz-combo.show { opacity: 1; transform: scale(1); }
.qz-talk { position: fixed; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%); width: min(820px, 94vw); display: flex; align-items: flex-end; gap: 12px; cursor: pointer; z-index: 3; }
.qz-talk.in { animation: talkIn .3s cubic-bezier(.2, 1.4, .4, 1); } @keyframes talkIn { from { transform: translate(-50%, 40px); opacity: 0; } }
.qz-face { flex: none; width: 96px; height: 96px; border-radius: 50%; overflow: hidden; border: 4px solid var(--gold); box-shadow: 0 6px 0 #0006; background: #2fa36b; }
.qz-face svg { width: 100%; height: 100%; }
.qz-bub { position: relative; flex: 1; padding: 14px 18px 26px; border-radius: 22px; background: var(--paper); color: var(--ink); border: 4px solid var(--wood); box-shadow: 0 8px 0 var(--wood3); }
.qz-who { display: block; font: 900 15px var(--f); color: #2f7a5a; } .qz-say { margin: 4px 0 0; font: 600 17px/1.45 var(--fu); min-height: 2.9em; }
.qz-next { position: absolute; right: 16px; bottom: 6px; font: 800 12px var(--fu); color: #8b745c; animation: blink .7s infinite alternate; }
.qz-flash { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: #c0392bee; font-weight: 800; z-index: 5; }
.qz-end { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10, 6, 2, .65); z-index: 4; }
.qz-endcard { width: min(400px, 92vw); padding: 26px; border-radius: 26px; text-align: center; background: linear-gradient(#fff8ea, #f3e3c2); color: var(--ink); border: 6px solid var(--wood); box-shadow: 0 0 0 3px var(--gold) inset, 0 12px 0 var(--wood3); animation: boardIn .4s cubic-bezier(.2, 1.4, .4, 1); display: flex; flex-direction: column; gap: 10px; }
.qz-endtitle { font: 900 36px var(--f); color: var(--wood); }
.qz-stars { font-size: 58px; letter-spacing: 6px; } .qz-stars span { color: #cdbba0; display: inline-block; } .qz-stars span.on { color: #ffc61a; text-shadow: 0 4px 0 #b06f12; animation: starIn .5s cubic-bezier(.2, 1.8, .4, 1) both; }
.qz-stars span.on:nth-child(2) { animation-delay: .26s; } .qz-stars span.on:nth-child(3) { animation-delay: .52s; } .qz-stars span.on:nth-child(1) { animation-delay: .0s; }
@keyframes starIn { from { transform: scale(3) rotate(-40deg); opacity: 0; } }
.qz-endcard p { margin: 0; font-weight: 700; } .qz-xp { color: #2f7a5a; font: 900 20px var(--f) !important; }

/* ---------- Lomba ---------- */
#lomba { position: fixed; inset: 0; z-index: 25; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-t)) 12px calc(12px + var(--safe-b)); }
#lomba > * { pointer-events: auto; }
.lb-top { width: min(760px, calc(100% - 400px)); min-width: min(520px, 100%); padding: 12px 18px; border-radius: 20px; background: rgba(25, 18, 12, .86); border: 3px solid #f2c14e88; text-align: center; animation: boardIn .3s; }
.lb-top b { font: 900 22px var(--f); color: var(--gold); } .lb-top p { margin: 6px 0 0; font-weight: 600; }
.lb-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; }
.lb-chip { padding: 3px 12px; border-radius: 10px; font-size: 13px; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-t { min-width: 46px; padding: 2px 10px; border-radius: 12px; background: var(--gold); color: var(--ink); font: 900 22px var(--f); }
.ph-siap .lb-t { display: inline-block; margin: 8px 0; font-size: 48px; }
.lb-q { margin: 8px 0; font: 800 clamp(17px, 2.3vw, 22px)/1.35 var(--fu); }
.lb-bar { height: 8px; border-radius: 4px; background: #ffffff22; overflow: hidden; } .lb-bar i { display: block; height: 100%; background: var(--gold); transform-origin: left; }
.lb-ans { width: min(900px, 100%); display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 6px; }
.lb-a { min-height: 64px; font-size: 16px; } .lb-a.sel { outline: 5px solid #fff; outline-offset: -5px; } .lb-a.dim { filter: saturate(.3) brightness(.6); }
.lb-hint { padding: 6px 14px; border-radius: 12px; background: rgba(25, 18, 12, .7); font-weight: 700; font-size: 14px; }
.lb-rank { margin: 8px auto 0; padding: 0; list-style: none; max-width: 420px; text-align: left; counter-reset: r; }
.lb-rank li { display: flex; justify-content: space-between; padding: 5px 10px; border-radius: 10px; font-weight: 700; counter-increment: r; } .lb-rank li::before { content: counter(r) '.'; width: 28px; color: var(--gold); }
.lb-rank li span { flex: 1; } .lb-rank li:nth-child(odd) { background: #ffffff12; }
.ph-siap, .ph-bahas, .ph-papan, .ph-selesai { justify-content: flex-start !important; }

/* ---------- Regu ---------- */
#regu { position: fixed; left: 50%; top: calc(10px + var(--safe-t)); transform: translateX(-50%); z-index: 22; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: calc(100% - 420px); min-width: 300px; pointer-events: none; }
.rg { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 14px; background: rgba(25, 18, 12, .8); border: 2px solid var(--c); font-size: 13px; font-weight: 800; }
.rg.me { box-shadow: 0 0 0 3px var(--c), 0 0 18px var(--c); } .rg b { color: var(--c); }
.rg-bar { width: 70px; height: 9px; border-radius: 5px; background: #ffffff22; overflow: hidden; } .rg-bar i { display: block; height: 100%; background: var(--c); transform-origin: left; transition: transform .5s; }
.rg em { font-style: normal; animation: pulse 1s infinite; }
.rg-note { width: 100%; margin: 2px 0 0; text-align: center; font-size: 13px; font-weight: 700; text-shadow: 0 1px 4px #000; }

/* ---------- Duel ---------- */
#duel { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); background: linear-gradient(rgba(60, 14, 8, .55), rgba(10, 6, 2, .2) 40%, rgba(10, 6, 2, .6)); overflow: auto; }
.du-vs { width: min(760px, 100%); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.du-p { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 40px; background: rgba(25, 18, 12, .82); border: 3px solid #2f7fd8; }
.du-p.op { flex-direction: row-reverse; padding: 8px 8px 8px 14px; border-color: #e2553f; text-align: right; }
.du-p b { flex: 1; font: 800 17px var(--f); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.du-face { flex: none; width: 54px; height: 54px; border-radius: 50%; overflow: hidden; }
.du-pip { display: flex; gap: 4px; } .du-pip i { width: 14px; height: 14px; border-radius: 50%; background: #ffffff25; } .du-pip i.on { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.du-p.typing .du-face { animation: blink .4s infinite alternate; }
.du-mid { text-align: center; } .du-mid b { display: block; font: 900 34px var(--f); color: var(--gold); text-shadow: 0 4px 0 #7a2418; } .du-t { font: 900 22px var(--f); }
.du-card { width: min(760px, 100%); padding: 18px 20px; border-radius: 22px; background: linear-gradient(#fff8ea, #f3e3c2); color: var(--ink); border: 6px solid var(--wood); box-shadow: 0 0 0 3px var(--gold) inset, 0 10px 0 var(--wood3); display: flex; flex-direction: column; gap: 10px; animation: boardIn .3s; }
.du-card.end { text-align: center; } .du-big { font: 900 34px var(--f); color: var(--wood); text-align: center; }
.du-chip { align-self: flex-start; padding: 3px 12px; border-radius: 10px; color: #fff; font: 800 13px var(--fu); }
.du-q { font: 800 clamp(18px, 2.4vw, 23px)/1.35 var(--fu); white-space: pre-wrap; }
.du-ans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .du-ans.t-n { grid-template-columns: 1fr; justify-items: center; }
.du-a.sel { outline: 5px solid #fff; outline-offset: -5px; animation: blink .4s infinite alternate; }
.du-a:disabled:not(.ok):not(.no):not(.key):not(.sel) { filter: saturate(.4) brightness(.8); }
.du-st { font: 800 16px var(--fu); text-align: center; color: #6a5440; min-height: 22px; } .du-st.res { color: var(--wood); font: 900 22px var(--f); }
.du-x { margin: 0; font-weight: 600; color: #4a3a2a; }
.du-bar { height: 8px; border-radius: 4px; background: #0001; overflow: hidden; } .du-bar i { display: block; height: 100%; background: var(--red); transform-origin: left; }

/* ---------- pause, help, credits ---------- */
#jeda .board { gap: 12px; } #jeda h2 { margin-left: 0; text-align: center; }
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .howto div { padding: 12px; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 #d8c09a; } .howto b { font: 800 16px var(--f); } .howto p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; }
.credit { display: flex; gap: 16px; align-items: center; } .credit img { border-radius: 50%; border: 4px solid var(--gold); object-fit: cover; } .credit b { font: 900 20px var(--f); } .credit p { margin: 2px 0; }
.cr-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; } .cr-list dt { font-weight: 800; color: var(--wood); } .cr-list dd { margin: 0; }

/* ---------- wardrobe ---------- */
#lemari { pointer-events: none; }
.lm-panel { pointer-events: auto; position: absolute; right: calc(16px + var(--safe-r)); top: 50%; transform: translateY(-50%); width: min(420px, 46vw); max-height: calc(100% - 32px); display: flex; flex-direction: column; gap: 10px; padding: 22px 18px 18px; border-radius: 24px; color: var(--ink); background: linear-gradient(#fff8ea, #f3e3c2); border: 6px solid var(--wood); box-shadow: 0 0 0 3px var(--gold) inset, 0 12px 0 var(--wood3); }
.lm-panel h2 { margin: 0 0 0 52px; font: 900 28px var(--f); color: var(--wood); }
.lm-tabs { display: flex; flex-wrap: wrap; gap: 6px; } .lm-tabs button { border: 0; border-radius: 10px; padding: 7px 10px; background: #ead9b8; font: 800 13px var(--fu); color: var(--ink); } .lm-tabs button.on { background: var(--wood); color: var(--gold); }
.lm-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; overflow: auto; padding: 4px; min-height: 120px; }
.lm-o { position: relative; border: 3px solid transparent; border-radius: 14px; padding: 8px 6px; background: #fff; font: 700 12.5px/1.2 var(--fu); color: var(--ink); box-shadow: 0 3px 0 #d8c09a; min-height: 56px; }
.lm-o.sw { min-height: 52px; padding: 0; } .lm-o.sw i { position: absolute; inset: 6px; border-radius: 9px; background: var(--c); }
.lm-o.on { border-color: var(--gold2); box-shadow: 0 0 0 3px #f2c14e66, 0 3px 0 #d8c09a; }
.lm-o.lock { opacity: .5; }
.lm-o.price::after { content: attr(data-harga); position: absolute; right: 4px; top: 2px; font-size: 10.5px; font-weight: 800; color: #b06f12; } .lm-o.lock::after { content: '🔒 Lv ' attr(data-lv); position: absolute; right: 4px; top: 2px; font-size: 10px; font-weight: 800; }
.lm-row { display: flex; gap: 10px; } .lm-row .tb { flex: 1; }
.lm-hint { position: absolute; left: calc(20px + var(--safe-l)); bottom: calc(20px + var(--safe-b)); padding: 8px 14px; border-radius: 12px; background: rgba(25, 18, 12, .7); font-weight: 700; font-size: 14px; }

/* ---------- teacher console ---------- */
#guru { position: fixed; inset: 0; z-index: 60; overflow: auto; background: #1d1712; color: var(--cream); }
#guru.proj { background: transparent; overflow: hidden; pointer-events: none; }
#guru.proj > * { pointer-events: auto; }
.g-wrap { max-width: 1180px; margin: 0 auto; padding: calc(18px + var(--safe-t)) 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.g-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.g-head h2 { margin: 0; font: 900 30px var(--f); color: var(--gold); } .g-head .sp { flex: 1; }
.g-back { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--wood); color: var(--gold); font: 900 22px var(--f); box-shadow: 0 4px 0 var(--wood3); }
.g-card { padding: 18px; border-radius: 20px; background: #2a2019; border: 2px solid #f2c14e33; box-shadow: 0 6px 0 #0005; }
.g-card h3 { margin: 0 0 10px; font: 900 20px var(--f); color: var(--gold); display: flex; align-items: center; gap: 8px; }
.g-card p { margin: 6px 0; color: #e8dcc8; line-height: 1.5; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.g-code { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.g-code .big { font: 900 clamp(48px, 8vw, 84px)/1 var(--f); letter-spacing: .1em; color: var(--gold); text-shadow: 0 5px 0 #7a2418; }
.g-qr { width: 150px; height: 150px; padding: 8px; border-radius: 14px; background: #fff; } .g-qr svg, .g-qr canvas { width: 100%; height: 100%; display: block; }
.g-link { font: 700 15px var(--fu); color: #fff; word-break: break-all; }
.g-tabs { display: flex; gap: 8px; flex-wrap: wrap; } .g-tabs button { border: 0; border-radius: 12px; padding: 10px 16px; background: #3a2c22; color: #fff; font: 800 15px var(--fu); }
.g-tabs button.on { background: var(--gold); color: var(--ink); }
.g-table { width: 100%; border-collapse: collapse; font-size: 14px; } .g-table th, .g-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #ffffff14; }
.g-table th { color: #f2c14e; font-weight: 800; position: sticky; top: 0; background: #2a2019; } .g-table tr.off td { opacity: .45; }
.g-scroll { max-height: 460px; overflow: auto; }
.g-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .g-row > label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 13px; color: #d8c8b0; }
.g-row select, .g-row input, .g-in { padding: 10px 12px; border-radius: 12px; border: 2px solid #5e4a3a; background: #1d1712; color: #fff; font: 700 15px var(--fu); }
.g-btn { border: 0; border-radius: 12px; padding: 11px 16px; font: 800 15px var(--fu); background: #3a2c22; color: #fff; box-shadow: 0 4px 0 #0006; }
.g-btn.gold { background: linear-gradient(#ffe08a, #f2b636); color: var(--ink); } .g-btn.red { background: #c0392b; } .g-btn.green { background: #2fa36b; } .g-btn.blue { background: #2f7fd8; }
.g-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0006; } .g-btn:disabled { opacity: .45; }
.g-bars { display: flex; flex-direction: column; gap: 6px; } .g-bar { display: grid; grid-template-columns: 110px 1fr 54px; gap: 8px; align-items: center; font-weight: 700; font-size: 14px; }
.g-bar div { height: 16px; border-radius: 8px; background: #ffffff18; overflow: hidden; } .g-bar i { display: block; height: 100%; background: var(--c, var(--gold)); transition: width .4s; }
.g-feed { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 4px; font-size: 14px; } .g-feed div { padding: 5px 8px; border-radius: 8px; background: #ffffff0c; }
.g-pill { display: inline-block; padding: 2px 9px; border-radius: 9px; font-size: 12px; font-weight: 800; background: #ffffff1a; }
.g-note { padding: 10px 12px; border-radius: 12px; background: #f2c14e1c; border-left: 4px solid var(--gold); font-size: 14px; }
.g-ed { width: 100%; min-height: 340px; resize: vertical; padding: 14px; border-radius: 14px; border: 2px solid #5e4a3a; background: #120d09; color: #f8eedd; font: 500 14px/1.55 ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.g-err { color: #ff8a7a; font-weight: 700; white-space: pre-wrap; font-size: 14px; }
.g-ok { color: #7ee0a6; font-weight: 700; font-size: 14px; }
.g-prev { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; font-size: 14px; }
.g-prev .m { padding: 8px 10px; border-radius: 10px; background: #ffffff10; border-left: 6px solid var(--c); }
.proj-top { position: absolute; left: 16px; top: 16px; display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-radius: 18px; background: rgba(25, 18, 12, .85); }
.proj-top .big { font: 900 52px/1 var(--f); letter-spacing: .1em; color: var(--gold); }
.proj-top .g-qr { width: 110px; height: 110px; }
.proj-side { position: absolute; right: 16px; top: 16px; width: 300px; max-height: calc(100% - 32px); overflow: auto; padding: 14px; border-radius: 18px; background: rgba(25, 18, 12, .85); display: flex; flex-direction: column; gap: 8px; }
.proj-bot { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- small screens ---------- */
@media (max-width: 760px), (max-height: 520px) {
  #title { grid-template-columns: 1fr; align-content: center; gap: 18px; padding-top: calc(18px + var(--safe-t)); text-align: center; background: linear-gradient(0deg, rgba(10, 6, 2, .75), rgba(10, 6, 2, .2) 70%); }
  .t-horn { margin: 0 auto 10px; } .t-menu { width: min(360px, 100%); justify-self: center; gap: 10px; }
  .t-set { position: static; justify-content: center; }
  .tb.big { min-height: 56px; font-size: 20px; }
  #minimap { width: 118px; height: 118px; border-width: 3px; }
  #btn-menu { right: calc(140px + var(--safe-r)); width: 40px; height: 40px; }
  #pcard { padding-right: 10px; } #pc-face { width: 42px; height: 42px; } #pc-lv { left: 30px; top: 30px; width: 22px; height: 22px; font-size: 11px; }
  .pc-txt b { font-size: 14px; max-width: 96px; } .pc-xp { width: 84px; }
  #room { top: calc(66px + var(--safe-t)); max-width: 200px; font-size: 12px; } #room small { display: none; }
  #btn-misi { top: calc(140px + var(--safe-t)); right: calc(18px + var(--safe-r)); padding: 6px 10px; font-size: 12.5px; }
  #feed { top: calc(108px + var(--safe-t)); width: min(260px, 64vw); } .fd { font-size: 12.5px; padding: 5px 9px; }
  .lb-top { width: 100%; min-width: 0; padding: 8px 12px; } .lb-q { font-size: 15px; margin: 4px 0; }
  .lb-ans { grid-template-columns: 1fr 1fr; gap: 6px; } .lb-a { min-height: 50px; font-size: 13.5px; padding: 8px 10px; } .lb-a b { width: 30px; height: 30px; font-size: 16px; }
  #regu { max-width: calc(100% - 150px); min-width: 0; top: calc(60px + var(--safe-t)); } .rg { padding: 4px 7px; font-size: 11px; } .rg-bar { width: 40px; }
  .qz-ans { grid-template-columns: 1fr; gap: 8px; } .qz-tile { min-height: 56px; } .qz-face { width: 64px; height: 64px; }
  .qz-q { font-size: 17px; } .qz-say { font-size: 15px; }
  .howto { grid-template-columns: 1fr; }
  .lm-panel { left: 10px; right: 10px; top: auto; bottom: 10px; transform: none; width: auto; max-height: 52%; padding: 14px 12px 12px; }
  .lm-panel h2 { font-size: 22px; } .lm-hint { top: calc(14px + var(--safe-t)); bottom: auto; }
  .du-ans { grid-template-columns: 1fr; } .du-face { width: 42px; height: 42px; } .du-p b { font-size: 14px; }
  .qz-pad, .du-pad { grid-template-columns: repeat(3, 68px); } .qz-pad button, .du-pad button { height: 48px; }
  .hb { width: 50px; height: 50px; font-size: 19px; } .hb.big { width: 66px; height: 66px; }
  #joy { width: 120px; height: 120px; left: calc(18px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); }
  #prompt { bottom: calc(100px + var(--safe-b)); font-size: 15px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .qz-card { padding: 12px 16px 18px; } .qz-tile { min-height: 46px; } .qz-ans { grid-template-columns: 1fr 1fr; }
  .qz-talk { bottom: 6px; } .qz-face { width: 56px; height: 56px; } .qz-bub { padding: 8px 12px 18px; }
  .lm-panel { left: auto; right: 10px; top: 10px; bottom: 10px; width: 46%; max-height: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- cinematic: letterbox, area titles, shot fades, mouse hint ---------- */
#cine { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
#cine i { position: absolute; left: 0; right: 0; height: 11vh; background: #000; transition: transform .7s cubic-bezier(.6, 0, .2, 1); }
#cine i:first-child { top: 0; transform: translateY(-100%); } #cine i:last-child { bottom: 0; transform: translateY(100%); }
#cine.on i { transform: none; }
#zone { position: fixed; left: 50%; top: 17%; z-index: 31; transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; white-space: nowrap; }
#zone small { display: block; font: 800 13px var(--fu); letter-spacing: .32em; text-transform: uppercase; color: #ffe2a8; text-shadow: 0 2px 8px #000; }
#zone b { display: block; margin-top: 4px; font: 900 clamp(30px, 6vw, 62px)/1 var(--f); font-style: italic; letter-spacing: .01em; color: #fff; text-shadow: 0 4px 0 rgba(122, 36, 24, .9), 0 10px 30px rgba(0, 0, 0, .6); }
#zone i { display: block; height: 6px; width: 0; margin: 10px auto 0; background: var(--band); border-radius: 3px; }
#zone.show { animation: zoneIn 3.2s ease both; } #zone.show i { animation: zoneBar 3.2s ease both; }
@keyframes zoneIn { 0% { opacity: 0; transform: translate(-50%, 14px); letter-spacing: .2em; } 14%, 78% { opacity: 1; transform: translate(-50%, 0); letter-spacing: .01em; } 100% { opacity: 0; transform: translate(-50%, -8px); } }
@keyframes zoneBar { 0% { width: 0; } 20%, 80% { width: 70%; } 100% { width: 70%; } }
#fade { position: fixed; inset: 0; z-index: 35; background: #000; opacity: 0; pointer-events: none; }
#fade.go { animation: shotCut .9s ease; } @keyframes shotCut { 0% { opacity: .85; } 100% { opacity: 0; } }
#lockhint { position: fixed; left: 50%; bottom: calc(52px + var(--safe-b)); transform: translateX(-50%); z-index: 21; padding: 6px 14px; border-radius: 12px; background: rgba(25, 18, 12, .6); font: 600 12.5px var(--fu); color: #fffc; pointer-events: none; white-space: nowrap; }
#title { background: linear-gradient(90deg, rgba(10, 6, 2, .62), rgba(10, 6, 2, 0) 50%), linear-gradient(0deg, rgba(10, 6, 2, .55), transparent 32%); }

/* ---------- Papan Misi, Buku Ilmu, Ruang Materi ---------- */
.pp-body { display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow: auto; padding: 2px; }
.pp-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 #d8c09a; font-weight: 700; }
.pp-row b { flex: 1; } .pp-row.done { background: #e4f7ea; } .pp-row.top { background: #fff3cf; }
.pp-bar { width: 120px; height: 10px; border-radius: 5px; background: #0001; overflow: hidden; } .pp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7ee0a6, #2fa36b); }
.pp-face { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; } .pp-face svg { width: 100%; height: 100%; }
.pp-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pp-book { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 #d8c09a; color: var(--ink); font: 700 13px var(--fu); text-align: center; }
.pp-book span { font-size: 30px; } .pp-book.lock { opacity: .5; }
#papan .lm-tabs, #materi .lm-tabs { margin-left: 52px; }
.mt-list { display: flex; flex-direction: column; gap: 12px; max-height: 58vh; overflow: auto; padding: 2px; }
.mt-card { padding: 14px; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 #d8c09a; border-left: 8px solid var(--c, #f2c14e); }
.mt-card b { display: block; font: 800 17px var(--f); color: var(--wood); margin-bottom: 6px; } .mt-card p { margin: 6px 0; font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; }
.mt-card img { max-width: 100%; max-height: 50vh; border-radius: 10px; display: block; }
.mt-vid { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; } .mt-vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mt-card a.tb { display: inline-flex; text-decoration: none; }

/* ---------- phones during class modes (audit 1.2.1) ---------- */
#lomba .lb-hint { pointer-events: none; }
@media (max-width: 760px), (max-height: 520px) {
  body.lomba-on #minimap, body.lomba-on #btn-misi, body.lomba-on #room, body.lomba-on #feed { display: none; }
  body.lomba-on #lomba { padding-top: calc(74px + var(--safe-t)); }
  body.lomba-on .lb-top { border-radius: 16px; }
  body.regu-on #regu { left: calc(12px + var(--safe-l)); right: calc(140px + var(--safe-r)); top: calc(100px + var(--safe-t)); transform: none; max-width: none; min-width: 0; justify-content: flex-start; }
  body.regu-on #feed { top: calc(176px + var(--safe-t)); }
  .rg-note { display: none; }
}
