/* AlvQuis — tokens follow the "AlvQuis" design system.
   Layout: dosen = app shell (header + content); panggung = full-bleed stage on zamrud-deep;
   mahasiswa = single-column phone flow with 2×2 answer tiles. */
:root {
  --surface: #f2f4f1;
  --surface-raised: #ffffff;
  --line: #d5ddd7;
  --ink: #15201b;
  --ink-muted: #56645d;
  --zamrud: #0e6b52;
  --zamrud-deep: #0b3d30;
  --on-stage: #f4f7f2;
  --emas: #e3a816;
  --answer-a: #c2363f;
  --answer-b: #1d5fb8;
  --answer-c: #d99a0b;
  --answer-d: #2e7d45;
  --benar: #1f7a45;
  --salah: #b3303a;
  --on-zamrud: #f4f7f2;
  --ink-fixed: #15201b;

  --font-display: "Sora", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-sm: 6px; --radius-md: 12px; --radius-lg: 20px; --radius-pill: 999px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #101714; --surface-raised: #18211d; --line: #2a3731;
    --ink: #eef3ef; --ink-muted: #9fb0a7;
    --zamrud: #3fbf93; --on-zamrud: #0b2219;
    --emas: #f0bd3c;
    --answer-a: #d14a54; --answer-b: #3474cc; --answer-c: #e0a92a; --answer-d: #3d9558;
    --benar: #4cc07c; --salah: #ec6a72;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
a { color: var(--zamrud); }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--emas); outline-offset: 2px; }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink);
  font: 600 15px/1 var(--font-sans); padding: 12px 16px; border-radius: var(--radius-md);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--zamrud); border-color: var(--zamrud); color: var(--on-zamrud); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.gold { background: var(--emas); border-color: var(--emas); color: var(--ink-fixed); }
.btn.danger { color: var(--salah); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 36px; padding: 8px 12px; font-size: 14px; }
.btn.lg { min-height: 56px; padding: 16px 24px; font-size: 18px; }
.btn.block { width: 100%; }

label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
input[type=text], input[type=number], input[type=datetime-local], input[type=email], select, textarea {
  width: 100%; font: 400 16px/1.4 var(--font-sans); color: var(--ink);
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--zamrud); box-shadow: 0 0 0 3px color-mix(in srgb, var(--zamrud) 25%, transparent); }
.check { display: flex; align-items: center; gap: var(--space-2); font-size: 15px; color: var(--ink); font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--zamrud); }

