:root {
  --bg-top: #eef8ff;
  --bg-bottom: #fff9ea;
  --surface: #ffffff;
  --surface-soft: #f6fbff;
  --ink: #1e293b;
  --ink-muted: #475569;
  --border: #cbd5e1;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-soft: #e0f2fe;
  --accent: #f59e0b;
  --accent-dark: #b45309;
  --accent-soft: #fef3c7;
  --good: #15803d;
  --good-bg: #dcfce7;
  --good-border: #22c55e;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --warn-border: #f59e0b;
  --focus-ring: #db2777;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 10px 26px rgba(15, 23, 42, 0.08);
  --font-main: "Nunito", "Fredoka", "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(56, 189, 248, 0.22), transparent 34%),
    radial-gradient(circle at 92% 14%, rgba(251, 191, 36, 0.24), transparent 34%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  line-height: 1.5;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 200;
  background: var(--ink);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  width: min(1260px, 100% - 24px);
  margin: 0 auto;
  padding: 16px 0 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.site-header {
  background: var(--surface);
  border: 2px solid #dbeafe;
  border-bottom: 6px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 320px;
}

.school-badge {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.28);
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(1.05rem, 1.9vw, 1.42rem);
  font-weight: 900;
  color: #0f172a;
  line-height: 1.25;
}

.brand-subtitle {
  margin: 3px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.chapter-select {
  min-height: 48px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 2px solid #93c5fd;
  border-bottom-width: 5px;
  background: #f8fafc;
  font-weight: 800;
  font-size: 0.94rem;
  color: #0c4a6e;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  border-bottom-width: 5px;
  background: var(--surface);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
  text-align: center;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 0.9rem;
  border-bottom-width: 4px;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary-dark);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #0369a1;
}

.btn-accent {
  background: #fbbf24;
  border-color: #d97706;
  color: #1e293b;
}

.btn-accent:hover:not(:disabled) {
  background: #f59e0b;
}

.btn-good {
  background: #22c55e;
  border-color: #15803d;
  color: #ffffff;
}

.btn-good:hover:not(:disabled) {
  background: #16a34a;
}

.btn-danger {
  background: #fb7185;
  border-color: #be123c;
  color: #ffffff;
}

.btn-soft {
  background: var(--surface-soft);
  border-color: #bae6fd;
  color: #0c4a6e;
}

.btn[aria-pressed="true"].btn-toggle-mute {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.btn[aria-pressed="true"].btn-toggle-active {
  background: var(--primary);
  border-color: var(--primary-dark);
  color: #ffffff;
}

.btn-lg {
  min-height: 56px;
  padding: 12px 24px;
  font-size: 1.12rem;
}

/* Scoreboard Bar (Projector Mode) */
.scoreboard-bar {
  background: var(--surface);
  border: 2px solid #fde68a;
  border-bottom: 6px solid #fcd34d;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-card);
}

.scoreboard-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.scoreboard-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
  color: #0f172a;
}

.scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.team-card {
  border-radius: 18px;
  padding: 12px 14px;
  border: 2.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-card.team-a {
  background: #e0f2fe;
  border-color: #38bdf8;
}

.team-card.team-b {
  background: #fef3c7;
  border-color: #fbbf24;
}

.team-card.team-c {
  background: #dcfce7;
  border-color: #4ade80;
}

.team-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-name-input {
  width: 124px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  padding: 2px 6px;
  font-weight: 900;
  font-size: 0.95rem;
  color: #0f172a;
}

.team-name-input:hover,
.team-name-input:focus {
  background: #ffffff;
  border-color: #94a3b8;
}

.team-score {
  font-size: 1.45rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
}

.team-score.is-pop {
  animation: score-pop 0.28s ease;
}

@keyframes score-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.team-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Main Navigation */
.module-nav {
  background: var(--surface);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-card);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.nav-btn {
  width: 100%;
  min-height: 60px;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  border-bottom-width: 4px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
  background: #eff6ff;
  border-color: #93c5fd;
}

.nav-btn[aria-current="page"] {
  background: linear-gradient(180deg, #0ea5e9, #0284c7);
  border-color: #0369a1;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.28);
}

.nav-icon {
  font-size: 1.35rem;
  line-height: 1;
}

/* Main Panel */
.stage-card {
  background: var(--surface);
  border: 2px solid #e2e8f0;
  border-bottom: 6px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2.5vw, 28px);
  box-shadow: var(--shadow-card);
  min-height: 480px;
}

.module-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px dashed #e2e8f0;
}

.module-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-desc {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 0.98rem;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pill-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: #0c4a6e;
  font-weight: 900;
  border: 2px solid #bae6fd;
}

/* Artwork Frame */
.art-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid rgba(15, 23, 42, 0.08);
  display: grid;
  place-items: center;
  position: relative;
}

