:root {
  --teal-900: #0b3f37;
  --teal-700: #0f5e4f;
  --teal-500: #2a8f7a;
  --teal-100: #d7efe9;
  --kitchen: #c9d6db;
  --orange: #f59e0b;
  --orange-dark: #c2410c;
  --yellow: #fde68a;
  --green: #22a447;
  --green-dark: #157a33;
  --red: #dc2626;
  --red-dark: #991b1b;
  --ink: #1f2933;
  --paper: #ffffff;
  --muted: #5b6b73;
  --radius: 18px;
  --shadow: 0 6px 0 rgba(0, 0, 0, .18);
  --pad-x: max(14px, env(safe-area-inset-left), env(safe-area-inset-right));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: #2b3036 url('../assets/img/kitchen-bg.webp') center / cover no-repeat;
  color: var(--ink);
  font-family: 'Nunito', system-ui, sans-serif;
  overscroll-behavior: none;
}

/* Layout horizontal (landscape). Di HP yang tegak, minta pemain memutar layar. */
#app {
  position: relative;
  width: 100%;
  max-width: 1100px;
  height: 100vh;
  height: 100dvh;
  min-height: 100%;
  margin: 0 auto;
  overflow: hidden;
  /* Foto dapur stainless untuk semua layar, dengan lapisan terang agar kartu & teks tetap terbaca.
     Halaman depan memakai foto yang sama tanpa lapisan (lihat #screen-title). */
  background:
    linear-gradient(180deg, rgba(236, 244, 242, .62) 0%, rgba(236, 244, 242, .5) 45%, rgba(214, 230, 226, .72) 100%),
    #3a3f45 url('../assets/img/kitchen-bg.webp') center / cover no-repeat;
  box-shadow: 0 0 60px rgba(0, 0, 0, .35);
}


.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top)) var(--pad-x) max(10px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.screen.active { display: flex; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Layar dua kolom: judul & hasil */
#screen-title.active { flex-direction: row; align-items: stretch; gap: 24px; }
/* Hasil: dua kolom yang bisa di-scroll + bar tombol yang selalu terlihat di bawah */
#screen-result.active { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 8px 20px; overflow: hidden; }
.result-actions { grid-column: 1 / -1; }
#screen-result .col { min-height: 0; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.title-right, .result-right, .result-left { overflow-y: auto; justify-content: flex-start; padding: 4px 2px; }
/* Tengah secara vertikal, tapi mulai dari atas bila konten lebih tinggi dari layar */
.result-left { justify-content: flex-start; }
.result-left::before, .result-left::after { content: ''; flex: 1 1 0; }
.title-right { justify-content: center; }

/* Layar satu kolom: konten dibatasi lebarnya agar tidak terlalu melebar */
#screen-howto > *, #screen-leaderboard > *, #screen-kitchen > *, #screen-badges > *, #screen-practice-menu > * { width: 100%; max-width: 760px; }

h2 { font-family: 'Baloo 2', sans-serif; font-size: clamp(22px, 5vh, 30px); color: var(--teal-900); margin: 4px 0 8px; text-align: center; }
.muted { color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- Tombol ---------- */
.btn {
  font: 800 17px 'Nunito', sans-serif;
  border: 0;
  border-radius: 14px;
  padding: 10px 20px;
  min-height: 46px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--teal-900); }
.link-btn { background: none; border: 0; color: var(--teal-900); font: 800 15px 'Nunito', sans-serif; padding: 8px; cursor: pointer; text-decoration: underline; }
.row, .actions { display: flex; gap: 12px; width: 100%; }
.row .btn, .actions .btn { flex: 1; }
/* Bar tombol di bawah layar: tetap terlihat walau konten di atasnya di-scroll */
.actions { position: sticky; bottom: 0; margin-top: auto; padding-top: 10px; max-width: 760px; }
.actions .btn-primary { flex: 1.4; }

/* Panel menu di layar judul */
.panel { width: 100%; max-width: 400px; background: rgba(255,255,255,.78); border-radius: 20px; padding: 12px 14px; box-shadow: 0 6px 18px rgba(11, 63, 55, .15); }
.menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; margin-top: 10px; }
.menu-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: #fff; border: 2px solid var(--teal-100); border-radius: 12px;
  padding: 5px 2px; font: 800 12px 'Nunito', sans-serif; color: var(--teal-900); cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0,0,0,.08);
}
.menu-btn span { font-size: 20px; line-height: 1.1; }
.menu-btn small { font-size: 11px; color: #8a5a00; }
.menu-btn:active { transform: translateY(2px); }

/* ---------- Judul ---------- */
.logo { width: clamp(90px, 22vh, 140px); border-radius: 12px; }
.game-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: clamp(26px, 8.5vh, 46px);
  line-height: 1.05;
  text-align: center;
  margin: 6px 0;
  color: #fff;
  text-shadow: 0 3px 0 var(--teal-900), 0 0 1px var(--teal-900);
  -webkit-text-stroke: 1px var(--teal-900);
}
.game-title span { display: block; color: var(--orange); }
.title-host { display: flex; align-items: flex-end; gap: 8px; width: 100%; max-width: 420px; }
.title-host img { width: clamp(96px, 30vh, 160px); border-radius: 16px; border: 3px solid #fff; flex: none; }
.bubble {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,.12);
}
.title-host .bubble { margin-bottom: 14px; }

.name-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 4px; }
.name-form label { font-weight: 800; font-size: 14px; color: var(--teal-900); }
.name-form small { font-weight: 600; color: var(--muted); }
.name-form input {
  font: 700 16px 'Nunito', sans-serif;
  padding: 10px 14px;
  border: 2px solid var(--teal-500);
  border-radius: 12px;
  outline: none;
}
.name-form input:focus { border-color: var(--orange); }
.name-form .btn { margin-top: 8px; font-size: 22px; }
.title-right > .econ-only { width: 100%; max-width: 380px; margin-top: 10px; }

.howto { background: #fff; border-radius: var(--radius); padding: 12px 16px 12px 34px; line-height: 1.45; font-weight: 600; margin: 0; font-size: 14px; columns: 2 300px; column-gap: 32px; }
.howto > li { break-inside: avoid; }
.howto li { margin-bottom: 6px; }
.howto .g { color: var(--green); }
.howto .r { color: var(--red); }

/* ---------- Hitung mundur ---------- */
#screen-countdown { justify-content: center; }
.countdown { font: 800 clamp(90px, 30vh, 160px) 'Baloo 2', sans-serif; color: var(--orange); -webkit-text-stroke: 3px var(--teal-900); animation: pop .8s ease; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 40% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- Gameplay: HUD ---------- */
#screen-game { gap: 8px; overflow: hidden; }
.hud { display: flex; gap: 8px; width: 100%; max-width: 640px; }
.pill {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex: 1;
  background: rgba(15, 40, 45, .85);
  color: #fff;
  font: 800 clamp(16px, 4.6vh, 22px) 'Nunito', sans-serif;
  border-radius: 12px;
  padding: 4px 10px;
  min-height: clamp(32px, 9vh, 44px);
  border: 0;
}
#hud-score { color: var(--yellow); }
.pill.icon { flex: 0 0 48px; cursor: pointer; font-size: 18px; }
.pill.timer.warn { background: var(--red); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.05); } }

/* ---------- Gameplay: panggung 3 kolom (Tashya · kartu · assist) ---------- */
.stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(110px, 21%) 1fr minmax(130px, 21%);
  gap: 12px;
}

.host-col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 0; gap: 6px; }
.host {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  max-height: 72%;
  object-fit: cover;
  object-position: 50% 10%;
  border-radius: 16px;
  border: 3px solid #fff;
  background: #fff;
}
.host.happy { animation: hop .4s; }
.host.sad { animation: shake .35s; }
.host-name { background: rgba(15, 40, 45, .85); color: #fff; font-weight: 800; font-size: 13px; padding: 2px 12px; border-radius: 8px; margin-top: -20px; z-index: 1; }
.host-bubble { width: 100%; font-size: clamp(12px, 3.4vh, 14px); text-align: center; }
.host-bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; }
.streak { position: absolute; right: -4px; bottom: 30%; background: var(--orange); color: #fff; font-weight: 800; border-radius: 999px; padding: 2px 10px; font-size: 15px; box-shadow: 0 2px 0 rgba(0,0,0,.2); }

.center-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }

/* ---------- Kartu ---------- */
.card-zone { position: relative; flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
.card {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--paper);
  border-radius: 22px;
  box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 0 0 4px #fff inset, 0 0 0 7px var(--teal-100) inset;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 26px 24px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.card-cat { position: absolute; top: 12px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-500); }
.card-q { font: 800 clamp(17px, 2.2vw + 1.6vh, 28px)/1.3 'Nunito', sans-serif; margin: 0; max-width: 34ch; }
.card.enter { animation: cardIn .28s ease; }
.card.good { box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 0 0 6px var(--green) inset; }
.card.bad { box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 0 0 6px var(--red) inset; animation: shake .35s; }
.card.shielded { box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 0 0 6px #3b82f6 inset; }
@keyframes cardIn { from { transform: translateX(40px) rotate(4deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes hop { 50% { transform: translateY(-10px); } }
.shield-badge { position: absolute; bottom: 10px; background: #dbeafe; color: #1e40af; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; }

.hint, .explain {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  background: #fffbeb; border: 3px solid var(--orange);
  border-radius: 14px; padding: 8px 12px;
  font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 0 rgba(0,0,0,.12);
  animation: cardIn .2s ease;
}
.card.with-hint { padding-bottom: 64px; justify-content: flex-start; padding-top: 36px; }
.hint::before { content: '🔍 Mas Hendi: '; font-weight: 800; color: var(--orange-dark); }
.explain { top: 10px; bottom: 10px; display: flex; flex-direction: column; justify-content: center; border-color: var(--red); background: #fff; font-size: 17px; text-align: center; }
.explain b { color: var(--red); font-size: 18px; }
.explain p { margin: 8px 0 0; }

#floaters { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.floater { position: absolute; left: 50%; top: 40%; font: 800 30px 'Baloo 2', sans-serif; transform: translateX(-50%); animation: floatUp .8s ease forwards; -webkit-text-stroke: 1px rgba(0,0,0,.25); }
.floater.plus { color: var(--green); }
.floater.minus { color: var(--red); }
.floater.info { color: #2563eb; }
@keyframes floatUp { to { transform: translate(-50%, -70px); opacity: 0; } }

/* ---------- Jawaban ---------- */
.answers { display: flex; gap: 12px; width: 100%; }
.btn-answer {
  flex: 1;
  min-height: clamp(48px, 16vh, 76px);
  border: 0;
  border-radius: 16px;
  color: #fff;
  font: 800 clamp(20px, 6vh, 28px) 'Baloo 2', sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .06s;
}
.btn-answer.true { background: linear-gradient(180deg, #34c35a, var(--green)); box-shadow: 0 6px 0 var(--green-dark); }
.btn-answer.false { background: linear-gradient(180deg, #ef4444, var(--red)); box-shadow: 0 6px 0 var(--red-dark); }
.btn-answer:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.btn-answer:disabled { opacity: .7; }

/* ---------- Assist (kolom kanan) ---------- */
.assists { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.assist {
  flex: 1;
  min-height: 0;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-content: center; align-items: center; column-gap: 8px;
  background: var(--teal-100);
  border: 2px solid var(--teal-500);
  border-radius: 14px;
  padding: 4px 8px;
  cursor: pointer;
  text-align: left;
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 3px 0 rgba(0,0,0,.12);
}
.assist img { grid-row: span 2; width: clamp(40px, 14vh, 64px); height: clamp(40px, 14vh, 64px); border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: #fff; border: 2px solid #fff; }
.assist-name { font-weight: 800; font-size: 14px; color: var(--teal-900); align-self: end; }
.assist-tag { justify-self: start; align-self: start; font-weight: 800; font-size: 12px; color: var(--orange-dark); white-space: nowrap; background: #fff; border-radius: 999px; padding: 1px 8px; margin-top: 2px; }
.assist:disabled { filter: grayscale(1); opacity: .5; cursor: default; }

/* ---------- Hasil ---------- */
.result-bubble { width: 100%; max-width: 420px; text-align: center; font-size: 14px; }
.big-score { display: flex; flex-direction: column; align-items: center; margin: 4px 0; }
.big-score small { font-weight: 800; color: var(--teal-900); }
.big-score span { font: 800 clamp(44px, 15vh, 72px)/1 'Baloo 2', sans-serif; color: var(--orange); -webkit-text-stroke: 2px var(--teal-900); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 420px; }
.stats div { background: #fff; border-radius: 12px; padding: 6px 4px; text-align: center; display: flex; flex-direction: column; }
.stats b { font-size: 20px; color: var(--teal-900); }
.stats small { font-size: 12px; color: var(--muted); font-weight: 700; }
.rank { font-weight: 800; color: var(--teal-900); text-align: center; margin: 8px 0 0; }
.review { width: 100%; }
.review h3 { font-size: 16px; margin: 10px 0 6px; color: var(--teal-900); }
.review-item { background: #fff; border-left: 5px solid var(--red); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-size: 14px; }
.review-item p { margin: 0 0 4px; font-weight: 800; }
.review-item span { color: var(--muted); font-weight: 600; }
.review-item em { font-style: normal; font-weight: 800; color: var(--green-dark); }

/* ---------- Koin & Dapurku ---------- */
.coin-box { width: 100%; background: #fff8e1; border: 3px solid #f2c94c; border-radius: 14px; padding: 8px 12px; }
.coin-head { display: flex; justify-content: space-between; align-items: center; color: #8a5a00; }
.coin-head b { font-size: 18px; }
.coin-head span { font-weight: 800; font-size: 13px; }
.coin-box ul { list-style: none; margin: 6px 0 8px; padding: 0; font-size: 14px; font-weight: 700; }
.coin-box li { display: flex; justify-content: space-between; padding: 2px 0; border-bottom: 1px dashed #f2d98c; }
.coin-box .btn { width: 100%; min-height: 40px; font-size: 15px; }

.kitchen-head { display: flex; gap: 8px; }
.kitchen-head div { flex: 1; background: #fff; border-radius: 12px; padding: 6px 12px; display: flex; flex-direction: column; }
.kitchen-head small { color: var(--muted); font-weight: 700; font-size: 12px; }
.kitchen-head b { font: 800 22px 'Baloo 2', sans-serif; color: var(--teal-900); }
.kitchen-bar { height: 10px; background: #fff; border-radius: 999px; margin: 8px 0 2px; overflow: hidden; }
.kitchen-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal-500), var(--orange)); transition: width .4s; }
.shop { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shop-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 2px solid var(--teal-100); border-radius: 14px;
  padding: 8px 6px; text-align: center; font-family: 'Nunito', sans-serif; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.1);
}
.shop-item .em { font-size: 30px; line-height: 1.1; }
.shop-item .nm { font-weight: 800; font-size: 12px; color: var(--ink); min-height: 32px; display: flex; align-items: center; }
.shop-item .pr { font-weight: 800; font-size: 13px; color: #8a5a00; }
.shop-item.owned { border-color: var(--teal-500); background: var(--teal-100); }
.shop-item.owned .pr { color: var(--teal-700); }
.shop-item.poor { opacity: .55; }
.shop-item.poor .em { filter: grayscale(1); }
.tipcard { position: fixed; inset: 0; max-width: none !important; background: rgba(11, 63, 55, .7); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 5; }
.tipcard-inner { background: #fff; border-radius: 20px; padding: 16px 20px; text-align: center; max-width: 380px; animation: pop .35s ease; }
.tip-emoji { font-size: 48px; }
.tipcard-inner small { color: var(--teal-500); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.tipcard-inner h3 { margin: 2px 0 6px; font: 800 22px 'Baloo 2', sans-serif; color: var(--teal-900); }
.tipcard-inner p { font-weight: 700; line-height: 1.45; margin: 0 0 12px; }
.tipcard-inner .btn { width: 100%; }
.lvl { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 800; color: var(--teal-700); background: var(--teal-100); border-radius: 999px; padding: 0 6px; vertical-align: middle; }

/* ---------- Leaderboard ---------- */
/* Top 10 dalam dua kolom: 1–5 kiri, 6–10 kanan */
.leaderboard { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(5, auto); grid-auto-flow: column; gap: 6px 10px; }
.leaderboard li {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px;
  background: #fff; border-radius: 12px; padding: 6px 12px;
  font-weight: 800;
}
.leaderboard li.muted { display: block; background: none; grid-column: span 2; }
.leaderboard .pos { font: 800 20px 'Baloo 2', sans-serif; color: var(--teal-500); text-align: center; }
.leaderboard li:nth-child(1) .pos { color: #d4a017; }
.leaderboard li:nth-child(2) .pos { color: #8e9aa3; }
.leaderboard li:nth-child(3) .pos { color: #b0703a; }
.leaderboard .who small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.leaderboard .pts { font: 800 20px 'Baloo 2', sans-serif; color: var(--orange-dark); }
.leaderboard li.me { outline: 3px solid var(--orange); }

/* ---------- Kartu spesial ---------- */
.special-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-weight: 800; font-size: 13px; padding: 4px 12px; border-radius: 999px; color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.card.gold { background: linear-gradient(160deg, #fffbea, #fff3c4); box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 0 0 5px #f2c94c inset, 0 0 24px rgba(242, 201, 76, .8); }
.card.gold .card-cat, .card.flash .card-cat { top: 22px; }
.card.gold .special-badge { background: linear-gradient(90deg, #d4a017, #f59e0b); }
.card.flash { background: linear-gradient(160deg, #f0f7ff, #dbeafe); box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 0 0 5px #60a5fa inset, 0 0 24px rgba(96, 165, 250, .7); }
.card.flash .special-badge { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.card.gold.good, .card.flash.good { box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 0 0 6px var(--green) inset; }
.card.gold.bad, .card.flash.bad { box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 0 0 6px var(--red) inset; }

/* ---------- Lencana ---------- */
.badge-new { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; max-width: 420px; }
.badge-new::before { content: '🏅 Lencana baru:'; width: 100%; text-align: center; font-weight: 800; font-size: 13px; color: var(--teal-900); }
.badge-chip { background: linear-gradient(90deg, #fde68a, #f59e0b); color: #5a3a00; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; animation: pop .5s ease; }
.badge-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.badge { background: rgba(255,255,255,.6); border: 2px dashed #b8c6cb; border-radius: 14px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.badge .em { font-size: 28px; filter: grayscale(1); opacity: .5; }
.badge b { font-size: 13px; color: var(--teal-900); }
.badge small { font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.badge.on { background: #fff; border: 2px solid #f2c94c; }
.badge.on .em { filter: none; opacity: 1; }
#screen-badges h2 small { font-size: 16px; }
.result-actions { max-width: none; padding-top: 0; }

/* ---------- Tab leaderboard ---------- */
.tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 4px; }
.tab { font: 800 15px 'Nunito', sans-serif; border: 2px solid var(--teal-500); background: #fff; color: var(--teal-900); padding: 6px 18px; border-radius: 999px; cursor: pointer; }
.tab.active { background: var(--teal-500); color: #fff; }

/* ---------- Latihan ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-card { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 2px solid var(--teal-100); border-radius: 14px; padding: 10px; text-align: left; font-family: 'Nunito', sans-serif; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.1); }
.cat-card b { font-size: 15px; color: var(--teal-900); }
.cat-icon { font-size: 24px; line-height: 1.1; }
.cat-card small { color: var(--muted); font-weight: 700; }
.cat-best { font-size: 12px; font-weight: 800; color: var(--orange-dark); }
.cat-card.all { background: var(--teal-100); border-color: var(--teal-500); }
#screen-practice { gap: 10px; overflow: hidden; }
.practice-stage { flex: 1; min-height: 0; width: 100%; display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.practice-stage .card { height: 100%; }
.practice-side { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 0; }
.practice-side .answers { flex-direction: column; }
.pr-feedback { background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: 0 4px 0 rgba(0,0,0,.12); overflow-y: auto; }
.pr-feedback b { font-size: 17px; }
.pr-feedback b.ok { color: var(--green-dark); }
.pr-feedback b.no { color: var(--red); }
.pr-feedback p { font-weight: 700; margin: 6px 0 10px; line-height: 1.4; }
.pr-feedback .btn { width: 100%; }
#screen-practice-end { justify-content: center; }
#screen-practice-end .actions { margin-top: 16px; }

/* ---------- Bagikan ---------- */
.share-modal { position: fixed; inset: 0; background: rgba(11, 63, 55, .8); display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 10; }
.share-inner { display: flex; gap: 16px; align-items: center; max-height: 100%; }
.share-inner img { height: min(86dvh, 640px); aspect-ratio: 4 / 5; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.share-actions { display: flex; flex-direction: column; gap: 10px; min-width: 180px; }
.share-actions .btn { text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; }

/* =====================================================================
   ART DIRECTION — gaya kartun tebal ala mockup: HUD navy, kartu bermain,
   tombol glossy, judul bergradien oranye.
   ===================================================================== */
:root {
  --navy: #1d2a3b;
  --navy-2: #2c3d54;
  --gold: #f7c948;
  --outline: #13302b;
}

/* Judul bergradien seperti logo di mockup */
.game-title {
  color: transparent;
  -webkit-text-stroke: 0;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 var(--outline)) drop-shadow(0 0 1px var(--outline));
}
.game-title span {
  background: linear-gradient(180deg, #ffe58a 0%, #f9a825 55%, #e8590c 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 1.5px var(--outline);
}
.game-title { background: linear-gradient(180deg, #ffffff, #e3f2ef); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: 1.5px var(--outline); }

h2 { color: #fff; -webkit-text-stroke: 1px var(--outline); text-shadow: 0 3px 0 var(--outline); letter-spacing: .01em; }
#screen-badges h2 small { -webkit-text-stroke: 0; text-shadow: none; color: #fff; }

/* HUD navy + aksen emas */
.pill {
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  border: 2px solid rgba(255, 255, 255, .14);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .15);
}
#hud-score { color: var(--gold); }
.pill.timer.warn { background: linear-gradient(180deg, #ef4444, #b91c1c); }

/* Bar sisa waktu */
.timebar { width: 100%; max-width: 640px; height: 6px; margin-top: -4px; background: rgba(29, 42, 59, .25); border-radius: 999px; overflow: hidden; }
.timebar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #34c35a, var(--gold)); border-radius: inherit; transition: width .2s linear; }
.timebar.warn span { background: linear-gradient(90deg, #ef4444, #f97316); }

/* Kartu soal: tampil seperti kartu bermain */
.card-zone { perspective: 900px; }
.card {
  border: 3px solid var(--outline);
  box-shadow: 0 7px 0 var(--outline), 0 12px 24px rgba(0, 0, 0, .18);
}
.card::before, .card::after {
  content: '🍽️'; position: absolute; font-size: 16px; opacity: .35; line-height: 1;
}
.card::before { left: 12px; top: 10px; }
.card::after { right: 12px; bottom: 10px; transform: rotate(180deg); }
.card.enter { animation: cardFlip .36s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes cardFlip {
  0% { transform: rotateY(-90deg) translateX(30px); opacity: .2; }
  100% { transform: none; opacity: 1; }
}
.card.good { box-shadow: 0 7px 0 var(--outline), 0 0 0 5px var(--green) inset, 0 0 22px rgba(34, 164, 71, .45); }
.card.bad { box-shadow: 0 7px 0 var(--outline), 0 0 0 5px var(--red) inset, 0 0 22px rgba(220, 38, 38, .4); }
.card.shielded { box-shadow: 0 7px 0 var(--outline), 0 0 0 5px #3b82f6 inset; }
.card.gold { box-shadow: 0 7px 0 var(--outline), 0 0 0 5px #f2c94c inset, 0 0 28px rgba(242, 201, 76, .9); }
.card.flash { box-shadow: 0 7px 0 var(--outline), 0 0 0 5px #60a5fa inset, 0 0 28px rgba(96, 165, 250, .8); }
.card.gold.good, .card.flash.good { box-shadow: 0 7px 0 var(--outline), 0 0 0 5px var(--green) inset; }
.card.gold.bad, .card.flash.bad { box-shadow: 0 7px 0 var(--outline), 0 0 0 5px var(--red) inset; }
.card-cat { background: var(--teal-100); color: var(--teal-700); padding: 2px 10px; border-radius: 999px; }

/* Tombol jawaban glossy dengan garis luar tebal */
.btn-answer {
  position: relative; overflow: hidden;
  border: 3px solid var(--outline);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  letter-spacing: .02em;
}
.btn-answer::after {
  content: ''; position: absolute; left: 8%; right: 8%; top: 6%; height: 38%;
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0));
  border-radius: 999px; pointer-events: none;
}
.btn-answer.true { box-shadow: 0 6px 0 var(--outline); }
.btn-answer.false { box-shadow: 0 6px 0 var(--outline); }

.btn { border: 3px solid var(--outline); box-shadow: 0 5px 0 var(--outline); }
.btn:active { box-shadow: 0 2px 0 var(--outline); }
.btn-primary { background: linear-gradient(180deg, #ffc23d, var(--orange) 60%, #e07b00); text-shadow: 0 2px 0 rgba(0,0,0,.25); }

/* Tashya: bingkai tebal & papan nama navy */
.host, .title-host img { border: 3px solid var(--outline); box-shadow: 0 5px 0 var(--outline); background: #eaf4f2; }
.host-name { background: var(--navy); border: 2px solid rgba(255,255,255,.2); }
.bubble { border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--outline); }
.host-bubble::after { border-top-color: var(--outline); bottom: -9px; }

/* Assist: kartu hijau muda + gelembung label seperti mockup */
.assist {
  background: linear-gradient(180deg, #e9f7f2, #cdebe2);
  border: 3px solid var(--outline);
  box-shadow: 0 4px 0 var(--outline);
  transition: transform .08s;
}
.assist:not(:disabled):hover { transform: translateY(-2px); }
.assist:not(:disabled):active { transform: translateY(2px); box-shadow: 0 2px 0 var(--outline); }
.assist img { border: 3px solid var(--outline); }
.assist-tag { border: 2px solid var(--outline); }

/* Panel & kartu lain mengikuti garis luar yang sama */
.panel, .howto, .stats div, .coin-box, .kitchen-head div, .shop-item, .cat-card, .badge.on, .leaderboard li, .review-item, .pr-feedback, .tipcard-inner {
  border: 2px solid var(--outline);
  box-shadow: 0 4px 0 var(--outline);
}
.review-item { border-left-width: 6px; border-left-color: var(--red); }
.menu-btn { border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--outline); }
.menu-btn:active { box-shadow: 0 1px 0 var(--outline); }
.big-score span {
  background: linear-gradient(180deg, #ffe58a, #f59e0b 60%, #e8590c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px var(--outline);
  filter: drop-shadow(0 4px 0 var(--outline));
}
.big-score small, .rank { color: var(--outline); }

/* Konfeti di layar hasil */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* =====================================================================
   LAYAR JUDUL — tata letak pemandangan: logo pita di atas tengah, tokoh
   membingkai kiri-kanan, tombol MAIN besar di tengah bawah.
   ===================================================================== */
#screen-title.title-scene.active { display: block; overflow: hidden; padding: 0; }
.title-scene::before { /* cahaya lembut dari atas agar logo menonjol */
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 18%, rgba(255,255,255,.75), rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.logo-banner {
  position: absolute; left: 50%; top: max(6px, env(safe-area-inset-top)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; z-index: 2;
  width: min(50%, 92vh, 640px);
}
.logo-badge { width: clamp(70px, 17vh, 120px); border-radius: 12px; border: 3px solid var(--outline); box-shadow: 0 4px 0 var(--outline); margin-bottom: -14px; z-index: 1; background: #fff; }
.title-scene .game-title {
  margin: 0; width: 100%; text-align: center; line-height: .95;
  background: none; -webkit-text-stroke: 0; filter: none; color: inherit;
}
.title-scene .game-title span {
  display: block; padding: 14px 8px 0;
  font: 800 clamp(34px, 12vh, 76px)/1 'Baloo 2', sans-serif;
  background: linear-gradient(180deg, #ffe58a 0%, #f9a825 50%, #e8590c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2.5px var(--outline);
  filter: drop-shadow(0 4px 0 var(--outline)) drop-shadow(0 8px 10px rgba(0,0,0,.2));
  animation: logoIn .7s cubic-bezier(.2, .9, .3, 1.3) both;
}
/* Pita "Food Hygiene" melengkung di bawah judul */
.title-scene .game-title em {
  display: inline-block; margin-top: 2px; padding: 2px 34px 6px;
  font: 800 clamp(18px, 6vh, 34px)/1.1 'Baloo 2', sans-serif; font-style: normal;
  color: #fff; -webkit-text-stroke: 1px var(--outline); text-shadow: 0 2px 0 var(--outline);
  background: linear-gradient(180deg, #34c35a, #157a33);
  border: 3px solid var(--outline); border-radius: 14px 14px 40px 40px / 14px 14px 22px 22px;
  box-shadow: 0 4px 0 var(--outline);
  transform: rotate(-2deg);
  animation: logoIn .7s .12s cubic-bezier(.2, .9, .3, 1.3) both;
}
@keyframes logoIn { from { transform: scale(.6) translateY(-20px); opacity: 0; } }

/* Logo judul (gambar) & latar foto dapur khusus halaman depan */
#screen-title.title-scene { background: #3a3f45 url('../assets/img/kitchen-bg.webp') center / cover no-repeat; }
.title-scene::before {
  background:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(255,255,255,.35), rgba(255,255,255,0) 70%),
    linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(11, 30, 28, .45) 100%);
}
.title-logo { margin: 0; width: 100%; line-height: 0; }
.title-logo img {
  width: 100%; height: auto;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
  animation: logoIn .7s cubic-bezier(.2, .9, .3, 1.3) both;
}
.logo-badge { margin-bottom: -6px; }
.title-scene .scene-tag { box-shadow: 0 3px 8px rgba(0,0,0,.3); }

/* Tokoh kanan: Mba Tashya besar, tepinya dibaurkan ke latar dapur */
.scene-right {
  position: absolute; right: max(0px, env(safe-area-inset-right)); bottom: 0;
  height: 86%; width: 32%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  z-index: 1;
}
.scene-host {
  width: 100%; height: auto; min-height: 0; flex: 0 1 auto; object-fit: contain; object-position: bottom;
  -webkit-mask-image: radial-gradient(ellipse 62% 72% at 50% 52%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 72% at 50% 52%, #000 62%, transparent 100%);
  animation: hostIn .6s .2s ease-out both;
}
@keyframes hostIn { from { transform: translateX(40px); opacity: 0; } }
.scene-bubble { position: relative; align-self: flex-start; margin: 0 0 4px -40px; max-width: 230px; font-size: 13px; z-index: 2; animation: pop .5s .6s both; }
.scene-bubble::after { content: ''; position: absolute; left: 60%; bottom: -10px; border: 8px solid transparent; border-top-color: var(--outline); border-bottom: 0; }
.scene-tag {
  position: relative; margin-bottom: max(10px, env(safe-area-inset-bottom)); margin-top: -26px;
  background: var(--navy); color: #fff; font-weight: 800; font-size: 13px;
  padding: 3px 12px; border-radius: 999px; border: 2px solid rgba(255,255,255,.25); white-space: nowrap;
}

/* Tokoh kiri: tim support bertumpuk */
.scene-left {
  position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: 0; width: 26%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; z-index: 1;
}
.trio { display: flex; align-items: flex-end; animation: hostIn .6s .3s ease-out both; }
.trio img {
  width: clamp(58px, 22vh, 120px); aspect-ratio: 1; object-fit: cover; object-position: 50% 20%;
  border-radius: 50%; border: 3px solid var(--outline); box-shadow: 0 4px 0 var(--outline); background: #eaf4f2;
  margin: 0 -10px;
}
.trio img:nth-child(2) { width: clamp(70px, 27vh, 146px); z-index: 1; margin-bottom: 14px; }
.scene-left .scene-tag { margin-top: 6px; }

/* Tengah bawah: tombol MAIN & menu bundar */
.title-cta {
  position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(40%, 420px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 3;
}
.btn-play {
  width: 100%; font: 800 clamp(26px, 9vh, 44px)/1 'Baloo 2', sans-serif; padding: 10px 20px; min-height: 0;
  border-radius: 20px; border-width: 4px; box-shadow: 0 7px 0 var(--outline), 0 12px 20px rgba(0,0,0,.25);
  animation: breathe 1.8s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.05); } }
.btn-play:active { animation: none; transform: translateY(4px); box-shadow: 0 3px 0 var(--outline); }
.player-chip { margin: 0; background: rgba(255,255,255,.9); border: 2px solid var(--outline); border-radius: 999px; padding: 2px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.player-chip button { background: none; border: 0; color: var(--orange-dark); font: 800 13px 'Nunito', sans-serif; text-decoration: underline; cursor: pointer; padding: 0; }
.title-scene .menu { width: 100%; margin-top: 2px; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); }
/* Menu halaman depan: warna biru-putih APJI (biru logo + garis putih seperti seragam) */
:root { --apji-blue: #1446c8; --apji-blue-dark: #0a2f8f; --apji-navy: #0a1f4d; }
.title-scene .menu-btn {
  border-radius: 16px;
  background: linear-gradient(180deg, #3a6cf0 0%, var(--apji-blue) 45%, var(--apji-blue-dark) 100%);
  color: #fff;
  border: 2px solid var(--apji-navy);
  box-shadow: 0 4px 0 var(--apji-navy), inset 0 0 0 2px rgba(255, 255, 255, .85), inset 0 2px 0 3px rgba(255, 255, 255, .25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  padding: 6px 4px 7px;
  gap: 3px;
}
.title-scene .menu-btn span {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 2px solid var(--apji-navy);
  font-size: 18px; text-shadow: none;
}
.title-scene .menu-btn small { color: #ffe58a; }
.title-scene .menu-btn small b { color: #ffe58a; }
.title-scene .menu-btn:hover { filter: brightness(1.08); }
.title-scene .menu-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--apji-navy), inset 0 0 0 2px rgba(255, 255, 255, .85); }
@media (min-height: 600px) and (min-width: 900px) {
  .title-scene .menu-btn span { width: 42px; height: 42px; font-size: 23px; }
}

/* Popup nama */
.name-modal { position: absolute; inset: 0; background: rgba(11, 63, 55, .6); display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 10; }
.name-modal .name-form { max-width: 420px; animation: pop .3s ease; }
.name-modal h3 { margin: 0 0 4px; font: 800 24px 'Baloo 2', sans-serif; color: var(--teal-900); text-align: center; }
.name-modal .actions { position: static; padding-top: 8px; }
.name-modal .actions .btn { font-size: 18px; margin-top: 0; }

@media (max-height: 380px) {
  .scene-bubble { display: none; }
  .title-cta { gap: 5px; }
  .title-scene .menu-btn span { font-size: 15px; width: 26px; height: 26px; }
  .title-scene .menu-btn { font-size: 11px; letter-spacing: -.01em; }
  .name-modal .name-form { padding: 10px 14px; }
  .name-modal h3 { display: none; }
}
@media (min-height: 600px) and (min-width: 900px) {
  .scene-bubble { font-size: 16px; max-width: 260px; }
  .scene-tag { font-size: 15px; }
}

/* Layar landscape yang sangat pendek (HP kecil): rapatkan */
@media (max-height: 380px) {
  .title-host img { width: 100px; }
  .logo { width: 84px; }
  .title-host .bubble { font-size: 12px; margin-bottom: 8px; }
  .host-name { display: none; }
  .card { padding: 22px 16px; }
}

/* Layar besar (tablet, laptop, proyektor): perbesar panel & teks agar tidak terlihat kecil */
@media (min-height: 600px) and (min-width: 900px) {
  .panel { max-width: 480px; padding: 18px 20px; }
  .name-form label { font-size: 16px; }
  .name-form input { font-size: 18px; padding: 12px 16px; }
  .name-form .btn { font-size: 26px; min-height: 58px; }
  .menu-btn { font-size: 14px; padding: 8px 4px; }
  .menu-btn span { font-size: 26px; }
  .title-host { max-width: 500px; }
  .title-host .bubble, .host-bubble { font-size: 16px; }
  .btn { font-size: 19px; min-height: 54px; }
  .assist-name { font-size: 17px; }
  .assist-tag { font-size: 14px; }
  .stats b { font-size: 26px; }
  .result-bubble, .stats, .badge-new { max-width: 520px; }
  /* Jangan biarkan panggung game melar setinggi layar: batasi & taruh di tengah */
  #screen-game { justify-content: center; }
  .stage { flex: 0 1 600px; }
  .assist img { width: 76px; height: 76px; }
  .card-q { font-size: 30px; }
}

/* Teks yang langsung berada di atas foto latar: lebih gelap & diberi pendar putih */
.screen > .muted, .rank, .review h3, .big-score small, .badge-new::before {
  color: var(--outline); font-weight: 700; text-shadow: 0 1px 0 rgba(255,255,255,.9), 0 0 8px rgba(255,255,255,.8);
}

/* =====================================================================
   HALAMAN DEPAN (horizontal) — grid 3 kolom agar tidak ada yang bertabrakan:
   [tim support] [logo · tombol MAIN · menu] [Tashya]
   ===================================================================== */
@media (orientation: landscape) {
#screen-title.title-scene.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 1.35fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: clamp(8px, 2vw, 24px);
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
.title-scene > * { position: relative; left: auto; right: auto; top: auto; bottom: auto; transform: none; }
.title-scene .name-modal { position: absolute; inset: 0; }

.title-scene .logo-banner { grid-column: 2; grid-row: 1; align-self: start; justify-self: center; width: 100%; max-width: 620px; }
.title-scene .title-cta { grid-column: 2; grid-row: 2; width: 100%; max-width: 460px; justify-self: center; }

/* Kolom kiri & kanan: tokoh berdiri di dasar kolom, papan nama di bawahnya */
.title-scene .scene-left, .title-scene .scene-right {
  grid-row: 1 / span 2; width: auto; height: auto; min-height: 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.title-scene .scene-left { grid-column: 1; }
.title-scene .scene-right { grid-column: 3; }

.title-scene .trio { display: flex; align-items: flex-end; justify-content: center; width: 100%; min-height: 0; }
.title-scene .trio img { width: 44%; height: auto; max-height: 100%; margin: 0 -8%; }
.title-scene .trio img:nth-child(2) { width: 50%; height: auto; z-index: 1; }

.title-scene .scene-host { width: auto; max-width: 100%; height: auto; max-height: 100%; min-height: 0; flex: 0 1 auto; }

.title-scene .scene-tag {
  margin: 4px 0 0; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
  white-space: normal; text-align: center; padding: 4px 12px 5px; border-radius: 12px;
}
.title-scene .scene-tag small { font-size: 11px; font-weight: 700; opacity: .85; }
.title-scene .scene-bubble { margin: 0 0 6px; align-self: center; max-width: 100%; }
}

.scene-tag { text-align: center; line-height: 1.15; }
.scene-tag small { display: block; font-size: 11px; font-weight: 700; opacity: .85; }
@media (max-width: 420px) {
  .title-scene .menu-btn { font-size: 11px; letter-spacing: -.01em; }
}

/* =====================================================================
   BAR NAVIGASI BAWAH (halaman depan) — biru APJI dengan garis putih
   ===================================================================== */
.title-nav {
  display: flex; justify-content: center; align-items: stretch; gap: 2px;
  background: linear-gradient(180deg, #2457dc 0%, #1446c8 40%, #0a2f8f 100%);
  border-top: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, .22);
  /* Atas & bawah sama rata (3px). Di iPhone dengan garis home, bawah ditambah
     setengah area aman saja supaya bar tidak terlihat "naik" terlalu tinggi. */
  padding: 3px 8px max(3px, calc(env(safe-area-inset-bottom) * .5));
  z-index: 4;
}
.nav-item {
  position: relative; flex: 0 1 96px; min-width: 0;
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 5px;
  background: none; border: 0; border-radius: 10px; padding: 0 6px;
  min-height: 38px; /* ikon & label sebaris agar bar ramping */
  align-self: center;
  color: #fff; cursor: pointer; font-family: 'Nunito', sans-serif;
  transition: background .15s, transform .08s;
}
.nav-item:hover { background: rgba(255, 255, 255, .14); }
.nav-item:active { transform: translateY(2px); background: rgba(255, 255, 255, .22); }
.nav-item:focus-visible { outline: 2px solid #ffe58a; outline-offset: -2px; }
.nav-ic { position: relative; font-size: 16px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); }
.nav-lb { font-weight: 800; font-size: 12px; letter-spacing: .01em; white-space: nowrap; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
/* Pemisah tipis antar item */
/* HP sempit: ikon di atas label (5 menu tidak muat sebaris), tetap rapat */
@media (max-width: 560px) {
  .nav-item { flex-direction: column; gap: 0; padding: 0 2px; }
  .nav-ic { font-size: 15px; }
  .nav-lb { font-size: 10px; }
  .nav-item .nav-badge { position: absolute; top: 1px; left: 58%; }
}
.nav-badge {
  position: static;
  min-width: 16px; padding: 0 4px; border-radius: 999px; text-align: center;
  background: #ffcf3f; color: #5a3a00; border: 2px solid #0a1f4d;
  font: 800 9px/12px 'Nunito', sans-serif; text-shadow: none;
}

@media (orientation: landscape) {
  /* Grid: baris 1 isi, baris 2 tombol MAIN, baris 3 bar navigasi selebar layar */
  #screen-title.title-scene.active { grid-template-rows: minmax(0, 1fr) auto auto; padding-bottom: 0; row-gap: 6px; }
  .title-scene .title-nav {
    grid-column: 1 / -1; grid-row: 3;
    margin: 0 calc(-1 * max(10px, env(safe-area-inset-right))) 0 calc(-1 * max(10px, env(safe-area-inset-left)));
  }
  .title-scene .title-cta { padding-bottom: 2px; }
  /* Logo APJI di pojok kiri atas saat horizontal */
  #screen-title .logo-banner { position: static; }
  #screen-title .brand {
    position: absolute; z-index: 5;
    top: max(8px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left));
  }
  #screen-title .logo-badge { margin: 0; width: clamp(70px, 15vh, 120px); }
  /* Tokoh berdiri tepat di atas bar navigasi */
  .title-scene .scene-left, .title-scene .scene-right { grid-row: 1 / span 2; }
}
@media (orientation: portrait) {
  #app #screen-title.title-scene.active { padding-bottom: 0; }
  /* Logo APJI di pojok kiri atas saat HP tegak */
  .title-scene .brand { align-self: flex-start; margin: 0 0 6px; }
  .title-scene .logo-badge { margin: 0; width: clamp(72px, 22vw, 104px); }
  .title-scene .title-nav { align-self: stretch; margin: 8px -12px 0; }
}
@media (min-height: 600px) and (min-width: 900px) {
  .nav-ic { font-size: 18px; }
  .nav-lb { font-size: 13px; }
}

/* Presisi sentuhan di HP: tanpa jeda ketuk-ganda & area sentuh minimal ~44px */
button, a, input { touch-action: manipulation; }
.player-chip button { padding: 12px 8px; margin: -12px -8px; } /* tautan "ganti" kecil, area sentuhnya diperluas */
.tab { min-height: 40px; }
.pill.icon { min-width: 44px; min-height: 40px; }

/* =====================================================================
   KARAKTER — gambar seluruh badan berlatar transparan, tampil tanpa bingkai.
   ===================================================================== */
.host, .scene-host, .trio img, .assist img {
  border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important;
  -webkit-mask-image: none; mask-image: none;
  filter: drop-shadow(0 6px 6px rgba(11, 48, 43, .28));
}
/* Gameplay: Tashya berdiri utuh di kolom kiri */
.host { max-height: 84%; object-fit: contain; object-position: 50% 100%; }
/* Judul: tim support berdiri berjajar di kiri, yang tengah sedikit di depan */
.trio { align-items: flex-end; }
.trio img {
  width: auto; height: clamp(110px, 44vh, 320px); aspect-ratio: auto; object-fit: contain;
  margin: 0 -30px;
}
.trio img:nth-child(2) { width: auto; height: clamp(122px, 50vh, 360px); margin-bottom: 0; }
.scene-left { width: 29%; }
.scene-left .scene-tag { margin-top: -18px; z-index: 2; }
/* Assist & avatar kecil memakai potongan kepala-bahu (assets/img/*-face.png) */
.assist img { object-fit: contain; }
.host-col picture { display: contents; }

/* =====================================================================
   POSISI TEGAK (portrait) — game langsung bisa dimainkan di web tanpa
   meminta pemain memutar HP. Semua layar disusun ulang menjadi satu kolom.
   ===================================================================== */
@media (orientation: portrait) {
  .screen { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }

  /* Judul: logo di atas, Tashya di tengah, tombol MAIN di bawah */
  #screen-title.title-scene.active {
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  }
  .logo-banner { position: relative; left: auto; top: auto; transform: none; width: 100%; }
  .title-scene .game-title span { font-size: clamp(36px, 11vw, 64px); }
  .title-scene .game-title em { font-size: clamp(18px, 5.5vw, 30px); }
  .logo-badge { width: clamp(80px, 24vw, 120px); }
  .scene-right { position: relative; right: auto; bottom: auto; width: 100%; height: auto; flex: 1 1 0; min-height: 0; justify-content: flex-end; }
  .scene-host { width: auto; max-width: 70%; max-height: 100%; }
  .scene-bubble { align-self: center; margin: 0 0 6px; max-width: 280px; font-size: 14px; display: block; }
  .scene-bubble::after { left: 50%; margin-left: -8px; }
  .scene-tag { margin-bottom: 0; }
  .scene-left { display: none; }
  .title-cta { position: relative; left: auto; bottom: auto; transform: none; width: 100%; max-width: 440px; margin-top: 12px; }
  .btn-play { font-size: clamp(30px, 9vw, 44px); }

  /* Gameplay: HUD → Tashya + balon → kartu → tombol jawaban → assist */
  .stage { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; }
  .host-col { flex-direction: row; justify-content: flex-start; gap: 10px; }
  .host { flex: none; width: 64px; height: 64px; max-height: none; object-fit: cover; object-position: 50% 0; }
  .host-name { display: none; }
  .host-bubble { order: 2; flex: 1; text-align: left; }
  .host-bubble::after { left: -9px; bottom: auto; top: 50%; margin: -7px 0 0; border: 7px solid transparent; border-right-color: var(--outline); border-left: 0; }
  .streak { right: 0; bottom: auto; top: -6px; }
  .assists { flex-direction: row; }
  .assist { grid-template-columns: 1fr; grid-template-rows: auto auto auto; justify-items: center; text-align: center; padding: 6px 4px; }
  .assist img { grid-row: auto; width: 44px; height: 44px; }
  .assist-name { align-self: auto; font-size: 13px; }
  .assist-tag { justify-self: center; }
  .btn-answer { min-height: 68px; }
  .card-q { font-size: clamp(19px, 5.6vw, 26px); }

  /* Hasil: satu kolom yang di-scroll, tombol tetap di bawah */
  #screen-result.active { display: flex; flex-direction: column; overflow-y: auto; gap: 10px; }
  #screen-result .col { flex: none; overflow: visible; width: 100%; }
  .result-left::before, .result-left::after { display: none; }
  .result-actions { position: sticky; bottom: 0; flex-wrap: wrap; }
  .result-actions .btn-primary { flex-basis: 100%; order: -1; }

  /* Grid lain jadi 2 kolom */
  .shop, .cat-grid, .badge-grid { grid-template-columns: 1fr 1fr; }
  .leaderboard { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .leaderboard li.muted { grid-column: auto; }
  .howto { columns: 1; }

  /* Latihan: kartu di atas, jawaban/penjelasan di bawah */
  .practice-stage { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .practice-side .answers { flex-direction: row; }

  /* Bagikan: gambar di atas, tombol di bawah */
  .share-inner { flex-direction: column; width: 100%; }
  .share-inner img { height: auto; width: min(100%, 420px); max-height: 62dvh; object-fit: contain; }
  .share-actions { flex-direction: row; flex-wrap: wrap; width: 100%; max-width: 420px; }
  .share-actions .btn { flex: 1; }
}

/* =====================================================================
   LAYAR HASIL — dua panel berbatas jelas + bar tombol solid di bawah,
   jadi isi yang di-scroll tidak pernah tertumpuk di bawah tombol.
   ===================================================================== */
#screen-result .col {
  background: rgba(255, 255, 255, .93);
  border: 2px solid var(--outline); border-radius: 18px; box-shadow: 0 4px 0 var(--outline);
  padding: 10px 14px; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  justify-content: flex-start;
}
#screen-result .result-left::before, #screen-result .result-left::after { display: none; }
#screen-result h2 { font-size: clamp(20px, 5.5vh, 28px); margin: 0 0 6px; color: var(--apji-blue, #1446c8); -webkit-text-stroke: 0; text-shadow: 0 2px 0 rgba(10, 31, 77, .15); }
#screen-result .result-left { justify-content: flex-start; justify-content: safe center; }
#screen-result .result-bubble { box-shadow: none; font-size: 13px; padding: 6px 10px; }
#screen-result .big-score { margin: 4px 0 6px; }
#screen-result .big-score span { font-size: clamp(42px, 13vh, 68px); }
#screen-result .stats { gap: 6px; }
#screen-result .stats div { box-shadow: 0 3px 0 var(--outline); padding: 4px 2px; }
#screen-result .rank { margin: 8px 0 0; text-shadow: none; }
#screen-result .badge-new { margin-top: 6px; }
#screen-result .badge-new::before { text-shadow: none; }
#screen-result .coin-box { box-shadow: none; }
#screen-result .review h3 { text-shadow: none; margin-top: 8px; }
#screen-result .review-item { box-shadow: none; border-width: 2px; border-left-width: 6px; }

/* Bar tombol: latar biru APJI solid selebar layar */
#screen-result .result-actions {
  position: relative; grid-column: 1 / -1; max-width: none; gap: 10px;
  margin: 0 calc(-1 * var(--pad-x));
  padding: 8px var(--pad-x) max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #2457dc 0%, #1446c8 40%, #0a2f8f 100%);
  border-top: 3px solid #fff; box-shadow: 0 -2px 0 #0a1f4d, 0 -8px 20px rgba(0, 0, 0, .2);
  z-index: 3;
}
#screen-result .result-actions .btn { min-height: 44px; padding: 6px 10px; font-size: 16px; }

@media (orientation: landscape) {
  #app #screen-result.active { padding-bottom: 0; row-gap: 10px; column-gap: 14px; align-items: stretch; }
}

@media (orientation: portrait) {
  /* Satu kolom: panel bertumpuk rapi, bar tombol menempel di bawah */
  #app #screen-result.active { padding-bottom: 0; gap: 12px; }
  #screen-result .col { overflow: visible; }
  #screen-result .result-actions {
    position: sticky; bottom: 0; margin-top: auto;
    margin-left: calc(-1 * max(12px, env(safe-area-inset-left))); margin-right: calc(-1 * max(12px, env(safe-area-inset-right)));
    padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
  }
  #screen-result .result-actions .btn-primary { flex-basis: 100%; }
}

@media (max-height: 380px) and (orientation: landscape) {
  #screen-result .result-bubble { display: none; }
  #screen-result .big-score small { display: none; }
}

/* Mba Tashya + jempol di panel hasil */
.result-head { display: flex; align-items: center; gap: 10px; width: 100%; }
.result-host { position: relative; flex: none; width: clamp(64px, 24vh, 110px); aspect-ratio: 3 / 4; }
.result-host img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; filter: drop-shadow(0 4px 4px rgba(11, 48, 43, .25)); }
.thumb {
  position: absolute; right: -10px; bottom: 6%;
  font-size: clamp(28px, 10vh, 46px); line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(10, 31, 77, .35));
  transform-origin: 50% 90%;
  animation: thumbUp .7s .35s cubic-bezier(.2, 1.4, .4, 1) both, thumbWiggle 1.6s 1.1s ease-in-out infinite;
}
@keyframes thumbUp { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
@keyframes thumbWiggle { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-12deg) translateY(-3px); } }
.result-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
#screen-result .result-head .result-bubble { position: relative; }
#screen-result .result-head .result-bubble::before {
  content: ''; position: absolute; left: -9px; top: 50%; margin-top: -7px;
  border: 7px solid transparent; border-right-color: var(--outline); border-left: 0;
}
@media (max-height: 380px) and (orientation: landscape) {
  #screen-result .result-head .result-bubble { display: block; font-size: 12px; padding: 4px 8px; }
  #screen-result h2 { margin-bottom: 4px; }
}

.modal-host { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px; }
.modal-host img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.2)); animation: wave 1.4s ease-in-out 2; transform-origin: 50% 90%; }
@keyframes wave { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.pr-head { max-width: 520px; margin: 8px auto; }
#screen-practice-end .pr-head .result-bubble { flex: 1; }

/* Logo APJI + keterangan pembuat */
.brand { display: flex; align-items: center; gap: 8px; }
.credit {
  margin: 0; padding: 4px 10px; border-radius: 10px;
  background: rgba(10, 31, 77, .72); color: #fff;
  font: 700 11px/1.25 'Nunito', sans-serif; letter-spacing: .01em;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.credit b { font-weight: 800; color: #ffe58a; }
@media (min-height: 600px) and (min-width: 900px) { .credit { font-size: 13px; } }

/* Hasil: skor + bintang sebaris, lencana baru sebagai pita di atas panel kanan */
.score-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 2px 0 6px; }
#screen-result .score-row .big-score { margin: 0; }
.stars { display: flex; gap: 2px; }
.stars i {
  font-style: normal; font-size: clamp(24px, 8vh, 38px); line-height: 1;
  color: #d5dde0; -webkit-text-stroke: 2px var(--outline);
}
.stars i.on {
  color: #ffc83d; filter: drop-shadow(0 3px 0 var(--outline));
  animation: starPop .45s cubic-bezier(.2, 1.5, .4, 1) both;
}
.stars i:nth-child(2) { transform: translateY(-6px); }
.stars i.on:nth-child(2) { animation-name: starPopMid; }
@keyframes starPop { from { transform: scale(0) rotate(-60deg); } to { transform: scale(1); } }
@keyframes starPopMid { from { transform: translateY(-6px) scale(0) rotate(-60deg); } to { transform: translateY(-6px) scale(1); } }

#screen-result .result-right .badge-new {
  max-width: none; width: 100%; margin: 0 0 8px; padding: 6px 8px;
  background: linear-gradient(90deg, #fff6d6, #ffe7a3); border: 2px solid #e0b43a; border-radius: 12px;
}
#screen-result .result-right .badge-new::before { color: #6b4a00; }

/* Angka skor bergaya logo judul: isi biru APJI, garis putih tebal, bayangan gelap 3D */
.big-score span, #screen-result .big-score span {
  font-family: 'Lilita One', 'Baloo 2', sans-serif; font-weight: 400; letter-spacing: .03em;
  background: none; -webkit-background-clip: border-box; background-clip: border-box;
  color: #1446c8; -webkit-text-fill-color: #1446c8;
  -webkit-text-stroke: 7px #fff; paint-order: stroke fill;
  filter: drop-shadow(0 4px 0 #0a1f4d) drop-shadow(0 8px 8px rgba(0, 0, 0, .25));
  line-height: 1.05;
}

/* Status lencana memakai teks agar tetap jelas tanpa bergantung pada warna. */
#screen-badges {
  --outline: #17366c;
  background: transparent; color: #172d50;
  padding: clamp(16px, 3vw, 32px); gap: 20px;
}
#screen-badges > * { width: 100%; max-width: 860px; flex-shrink: 0; }
.badges-intro { text-align: center; }
#screen-badges h2 {
  margin: 0 0 8px; font-size: clamp(28px, 4vw, 38px); line-height: 1.2;
}
.badges-intro p { margin: 0; color: #17366c; font-size: 16px; line-height: 1.5; font-weight: 800; text-shadow: 0 1px 0 #fff, 0 0 8px #fff; }
.badges-progress { padding: 18px 20px; background: #fff; border: 1px solid #bdcdeb; border-radius: 16px; }
.badges-progress-label { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.badges-progress-label h3 { margin: 0; font-size: 16px; }
#badge-count { color: #1746b2; font-weight: 800; font-size: 13px; }
#badge-meter { display: block; width: 100%; height: 8px; margin-top: 14px; appearance: none; border: 0; border-radius: 8px; overflow: hidden; background: #d9e4f8; accent-color: #1446c8; }
#badge-meter::-webkit-progress-bar { background: #d9e4f8; }
#badge-meter::-webkit-progress-value { background: #1446c8; }
#badge-meter::-moz-progress-bar { background: #1446c8; }
#badge-progress-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: #425575; }
#screen-badges .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#screen-badges .badge {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); align-content: start;
  gap: 8px 10px; padding: 18px; border: 1px solid #c6d2e8; border-radius: 16px;
  background: #fff; text-align: left; box-shadow: 0 4px 0 #17366c; min-width: 0; border: 2px solid #17366c;
}
#screen-badges .badge .em {
  grid-column: 1; grid-row: 1; display: grid; place-items: center;
  width: 48px; height: 48px; font-size: 27px; border-radius: 12px;
  background: #e8edf5; filter: grayscale(1); opacity: 1;
}
#screen-badges .badge-status { grid-column: 2; align-self: center; font-size: 11px; font-weight: 800; color: #52617a; line-height: 1.4; }
#screen-badges .badge b { grid-column: 1 / -1; font-size: 17px; color: #17366c; line-height: 1.35; }
#screen-badges .badge small { grid-column: 1 / -1; font-size: 13px; line-height: 1.55; color: #425575; }
#screen-badges .badge.on { background: #e7efff; border: 2px solid #1446c8; padding: 18px; }
#screen-badges .badge.on .em { background: #e7efff; filter: none; }
#screen-badges .badge.on .badge-status { color: #1446c8; }
#screen-badges .actions { position: sticky; bottom: -1px; z-index: 2; margin-top: auto; padding: 12px 0 8px; background: transparent; }
#screen-badges .btn { min-height: 48px; font-size: 15px; border: 1px solid #bdcdeb; box-shadow: 0 3px 0 #c9d8f2; color: #17366c; text-shadow: none; }
#screen-badges .btn-primary { background: #1446c8; border-color: #1446c8; box-shadow: 0 3px 0 #0a2f8f; color: #fff; }
#screen-badges .btn:hover { filter: brightness(.96); }
#screen-badges .btn:focus-visible { outline: 3px solid #1446c8; outline-offset: 4px; }
@media (max-width: 680px) {
  #screen-badges { gap: 16px; }
  #screen-badges .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #screen-badges .badge { padding: 12px; grid-template-columns: 1fr; }
  #screen-badges .badge.on { padding: 12px; }
  #screen-badges .badge-status { grid-column: 1; grid-row: 2; }
  #screen-badges .badge b { font-size: 16px; }
  .badges-progress { padding: 16px; }
}
@media (max-width: 340px) {
  #screen-badges .badge-grid { grid-template-columns: 1fr; }
}
/* Biru APJI menyatukan alur belajar; permukaan terang menjaga keterbacaan soal. */
#screen-practice-menu, #screen-practice, #screen-practice-end {
  --outline: #17366c;
  --teal-900: #17366c;
  --teal-700: #214a91;
  --teal-100: #e7efff;
  background: transparent;
  color: #172d50;
  padding: clamp(16px, 3vw, 32px);
  gap: 16px;
}
#screen-practice-menu > *, #screen-practice-end > * { max-width: 860px; flex-shrink: 0; }
#screen-practice-menu h2, #screen-practice-end h2 {
  font-size: clamp(28px, 4vw, 38px); line-height: 1.2; margin: 0 0 8px;
}
#screen-badges h2, #screen-practice-menu h2, #screen-practice-end h2, #screen-howto h2, #screen-leaderboard h2 {
  font-family: 'Lilita One', 'Baloo 2', sans-serif;
  font-weight: 400; letter-spacing: .01em;
  color: #1446c8; -webkit-text-fill-color: #1446c8;
  -webkit-text-stroke: 4px #fff; paint-order: stroke fill;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 #0a1f4d);
}
.practice-intro { text-align: center; }
.practice-intro p { margin: 0; font-size: 16px; line-height: 1.5; color: #17366c; font-weight: 800; text-shadow: 0 1px 0 #fff, 0 0 8px #fff; }
.practice-notes { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; font-size: 13px; font-weight: 800; color: #214a91; }
.practice-section-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.practice-section-label h3 { margin: 0; font-size: 16px; }
.practice-section-label > span { color: #425575; font-size: 13px; }
#screen-practice-menu .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#screen-practice-menu .cat-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto 1fr auto;
  gap: 4px 10px; min-height: 146px; padding: 16px; border: 1px solid #bdcdeb;
  border-radius: 16px; background: #fff; box-shadow: 0 4px 0 #17366c; border: 2px solid #17366c;
  transition: border-color .15s, background .15s;
}
#screen-practice-menu .cat-icon { grid-column: 1; grid-row: 1 / 3; font-size: 26px; background: #edf3ff; border-radius: 12px; width: 44px; height: 44px; display: grid; place-items: center; }
#screen-practice-menu .cat-card b { grid-column: 2; color: #17366c; font-size: 17px; line-height: 1.3; }
.cat-description { grid-column: 2; font-size: 12px; line-height: 1.5; color: #425575; }
#screen-practice-menu .cat-card small { grid-column: 1 / 3; grid-row: 3; font-size: 12px; color: #425575; align-self: end; }
#screen-practice-menu .cat-best { grid-column: 1 / 3; grid-row: 4; color: #1746b2; font-size: 12px; padding-top: 5px; font-weight: 800; }
#screen-practice-menu .cat-card.all { grid-column: 1 / -1; min-height: 100px; background: #1446c8; border-color: #1446c8; box-shadow: 0 3px 0 #0a2f8f; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto auto; }
#screen-practice-menu .all b, #screen-practice-menu .all .cat-description, #screen-practice-menu .all small, #screen-practice-menu .all .cat-best { color: #fff; }
#screen-practice-menu .all small { grid-column: 3; grid-row: 1; }
#screen-practice-menu .all .cat-best { grid-column: 3; grid-row: 2; padding: 0; align-self: end; }
#screen-practice-menu .cat-card:hover { background: #f2f6ff; border-color: #1446c8; }
#screen-practice-menu .cat-card.all:hover { background: #103ba9; }
#screen-practice-menu .cat-card:active { transform: translateY(2px); box-shadow: none; }
#screen-practice-menu .actions, #screen-practice-end .actions { position: sticky; bottom: -1px; margin-top: auto; background: transparent; padding: 12px 0 8px; z-index: 2; }
:is(#screen-practice-menu, #screen-practice, #screen-practice-end) .btn { border: 1px solid #bdcdeb; box-shadow: 0 3px 0 #c9d8f2; font-size: 15px; min-height: 48px; text-shadow: none; }
:is(#screen-practice-menu, #screen-practice, #screen-practice-end) .btn-primary { background: #1446c8; border-color: #1446c8; color: #fff; box-shadow: 0 3px 0 #0a2f8f; }
:is(#screen-practice-menu, #screen-practice, #screen-practice-end) button:focus-visible { outline: 3px solid #1446c8; outline-offset: 4px; }
#screen-practice { overflow-y: auto; }
#screen-practice .hud { width: 100%; max-width: 960px; flex-shrink: 0; }
#screen-practice .pill { background: #fff; color: #17366c; border: 1px solid #bdcdeb; box-shadow: none; text-shadow: none; font-size: 15px; display: flex; gap: 6px; align-items: center; }
#screen-practice .pill.icon { cursor: pointer; min-width: 44px; min-height: 44px; justify-content: center; }
.practice-progress { width: 100%; max-width: 960px; height: 7px; border: 0; border-radius: 8px; overflow: hidden; background: #d9e4f8; accent-color: #1446c8; flex-shrink: 0; }
.practice-progress::-webkit-progress-bar { background: #d9e4f8; }
.practice-progress::-webkit-progress-value { background: #1446c8; }
.practice-progress::-moz-progress-bar { background: #1446c8; }
#screen-practice .practice-stage { max-width: 960px; min-height: 300px; gap: 24px; align-items: center; }
#screen-practice .card { min-height: 280px; max-height: 470px; border: 2px solid #1446c8; background: #fff; box-shadow: 0 5px 0 #cad8f3; padding: 48px 28px 28px; }
#screen-practice .card::before, #screen-practice .card::after { display: none; }
#screen-practice .card-cat { color: #214a91; text-shadow: none; -webkit-text-stroke: 0; font-size: 14px; }
#screen-practice .card-q { color: #172d50; font-size: clamp(21px, 2.8vw, 30px); line-height: 1.45; text-shadow: none; }
#screen-practice .card.good { border-color: #157a33; }
#screen-practice .card.bad { border-color: #b52323; }
#screen-practice .practice-side { min-width: 0; }
#screen-practice .btn-answer { min-height: 64px; border: 2px solid #1446c8; box-shadow: 0 3px 0 #cad8f3; font-size: 22px; text-shadow: none; }
#screen-practice .btn-answer.true { background: #1446c8; color: #fff; }
#screen-practice .btn-answer.false { background: #fff; color: #17366c; }
#screen-practice .btn-answer::after { display: none; }
.practice-answer-hint { color: #425575; text-align: center; font-size: 13px; margin: 0; }
#screen-practice .pr-feedback { border: 1px solid #bdcdeb; box-shadow: none; padding: 22px; }
#screen-practice .pr-feedback p { font-size: 16px; line-height: 1.65; font-weight: 600; margin: 12px 0 20px; }
#screen-practice-end .big-score small { color: #425575; text-shadow: none; }
#screen-practice-end .pr-head { width: 100%; max-width: 560px; }
#screen-practice-end .result-bubble { background: #fff; color: #17366c; border-color: #bdcdeb; box-shadow: none; }
#screen-practice-end .actions { position: static; margin-top: 20px; }
@media (orientation: portrait) {
  #screen-practice .practice-stage { flex: none; grid-template-columns: 1fr; grid-template-rows: auto auto; margin: auto 0; }
  #screen-practice .card { height: auto; min-height: 260px; }
}
@media (max-width: 680px) {
  #screen-practice-menu .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #screen-practice-menu .cat-card { padding: 12px; grid-template-columns: 1fr; min-height: 160px; }
  #screen-practice-menu .cat-card > * { grid-column: 1; grid-row: auto; }
  #screen-practice-menu .cat-card b { font-size: 16px; }
  #screen-practice-menu .cat-card.all { grid-template-columns: 44px minmax(0, 1fr); }
  #screen-practice-menu .all .cat-icon { grid-row: 1 / 3; }
  #screen-practice-menu .all b, #screen-practice-menu .all .cat-description { grid-column: 2; }
  #screen-practice-menu .all small { grid-column: 1 / -1; grid-row: 3; }
  #screen-practice-menu .all .cat-best { grid-column: 1 / -1; grid-row: 4; }
  .practice-section-label { align-items: start; flex-wrap: wrap; }
  #screen-practice .practice-stage { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: start; min-height: auto; flex: none; width: 100%; gap: 20px; }
  #screen-practice .card { min-height: 250px; height: auto; }
  #screen-practice .practice-side .answers { flex-direction: row; }
  #screen-practice-end .actions { flex-wrap: wrap; }
  #screen-practice-end .actions .btn { flex: 1 1 140px; }
}
@media (max-height: 620px) and (min-width: 681px) {
  #screen-practice-menu { gap: 10px; }
  #screen-practice-menu .cat-card { min-height: 120px; padding: 12px; }
  #screen-practice-menu .cat-card.all { min-height: 80px; }
  #screen-practice .card { min-height: 220px; }
  #screen-practice-end { justify-content: flex-start; }
}
/* Garis tebal dan bayangan mengikuti kartu serta tombol pada layar game. */
:is(#screen-practice-menu, #screen-practice, #screen-practice-end, #screen-badges) .btn {
  border: 3px solid #17366c; box-shadow: 0 5px 0 #17366c;
  border-radius: 14px; font-size: 17px;
}
:is(#screen-practice-menu, #screen-practice, #screen-practice-end, #screen-badges) .btn-primary {
  background: linear-gradient(180deg, #3165e1, #1446c8 60%, #0a2f8f);
  color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25);
}
:is(#screen-practice-menu, #screen-practice, #screen-practice-end, #screen-badges) .btn:active { box-shadow: 0 2px 0 #17366c; }
.badges-progress, #screen-practice .pr-feedback { border: 2px solid #17366c; box-shadow: 0 4px 0 #17366c; }
.practice-notes, .practice-section-label, .practice-answer-hint { color: #17366c; font-weight: 800; text-shadow: 0 1px 0 #fff, 0 0 8px #fff; }
.practice-section-label > span { color: #17366c; }
#screen-practice .card { box-shadow: 0 5px 0 #17366c; }
#screen-practice .pill { border: 2px solid #17366c; box-shadow: 0 3px 0 #17366c; }
.start-error { background: #fff; color: #9a2323; border: 2px solid #9a2323; border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 800; }
.event-picker { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; color: #17366c; font-weight: 800; }
.event-picker select { max-width: 100%; min-height: 44px; padding: 8px; font: inherit; border: 2px solid #17366c; border-radius: 10px; background: #fff; color: #17366c; cursor: pointer; }
.panitia-link { color: #17366c; background: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 800; text-align: center; }
#screen-result .result-actions { flex-wrap: wrap; gap: 8px; }
#screen-result .result-actions .btn { flex: 1 1 135px; }
#screen-review { gap: 14px; }
#screen-review > * { width: 100%; max-width: 860px; flex-shrink: 0; }
#screen-review h2 { font-family: 'Lilita One', 'Baloo 2', sans-serif; font-weight: 400; color: #1446c8; -webkit-text-fill-color: #1446c8; -webkit-text-stroke: 4px #fff; paint-order: stroke fill; text-shadow: none; filter: drop-shadow(0 3px 0 #0a1f4d); }
#screen-review .review-item { border: 2px solid #17366c; border-radius: 14px; padding: 16px; box-shadow: 0 4px 0 #17366c; margin-bottom: 16px; }
#screen-review h3 { margin: 0; color: #1446c8; font-size: 16px; }
#screen-review p { line-height: 1.6; }
#screen-review .actions { padding-bottom: 8px; }
#screen-review .btn-primary { background: #1446c8; }
@media (max-width: 560px) { #screen-review .actions { flex-wrap: wrap; } #screen-review .actions .btn { flex: 1 1 180px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