.card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: var(--space-4); }
.stack.tight { gap: var(--space-2); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--line); color: var(--ink-muted); white-space: nowrap; }
.pill.live { color: var(--salah); border-color: currentColor; }
.pill.open { color: var(--benar); border-color: currentColor; }
.pill.gold { background: var(--emas); color: var(--ink-fixed); border-color: var(--emas); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- shapes ---------- */
.shape { width: 28px; height: 28px; flex: none; }
.shape path, .shape circle, .shape rect, .shape polygon { fill: currentColor; }
.opt-a { background: var(--answer-a); color: #fff; }
.opt-b { background: var(--answer-b); color: #fff; }
.opt-c { background: var(--answer-c); color: var(--ink-fixed); }
.opt-d { background: var(--answer-d); color: #fff; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: var(--radius-md);
  font-weight: 600; font-size: 15px; z-index: 100; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgb(0 0 0 / .2); }

/* ---------- dosen shell ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; white-space: nowrap; flex: none; }
.m-top .brand { font-size: 18px; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 26px; height: 26px; }
.brand-mark i { border-radius: 3px; }
.brand-mark i:nth-child(1){background:var(--answer-a)} .brand-mark i:nth-child(2){background:var(--answer-b)}
.brand-mark i:nth-child(3){background:var(--answer-c)} .brand-mark i:nth-child(4){background:var(--answer-d)}
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tab { border: 0; background: transparent; font: 600 15px var(--font-sans); color: var(--ink-muted); padding: 10px 14px; border-radius: var(--radius-sm); cursor: pointer; }
.tab[aria-selected=true] { color: var(--ink); background: var(--surface); }
main.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; gap: var(--space-4); align-items: end; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--space-6); }

.list { display: grid; gap: var(--space-3); }
.item { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); align-items: center; }
.item .meta { display: flex; gap: var(--space-3); flex-wrap: wrap; font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.item .actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: end; }
@media (max-width: 640px) { .item { grid-template-columns: 1fr; } .item .actions { justify-content: start; } }

.empty { text-align: center; padding: 48px 16px; border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--ink-muted); display: grid; gap: var(--space-3); justify-items: center; }

/* editor */
.qcard { display: grid; gap: var(--space-3); }
.qcard-head { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.qnum { font-family: var(--font-mono); font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px 8px; }
.qcard-head .spacer { flex: 1; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-2); }
.opt-edit { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-2); border-radius: var(--radius-md); padding: 6px 6px 6px 10px; }
.opt-edit input[type=text] { background: rgb(255 255 255 / .92); color: var(--ink-fixed); border: 0; min-height: 40px; }
.opt-edit .correct { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 0 6px; cursor: pointer; }
.opt-edit .correct input { width: 20px; height: 20px; accent-color: var(--ink-fixed); }
.qsettings { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.qsettings label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-muted); font-weight: 600; }
.qsettings select { width: auto; min-height: 36px; padding: 6px 8px; font-size: 14px; }

dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; background: var(--surface-raised); color: var(--ink); width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); }
dialog::backdrop { background: rgb(5 20 15 / .55); }
.dlg { padding: 24px; display: grid; gap: var(--space-4); }
.dlg-foot { display: flex; gap: var(--space-2); justify-content: end; flex-wrap: wrap; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.seg label { border: 2px solid var(--line); border-radius: var(--radius-md); padding: 14px; cursor: pointer; display: grid; gap: 4px; }
.seg label:has(input:checked) { border-color: var(--zamrud); background: color-mix(in srgb, var(--zamrud) 8%, var(--surface-raised)); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg b { font-size: 16px; }
.seg span { font-size: 13px; color: var(--ink-muted); }

/* results */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
.stat .v { font-family: var(--font-mono); font-size: 28px; font-weight: 700; }
.stat .k { font-size: 13px; color: var(--ink-muted); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); background: var(--surface); }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
.flag { color: var(--salah); font-weight: 700; font-size: 12px; }
.qstat { display: grid; grid-template-columns: 40px 1fr 64px; gap: var(--space-3); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qstat:last-child { border-bottom: 0; }
.qstat .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; background: var(--surface); border-radius: var(--radius-pill); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--zamrud); }

/* ---------- panggung (host stage) ---------- */
.stage { position: fixed; inset: 0; z-index: 50; background: var(--zamrud-deep); color: var(--on-stage);
  display: grid; grid-template-rows: auto 1fr auto; padding: calc(16px + env(safe-area-inset-top, 0px)) 24px calc(16px + env(safe-area-inset-bottom, 0px)); overflow: auto; }
.stage .btn { border-color: rgb(255 255 255 / .25); background: rgb(255 255 255 / .08); color: var(--on-stage); }
.stage .btn.gold { background: var(--emas); color: var(--ink-fixed); border-color: var(--emas); }
.stage .btn.light { background: var(--on-stage); color: var(--zamrud-deep); border-color: var(--on-stage); }
.stage-top { display: flex; gap: var(--space-4); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stage-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; opacity: .85; }
.stage-body { display: grid; align-content: center; gap: clamp(16px, 3vh, 40px); padding-block: 16px; min-height: 0; }
.stage-foot { display: flex; gap: var(--space-3); justify-content: space-between; align-items: center; flex-wrap: wrap; }

.lobby { display: grid; gap: var(--space-8); justify-items: center; text-align: center; }
.joinbox { display: flex; gap: var(--space-8); align-items: center; justify-content: center; flex-wrap: wrap; background: var(--on-stage); color: var(--ink-fixed); border-radius: var(--radius-lg); padding: 20px 32px; }
.joinbox .url { font-size: clamp(16px, 2vw, 24px); font-weight: 600; }
.joinbox .pin { font-family: var(--font-mono); font-size: clamp(48px, 8vw, 96px); font-weight: 700; letter-spacing: .08em; line-height: 1; }
.players { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 1100px; }
.players span { background: rgb(255 255 255 / .1); border-radius: var(--radius-pill); padding: 8px 16px; font-weight: 700; font-size: clamp(14px, 1.6vw, 20px); animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.bigcount { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 6vw, 72px); line-height: 1; }