.art-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-frame svg {
  width: 100%;
  height: 100%;
}

/* Hobby Flashcard Grid */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.hobby-card {
  position: relative;
  background: var(--card-bg, #f8fafc);
  border: 3px solid var(--card-border, #cbd5e1);
  border-bottom-width: 7px;
  border-radius: 22px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: transform 0.14s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.hobby-card:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.hobby-card.is-active {
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.35), 0 12px 24px rgba(2, 132, 199, 0.18);
  transform: translateY(-4px) scale(1.01);
}

.hobby-card.is-speaking {
  animation: card-bounce 0.55s ease;
}

@keyframes card-bounce {
  0%, 100% { transform: translateY(-4px) scale(1.01); }
  40% { transform: translateY(-9px) scale(1.03); }
}

.hobby-card .art-frame {
  max-width: 176px;
}

.hobby-label-en {
  font-size: clamp(1.12rem, 1.8vw, 1.35rem);
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
}

.hobby-label-id {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.speak-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  font-size: 0.85rem;
  font-weight: 800;
  color: #0369a1;
}

/* Explore Spotlight */
.spotlight-box {
  margin-top: 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #fefce8 100%);
  border: 2px solid #bae6fd;
  border-radius: 22px;
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.spotlight-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 280px;
}

.spotlight-info .art-frame {
  width: 92px;
  flex-shrink: 0;
}

.spotlight-sentence {
  margin: 0;
  font-size: clamp(1.25rem, 2.3vw, 1.7rem);
  font-weight: 900;
  color: #0c4a6e;
}

.spotlight-sub {
  margin: 4px 0 0;
  font-weight: 700;
  color: var(--ink-muted);
}

/* Pass the Ball + Countdown Timer */
.pass-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}

.spinner-arena {
  position: relative;
  background: radial-gradient(circle at center, #ffffff 0%, #f0f9ff 100%);
  border: 3px solid #bae6fd;
  border-radius: 24px;
  padding: 18px;
}

.ball-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 900;
  font-size: 1.08rem;
  color: #0369a1;
}

.bouncing-ball {
  display: inline-block;
  font-size: 1.8rem;
  transition: transform 0.15s ease;
}

.bouncing-ball.is-spinning {
  animation: ball-hop 0.32s infinite alternate ease-in-out;
}

@keyframes ball-hop {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-8px) rotate(18deg); }
}

.spinner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.spinner-slot {
  border: 3px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.spinner-slot .art-frame {
  max-width: 112px;
}

.spinner-slot.is-highlighted {
  border-color: #f59e0b;
  background: #fef3c7;
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.32);
}

.spinner-slot.is-winner {
  border-color: #16a34a;
  background: #dcfce7;
  transform: scale(1.06);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.35);
}

.spinner-slot-name {
  font-weight: 900;
  font-size: 0.95rem;
  color: #0f172a;
}

