/* ============================================================
   Latihan Soal AAS 1 — Kelas VI
   ============================================================ */

:root {
  --bg: #f7fbf8;
  --ink: #1e302a;
  --ink-soft: #3f5149;
  --muted: #647a72;
  --card: #ffffff;
  --line: #e2e8e3;
  --line-soft: #eef2ef;
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-soft: #e6faf6;
  --accent: #f59e0b;
  --green: #0d9f6e;
  --green-soft: #e7f8f1;
  --red: #e0454c;
  --red-soft: #fdeceb;
  --amber: #f5a623;
  --shadow-sm: 0 1px 2px rgba(30, 48, 42, .05), 0 2px 8px rgba(30, 48, 42, .04);
  --shadow-md: 0 4px 14px rgba(30, 48, 42, .07), 0 16px 36px rgba(30, 48, 42, .06);
  --shadow-lg: 0 10px 28px rgba(13, 148, 136, .18), 0 30px 70px rgba(30, 48, 42, .12);
  --radius: 24px;
  --radius-sm: 15px;
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 92px; }

.subject-card, .option, .btn, input { scroll-margin-top: 96px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }

button, .option, .chip, .segmented button { touch-action: manipulation; }

body { -webkit-tap-highlight-color: transparent; }

button { cursor: pointer; }

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
}
.blob-1 { width: 520px; height: 520px; background: #ccfbf1; top: -220px; right: -140px; }
.blob-2 { width: 420px; height: 420px; background: #fef3c7; top: 42%; left: -220px; opacity: .55; }
.blob-3 { width: 380px; height: 380px; background: #dbeafe; bottom: -200px; right: 12%; opacity: .45; }

/* ---------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(246, 244, 238, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 225, 216, .7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  color: var(--ink);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #2dd4bf, #0f766e);
  box-shadow: 0 6px 14px rgba(13, 148, 136, .28);
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text small { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------- layout */

main { padding: 0 clamp(16px, 4vw, 40px) 64px; }

.screen {
  max-width: 1040px;
  margin: 0 auto;
  animation: rise .35s cubic-bezier(.2, .7, .3, 1);
}
.screen-narrow { max-width: 760px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.hero { padding: clamp(34px, 6vw, 64px) 0 26px; max-width: 720px; }

.eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 7px 12px;
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(34px, 6.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -.035em;
  margin: 18px 0 16px;
  font-weight: 800;
}
.grad {
  background: linear-gradient(95deg, #0d9488 10%, #0ea5e9 55%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { font-size: clamp(15px, 1.9vw, 17.5px); line-height: 1.65; color: var(--ink-soft); margin: 0 0 20px; max-width: 620px; }

.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  font-size: 12.5px;
  font-weight: 700;
  color: #3d6b58;
  background: #e9f7f0;
  border: 1px solid #d4efe2;
  padding: 6px 11px;
  border-radius: 999px;
}

/* ---------------------------------------------------------- panel */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.name-panel { padding: 20px clamp(18px, 3vw, 26px) 18px; max-width: 720px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  margin-bottom: 9px;
}
.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #faf9f6;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.name-row:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .12);
}
.name-row.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(224, 69, 76, .1); }
.name-icon { font-size: 16px; opacity: .75; }
#nameInput {
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
#nameInput::placeholder { color: #a8a4b8; font-weight: 500; }
.hint { margin: 9px 2px 0; font-size: 12.5px; color: var(--muted); }
.hint.error { color: var(--red); font-weight: 700; }

/* ---------------------------------------------------------- picker */

.picker-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin: 42px 2px 16px;
}
.picker-head h2 { font-size: clamp(20px, 2.6vw, 25px); letter-spacing: -.02em; margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 13.5px; margin: 0; }

.count-block { display: flex; align-items: center; gap: 10px; }
.count-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }

.segmented {
  display: inline-flex;
  background: #e6efe9;
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.segmented button {
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .16s, color .16s, box-shadow .16s;
  min-width: 48px;
}
.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(30, 48, 42, .13);
}

/* ---------------------------------------------------------- subjects */

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 14px;
}

.subject-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  overflow: hidden;
}
.subject-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 120px at 100% 0%, var(--tint, rgba(13, 148, 136, .08)), transparent 70%);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.subject-card:hover, .subject-card:focus-visible {
  transform: translateY(-3px);
  border-color: #b9e6dd;
  box-shadow: var(--shadow-md);
  outline: none;
}
.subject-card:hover::after, .subject-card:focus-visible::after { opacity: 1; }
.subject-card:active { transform: translateY(-1px) scale(.995); }

.subject-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 23px;
  background: var(--tint, #e6faf6);
  flex: 0 0 auto;
}
.subject-body { min-width: 0; flex: 1; }
.subject-body h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 2px 0 4px;
  line-height: 1.3;
}
.subject-body p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.subject-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f4f2ec;
  color: var(--ink-soft);
}
.pill.go { background: var(--primary-soft); color: var(--primary); }
.subject-arrow { color: var(--muted); font-size: 15px; transition: transform .18s; }
.subject-card:hover .subject-arrow { transform: translateX(3px); color: var(--primary); }