.qtext { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; font-size: clamp(26px, 4.4vw, 56px); line-height: 1.12; text-align: center; max-width: 1200px; margin: 0 auto; text-wrap: balance; background: var(--on-stage); color: var(--ink-fixed); padding: clamp(16px, 3vw, 32px); border-radius: var(--radius-lg); width: 100%; }
.qmeta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); max-width: 1200px; margin: 0 auto; width: 100%; }
.timer { width: clamp(72px, 10vw, 120px); aspect-ratio: 1; max-width: 100%; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: clamp(28px, 4vw, 48px);
  background: conic-gradient(var(--emas) calc(var(--p, 1) * 360deg), rgb(255 255 255 / .12) 0); position: relative; }
.timer::before { content: ""; position: absolute; inset: 8px; background: var(--zamrud-deep); border-radius: 50%; }
.timer b { position: relative; }
.answered { text-align: center; }
.answered .n { font-family: var(--font-mono); font-size: clamp(28px, 4vw, 48px); font-weight: 700; line-height: 1; }
.answered .l { font-size: 14px; opacity: .8; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.6vw, 20px); max-width: 1200px; width: 100%; margin: 0 auto; }
.tile { border-radius: var(--radius-lg); padding: clamp(14px, 2vw, 24px); display: flex; align-items: center; gap: clamp(10px, 1.5vw, 20px); font-weight: 600; font-size: clamp(18px, 2.4vw, 32px); line-height: 1.2; min-height: clamp(64px, 11vh, 120px); transition: opacity .3s, transform .3s; min-width: 0; }
.tile .shape { width: clamp(28px, 3vw, 44px); height: clamp(28px, 3vw, 44px); }
.tile .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tile .cnt { font-family: var(--font-mono); font-size: .9em; }
.tile.dim { opacity: .28; }
.tile.win { outline: 4px solid var(--on-stage); outline-offset: 3px; }
.tile .mark { font-size: .9em; }

.dist { display: flex; align-items: end; justify-content: center; gap: clamp(12px, 3vw, 40px); height: clamp(120px, 24vh, 240px); }
.dist .col { width: clamp(48px, 8vw, 110px); display: grid; grid-template-rows: auto 1fr auto; gap: 0; height: 100%; text-align: center; }
.dist .col .c { margin-bottom: 6px; font-family: var(--font-mono); font-weight: 700; font-size: clamp(18px, 2.4vw, 30px); }
.dist .col .b { align-self: end; border-radius: var(--radius-sm) var(--radius-sm) 0 0; min-height: 6px; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.dist .col .s { display: grid; place-items: center; padding: 6px 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); border-top: 2px solid rgb(0 0 0 / .25); }
.dist .col .s .shape { width: 24px; height: 24px; }