.pass-controls {
  background: #fffbeb;
  border: 3px solid #fde68a;
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.big-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.timer-widget {
  background: #ffffff;
  border: 2px solid #fde68a;
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timer-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: #0369a1;
  min-width: 68px;
  text-align: right;
}

.timer-widget.is-warning .timer-value {
  color: #d97706;
}

.timer-widget.is-danger .timer-value,
.timer-widget.is-done .timer-value {
  color: #be123c;
}

.timer-bar-track {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  width: var(--timer-pct, 100%);
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  border-radius: 999px;
  transition: width 0.25s linear, background 0.2s ease;
}

.timer-widget.is-warning .timer-bar-fill {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.timer-widget.is-danger .timer-bar-fill,
.timer-widget.is-done .timer-bar-fill {
  background: linear-gradient(90deg, #fb7185, #e11d48);
}

.prompt-bubble {
  background: #ffffff;
  border: 2px solid #bae6fd;
  border-radius: 18px;
  padding: 14px 16px;
}

.prompt-bubble-tag {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0284c7;
  margin-bottom: 4px;
}

.prompt-bubble-text {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.5rem);
  font-weight: 900;
  color: #0f172a;
}

/* Listen & Check + Quiz Cards */
.audio-prompt-card {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
  border: 2px solid #bae6fd;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.options-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.option-pic-card {
  background: #ffffff;
  border: 3px solid #cbd5e1;
  border-bottom-width: 7px;
  border-radius: 20px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.option-pic-card:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: #38bdf8;
  background: #f0f9ff;
}

.option-pic-card.is-correct {
  border-color: var(--good-border);
  background: var(--good-bg);
}

.option-pic-card.is-wrong {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  opacity: 0.72;
  animation: gentle-shake 0.35s ease;
}

@keyframes gentle-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Dialogue Layout */
.dialogue-stage {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 20px;
  align-items: stretch;
}

.dialogue-character-card {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  border: 2px solid #bfdbfe;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.character-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.character-avatar {
  width: 82px;
  height: 82px;
  flex-shrink: 0;
}

.speech-bubble {
  position: relative;
  background: #ffffff;
  border: 2.5px solid #38bdf8;
  border-radius: 18px;
  padding: 12px 16px;
  text-align: left;
  flex: 1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
}

.dialogue-clue-img {
  width: 196px;
  max-width: 100%;
}

.dialogue-answer-card {
  background: #fffdf5;
  border: 2px solid #fde68a;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.sentence-fill-box {
  background: #ffffff;
  border: 2.5px dashed #f59e0b;
  border-radius: 18px;
  padding: 18px;
  font-size: clamp(1.3rem, 2.3vw, 1.8rem);
  font-weight: 900;
  color: #0f172a;
  text-align: center;
}

.sentence-blank {
  display: inline-block;
  min-width: 150px;
  padding: 2px 14px;
  margin: 0 4px;
  border-radius: 12px;
  background: #fef3c7;
  border-bottom: 4px solid #d97706;
  color: #b45309;
}

.sentence-blank.is-filled {
  background: #dcfce7;
  border-bottom-color: #15803d;
  color: #15803d;
}

.chips-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.word-chip-btn {
  min-height: 58px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 2.5px solid #cbd5e1;
  border-bottom-width: 6px;
  background: #ffffff;
  font-size: 1.08rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.word-chip-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #0284c7;
  background: #f0f9ff;
}

.word-chip-btn.is-correct {
  background: var(--good-bg);
  border-color: var(--good-border);
  color: #14532d;
}

.word-chip-btn.is-wrong {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: #78350f;
  animation: gentle-shake 0.35s ease;
}

/* Mini Wheel of Names */
.wheel-card {
  margin-top: 22px;
  background: linear-gradient(135deg, #fffbeb 0%, #f0f9ff 100%);
  border: 2.5px solid #fde68a;
  border-radius: 22px;
  padding: 18px 20px;
}

.wheel-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
  align-items: start;
  margin-top: 12px;
}

.wheel-textarea {
  width: 100%;
  min-height: 112px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  font-weight: 700;
  resize: vertical;
}

.wheel-stage {
  background: #ffffff;
  border: 2px solid #bae6fd;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wheel-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wheel-slot {
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  border: 2.5px solid #cbd5e1;
  background: #f8fafc;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.wheel-slot.slot-adik {
  background: #e0f2fe;
  border-color: #38bdf8;
}

.wheel-slot.slot-kakak {
  background: #fef3c7;
  border-color: #fbbf24;
}

.wheel-slot.is-spinning {
  animation: wheel-pulse 0.2s infinite alternate ease-in-out;
}

.wheel-slot.is-picked {
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.16);
}

@keyframes wheel-pulse {
  from { transform: scale(0.98); }
  to { transform: scale(1.03); }
}

.wheel-role-label {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.wheel-student-name {
  margin-top: 4px;
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Class Practice Dialogue Script */
.class-script-card {
  margin-top: 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
  border: 2.5px solid #bae6fd;
  border-radius: 22px;
  padding: 20px;
}

.class-script-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px dashed #bae6fd;
}

.class-script-title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 900;
  color: #0c4a6e;
}

.class-script-sub {
  margin: 3px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.script-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.script-select-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
  flex: 1 1 190px;
}

.script-select-label {
  font-size: 0.85rem;
  font-weight: 900;
  color: #334155;
}

.script-select {
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 2px solid #93c5fd;
  background: #ffffff;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
}

.script-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.script-line {
  background: #ffffff;
  border: 2px solid #dbeafe;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.script-line.is-playing {
  background: #fef9c3;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  transform: translateX(4px);
}

.script-line-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.script-role-badge {
  flex-shrink: 0;
  min-width: 124px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

.role-adik {
  background: #e0f2fe;
  border: 1.5px solid #38bdf8;
  color: #0369a1;
}

.role-kakak {
  background: #fef3c7;
  border: 1.5px solid #fbbf24;
  color: #b45309;
}

.role-both {
  background: #dcfce7;
  border: 1.5px solid #4ade80;
  color: #15803d;
}

.script-text-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: clamp(1rem, 1.8vw, 1.16rem);
  font-weight: 800;
  color: #0f172a;
}

.script-btn-col {
  flex-shrink: 0;
}

.script-line-btn {
  min-width: 48px;
  min-height: 48px;
  padding: 6px 12px;
}

/* Mini-Games */
.subtab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.subtab-btn {
  min-height: 50px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 2.5px solid #cbd5e1;
  border-bottom-width: 5px;
  background: #f8fafc;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
}

.subtab-btn[aria-selected="true"] {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
}

/* Sentence Builder */
.builder-stage {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

.builder-clue {
  background: #f0f9ff;
  border: 2px solid #bae6fd;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.builder-clue .art-frame {
  max-width: 196px;
}

.builder-workspace {
  background: #fffdf5;
  border: 2px solid #fde68a;
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sentence-slots {
  min-height: 80px;
  background: #ffffff;
  border: 2.5px dashed #f59e0b;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.word-tile {
  min-height: 52px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 2.5px solid #93c5fd;
  border-bottom-width: 5px;
  background: #ffffff;
  font-weight: 900;
  font-size: 1.15rem;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.word-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #e0f2fe;
}

.word-tile.is-placed {
  background: #fef3c7;
  border-color: #f59e0b;
}

.word-tile.is-locked-dot {
  background: #f1f5f9;
  border-color: #cbd5e1;
  cursor: default;
}

/* Memory Match */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.memory-card {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.36s ease;
  transform-style: preserve-3d;
}

.memory-card.is-flipped .memory-card-inner,
.memory-card.is-matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  border: 3px solid #cbd5e1;
  border-bottom-width: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
}

.memory-front {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  border-color: #0369a1;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
}

.memory-back {
  background: #ffffff;
  border-color: #93c5fd;
  transform: rotateY(180deg);
}

.memory-card.is-matched .memory-back {
  background: #dcfce7;
  border-color: #22c55e;
}

.memory-back .art-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.memory-word {
  font-size: clamp(1.05rem, 1.8vw, 1.32rem);
  font-weight: 900;
  color: #0f172a;
}

/* Feedback Banner */
.feedback-banner {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 18px;
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-good {
  background: var(--good-bg);
  border: 2px solid var(--good-border);
  color: #14532d;
}

.feedback-try {
  background: var(--warn-bg);
  border: 2px solid var(--warn-border);
  color: #78350f;
}

.feedback-info {
  background: var(--primary-soft);
  border: 2px solid #7dd3fc;
  color: #0c4a6e;
}

/* Quiz Progress & Results */
.progress-track {
  width: 100%;
  height: 14px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  width: var(--progress-pct, 0%);
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.result-hero {
  position: relative;
  text-align: center;
  padding: 24px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fef9c3 0%, #e0f2fe 55%, #dcfce7 100%);
  border: 3px solid #fde047;
  margin-bottom: 20px;
  overflow: hidden;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 150;
}

.score-circle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: #ffffff;
  border: 6px solid #f59e0b;
  margin: 10px auto;
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.22);
}

.score-number {
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1;
  color: #0f172a;
}

.score-max {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink-muted);
}

.mastery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 20px;
}