.skeleton-card {
  height: 132px;
  border-radius: 18px;
  background: linear-gradient(100deg, #e8f0eb 30%, #f6faf7 50%, #e8f0eb 70%);
  background-size: 220% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }

.footnote {
  margin: 34px 2px 0;
  font-size: 12px;
  line-height: 1.6;
  color: #9692a6;
  max-width: 620px;
}

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 800;
  font-size: 14px;
  padding: 11px 18px;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(160deg, #14b8a6, #0f766e);
  color: #fff;
  box-shadow: 0 6px 16px rgba(13, 148, 136, .28);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 9px 22px rgba(13, 148, 136, .36); }

.btn-dark { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.btn-dark:hover { background: #2b2843; }

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: #a7dcd1; background: #f7fffd; }

.btn-plain {
  background: none;
  border: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 4px;
}
.btn-plain:hover { color: var(--ink); }

.btn-lg { padding: 15px 26px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 10px; }

/* ---------------------------------------------------------- quiz */

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 26px 0 14px;
  flex-wrap: wrap;
}
.quiz-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.subject-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 7px 12px;
  border-radius: 999px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quiz-player { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.quiz-score {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
  background: var(--green-soft);
  padding: 7px 12px;
  border-radius: 999px;
}

.progress-wrap { max-width: 760px; margin: 0 auto 16px; }
.screen#screen-quiz { max-width: 760px; }
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 7px;
}
.progress-track {
  height: 8px;
  background: #e7e3d9;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #14b8a6, #0ea5e9);
  transition: width .35s cubic-bezier(.3, .8, .3, 1);
}

.question-card { padding: clamp(20px, 4vw, 34px); }

.q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.q-category {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #8a6a1f;
  background: #fdf3d7;
  padding: 5px 9px;
  border-radius: 7px;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-number { font-size: 11.5px; font-weight: 700; color: #a19db0; }

.q-text {
  font-size: clamp(17.5px, 2.4vw, 21px);
  line-height: 1.55;
  letter-spacing: -.012em;
  margin: 0 0 22px;
  font-weight: 700;
  white-space: pre-line;
}

.options { display: grid; gap: 10px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  text-align: left;
  background: #fbfaf7;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 15px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 600;
  transition: border-color .14s, background .14s, box-shadow .14s, transform .14s;
}
.option:hover:not(:disabled) { border-color: #9ed9cd; background: #f5fffc; transform: translateX(2px); }
.option:disabled { cursor: default; }
.option .letter {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: #eeebe3;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 800;
  flex: 0 0 auto;
  transition: background .14s, color .14s;
}
.option .opt-text { padding-top: 3px; }

.option.selected { border-color: var(--primary); background: #ecfdf9; box-shadow: 0 0 0 3px rgba(13, 148, 136, .1); }
.option.selected .letter { background: var(--primary); color: #fff; }

.option.correct { border-color: var(--green); background: var(--green-soft); box-shadow: none; }
.option.correct .letter { background: var(--green); color: #fff; }

.option.wrong { border-color: var(--red); background: var(--red-soft); }
.option.wrong .letter { background: var(--red); color: #fff; }

.option.dim { opacity: .62; }

.q-action { margin-top: 20px; display: flex; justify-content: flex-end; }

.feedback {
  margin-top: 22px;
  border-top: 1px dashed var(--line);
  padding-top: 20px;
  animation: rise .3s cubic-bezier(.2, .7, .3, 1);
}
.feedback-head { display: flex; align-items: flex-start; gap: 12px; }
.feedback-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 19px;
  font-weight: 800;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}
.feedback.bad .feedback-icon { background: var(--red-soft); color: var(--red); }
.feedback-head strong { font-size: 16.5px; letter-spacing: -.01em; }
.feedback-answer { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.feedback-answer b { color: var(--green); }

.feedback-body {
  margin: 14px 0 18px;
  background: #faf9f5;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  padding: 14px 16px;
}
.feedback-body p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); }
.feedback-body .source-line {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.kbd-hint { font-size: 11px; color: #a5a1b4; }
kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- result */

#screen-result { padding-top: clamp(30px, 6vw, 60px); }

.result-card {
  padding: clamp(28px, 5vw, 46px);
  text-align: center;
  box-shadow: var(--shadow-md);
}
.result-card .eyebrow { margin-bottom: 6px; }

.score-ring {
  --p: 0;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  margin: 24px auto 18px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring-color, #0d9488) calc(var(--p) * 1%), #e6efe9 0);
  position: relative;
  transition: background .6s;
}
.score-ring::before {
  content: '';
  position: absolute;
  inset: 11px;
  background: #fff;
  border-radius: 50%;
  box-shadow: inset 0 2px 8px rgba(30, 48, 42, .05);
}
.score-ring-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.score-ring-inner strong { font-size: 42px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.score-ring-inner span { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }

.result-card h2 { font-size: clamp(24px, 4vw, 31px); letter-spacing: -.025em; margin: 4px 0 8px; }
.result-line { font-size: 15px; color: var(--ink-soft); margin: 0 0 6px; font-weight: 600; }
.result-rank {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  color: #8a6a1f;
  background: #fdf3d7;
  border: 1px solid #f5e2ac;
  padding: 7px 14px;
  border-radius: 999px;
  margin: 10px 0 0;
}
.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}
.save-note { font-size: 12px; color: var(--muted); margin: 18px 0 0; min-height: 16px; }
.save-note.error { color: var(--red); font-weight: 600; }

/* ---------------------------------------------------------- board */

#screen-board { padding-top: 30px; }

.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.board-head h1 { font-size: clamp(28px, 4.5vw, 38px); letter-spacing: -.03em; margin: 10px 0 4px; }

.board-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: thin;
}
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 999px;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: #a7dcd1; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.board-panel { padding: 6px 0; overflow: hidden; }

.board-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
}
.board-row-head {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #a19db0;
  padding-top: 14px;
  padding-bottom: 8px;
}
.ta-r { text-align: right; }

.board-list { max-height: min(60vh, 560px); overflow-y: auto; }

.board-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-top: 1px solid var(--line-soft);
  animation: rise .25s ease both;
}
.board-item:nth-child(-n+3) { background: linear-gradient(90deg, rgba(255, 248, 228, .75), rgba(255, 255, 255, 0)); }
.rank-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
  background: #f2efe8;
}
.rank-1 .rank-badge { background: linear-gradient(140deg, #ffd66b, #f5a623); color: #5c3d00; box-shadow: 0 3px 8px rgba(245, 166, 35, .35); }
.rank-2 .rank-badge { background: linear-gradient(140deg, #e8ebf1, #b9c0cd); color: #3e4552; }
.rank-3 .rank-badge { background: linear-gradient(140deg, #ffcfae, #d9925f); color: #5c3517; }

.player-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #38bdf8, #0d9488);
  flex: 0 0 auto;
}
.player-name {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-sub { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.score-cell { text-align: right; }
.score-num { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.score-num small { font-size: 10.5px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.score-bar {
  height: 4px;
  width: 74px;
  margin-left: auto;
  margin-top: 5px;
  background: #efecE4;
  border-radius: 999px;
  overflow: hidden;
}
.score-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #14b8a6, #0ea5e9); }

.board-empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }
.board-note { font-size: 11.5px; color: #9692a6; line-height: 1.6; margin: 12px 2px 10px; }

/* ---------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 80;
  max-width: min(90vw, 480px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------- kelas 2 */

.subject-body h3 { font-size: 16.5px; }
.subject-body p { font-size: 13.5px; }
.q-text { font-size: clamp(19px, 2.5vw, 23px); }
.option { font-size: 16px; padding: 16px; }
.option .letter { width: 30px; height: 30px; font-size: 13px; }
.hero-sub { font-size: clamp(16px, 2vw, 18px); }
.badge { font-size: 13px; }
.footnote { font-size: 13px; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 640px) {
  .topbar {
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-bottom: 10px;
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
  }
  main { padding-bottom: calc(44px + env(safe-area-inset-bottom)); }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 13.5px; }
  .topbar .btn-ghost { padding: 9px 12px; font-size: 12.5px; }
  .hero { padding-top: 20px; padding-bottom: 16px; }
  .hero h1 { font-size: clamp(29px, 8.4vw, 38px); margin: 14px 0 12px; }
  .hero-sub { font-size: 14px; line-height: 1.6; margin-bottom: 14px; }
  .hero-badges { gap: 6px; }
  .badge { font-size: 11.5px; padding: 5px 9px; }
  .name-panel { padding: 16px 16px 14px; }
  .picker-head { align-items: flex-start; margin-top: 30px; }
  .count-block { width: 100%; justify-content: space-between; }
  .segmented button { min-height: 40px; padding: 10px 14px; }
  .chip { display: inline-flex; align-items: center; min-height: 40px; padding: 10px 14px; }
  .subject-grid { grid-template-columns: 1fr; }
  .question-card { border-radius: 18px; }
  .q-action .btn { width: 100%; }
  .feedback .btn { width: 100%; }
  .quiz-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
  .kbd-hint { display: none; }
  .result-actions .btn { flex: 1 1 100%; }
  .score-ring { width: 148px; height: 148px; }
  .score-ring-inner strong { font-size: 36px; }
  .board-row, .board-item { grid-template-columns: 38px minmax(0, 1fr) 78px; padding-left: 14px; padding-right: 14px; }
  .board-row-head { padding-left: 14px; padding-right: 14px; }
  .player-sub { display: none; }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
}

@media (max-width: 400px) {
  .q-head { flex-wrap: wrap; }
  .q-category { max-width: 58%; font-size: 9.5px; }
  .q-number { white-space: nowrap; }
  .quiz-top { row-gap: 6px; }
  .subject-chip { max-width: 200px; }
}

@media (max-width: 360px) {
  .topbar { gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-text strong { font-size: 12.5px; }
  .topbar .btn-ghost { padding: 8px 10px; font-size: 12px; }
  .hero-sub { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