.board { display: grid; gap: 10px; max-width: 900px; width: 100%; margin: 0 auto; }
.board-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; background: rgb(255 255 255 / .08); border-radius: var(--radius-md); padding: 12px 20px; font-size: clamp(18px, 2.2vw, 28px); font-weight: 600; animation: pop .3s ease-out both; }
.board-row:first-child { background: var(--emas); color: var(--ink-fixed); }
.board-row .r { font-family: var(--font-mono); }
.board-row .sc { font-family: var(--font-mono); }
.board-row .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium { display: flex; align-items: end; justify-content: center; gap: clamp(8px, 2vw, 24px); }
.podium .p { display: grid; gap: 8px; justify-items: center; text-align: center; width: clamp(96px, 18vw, 220px); }
.podium .p .nm { font-weight: 700; font-size: clamp(16px, 2vw, 26px); overflow-wrap: anywhere; }
.podium .p .blk { width: 100%; border-radius: var(--radius-md) var(--radius-md) 0 0; display: grid; place-items: start center; padding-top: 12px; font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 5vw, 64px); }
.podium .p1 .blk { height: clamp(140px, 26vh, 260px); background: var(--emas); color: var(--ink-fixed); }
.podium .p2 .blk { height: clamp(100px, 19vh, 190px); background: var(--on-stage); color: var(--zamrud-deep); }
.podium .p3 .blk { height: clamp(72px, 13vh, 130px); background: rgb(255 255 255 / .3); }
.podium .p .sc { font-family: var(--font-mono); opacity: .85; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- mahasiswa ---------- */
.m-shell { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.m-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.m-top .who { font-weight: 700; font-size: 14px; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-main { padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)); width: 100%; max-width: 560px; margin: 0 auto; display: grid; align-content: start; gap: var(--space-6); }
.m-main.center { align-content: center; text-align: center; justify-items: center; }
.pin-input { font-family: var(--font-mono) !important; font-size: 32px !important; letter-spacing: .3em; text-align: center; font-weight: 700 !important; min-height: 64px !important; }
.hero-join { display: grid; gap: 8px; text-align: center; }
.hero-join h1 { font-size: 30px; }
.big-icon { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; font-weight: 700; }
.big-icon.ok { background: var(--benar); color: #fff; }
.big-icon.no { background: var(--salah); color: #fff; }
.big-icon.wait { background: var(--surface-raised); border: 2px solid var(--line); color: var(--ink-muted); }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-tiles.two { grid-template-columns: 1fr 1fr; }
.m-tile { border: 0; border-radius: var(--radius-lg); min-height: 120px; padding: 14px; display: grid; justify-items: center; align-content: center; gap: 8px; cursor: pointer; font: 700 16px/1.25 var(--font-sans); text-align: center; overflow-wrap: anywhere; }
.m-tile .shape { width: 40px; height: 40px; }
.m-tile:active { transform: scale(.97); }
.m-tile:disabled { cursor: default; }
.m-q { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.3; }
.m-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-muted); }
.scorebadge { background: var(--ink); color: var(--surface); border-radius: var(--radius-pill); padding: 6px 14px; font-family: var(--font-mono); font-weight: 700; }

/* self-paced exam */
.exam-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.exam-nav button { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink); font: 700 14px var(--font-mono); cursor: pointer; }
.exam-nav button.done { background: var(--zamrud); color: var(--on-zamrud); border-color: var(--zamrud); }
.exam-nav button.cur { outline: 3px solid var(--emas); outline-offset: 1px; }
.choice { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; width: 100%; text-align: left; border: 2px solid var(--line); background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-md); padding: 12px 14px; font: 500 16px/1.4 var(--font-sans); cursor: pointer; min-height: 56px; }
.choice .badge { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; }
.choice .badge .shape { width: 20px; height: 20px; }
.choice[aria-pressed=true] { border-color: var(--zamrud); background: color-mix(in srgb, var(--zamrud) 10%, var(--surface-raised)); font-weight: 700; }
.clock { font-family: var(--font-mono); font-weight: 700; font-size: 18px; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); }
.clock.warn { color: var(--salah); border-color: currentColor; }

.notice { border: 1px solid var(--emas); background: color-mix(in srgb, var(--emas) 12%, var(--surface-raised)); border-radius: var(--radius-md); padding: 14px 16px; font-size: 14px; }
.notice code { font-family: var(--font-mono); font-size: 13px; }

/* ================================================================ TEMA & AVATAR */
.av { width: 40px; height: 40px; flex: none; display: block; overflow: visible; }
.av.big { width: 96px; height: 96px; }
.av-out { opacity: .55; filter: grayscale(.8); }
.players .chip { display: inline-flex; align-items: center; gap: 8px; background: rgb(255 255 255 / .1); border-radius: var(--radius-pill); padding: 4px 16px 4px 4px; font-weight: 700; font-size: clamp(14px, 1.6vw, 20px); animation: pop .25s ease-out; }
.players .chip .av { width: 34px; height: 34px; }