.mastery-item {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
}

.badge-mastered {
  background: #dcfce7;
  color: #166534;
}

.badge-practice {
  background: #fef3c7;
  color: #92400e;
}

/* Mood Check */
.mood-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px 18px;
}

.field-label {
  display: block;
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: #0f172a;
}

.text-input {
  width: min(440px, 100%);
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 2px solid #94a3b8;
  background: #ffffff;
  font-size: 1.02rem;
  font-weight: 700;
}

.mood-choices-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.mood-btn {
  min-height: 68px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 2.5px solid #cbd5e1;
  border-bottom-width: 5px;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 800;
  font-size: 0.92rem;
  text-align: center;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.mood-btn:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}

.mood-btn[aria-pressed="true"] {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0c4a6e;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.22);
}

.mood-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.vocab-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.vocab-pick-btn {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid #cbd5e1;
  border-bottom-width: 4px;
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.vocab-pick-btn[aria-pressed="true"] {
  background: #fef3c7;
  border-color: #d97706;
  color: #78350f;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

/* Reflection Certificate */
.certificate-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 50%, #fffbeb 100%);
  border: 4px solid #0284c7;
  outline: 4px dashed #fbbf24;
  outline-offset: -12px;
  border-radius: 24px;
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 0 14px 30px rgba(2, 132, 199, 0.14);
}

.cert-header {
  text-align: center;
  border-bottom: 2px solid #bae6fd;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.cert-school {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cert-title {
  margin: 6px 0;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 900;
  color: #0f172a;
}

.cert-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cert-list li {
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.cert-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.cert-meta-box {
  background: #ffffff;
  border: 2px solid #fde68a;
  border-radius: 16px;
  padding: 12px 14px;
}

.site-footer {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-muted);
  padding-top: 4px;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .scoreboard-grid,
  .pass-layout,
  .dialogue-stage,
  .wheel-layout,
  .builder-stage {
    grid-template-columns: 1fr;
  }

  .options-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mastery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .hobby-grid,
  .spinner-grid,
  .vocab-pill-grid,
  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mood-choices-row,
  .cert-meta-grid,
  .mastery-grid,
  .chips-grid-2,
  .wheel-pair {
    grid-template-columns: 1fr;
  }

  .script-line {
    flex-wrap: wrap;
  }

  .script-line-main {
    flex-direction: column;
    gap: 6px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (pointer: coarse) {
  .btn,
  .nav-btn,
  .word-chip-btn,
  .vocab-pick-btn,
  .word-tile {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .site-header,
  .scoreboard-bar,
  .module-nav,
  .module-header,
  .no-print,
  .site-footer {
    display: none !important;
  }

  .stage-card {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}