.heart { width: 16px; height: 15px; }
.heart path { fill: #ff5a6e; stroke: #fff; stroke-width: 1.2; }
.heart.off path { fill: rgb(255 255 255 / .18); stroke: transparent; }
.heart.break { animation: heartbreak 1s ease-in forwards .3s; }
@keyframes heartbreak { 0% { transform: scale(1); } 30% { transform: scale(1.5) rotate(-10deg); } 100% { transform: scale(.2) translateY(20px) rotate(40deg); opacity: 0; } }
.hearts { display: flex; gap: 2px; justify-content: center; }

.arena { position: relative; border-radius: var(--radius-lg); overflow: hidden; width: 100%; max-width: 1200px; margin: 0 auto; }
.arena .pl { display: grid; justify-items: center; gap: 2px; min-width: 0; animation: pop .35s ease-out both; animation-delay: var(--d, 0ms); }
.arena .nm { font-size: clamp(11px, 1vw, 14px); font-weight: 700; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena .more { align-self: center; font-weight: 700; opacity: .8; padding: 8px; }
.arena .pl.answered .av, .lane.answered .rocket-av .av { animation: hop .5s ease-out; filter: drop-shadow(0 0 6px #ffd23f); }
@keyframes hop { 40% { transform: translateY(-10px); } }
.arena.mini { max-height: 26vh; }
.arena.mini .av { width: 30px; height: 30px; }
.arena.mini .nm { display: none; }

/* --- Robot Lapar --- */
.robot-arena { display: grid; grid-template-columns: 1fr minmax(150px, 22%); gap: 16px; background: linear-gradient(#123f33, #0a2a22); padding: 16px; min-height: 220px; }
.robot-arena .crowd { display: flex; flex-wrap: wrap; gap: 12px 10px; align-content: center; justify-content: center; }
.robot-arena .av { width: clamp(40px, 4.5vw, 64px); height: clamp(40px, 4.5vw, 64px); }
.robot-arena .pl.hit .av { animation: shake .5s ease-in-out 2; }
@keyframes shake { 25% { transform: translateX(-5px) rotate(-6deg); } 75% { transform: translateX(5px) rotate(6deg); } }
.robot-arena .pl.eaten-now { animation: eaten 1.4s cubic-bezier(.5,-0.3,.7,.4) forwards .9s; }
@keyframes eaten { 0% { transform: none; } 30% { transform: translateY(-30px) rotate(-20deg); } 100% { transform: translate(60vw, 10px) scale(.1) rotate(540deg); opacity: 0; } }
.robot-box { display: grid; justify-items: center; align-content: end; position: relative; }
.robot { width: 100%; max-width: 220px; height: auto; }
.robot .jaw { transform-origin: 100px 104px; }
.robot.chomp .jaw { animation: chomp .3s ease-in-out 6 alternate 1.3s; }
.robot.chomp .head { animation: chomphead .3s ease-in-out 6 alternate 1.3s; }
@keyframes chomp { to { transform: translateY(22px); } }
@keyframes chomphead { to { transform: translateY(-6px); } }
.robot .bulb { animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.robot .eye { animation: look 3s ease-in-out infinite; }
@keyframes look { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
.belly-list { position: absolute; left: 30%; right: 30%; bottom: 14%; height: 24%; display: flex; flex-wrap: wrap; gap: 1px; justify-content: center; align-content: center; overflow: hidden; }
.belly-list .av { width: 16px; height: 16px; }
.belly-list b { font-size: 10px; }
.robot-cap { font-weight: 700; font-size: 14px; opacity: .85; }
.arena.mini.robot-arena { min-height: 0; padding: 8px 12px; grid-template-columns: 1fr 90px; }
.arena.mini .belly-list { display: none; }

/* --- Pesta Balon --- */
.balon-arena { background: linear-gradient(#8fd3ff, #d9f1ff 75%); color: #15201b; min-height: 280px; display: grid; grid-template-rows: 1fr 28px; }
.balon-arena .sky { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; align-items: end; padding: 16px 16px 0; }
.balon-arena .pl { transform: translateY(calc((1 - var(--h)) * 60px)); transition: transform 1.2s ease .6s; }
.balon-arena .pl .balloons { width: 74px; height: 50px; margin-bottom: -6px; }
.balon-arena .av { width: clamp(38px, 4vw, 56px); height: clamp(38px, 4vw, 56px); }
.balon-arena .pl.landed { transform: translateY(60px); }
.balon-arena .ground { background: #6cc46a; border-top: 6px solid #4fa84d; }
.bl.pop { transform-origin: center; animation: popb .5s ease-out forwards .5s; }
.bl { transform-box: fill-box; }
@keyframes popb { 0% { transform: scale(1); } 40% { transform: scale(1.5); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
.balon-arena .pl.hit .av { animation: shake .5s ease-in-out 2; }
.arena.mini.balon-arena { min-height: 0; }
.arena.mini.balon-arena .balloons { width: 48px; height: 32px; }

/* --- Balap Roket --- */
.roket-arena { background: radial-gradient(ellipse at 90% 50%, #2a3c78, #0d1330 70%); padding: 14px 120px 14px 16px; display: grid; gap: 6px; }
.roket-arena .stars { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 60% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 80% 20%, #fff, transparent), radial-gradient(1px 1px at 40% 85%, #fff, transparent); background-size: 220px 140px; opacity: .7; pointer-events: none; }
.roket-arena .moon { position: absolute; right: 16px; top: 50%; width: 96px; height: 96px; transform: translateY(-50%); }
.lane { position: relative; display: grid; grid-template-columns: 28px 120px 1fr; gap: 8px; align-items: center; min-height: 40px; }
.lane .rk { font-family: var(--font-mono); font-weight: 700; opacity: .8; }
.lane .nm { max-width: 120px; }
.track { position: relative; height: 40px; border-bottom: 2px dashed rgb(255 255 255 / .18); }
.ship { position: absolute; top: 0; left: calc(var(--to) * (100% - 90px)); }
.ship.fly { animation: fly 1.6s cubic-bezier(.3,.7,.3,1) both .4s; }
@keyframes fly { from { left: calc(var(--from) * (100% - 90px)); } }
.rocket-wrap { position: relative; display: block; width: 90px; height: 44px; }
.rocket { width: 90px; height: 44px; }
.rocket .flame, .rocket .flame2 { transform-origin: 18px 22px; animation: flicker .15s linear infinite alternate; }
@keyframes flicker { to { transform: scaleX(1.4); } }
.rocket-av { position: absolute; left: 50px; top: 13px; width: 18px; height: 18px; }
.rocket-av .av { width: 18px; height: 18px; }
.arena.mini.roket-arena { gap: 2px; padding-block: 8px; }
.arena.mini .lane { min-height: 30px; grid-template-columns: 24px 100px 1fr; }
.arena.mini .lane .nm { display: block; font-size: 11px; }
.arena.mini .moon { width: 64px; height: 64px; }

/* --- Kebun Ceria --- */
.kebun-arena { background: linear-gradient(#bfe9ff, #e9f8ff 55%, #9bd77a 55%, #7cc463); color: #15201b; padding: 16px; }
.kebun-arena .garden { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; align-items: end; }
.kebun-arena .pl { position: relative; width: clamp(56px, 6vw, 84px); }
.plant { width: 100%; height: auto; display: block; }
.plant .stalk { transform-box: view-box; transform-origin: 30px 70px; }
.plant.grow .stalk { animation: grow 1.4s cubic-bezier(.3,1.4,.5,1) both .4s; }
@keyframes grow { from { transform: scaleY(var(--from)); } }
.plant .bloom { transform-box: fill-box; transform-origin: center; animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pot-av { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); }
.pot-av .av { width: 26px; height: 26px; }
.kebun-arena .nm { display: block; text-align: center; color: #15201b; }
.raincloud { position: absolute; left: 0; right: 0; top: -6px; width: 100%; animation: rain 2.4s ease-in-out both .3s; z-index: 1; }
@keyframes rain { 0% { opacity: 0; transform: translateY(-10px); } 20%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.arena.mini.kebun-arena .pl { width: 44px; }
.arena.mini .pot-av .av { width: 18px; height: 18px; }

/* --- banner jawaban pada tema --- */
.answer-banner { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; width: 100%; }
.answer-banner .tile { min-height: 0; padding: 10px 18px; font-size: clamp(16px, 2vw, 26px); }
.answer-banner .stat { font-family: var(--font-mono); font-weight: 700; opacity: .85; }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.theme-pick label { border: 2px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; }
.theme-pick label:has(input:checked) { border-color: var(--zamrud); background: color-mix(in srgb, var(--zamrud) 8%, var(--surface-raised)); }
.theme-pick input { position: absolute; opacity: 0; pointer-events: none; }
.theme-pick b { font-size: 15px; }
.theme-pick span { font-size: 12px; color: var(--ink-muted); }
.podium .p .av { width: clamp(48px, 6vw, 88px); height: clamp(48px, 6vw, 88px); }
.board-row .av { width: 36px; height: 36px; }
.board-row.with-av { grid-template-columns: 56px 40px 1fr auto; }

/* --- HP --- */
.av-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.av-opt { border: 2px solid var(--line); background: var(--surface-raised); border-radius: var(--radius-md); padding: 6px; cursor: pointer; display: grid; place-items: center; }
.av-opt .av { width: 52px; height: 52px; }
.av-opt[aria-checked=true] { border-color: var(--zamrud); background: color-mix(in srgb, var(--zamrud) 12%, var(--surface-raised)); }
.mw { display: grid; justify-items: center; gap: 6px; position: relative; }
.mw .hearts .heart { width: 26px; height: 24px; }
.mw .hearts .heart.off path { fill: var(--line); }
.mw-robot .robot { width: 140px; }
.balon-mw .balloons { width: 140px; height: 90px; margin-bottom: -16px; }
.roket-mw { width: 100%; background: radial-gradient(ellipse at 90% 50%, #2a3c78, #0d1330 70%); border-radius: var(--radius-md); padding: 12px; color: #fff; }
.roket-mw .muted { color: #c9d3ff; }
.kebun-mw { width: 140px; }
.kebun-mw .pot-av .av { width: 40px; height: 40px; }
.kebun-mw .pot-av { bottom: 26px; }
.m-tile.chosen { outline: 4px solid var(--ink); outline-offset: 2px; }
.stage-body { overflow-y: auto; }
.stage-body.has-arena { gap: clamp(10px, 2vh, 20px); align-content: start; }
.has-arena .qtext { font-size: clamp(20px, 3vw, 38px); padding: clamp(12px, 2vw, 22px); }
.has-arena .tile { min-height: clamp(48px, 8vh, 84px); font-size: clamp(16px, 2vw, 26px); }
.has-arena .timer { width: clamp(60px, 7vw, 92px); font-size: clamp(22px, 3vw, 36px); }
.arena.mini { max-height: 24vh; }
.arena.mini.robot-arena .robot { max-width: 80px; }
.arena.mini .robot-cap { display: none; }
.stage-body.has-arena { align-content: center; }
.robot-arena .av { width: clamp(48px, 5.5vw, 80px); height: clamp(48px, 5.5vw, 80px); }
.robot-arena .crowd { gap: 16px 14px; }
.belly-list .av { width: 22px; height: 22px; }
.balon-arena .pl .balloons { width: 104px; height: 64px; margin-bottom: -10px; }
.balon-arena .pl { transform: translateY(calc((1 - var(--h)) * 90px)); }
.balon-arena .pl.landed { transform: translateY(90px); }
.balon-arena { min-height: 330px; }
.balon-arena .av { width: clamp(44px, 4.6vw, 64px); height: clamp(44px, 4.6vw, 64px); }
.kebun-arena .pl { width: clamp(64px, 7.4vw, 100px); }
.kebun-arena .pot-av .av { width: 30px; height: 30px; }
.balon-arena .pl, .balon-arena .pl.landed { transform: none; position: relative; top: calc((1 - var(--h)) * 90px); transition: top 1.2s ease .6s; }
.balon-arena .pl .balloons { width: 88px; height: 54px; }
.balon-arena .sky { gap: 6px 8px; padding-bottom: 0; align-items: start; padding-top: 24px; }
.kebun-arena .pl { width: clamp(56px, 6.4vw, 92px); }
.kebun-arena .garden { gap: 4px 8px; }
.stage-body, .stage-body.has-arena { align-content: safe center; }
.lane .nm { text-align: left; }

/* ================================================================ SOAL URUT & COCOK */
.ord-slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ord-item { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; border: 2px solid var(--line); background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-md); padding: 10px 12px; min-height: 52px; font: 600 16px/1.3 var(--font-sans); cursor: pointer; }
.ord-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.ord-pool .ord-item { width: auto; grid-template-columns: 1fr; border-style: dashed; }
.ord-item.placed { border-color: var(--zamrud); background: color-mix(in srgb, var(--zamrud) 10%, var(--surface-raised)); }
.ord-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--zamrud); color: var(--on-zamrud); font: 700 14px var(--font-mono); }
.ord-x { color: var(--ink-muted); font-size: 14px; }
.ord-empty { display: flex; align-items: center; gap: 10px; border: 2px dashed var(--line); border-radius: var(--radius-md); padding: 10px 12px; min-height: 52px; }
.ord-empty .ord-n { background: var(--surface); color: var(--ink-muted); border: 1px solid var(--line); }
.mt-rows { display: grid; gap: 8px; }
.mt-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; text-align: left; border: 2px solid var(--line); background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer; font: 600 15px/1.3 var(--font-sans); }
.mt-row .mt-n { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font: 700 13px var(--font-mono); }
.mt-row .mt-r { font-weight: 500; color: var(--ink-muted); font-size: 14px; }
.mt-row.done .mt-r { color: var(--zamrud); font-weight: 700; }
.mt-row.done .mt-n { background: var(--zamrud); color: var(--on-zamrud); border-color: var(--zamrud); }
.mt-row.active { border-color: var(--emas); box-shadow: 0 0 0 3px color-mix(in srgb, var(--emas) 30%, transparent); }
.mt-pool { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.mt-opt { border: 2px solid var(--line); background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-pill); padding: 8px 14px; font: 600 15px var(--font-sans); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 44px; }
.mt-opt.used { border-color: var(--zamrud); opacity: .7; }
.mt-badge { width: 22px; height: 22px; border-radius: 50%; background: var(--zamrud); color: var(--on-zamrud); display: grid; place-items: center; font: 700 12px var(--font-mono); }
.seq-submit { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }

/* panggung */
.seq-stage { max-width: 1200px; width: 100%; margin: 0 auto; display: grid; gap: 10px; }
.seq-hint { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; text-align: center; }
.seq-items { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.seq-card { background: rgb(255 255 255 / .1); border: 2px solid rgb(255 255 255 / .2); border-radius: var(--radius-md); padding: 12px 18px; font-weight: 700; font-size: clamp(16px, 2vw, 26px); display: flex; gap: 12px; align-items: center; }
.seq-card b { font-family: var(--font-mono); color: var(--emas); }
.seq-card.alt b { color: #9fd3ff; }
.seq-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.seq-cols > div { display: grid; gap: 10px; align-content: start; }
.seq-solution { display: grid; gap: 8px; max-width: 900px; width: 100%; margin: 0 auto; }
.seq-card.ok { background: var(--on-stage); color: var(--ink-fixed); border-color: var(--on-stage); animation: pop .3s ease-out both; }
.seq-card.ok b { color: var(--zamrud); }
.seq-score { text-align: center; font-family: var(--font-mono); font-weight: 700; font-size: clamp(18px, 2.2vw, 28px); }

/* editor */
.seq-edit { display: grid; gap: 8px; }
.seq-edit .row-e { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; }
.seq-edit .row-e.pair { grid-template-columns: 36px 1fr 20px 1fr auto; }
.seq-edit .idx { font: 700 14px var(--font-mono); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); text-align: center; padding: 8px 0; }
.seq-edit .arrow { text-align: center; color: var(--ink-muted); }
@media (max-width: 560px) { .seq-edit .row-e.pair { grid-template-columns: 30px 1fr auto; } .seq-edit .row-e.pair .arrow { display: none; } .seq-edit .row-e.pair input:nth-of-type(2) { grid-column: 2; } }
.seq-stage .seq-card { padding: 8px 14px; font-size: clamp(15px, 1.8vw, 24px); }
.seq-stage .seq-items, .seq-stage .seq-cols > div { gap: 8px; }
.qtext.sm { font-size: clamp(20px, 3vw, 38px); padding: clamp(12px, 2vw, 22px); }
.seq-solution .seq-card b { font-family: var(--font-sans); }

/* ---- perbaikan tampilan HP kecil (320–400px) ---- */
.m-shell { grid-template-columns: minmax(0, 1fr); width: 100%; overflow-x: hidden; }
.m-main, .m-top, .m-main > * { min-width: 0; }
.m-main input, .m-main textarea, .m-main select { min-width: 0; max-width: 100%; }
.pin-input { letter-spacing: .2em; font-size: clamp(24px, 8vw, 32px) !important; }
.m-top .brand { font-size: 17px; gap: 8px; }
.m-top .who { flex: 1; }
.m-q { font-size: clamp(17px, 5vw, 20px); overflow-wrap: anywhere; }
.m-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.m-tile { min-height: clamp(96px, 26vw, 120px); padding: 10px; font-size: 15px; min-width: 0; }
.m-tile .shape { width: 34px; height: 34px; }
.av-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.av-opt { padding: 4px; min-width: 0; }
.av-opt .av { width: 100%; height: auto; aspect-ratio: 1; max-width: 52px; }
.mt-row, .ord-item, .choice { min-width: 0; overflow-wrap: anywhere; }
.mt-opt { max-width: 100%; white-space: normal; text-align: left; }
.exam-nav button { width: 38px; height: 38px; }
.m-main.center { justify-items: center; }
.m-main.center > * { max-width: 100%; }
.mw-robot .robot { max-width: 100%; }
.m-tile { overflow-wrap: break-word; hyphens: auto; }
.admin-table td, .admin-table th { white-space: normal; vertical-align: middle; }
.admin-table td.mono.small { word-break: break-all; }
.admin-table td:last-child { white-space: nowrap; }

/* ---------- layar PIN ujian mandiri ---------- */
.ps-stats { display: flex; gap: clamp(24px, 6vw, 96px); justify-content: center; text-align: center; flex-wrap: wrap; }
.ps-stats > div > div:last-child { opacity: .8; font-size: clamp(14px, 1.6vw, 20px); margin-top: 6px; }
