/* ===== Variabel & Base ===== */
:root {
  --bg: #0f1419;
  --bg-card: #1a2332;
  --bg-section: #151d28;
  --primary: #22c55e;
  --primary-dim: #16a34a;
  --accent: #f59e0b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --font-sans: 'Outfit', sans-serif;
  --font-ar: 'Amiri', serif;
  /* Tema "anak SD" untuk komponen (tanpa ubah background halaman) */
  --kid-radius: 16px;
  --kid-radius-pill: 999px;
  --kid-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  --kid-shadow-strong: 0 18px 44px rgba(0, 0, 0, 0.22);
  --kid-focus: 0 0 0 4px rgba(250, 204, 21, 0.45);
  --kid-primary-grad: linear-gradient(145deg, #22c55e 0%, #16a34a 45%, #0ea5e9 120%);
  --kid-warm-grad: linear-gradient(145deg, #f97316 0%, #facc15 55%, #fb7185 140%);
  /* Latar foto fullscreen (landing, role, nama, hub, materi SPD, media pembelajaran) */
  --page-bg-image: url("assets/bg1.png");
  --intro-bg-image: var(--page-bg-image);
  --hub-bg-image: var(--page-bg-image);
  --hub-bg-fallback: var(--page-bg-image);
  --materi-spd-bg-image: var(--page-bg-image);
  --materi-spd-bg-fallback: var(--page-bg-image);
  --mp-bg-image: var(--page-bg-image);
  --mp-bg-fallback: var(--page-bg-image);
  --intro-bg-overlay: linear-gradient(180deg,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0.06) 38%,
      rgba(15, 23, 42, 0.3) 72%,
      rgba(15, 23, 42, 0.52) 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: var(--page-bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  /* HP: cegah geser horizontal karena elemen fixed/animasi */
  overflow-x: hidden;
}

/* iOS/Android: tinggi viewport lebih stabil untuk elemen fixed */
.landing-page,
.role-page,
.name-page,
.hub-page,
.materi-spd-page {
  min-height: 100svh;
}

/* Utility Classes */
.is-hidden {
  display: none !important;
}

/* Student Profile Badge (Top Right) */
.header-right-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left-profile {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 18px;
  border-radius: 50px;
  border: 3px solid #fde68a;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: 0.3s;
}

.header-left-profile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.profile-icon {
  font-size: 1.3rem;
}

.profile-name {
  font-weight: 800;
  color: #1e293b;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1rem;
}

/* Custom Logout Popup */
.logout-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
}

.logout-card {
  background: white;
  width: 100%;
  max-width: 400px;
  border-radius: 40px;
  padding: 40px;
  text-align: center;
  border: 8px solid #fecaca;
  animation: cardShoot 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardShoot {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.logout-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  display: block;
}

.logout-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.8rem;
  color: #991b1b;
  margin-bottom: 10px;
}

.logout-text {
  color: #475569;
  font-weight: 600;
  margin-bottom: 30px;
}

.logout-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.btn-logout-confirm {
  background: #ef4444;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 20px;
  font-weight: 800;
  font-family: 'Baloo 2', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 0 #b91c1c;
}

.btn-logout-cancel {
  background: #f1f5f9;
  color: #475569;
  border: none;
  padding: 15px;
  border-radius: 20px;
  font-weight: 800;
  font-family: 'Baloo 2', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 0 #cbd5e1;
}

.logout-item {
  color: #ef4444 !important;
  border-top: 1px solid #f1f5f9;
  margin-top: 5px;
}

.logout-item:hover {
  background: #fef2f2 !important;
}

/* HP: background fixed sering patah di mobile, jadi ubah ke scroll (tanpa ubah gambar) */
@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }
}

/* Sembunyikan AI Widget di Halaman Utama & Map Login */
body:has(#landing-page:not(.is-hidden)) #global-help-root,
body:has(#login-map-page:not(.is-hidden)) #global-help-root {
  display: none !important;
}

/* Sentuhan HP: target tombol lebih nyaman */
button,
a.landing-link,
.btn-primary,
.btn-secondary,
.btn-masuk,
.btn-role,
.name-pill-submit {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.welcome-intro-active {
  overflow: hidden;
}

html.welcome-intro-skip #welcome-intro {
  display: none !important;
}

body:has(#landing-page:not(.is-hidden)),
body:has(#role-page:not(.is-hidden)),
body:has(#name-page:not(.is-hidden)),
body:has(#login-page:not(.is-hidden)),
body:has(#admin-page:not(.is-hidden)),
body:has(#hub-page:not(.is-hidden)),
body:has(#materi-spd-page:not(.is-hidden)) {
  overflow: hidden;
}

/* ===== Sambutan pembuka (maskot + narasi Islami) ===== */
.welcome-intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  overflow-y: auto;
  overflow-x: hidden;
}

@media (max-height: 600px) {
  .welcome-intro {
    align-items: flex-start;
  }
}

.welcome-intro-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 20%, rgba(34, 197, 94, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    linear-gradient(165deg, rgba(15, 23, 42, 0.97) 0%, rgba(30, 41, 59, 0.98) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.welcome-intro-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  text-align: center;
}

.welcome-mascot-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.welcome-mascot {
  width: min(200px, 52vw);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
  animation: mascotFloat 2.8s ease-in-out infinite;
}

@keyframes mascotFloat {

  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-12px) rotate(2deg);
  }
}

.welcome-mascot-body {
  animation: mascotPulse 2s ease-in-out infinite;
}

@keyframes mascotPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

.welcome-mascot-hand--L {
  animation: handWaveL 1.2s ease-in-out infinite;
  transform-origin: 54px 156px;
}

.welcome-mascot-hand--R {
  animation: handWaveR 1.2s ease-in-out infinite 0.15s;
  transform-origin: 146px 156px;
}

@keyframes handWaveL {

  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(-14deg);
  }
}

@keyframes handWaveR {

  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(14deg);
  }
}

.welcome-mascot-face {
  animation: faceNod 3s ease-in-out infinite;
  transform-origin: 100px 110px;
}

@keyframes faceNod {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(2px);
  }
}

.welcome-mascot-leaf {
  animation: leafGlow 2.5s ease-in-out infinite;
}

@keyframes leafGlow {

  0%,
  100% {
    opacity: 0.85;
  }

  50% {
    opacity: 1;
  }
}

.welcome-mascot-sparkle {
  position: absolute;
  top: 10%;
  right: 0;
  width: 36px;
  height: 36px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.95) 0%, transparent 70%);
  border-radius: 50%;
  animation: sparklePop 1.8s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.5);
}

@keyframes sparklePop {

  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.welcome-intro-ar {
  margin: 0 0 0.35rem;
  font-family: var(--font-ar);
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  color: #86efac;
  text-shadow: 0 0 24px rgba(34, 197, 94, 0.35);
}

.welcome-intro-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.02em;
}

.welcome-intro-text {
  margin: 0 0 1.25rem;
  min-height: 5.5em;
  font-size: clamp(0.92rem, 2.8vw, 1rem);
  line-height: 1.65;
  color: #cbd5e1;
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.welcome-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.btn-welcome {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, filter 0.2s;
}

.btn-welcome:active {
  transform: scale(0.98);
}

.btn-welcome--speak {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(34, 197, 94, 0.35);
}

.btn-welcome--speak:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-welcome--speak:disabled {
  opacity: 0.75;
  cursor: wait;
}

.btn-welcome--skip {
  background: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.btn-welcome--skip:hover {
  background: rgba(148, 163, 184, 0.38);
}

.welcome-intro-footnote {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
}

/* ===== Landing / menu utama ===== */
.landing-page {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background-color: #4a9fe0;
  background-image: var(--intro-bg-overlay), var(--intro-bg-image);
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.landing-page.is-hidden,
.role-page.is-hidden,
.name-page.is-hidden,
.hub-page.is-hidden,
.materi-spd-page.is-hidden {
  display: none !important;
}

/* ===== Transisi antar halaman (full-screen & app) ===== */
.landing-page,
.role-page,
.name-page,
.hub-page,
.materi-spd-page {
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.35s ease;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}

@media (max-height: 600px) {

  .landing-page,
  .role-page,
  .name-page,
  .hub-page,
  .materi-spd-page,
  .role-main,
  .name-main,
  .hub-main,
  .materi-spd-main {
    justify-content: flex-start !important;
  }
}

.app-root:not([hidden]) {
  display: block;
  min-height: 100vh;
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.35s ease;
}

.landing-page.page-anim-leave,
.role-page.page-anim-leave,
.name-page.page-anim-leave,
.hub-page.page-anim-leave,
.materi-spd-page.page-anim-leave,
.app-root.page-anim-leave:not([hidden]) {
  opacity: 0;
  transform: scale(0.985) translateY(-14px);
  filter: blur(6px);
  pointer-events: none;
}

@keyframes pageAnimEnter {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(28px);
    filter: blur(8px);
  }

  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

    .landing-page.page-anim-enter,
    .role-page.page-anim-enter,
    .name-page.page-anim-enter,
    .hub-page.page-anim-enter,
    .materi-spd-page.page-anim-enter,
    .app-root.page-anim-enter:not([hidden]) {
      animation: pageAnimEnter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }

    /* MOVING CLOUDS SYSTEM */
    .drifting-clouds {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 1;
      overflow: hidden;
      opacity: 0.4;
    }

    .drifting-cloud {
      position: absolute;
      background: white;
      filter: blur(40px);
      border-radius: 50%;
      animation: drift var(--duration) linear infinite;
    }

    @keyframes drift {
      from { transform: translateX(-20vw); }
      to { transform: translateX(120vw); }
    }

    /* CURSOR SPARKLE TRAIL */
    .cursor-sparkle {
      position: fixed;
      width: 10px;
      height: 10px;
      background: rgba(255, 255, 255, 0.8);
      border-radius: 50%;
      pointer-events: none;
      z-index: 100000;
      box-shadow: 0 0 10px #fff, 0 0 20px #fbc02d;
      animation: sparklePop 0.8s ease-out forwards;
    }

    @keyframes sparklePop {
      0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
      100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    }

@media (prefers-reduced-motion: reduce) {

  .landing-page,
  .role-page,
  .name-page,
  .hub-page,
  .materi-spd-page,
  .app-root:not([hidden]) {
    transition: none;
  }

  .landing-page.page-anim-enter,
  .role-page.page-anim-enter,
  .name-page.page-anim-enter,
  .hub-page.page-anim-enter,
  .materi-spd-page.page-anim-enter,
  .app-root.page-anim-enter:not([hidden]) {
    animation: none;
  }
}

/* ===== Halaman SISWA / GURU (Role Selection) ===== */
.role-page {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* Pastikan mulai dari atas */
  padding: 0;
  background: url('assets/bg1.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  height: 100vh;
  overflow: hidden; /* Tetap tanpa scroll */
}

.role-main {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3vh 20px; /* Gunakan vh agar adaptif dengan tinggi layar */
}

.role-selection-header {
  text-align: center;
  color: white;
  margin-bottom: 0px;
}

.role-selection-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0;
  text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.role-selection-subtitle {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.role-cards-container {
  display: flex;
  gap: 2rem;
  width: 100%;
  justify-content: center;
  perspective: 1000px;
}

.role-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 40px;
  padding: 40px 30px;
  width: 320px;
  text-align: center;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 6px solid transparent;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.role-card:hover {
  transform: translateY(-20px) scale(1.05) rotate(1deg);
}

.role-card--murid:hover {
  box-shadow: 0 30px 60px rgba(34, 197, 94, 0.4);
  border-color: #22c55e;
}

/* Prevent content cutoff on small screens without scroll */
@media (max-height: 800px) {
  .role-selection-title { font-size: 1.8rem; }
  .role-cards-container { gap: 1rem; }
  .role-card { padding: 25px 20px; width: 280px; }
  .role-card-icon { font-size: 3rem; margin-bottom: 10px; }
}

@media (max-height: 650px) {
  .role-main { gap: 1rem; }
  .role-selection-title { font-size: 1.5rem; }
  .role-card { padding: 15px 15px; width: 250px; }
  .role-card-icon { font-size: 2.5rem; }
}

.role-card::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: 0.6s;
}

.role-card:hover::before {
  top: 100%;
  left: 100%;
}

.role-card-icon {
  width: 140px;
  height: 140px;
  background: #f8fafc;
  border-radius: 50%;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.1);
}

.role-mascot-img {
  width: 80%;
  height: auto;
}

.teacher-mascot-svg {
  width: 100px;
  height: 100px;
}

.role-card-name {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 10px 0;
}

.role-card-desc {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 25px;
  line-height: 1.4;
  flex: 1;
}

.role-card-btn {
  width: 100%;
  padding: 15px;
  border-radius: 50px;
  border: none;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.role-card--murid .role-card-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 6px 0 #15803d;
}

.role-card--guru .role-card-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 6px 0 #0369a1;
}

.role-card-btn:active {
  transform: translateY(4px);
  box-shadow: none;
}

.btn-role-guides {
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.4rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  color: white;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.18);
  transition: transform 0.2s, filter 0.2s, background 0.2s;
}

.btn-role-guides:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn-role-guides:active {
  transform: translateY(2px);
}

.role-guides {
  width: 100%;
  max-width: 900px;
  margin-top: -0.5rem;
}

.role-guides-header {
  text-align: center;
  color: #fff;
  margin-bottom: 1rem;
}

.role-guides-title {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  text-shadow: 0 4px 15px rgba(0,0,0,0.45);
}

.role-guides-subtitle {
  margin: 0.25rem 0 0;
  font-weight: 500;
  opacity: 0.92;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.role-guides-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.role-guide {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  padding: 18px 18px 16px;
  border: 4px solid transparent;
  box-shadow: 0 18px 35px rgba(0,0,0,0.25);
  backdrop-filter: blur(10px);
}

.role-guide--murid {
  border-color: rgba(34, 197, 94, 0.75);
}

.role-guide--guru {
  border-color: rgba(14, 165, 233, 0.75);
}

.role-guide-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.role-guide-badge {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #0f172a;
  background: #e2e8f0;
}

.role-guide--murid .role-guide-badge {
  background: rgba(34, 197, 94, 0.16);
  color: #14532d;
}

.role-guide--guru .role-guide-badge {
  background: rgba(14, 165, 233, 0.16);
  color: #0c4a6e;
}

.role-guide-title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 900;
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1.2;
}

.role-guide-section {
  margin-top: 0.25rem;
}

.role-guide-subtitle {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 900;
  color: #0f172a;
  font-size: 0.98rem;
  margin: 0.2rem 0 0.55rem;
}

.role-guide-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
  font-weight: 600;
  line-height: 1.45;
}

.role-guide-steps li {
  margin: 0.35rem 0;
}

.role-guide-bullets {
  margin: 0;
  padding-left: 1.1rem;
  color: #334155;
  font-weight: 600;
  line-height: 1.45;
}

.role-guide-bullets li {
  margin: 0.35rem 0;
}

.role-guide-details {
  margin-top: 0.75rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.9);
  overflow: hidden;
}

.role-guide-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 0.85rem 0.95rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.role-guide-summary::-webkit-details-marker {
  display: none;
}

.role-guide-summary::before {
  content: "▸";
  display: inline-block;
  transform: translateY(-1px);
  color: rgba(15, 23, 42, 0.7);
}

details[open] > .role-guide-summary::before {
  content: "▾";
}

.role-guide-detail-body {
  padding: 0 0.95rem 0.95rem;
}

.role-guide-detail-body .role-guide-section + .role-guide-section {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

@media (max-width: 768px) {
  .role-cards-container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  
  .role-card {
    width: 100%;
    max-width: 320px;
    padding: 30px 20px;
  }

  .role-selection-title {
    font-size: 2.2rem;
  }

  .role-guides-grid {
    grid-template-columns: 1fr;
  }
}

.landing-header {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.landing-nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: min(1100px, 100%);
  padding: 0.55rem 1.1rem;
  background: rgba(26, 37, 51, 0.92);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.landing-logo {
  flex-shrink: 0;
  display: flex;
  color: #fff;
}

.landing-brand-text {
  font-size: clamp(0.65rem, 2.5vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landing-menu-toggle {
  display: none;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

.landing-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.landing-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.landing-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 0.5rem;
  width: 100%;
  max-width: 720px;
}

.landing-headline {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 6vw, 2.75rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.landing-ar-glow {
  padding: 0.65rem 1.5rem;
  margin: 0 0 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}

.landing-ar {
  margin: 0;
  font-family: var(--font-ar);
  font-size: clamp(1.1rem, 4vw, 1.65rem);
  font-weight: 700;
  color: #0f172a;
  line-height: 1.6;
}

.landing-quote {
  margin: 0 0 0.5rem;
  font-size: clamp(0.85rem, 2.8vw, 1rem);
  font-weight: 300;
  color: #f8fafc;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  line-height: 1.55;
  max-width: 38em;
}

.landing-ref {
  margin: 0;
  font-size: clamp(0.75rem, 2.2vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #e2e8f0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.landing-cta {
  flex-shrink: 0;
  padding-bottom: 0.25rem;
}

.btn-masuk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(280px, 88vw);
  min-height: 52px;
  padding: 0.85rem 2.5rem;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  background: #5a7c4a;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, background 0.2s, box-shadow 0.2s;
}

.btn-masuk:hover {
  background: #4d6a3f;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.btn-masuk:active {
  transform: translateY(0);
}

.btn-menu-materi {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid var(--primary);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-menu-materi:hover {
  background: rgba(34, 197, 94, 0.22);
  color: var(--primary);
}

.btn-menu-utama {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-menu-utama:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* Landing modals */
.landing-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 20, 25, 0.55);
  backdrop-filter: blur(4px);
}

.landing-modal {
  position: fixed;
  z-index: 10001;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 2rem));
  max-height: min(80vh, 480px);
  overflow: auto;
  padding: 1.5rem 1.75rem;
  background: #1a2332;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  color: var(--text);
}

.landing-modal[hidden] {
  display: none !important;
}

.landing-modal h2 {
  margin: 0 0 0.75rem;
  padding-right: 2rem;
  font-size: 1.2rem;
  color: var(--primary);
}

.admin-student-modal .name-pill-field {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.admin-student-sub {
  margin-top: -0.25rem;
  margin-bottom: 0.9rem;
  color: var(--text-muted);
}

/* ===== Intro Guru (animasi + dialog) ===== */
.guru-intro[hidden] {
  display: none !important;
}

.guru-intro {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  overflow-y: auto;
  overflow-x: hidden;
}

@media (max-height: 600px) {
  .guru-intro {
    align-items: flex-start;
  }
}

.guru-intro-bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.guru-intro-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 2rem));
  background: linear-gradient(165deg, rgba(26, 35, 50, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.45);
  padding: 1.1rem 1.2rem 1rem;
  overflow: hidden;
}

.guru-intro-top {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.guru-intro-title {
  margin: 0;
  font-size: 1.25rem;
  color: #fff;
}
/* ===== BALANCED PROPORTIONS MAP PAGE ===== */
.login-map-page {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  width: 100% !important;
  background: #0f1419 !important; /* Base Dark */
  overflow: hidden !important;
}

.login-map-page .new-header {
  position: relative !important;
  background: #1e293b !important;
  z-index: 100;
  flex-shrink: 0;
}

.login-map-main {
  flex: 1;
  position: relative;
  width: 100%;
  overflow-y: auto !important; /* Allow scroll if content is long */
  overflow-x: hidden;
  display: block;
  background: #0d1117;
}

.login-map-content {
  position: relative;
  width: 100%;
  min-height: 100%;
}

.map-image-container {
  width: 100%;
  display: block;
}

.map-render-area {
  position: relative;
  width: 100%;
  max-width: 100vw;
}

.map-img-asset {
  display: block;
  width: 100%;
  height: auto !important; /* Scale naturally */
  max-width: 100%;
  object-fit: contain;
}

.map-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-pin {
  pointer-events: auto;
}

/* Smaller Floating Sidebar */
.login-map-sidebar {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 220px; /* Reduced width */
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-radius: 20px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 50;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.sidebar-title {
  color: #fff !important;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.2rem !important; /* Smaller text */
  margin-bottom: 10px !important;
}

.login-map-form p {
  font-size: 0.8rem !important;
  margin-bottom: 10px !important;
}

/* Smaller Digital Pins */
.map-pin {
  position: absolute !important;
  width: 44px !important; /* Reduced size */
  height: 44px !important;
  border-radius: 50% !important;
  border: 3px solid #fff !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800 !important;
  font-size: 1.15rem !important;
  color: white !important;
  cursor: pointer;
  z-index: 60;
  animation: pinPulse 2s infinite;
}

/* Pin Positions Locked to the Image Boundary */
.pin-pos-1 { top: 29%; left: 10%; background: #3b82f6 !important; }
.pin-pos-2 { top: 64%; left: 35%; background: #06b6d4 !important; }
.pin-pos-3 { top: 50%; left: 51%; background: #f59e0b !important; }
.pin-pos-4 { top: 58%; left: 67%; background: #ec4899 !important; }
.pin-pos-5 { top: 29%; left: 76%; background: #8b5cf6 !important; }

@keyframes pinPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

@media (max-width: 768px) {
  .login-map-sidebar {
    width: calc(100% - 30px);
    top: 5px;
    left: 15px;
  }
}
.guru-intro-sub {
  margin: 0.2rem 0 0;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.9rem;
}

.guru-intro-text {
  margin: 0.85rem 0 0;
  color: rgba(226, 232, 240, 0.92);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 4.2em;
}

.guru-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.guru-intro-footnote {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.9);
}

/* Mascot guru sederhana (animasi) */
.guru-intro-mascot {
  width: 86px;
  height: 86px;
  position: relative;
  flex-shrink: 0;
}

.guru-intro-avatar {
  width: 86px;
  height: 86px;
  display: block;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.22));
}

.gi-body {
  animation: guruFloat 2.4s ease-in-out infinite;
  transform-origin: 60px 96px;
}

.gi-face {
  transform-origin: 60px 52px;
  animation: faceNod 3s ease-in-out infinite;
}

.gi-eye {
  transform-origin: center;
  animation: guruBlink 4.2s infinite;
}

.gi-sparkle {
  transform-origin: 98px 18px;
  animation: guruSpark 2.1s ease-in-out infinite;
}

.guru-mascot-head {
  position: absolute;
  inset: 8px 14px auto 14px;
  height: 44px;
  border-radius: 18px;
  background: linear-gradient(145deg, #fde68a, #fca5a5);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.guru-mascot-hair {
  position: absolute;
  top: -8px;
  left: 8px;
  right: 8px;
  height: 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
}

.guru-mascot-face {
  position: absolute;
  inset: 0;
}

.guru-mascot-eye {
  position: absolute;
  top: 18px;
  width: 10px;
  height: 12px;
  border-radius: 999px;
  background: #0f172a;
  animation: guruBlink 4.2s infinite;
}

.guru-mascot-eye--l {
  left: 16px;
}

.guru-mascot-eye--r {
  right: 16px;
  animation-delay: 0.25s;
}

@keyframes guruBlink {

  0%,
  94%,
  100% {
    transform: scaleY(1);
  }

  96% {
    transform: scaleY(0.12);
  }
}

.guru-mascot-mouth {
  position: absolute;
  top: 33px;
  left: 50%;
  width: 18px;
  height: 8px;
  transform: translateX(-50%);
  border-bottom: 3px solid #0f172a;
  border-radius: 0 0 999px 999px;
}

.guru-mascot-body {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 52px;
  height: 30px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.9), rgba(14, 165, 233, 0.85));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2);
  animation: guruFloat 2.4s ease-in-out infinite;
}

.guru-mascot-sparkle {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.guru-mascot-sparkle::before,
.guru-mascot-sparkle::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(145deg, #fde047, #fb7185);
  transform: rotate(45deg);
  opacity: 0;
  animation: guruSpark 2.1s ease-in-out infinite;
}

.guru-mascot-sparkle::before {
  top: 6px;
  right: 8px;
  animation-delay: 0.2s;
}

.guru-mascot-sparkle::after {
  bottom: 10px;
  left: 6px;
  animation-delay: 1.0s;
}

@keyframes guruFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes guruSpark {
  0% {
    opacity: 0;
    transform: translateY(6px) rotate(45deg) scale(0.6);
  }

  18% {
    opacity: 1;
    transform: translateY(0) rotate(45deg) scale(1);
  }

  70%,
  100% {
    opacity: 0;
    transform: translateY(-8px) rotate(45deg) scale(0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  .guru-mascot-body {
    animation: none;
  }

  .guru-mascot-eye {
    animation: none;
  }

  .guru-mascot-sparkle::before,
  .guru-mascot-sparkle::after {
    animation: none;
    opacity: 0;
  }

  .gi-body,
  .gi-face,
  .gi-eye,
  .gi-sparkle {
    animation: none;
  }
}

.landing-modal p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ===== Modal Pendahuluan ===== */
.landing-modal--intro {
  width: min(860px, calc(100vw - 2rem));
  max-height: min(82vh, 720px);
}

.intro-block {
  margin-top: 0.85rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.intro-card {
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.intro-h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  color: #e2e8f0;
}

.intro-p {
  margin: 0;
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.92rem;
}

.intro-ul {
  margin: 0;
  padding-left: 1.15rem;
  color: rgba(226, 232, 240, 0.88);
  line-height: 1.55;
  font-size: 0.92rem;
}

.intro-ul li {
  margin: 0.25rem 0;
}

.intro-infogrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.55rem;
}

.intro-info {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.intro-ico {
  font-size: 1.35rem;
  line-height: 1;
}

.intro-info strong {
  color: #fff;
}

.intro-info span {
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.88rem;
}

@media (max-width: 720px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .intro-infogrid {
    grid-template-columns: 1fr;
  }
}

.landing-modal-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.landing-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.landing-modal-close:hover {
  color: var(--text);
  background: var(--bg-section);
}

@media (max-width: 768px) {
  .landing-nav-pill {
    flex-wrap: wrap;
    border-radius: 16px;
    padding: 0.5rem 0.85rem;
  }

  .landing-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .landing-brand-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .landing-menu-toggle {
    display: flex;
  }

  .landing-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0.25rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .landing-links.is-open {
    display: flex;
  }

  .landing-link {
    width: 100%;
    text-align: left;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .landing-headline {
    font-size: clamp(1.35rem, 7vw, 1.85rem);
  }

  .btn-masuk {
    min-height: 48px;
    font-size: 0.95rem;
  }

  /* tombol & input lebih nyaman di HP */
  .btn-primary,
  .btn-secondary,
  .btn-role,
  .name-pill-submit,
  .btn-flip {
    min-height: 48px;
  }

  .name-pill-input,
  .global-help-input {
    min-height: 46px;
    font-size: 16px;
    /* cegah iOS auto-zoom */
  }

  .welcome-intro-inner {
    width: min(520px, calc(100vw - 1.25rem));
  }

  .guru-intro-card {
    width: min(720px, calc(100vw - 1.25rem));
  }

  .global-help-panel {
    max-height: 74svh;
  }
}

/* ===== Halaman input nama ===== */
.name-page {
  position: fixed;
  inset: 0;
  z-index: 195;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background-color: #4a9fe0;
  background-image: var(--intro-bg-overlay), var(--intro-bg-image);
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

/* Login page memakai layout name-page; hanya beda kecil */
.login-page .name-pill-label {
  font-size: clamp(0.9rem, 3.2vw, 1.15rem);
}

.login-page .name-pill-input {
  letter-spacing: 0.01em;
}

.login-title-wrap {
  width: 100%;
  max-width: 520px;
  text-align: center;
  margin: 0 0 0.75rem;
}

.login-title {
  margin: 0;
  font-size: 1.35rem;
  color: #fff;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.login-sub {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 0.9rem;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.admin-page .admin-card {
  width: 100%;
  max-width: 560px;
  background: rgba(15, 23, 42, 0.55);
  border: 2px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.admin-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: #fff;
}

.admin-sub {
  margin: 0 0 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  line-height: 1.4;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
}

.admin-select-label {
  flex-shrink: 0;
  font-size: clamp(0.9rem, 3.2vw, 1.15rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
}

.admin-select {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 14px;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-sans);
  font-weight: 800;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  outline: none;
}

.admin-note {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.admin-divider {
  height: 1px;
  margin: 1rem 0 0.85rem;
  background: rgba(148, 163, 184, 0.18);
}

.admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-start;
}

.admin-list {
  margin-top: 0.9rem;
}

.admin-list-title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  color: #fff;
}

.admin-search-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  border: 2px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
}

.admin-search-label {
  font-size: 0.85rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.03em;
}

.admin-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  font-family: var(--font-sans);
  font-weight: 800;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
}

.admin-search-input::placeholder {
  color: rgba(148, 163, 184, 0.9);
}

.admin-table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 14px;
  border: 2px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.admin-table th,
.admin-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
  vertical-align: top;
}

.admin-table th {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.85);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.92);
}

.admin-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.admin-action-btn {
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  border: 2px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-sans);
  font-weight: 800;
  cursor: pointer;
}

.admin-action-btn:hover {
  border-color: rgba(250, 204, 21, 0.55);
  transform: translateY(-1px);
}

.name-main {
  flex: 1;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem;
}

.name-form-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.name-pill-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 56px;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(180deg, #92b82e 0%, #82ac25 45%, #6d8f1f 100%);
  border: none;
  border-radius: 50px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.name-pill-label {
  flex-shrink: 0;
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
}

.name-pill-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  font-weight: 600;
  outline: none;
}

.name-pill-input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.name-guru-code-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.name-guru-code-wrap[hidden] {
  display: none !important;
}

.name-pill-field--code {
  background: linear-gradient(180deg, #6b8f2a 0%, #5a7a22 45%, #4a6518 100%);
}

.name-guru-code-help {
  margin: 0;
  padding: 0 0.35rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.name-pill-submit {
  width: 100%;
  min-height: 56px;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(180deg, #92b82e 0%, #82ac25 45%, #6d8f1f 100%);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  transition: filter 0.2s, transform 0.15s;
}

.name-pill-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.name-hint {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: #fecaca;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* ===== Menu hub (awan) setelah nama ===== */
.hub-page {
  position: fixed;
  inset: 0;
  z-index: 187;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(0.65rem, env(safe-area-inset-top)) max(0.85rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(0.85rem, env(safe-area-inset-left));
  background: #4a7ab0;
  overflow: hidden;
}

.hub-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #3d6a9e;
  background-image:
    linear-gradient(180deg, rgba(135, 180, 220, 0.32) 0%, rgba(25, 45, 75, 0.42) 55%, rgba(15, 30, 50, 0.52) 100%),
    var(--hub-bg-image),
    var(--hub-bg-fallback);
  background-size: cover;
  background-position: center 38%;
  background-repeat: no-repeat;
}

.hub-deco {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.42;
  filter: blur(0.5px);
}

.hub-deco--left {
  width: min(42vw, 220px);
  height: min(42vw, 220px);
  left: -8%;
  top: 28%;
  background: radial-gradient(circle at 40% 40%, rgba(139, 90, 43, 0.55) 0%, rgba(60, 40, 25, 0.35) 45%, transparent 70%);
  box-shadow: inset 0 0 40px rgba(255, 248, 220, 0.15);
}

.hub-deco--right {
  width: min(38vw, 200px);
  height: min(38vw, 200px);
  right: -6%;
  top: 32%;
  background: radial-gradient(circle at 55% 45%, rgba(40, 70, 120, 0.5) 0%, rgba(20, 45, 85, 0.4) 50%, transparent 72%);
  box-shadow: inset 0 0 36px rgba(255, 255, 255, 0.12);
}

.hub-cloud-float {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
  filter: blur(1px);
}

.hub-cloud-float--1 {
  width: clamp(48px, 12vw, 90px);
  height: clamp(36px, 9vw, 70px);
  top: 22%;
  left: 18%;
  transform: rotate(-8deg);
}

.hub-cloud-float--2 {
  width: clamp(56px, 14vw, 100px);
  height: clamp(40px, 10vw, 75px);
  top: 38%;
  right: 12%;
  transform: rotate(12deg);
}

.hub-cloud-float--3 {
  width: clamp(40px, 10vw, 72px);
  height: clamp(30px, 8vw, 55px);
  bottom: 26%;
  left: 22%;
  transform: rotate(6deg);
}

.hub-top.landing-header {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hub-top {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
}

.hub-nav-pill {
  background: rgba(18, 28, 48, 0.62) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hub-welcome {
  margin: 0;
  text-align: center;
  font-size: clamp(0.9rem, 2.8vw, 1.05rem);
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hub-welcome-label {
  font-weight: 500;
  opacity: 0.95;
}

.hub-welcome strong {
  font-weight: 800;
  color: #fff;
}

.hub-role-hint {
  margin: 0.15rem 0 0;
  text-align: center;
  font-size: clamp(0.78rem, 2.2vw, 0.88rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  max-width: 26rem;
  padding: 0 0.5rem;
}

.hub-role-hint:empty {
  display: none;
}

.hub-main {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.75rem 0.5rem 1rem;
  min-height: 0;
}

.hub-cluster {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "tl tr"
    "c c"
    "bl br";
  gap: clamp(0.65rem, 2.5vw, 1.25rem);
  align-items: center;
  justify-items: center;
  width: 100%;
}

.hub-cloud {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: min(200px, 42vw);
  min-height: clamp(118px, 28vw, 150px);
  padding: 0.65rem 0.5rem 0.75rem;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  color: #1e3a5f;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s;
}

.hub-cloud:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.03);
  box-shadow:
    0 6px 0 rgba(0, 0, 0, 0.05),
    0 18px 36px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.hub-cloud:active {
  transform: translateY(0) scale(0.99);
}

.hub-cloud--tl {
  grid-area: tl;
  border-radius: 58% 42% 48% 52% / 52% 48% 58% 42%;
}

.hub-cloud--tr {
  grid-area: tr;
  border-radius: 45% 55% 52% 48% / 48% 52% 45% 55%;
}

.hub-cloud--c {
  grid-area: c;
  max-width: min(220px, 48vw);
  min-height: clamp(128px, 30vw, 168px);
  border-radius: 48% 52% 50% 50% / 55% 45% 55% 45%;
}

.hub-cloud--bl {
  grid-area: bl;
  border-radius: 52% 48% 55% 45% / 42% 58% 42% 58%;
}

.hub-cloud--br {
  grid-area: br;
  border-radius: 50% 50% 45% 55% / 55% 45% 52% 48%;
}

.hub-cloud--guru {
  max-width: min(320px, 92vw);
  min-height: 72px;
  flex-direction: row;
  gap: 0.65rem;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(235, 245, 255, 0.95) 100%);
}

.hub-cloud-icon {
  font-size: clamp(1.75rem, 6vw, 2.35rem);
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.hub-cloud--guru .hub-cloud-icon {
  font-size: 1.75rem;
}

.hub-cloud-text {
  font-size: clamp(0.62rem, 2.1vw, 0.72rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  max-width: 12em;
}

.hub-cloud--guru .hub-cloud-text {
  font-size: 0.8rem;
  max-width: none;
}

/* ===== Hub khusus Guru: mode dashboard admin (tanpa ubah background) ===== */
body[data-media-role="guru"] #hub-page .hub-cluster {
  display: none;
}

body[data-media-role="guru"] #hub-page .hub-main {
  max-width: 680px;
  gap: 1rem;
}

body[data-media-role="guru"] #hub-guru-dashboard {
  width: 100%;
  max-width: min(640px, 92vw);
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
}

.hub-guru-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.hub-guru-stat {
  background: rgba(15, 23, 42, 0.55);
  border: 2px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  animation: guruDashIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hub-guru-stat:nth-child(2) {
  animation-delay: 0.06s;
}

.hub-guru-stat:nth-child(3) {
  animation-delay: 0.12s;
}

.hub-guru-stat:nth-child(4) {
  animation-delay: 0.18s;
}

.hub-guru-stat-val {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
}

.hub-guru-stat-label {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.85);
  text-transform: uppercase;
}

.hub-guru-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-start;
}

.hub-guru-bulk {
  background: rgba(15, 23, 42, 0.55);
  border: 2px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 0.85rem;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.hub-guru-bulk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.hub-guru-bulk-label {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.9);
  text-transform: uppercase;
}

.hub-guru-bulk-input,
.hub-guru-bulk-select {
  border: 2px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  border-radius: 14px;
  padding: 0.5rem 0.65rem;
  font-family: var(--font-sans);
  font-weight: 800;
}

.hub-guru-bulk-input {
  width: 92px;
}

.hub-guru-bulk-select {
  min-width: 220px;
}

.hub-guru-bulk-hint {
  margin: 0.2rem 0 0;
  color: rgba(226, 232, 240, 0.92);
  font-weight: 700;
  font-size: 0.88rem;
}

@media (max-width: 520px) {
  .hub-guru-stats {
    grid-template-columns: 1fr;
  }

  .hub-guru-bulk-input {
    width: 100%;
    flex: 1 1 120px;
  }

  .hub-guru-bulk-select {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-guru-stat {
    animation: none;
  }
}

body[data-media-role="guru"] #hub-btn-guru-hasil,
body[data-media-role="guru"] #hub-btn-admin,
body[data-media-role="guru"] #hub-btn-create-student {
  width: 100%;
  max-width: min(640px, 92vw);
  min-height: 86px;
  border-radius: 18px;
  padding: 0.9rem 1.15rem;
  background:
    radial-gradient(circle at 12% 20%, rgba(250, 204, 21, 0.20) 0%, transparent 45%),
    radial-gradient(circle at 86% 30%, rgba(34, 197, 94, 0.16) 0%, transparent 45%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.96) 0%, rgba(235, 245, 255, 0.94) 100%);
  border: 2px solid rgba(148, 163, 184, 0.22);
  box-shadow:
    0 10px 0 rgba(0, 0, 0, 0.05),
    0 24px 48px rgba(0, 0, 0, 0.20);
  justify-content: flex-start;
  gap: 0.9rem;
  text-align: left;
  position: relative;
  overflow: hidden;
}

body[data-media-role="guru"] #hub-page .hub-cloud--guru .hub-cloud-icon {
  font-size: 2.1rem;
}

body[data-media-role="guru"] #hub-page .hub-cloud--guru .hub-cloud-text {
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #0f172a;
}

@keyframes guruDashIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
    filter: blur(6px);
  }

  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

body[data-media-role="guru"] #hub-btn-guru-hasil {
  animation: guruDashIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body[data-media-role="guru"] #hub-btn-admin {
  animation: guruDashIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.08s;
}

body[data-media-role="guru"] #hub-btn-create-student {
  animation: guruDashIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.16s;
}

/* Hover lebih terasa seperti dashboard */
body[data-media-role="guru"] #hub-page .hub-cloud--guru:hover {
  transform: translateY(-4px) scale(1.01);
  filter: saturate(1.05);
}

body[data-media-role="guru"] #hub-page .hub-cloud--guru:active {
  transform: translateY(-1px) scale(0.995);
}

/* ===== Murid: menu awan — tombol bergerak + animasi masuk berputar (lucu untuk SD) ===== */
@keyframes kidHubSpinIn {
  0% {
    opacity: 0;
    transform: rotate(-220deg) scale(0.12);
    filter: blur(3px);
  }

  58% {
    opacity: 1;
    transform: rotate(14deg) scale(1.08);
    filter: blur(0);
  }

  78% {
    transform: rotate(-6deg) scale(0.97);
  }

  100% {
    transform: rotate(0deg) scale(1);
  }
}

@keyframes kidHubIconBob {

  0%,
  100% {
    transform: translateY(0) rotate(-5deg) scale(1);
  }

  50% {
    transform: translateY(-5px) rotate(5deg) scale(1.08);
  }
}

@keyframes kidHubShadowPulse {

  0%,
  100% {
    box-shadow:
      0 4px 0 rgba(0, 0, 0, 0.06),
      0 12px 28px rgba(0, 0, 0, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      0 0 0 0 rgba(250, 204, 21, 0);
  }

  50% {
    box-shadow:
      0 5px 0 rgba(0, 0, 0, 0.05),
      0 16px 34px rgba(34, 197, 94, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 1),
      0 0 0 10px rgba(250, 204, 21, 0.28);
  }
}

body[data-media-role="siswa"] #hub-page .hub-cluster .hub-cloud:not(.hub-cloud--guru) {
  position: relative;
  overflow: visible;
  animation: kidHubShadowPulse 2.8s ease-in-out infinite;
}

body[data-media-role="siswa"] #hub-page .hub-cluster .hub-cloud:not(.hub-cloud--guru) .hub-cloud-icon {
  display: inline-block;
  transform-origin: 50% 70%;
  animation: kidHubIconBob 2.5s ease-in-out infinite;
}

body[data-media-role="siswa"] #hub-page .hub-cloud[data-pos='tl'] .hub-cloud-icon {
  animation-delay: 0s;
}

body[data-media-role="siswa"] #hub-page .hub-cloud[data-pos='tr'] .hub-cloud-icon {
  animation-delay: 0.12s;
}

body[data-media-role="siswa"] #hub-page .hub-cloud[data-pos='c'] .hub-cloud-icon {
  animation-delay: 0.24s;
}

body[data-media-role="siswa"] #hub-page .hub-cloud[data-pos='bl'] .hub-cloud-icon {
  animation-delay: 0.36s;
}

body[data-media-role="siswa"] #hub-page .hub-cloud[data-pos='br'] .hub-cloud-icon {
  animation-delay: 0.48s;
}

body[data-media-role="siswa"] #hub-page.hub-page--kid-enter .hub-cluster .hub-cloud:not(.hub-cloud--guru) {
  animation:
    kidHubSpinIn 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    kidHubShadowPulse 2.8s ease-in-out infinite;
}

body[data-media-role="siswa"] #hub-page.hub-page--kid-enter .hub-cloud[data-pos='tl'] {
  animation-delay: 0.02s;
}

body[data-media-role="siswa"] #hub-page.hub-page--kid-enter .hub-cloud[data-pos='tr'] {
  animation-delay: 0.1s;
}

body[data-media-role="siswa"] #hub-page.hub-page--kid-enter .hub-cloud[data-pos='c'] {
  animation-delay: 0.18s;
}

body[data-media-role="siswa"] #hub-page.hub-page--kid-enter .hub-cloud[data-pos='bl'] {
  animation-delay: 0.26s;
}

body[data-media-role="siswa"] #hub-page.hub-page--kid-enter .hub-cloud[data-pos='br'] {
  animation-delay: 0.34s;
}

body[data-media-role="siswa"] #hub-page .hub-cluster .hub-cloud:not(.hub-cloud--guru):hover .hub-cloud-icon {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {

  body[data-media-role="siswa"] #hub-page .hub-cluster .hub-cloud:not(.hub-cloud--guru),
  body[data-media-role="siswa"] #hub-page.hub-page--kid-enter .hub-cluster .hub-cloud:not(.hub-cloud--guru) {
    animation: none;
  }

  body[data-media-role="siswa"] #hub-page .hub-cluster .hub-cloud:not(.hub-cloud--guru) .hub-cloud-icon {
    animation: none;
  }

  body[data-media-role="guru"] #hub-btn-guru-hasil,
  body[data-media-role="guru"] #hub-btn-admin,
  body[data-media-role="guru"] #hub-btn-create-student {
    animation: none;
  }
}

@media (max-width: 380px) {
  .hub-cloud {
    max-width: 44vw;
    min-height: 108px;
    padding: 0.5rem 0.35rem;
  }

  .hub-cloud--c {
    max-width: 50vw;
  }
}

/* ===== Halaman Materi SPD (dari menu awan) ===== */
.materi-spd-page {
  position: fixed;
  inset: 0;
  z-index: 188;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(0.65rem, env(safe-area-inset-top)) max(0.85rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(0.85rem, env(safe-area-inset-left));
  background: #1a2840;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.materi-spd-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #1a2840;
  background-image:
    linear-gradient(180deg, rgba(12, 22, 42, 0.55) 0%, rgba(8, 16, 32, 0.72) 45%, rgba(5, 12, 28, 0.78) 100%),
    var(--materi-spd-bg-image),
    var(--materi-spd-bg-fallback);
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
}

.materi-spd-deco {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  filter: saturate(1.05);
}

.materi-spd-deco--left {
  width: min(52vw, 280px);
  height: min(72vw, 360px);
  left: -18%;
  top: 22%;
  border-radius: 0 50% 50% 0;
  background:
    radial-gradient(ellipse 120% 80% at 20% 45%, rgba(90, 55, 30, 0.75) 0%, rgba(45, 30, 18, 0.5) 55%, transparent 78%),
    linear-gradient(160deg, rgba(60, 40, 25, 0.85) 0%, rgba(35, 22, 14, 0.6) 100%);
  box-shadow: inset -8px 0 48px rgba(255, 248, 220, 0.12);
  clip-path: ellipse(100% 52% at 0% 50%);
}

.materi-spd-deco--right {
  width: min(48vw, 260px);
  height: min(68vw, 340px);
  right: -16%;
  top: 24%;
  border-radius: 50% 0 0 50%;
  background:
    radial-gradient(ellipse 100% 70% at 85% 48%, rgba(70, 110, 160, 0.45) 0%, rgba(30, 50, 90, 0.55) 50%, rgba(20, 35, 65, 0.5) 100%),
    linear-gradient(200deg, rgba(255, 255, 255, 0.14) 0%, rgba(40, 70, 120, 0.35) 100%);
  box-shadow: inset 8px 0 40px rgba(255, 255, 255, 0.08);
  clip-path: ellipse(100% 52% at 100% 50%);
}

.materi-spd-cloud-float {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
  filter: blur(1px);
}

.materi-spd-cloud-float--1 {
  width: clamp(48px, 12vw, 90px);
  height: clamp(36px, 9vw, 70px);
  top: 22%;
  left: 18%;
  transform: rotate(-8deg);
}

.materi-spd-cloud-float--2 {
  width: clamp(56px, 14vw, 100px);
  height: clamp(40px, 10vw, 75px);
  top: 38%;
  right: 12%;
  transform: rotate(12deg);
}

.materi-spd-cloud-float--3 {
  width: clamp(44px, 11vw, 80px);
  height: clamp(32px, 8vw, 58px);
  bottom: 12%;
  left: 30%;
  transform: rotate(3deg);
}

.materi-spd-top.landing-header {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.materi-spd-top {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
}

.materi-spd-main {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0.35rem 0.75rem 1.5rem;
  min-height: 0;
}

.materi-spd-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.5rem);
}

.materi-spd-page-title {
  margin: 0;
  width: 100%;
  max-width: 36rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 3.2vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(34, 197, 94, 0.2);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 25, 45, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.materi-spd-duo {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: start;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2rem);
  width: 100%;
  max-width: 880px;
}

.materi-spd-col--cta {
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
}

.materi-spd-col--panel {
  min-width: 0;
}

.materi-spd-bubble {
  font-family: var(--font-sans);
  color: #153a5c;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 6px 0 rgba(30, 80, 130, 0.1),
    0 20px 44px rgba(0, 30, 60, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    inset 0 -16px 40px rgba(120, 190, 240, 0.12);
}

.materi-spd-bubble--cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: min(220px, 78vw);
  min-height: clamp(158px, 38vw, 210px);
  padding: 1.15rem 1rem 1.2rem;
  cursor: pointer;
  text-align: center;
  border: none;
  font-family: inherit;
  border-radius: 58% 42% 50% 50% / 52% 48% 58% 42%;
  background:
    radial-gradient(ellipse 90% 70% at 35% 22%, rgba(255, 255, 255, 0.9) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 70% 80%, rgba(200, 230, 255, 0.55) 0%, transparent 50%),
    linear-gradient(168deg, rgba(218, 240, 255, 0.98) 0%, rgba(165, 215, 248, 0.95) 48%, rgba(120, 195, 235, 0.96) 100%);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.2s;
}

.materi-spd-bubble--cta:hover {
  transform: translateY(-5px) scale(1.02);
  filter: brightness(1.03);
  box-shadow:
    0 8px 0 rgba(30, 80, 130, 0.08),
    0 26px 50px rgba(0, 40, 80, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.85);
}

.materi-spd-bubble--cta:active {
  transform: translateY(-1px) scale(0.99);
}

.materi-spd-bubble-icon {
  font-size: clamp(2.75rem, 10vw, 3.5rem);
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 40, 80, 0.18));
}

.materi-spd-bubble-label {
  font-size: clamp(0.62rem, 2.1vw, 0.76rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
  max-width: 12em;
  color: #0a2844;
}

.materi-spd-panel {
  border-radius: 20px;
  padding: clamp(1.15rem, 3.5vw, 1.65rem) clamp(1.2rem, 3.5vw, 1.75rem);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.97) 0%, rgba(236, 248, 255, 0.94) 45%, rgba(210, 235, 252, 0.96) 100%);
  border: 1px solid rgba(180, 210, 235, 0.65);
  box-shadow:
    0 4px 0 rgba(100, 140, 180, 0.12),
    0 16px 40px rgba(0, 35, 70, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.materi-spd-info-block {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(100, 150, 200, 0.2);
  border-left: 4px solid #22c55e;
  box-shadow: 0 2px 12px rgba(15, 50, 90, 0.06);
}

.materi-spd-info-block:last-of-type {
  margin-bottom: 0;
  border-left-color: #38bdf8;
}

.materi-spd-info-heading {
  margin: 0 0 0.5rem;
  font-size: clamp(0.75rem, 2.2vw, 0.88rem);
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #0c2f52;
  line-height: 1.3;
}

.materi-spd-info-text {
  margin: 0;
  font-size: clamp(0.8rem, 2.3vw, 0.95rem);
  font-weight: 500;
  line-height: 1.65;
  color: #1e3a5f;
}

.materi-spd-back {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  margin: 0 0 0.15rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  background: rgba(18, 28, 48, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.materi-spd-back:hover {
  background: rgba(28, 40, 65, 0.62);
  border-color: rgba(255, 255, 255, 0.32);
}

.materi-spd-back:active {
  transform: scale(0.98);
}

@media (max-width: 640px) {
  .materi-spd-duo {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .materi-spd-col--panel {
    width: 100%;
    max-width: 420px;
  }

  .materi-spd-panel {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .materi-spd-bubble--cta {
    width: min(200px, 86vw);
    min-height: 150px;
  }
}

/* ===== Header & Nav ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 100%;
}

.header-user-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.header-user-badge--siswa {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
}

.header-user-badge--guru {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

.header-user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 0;
}

.header-user-label {
  font-weight: 500;
  font-size: 0.72rem;
  opacity: 0.85;
}

.header-user-name {
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(220px, 40vw);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}

.nav-btn.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

/* Hasil Asesmen & tombol hub guru: hanya tampil jika login sebagai guru */
body:not([data-media-role="guru"]) .nav-btn--guru-only,
body:not([data-media-role="guru"]) #hub-btn-guru-hasil,
body:not([data-media-role="guru"]) #hub-btn-admin,
body:not([data-media-role="guru"]) #hub-btn-create-student {
  display: none !important;
}

.menu-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .nav.open {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.35rem;
  }

  .menu-toggle {
    display: block;
    min-width: 44px;
    min-height: 44px;
  }

  .nav-btn {
    min-height: 44px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
  }
}

/* Instruction Styles */
.puzzle-instruction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  color: #1e293b;
  font-weight: 800;
  font-size: 1.1rem;
}

.puzzle-instruction small {
  color: #64748b;
  font-weight: 600;
}

.curved-arrow {
  font-size: 1.8rem;
  color: #94a3b8;
  transform: rotate(45deg) translateY(-5px);
  animation: bounceArrow 1s infinite alternate;
}

@keyframes bounceArrow {
  from { transform: rotate(45deg) translateY(-5px); }
  to { transform: rotate(45deg) translateY(2px); }
}

/* Slot Labels */
.slot-label {
  margin-top: 10px;
  font-weight: 800;
  color: #94a3b8;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

/* Success Modal Refinements */
.ayat-finish-card .finish-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.success-title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  color: #16a34a;
  font-size: 2rem;
  margin-bottom: 15px;
}

.meaning-label {
  font-weight: 900;
  color: #475569;
  letter-spacing: 1px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.meaning-translate {
  color: #334155;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 400px;
}

.btn-misi-lanjut {
  background: #22c55e;
  color: white;
  border: none;
  padding: 18px 40px;
  border-radius: 18px;
  font-weight: 800;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 0 #15803d;
  transition: 0.2s;
}

.btn-misi-lanjut:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #15803d;
}

/* Responsive adjust for mobile */
@media (max-width: 768px) {
  .word-puzzle-item, .drop-slot-dotted {
    width: 140px;
    height: 70px;
    font-size: 1.4rem;
  }
  .ayat-main-text { font-size: 1.8rem; }
  .puzzle-slots-area { flex-wrap: wrap; }
}

/* ===== Tampilan HP / mobile ===== */
@media (max-width: 768px) {
  .header-inner {
    padding: 0.6rem 1rem;
  }

  .logo {
    font-size: 1rem;
    line-height: 1.3;
  }

  .main {
    padding: 1rem 1rem 3rem;
  }

  .section-header {
    margin-bottom: 1.25rem;
  }

  .section-header h2 {
    font-size: 1.35rem;
  }

  .section-header p {
    font-size: 0.9rem;
  }

  .flipbook-container {
    padding: 1rem;
  }

  .flipbook-viewport {
    min-height: 300px;
    padding: 0.25rem 0;
  }

  .flipbook-stage {
    padding: 0.5rem 0.5rem 0.5rem 0.85rem;
  }

  .flipbook {
    min-height: 300px;
  }

  .page {
    min-height: 280px;
    max-height: min(58vh, 480px);
  }

  .page-content {
    padding: 1.1rem 1.1rem 1.25rem;
  }

  .page-content h4 {
    font-size: 1rem;
  }

  .page-content p {
    font-size: 0.88rem;
  }

  .flipbook-list {
    font-size: 0.86rem;
  }

  .flipbook-controls {
    gap: 0.75rem;
    margin-top: 1.1rem;
  }

  .btn-flip {
    min-height: 44px;
    padding: 0.6rem 1rem;
  }

  .btq-sel-container {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .verse-ar {
    font-size: 1.4rem;
    line-height: 1.9;
  }

  .verse-id {
    font-size: 0.9rem;
  }

  .word-chip {
    min-height: 44px;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
  }

  .word-chip .ar {
    font-size: 1rem;
  }

  .sel-themes ul {
    font-size: 0.9rem;
  }

  .game-container {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .game-container--arena {
    padding: 1rem;
  }

  .game-question {
    font-size: 1rem;
  }

  .game-option {
    min-height: 48px;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  .btn-primary {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
  }

  .ref-panel {
    padding-bottom: 2rem;
  }

  .ref-storage-hint {
    padding: 0.9rem 1rem;
  }

  .ref-storage-steps {
    font-size: 0.85rem;
  }

  #refleksi-video {
    max-height: 40vh;
  }

  .footer {
    padding: 1rem;
    font-size: 0.8rem;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 0.95rem;
  }

  .section-header h2 {
    font-size: 1.2rem;
  }

  .flipbook-viewport {
    min-height: 280px;
  }

  .page {
    min-height: 260px;
    max-height: min(55vh, 420px);
  }

  .verse-ar {
    font-size: 1.25rem;
  }
}

/* ===== Main & Sections ===== */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

@keyframes sectionReveal {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.992);
    filter: blur(4px);
  }

  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.section.active.section-anim-in {
  animation: sectionReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .section.active.section-anim-in {
    animation: none;
  }
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.section-header p {
  color: var(--text-muted);
  margin: 0;
}

/* ===== Flipbook ===== */
.section-header--flipbook h2 {
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  letter-spacing: -0.02em;
}

.section-header--flipbook p {
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

.flipbook-container {
  background: linear-gradient(165deg, rgba(26, 35, 50, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%);
  border-radius: 20px;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 48px rgba(0, 0, 0, 0.35);
}

.flipbook-viewport {
  perspective: 1400px;
  min-height: 360px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0.5rem 0;
}

.flipbook-stage {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 0.65rem 0.65rem 0.65rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.5) 100%);
  border: 1px solid rgba(51, 65, 85, 0.6);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 12px 40px rgba(0, 0, 0, 0.4);
}

.flipbook-spine {
  position: absolute;
  left: 0.35rem;
  top: 0.65rem;
  bottom: 0.65rem;
  width: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg,
      rgba(15, 23, 42, 0.9) 0%,
      rgba(34, 197, 94, 0.35) 45%,
      rgba(15, 23, 42, 0.9) 100%);
  box-shadow: 2px 0 12px rgba(34, 197, 94, 0.15);
  pointer-events: none;
}

.flipbook {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 340px;
}

.page {
  display: none;
  width: 100%;
  max-width: 100%;
  min-height: 320px;
  max-height: min(62vh, 520px);
  overflow: hidden;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 48%, #0c1220 100%);
  border-radius: 12px;
  border: 1px solid rgba(71, 85, 105, 0.5);
  padding: 0;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.2),
    4px 8px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.page.active {
  display: flex;
  flex-direction: column;
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.12),
    0 8px 32px rgba(34, 197, 94, 0.08),
    4px 12px 28px rgba(0, 0, 0, 0.4);
  animation: flipbookPageIn 0.38s ease;
}

@keyframes flipbookPageIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.page-content {
  padding: 1.35rem 1.35rem 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 197, 94, 0.45) rgba(15, 23, 42, 0.5);
}

.page-content::-webkit-scrollbar {
  width: 6px;
}

.page-content::-webkit-scrollbar-thumb {
  background: rgba(34, 197, 94, 0.4);
  border-radius: 6px;
}

.page-cover {
  text-align: center;
}

.page-cover .page-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  text-align: center;
}

.page-cover-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  font-size: 2rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(34, 197, 94, 0.25) 0%, rgba(15, 23, 42, 0.8) 70%);
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.page-cover .page-content h3 {
  font-size: clamp(1.15rem, 3.2vw, 1.45rem);
  margin: 0 0 0.65rem;
  line-height: 1.25;
  color: #f1f5f9;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
}

.page-cover--front .page-content h3 {
  color: var(--primary);
  text-shadow: 0 0 40px rgba(34, 197, 94, 0.25);
}

.page-cover-lead {
  margin: 0 0 0.5rem !important;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 22em;
}

.page-cover .sub {
  margin: 0;
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-content h4 {
  font-size: 1.05rem;
  margin: 1.15rem 0 0.55rem;
  color: #fbbf24;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.page-content h4:first-child {
  margin-top: 0;
}

.page-content p {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #cbd5e1;
}

.page-content p:last-child {
  margin-bottom: 0;
}

.flipbook-list {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.65;
}

.flipbook-list li {
  margin-bottom: 0.45rem;
  padding-left: 0.25rem;
}

.flipbook-list li:last-child {
  margin-bottom: 0;
}

.flipbook-list strong {
  color: #e2e8f0;
  font-weight: 700;
}

.flipbook-callout {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.flipbook-callout--alt {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
}

.flipbook-callout-title {
  margin: 0 0 0.4rem !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  color: #86efac !important;
  letter-spacing: 0.03em;
}

.flipbook-callout--alt .flipbook-callout-title {
  color: #93c5fd !important;
}

.flipbook-callout p:last-child {
  margin-bottom: 0 !important;
  font-size: 0.88rem !important;
  line-height: 1.6 !important;
}

.flipbook-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 1.75rem);
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-flip {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  border: none;
  padding: 0.65rem 1.35rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
  transition: transform 0.15s ease, filter 0.2s, box-shadow 0.2s;
}

.btn-flip:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-flip:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-flip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.page-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.page-indicator-sep {
  color: var(--text-muted);
  font-weight: 600;
}

/* ===== BTQ & SEL ===== */
.btq-sel-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border);
}

.verse-ref {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.verse-ar {
  font-family: var(--font-ar);
  font-size: 1.75rem;
  line-height: 2;
  margin-bottom: 1rem;
  color: var(--text);
}

.verse-id {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.words-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.word-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.word-chip:hover {
  border-color: var(--primary);
  background: rgba(34, 197, 94, 0.1);
}

.word-chip .ar {
  font-family: var(--font-ar);
  font-size: 1.1rem;
}

.word-chip.active {
  border-color: var(--primary);
  background: rgba(34, 197, 94, 0.2);
}

.sel-themes {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sel-themes h4 {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 1rem;
}

.sel-themes ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.word-detail-panel {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-section);
  border-radius: 8px;
  border: 1px solid var(--border);
  display: none;
}

.word-detail-panel.show {
  display: block;
}

.word-detail-panel h5 {
  margin: 0 0 0.5rem;
  color: var(--primary);
  font-size: 0.95rem;
}

.word-detail-panel .tajwid {
  color: var(--accent);
  font-size: 0.9rem;
}

.word-detail-panel .sel-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ===== Asesmen — tema anak SD (petualangan tubuh) ===== */
#game.game-section--kid {
  --game-kid-font: 'Baloo 2', 'Comic Neue', 'Poppins', var(--font-sans);
  --game-kid-ink: #0f172a;
  --game-kid-ink-soft: #334155;
  --game-kid-sky: #e0f2fe;
  --game-kid-sky-deep: #bae6fd;
  --game-kid-vein: #38bdf8;
  --game-kid-yellow: #fde047;
  --game-kid-yellow-deep: #facc15;
  --game-kid-heart: #f87171;
  --game-kid-ok: #22c55e;
  font-family: var(--game-kid-font);
}

#game.game-section--kid .section-header--game-kid h2 {
  font-family: var(--game-kid-font);
  font-weight: 800;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  color: #fef3c7;
  text-shadow: 0 2px 12px rgba(15, 23, 42, 0.35);
}

#game.game-section--kid .section-header--game-kid p {
  font-family: 'Poppins', var(--game-kid-font);
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  font-weight: 600;
  color: rgba(224, 242, 254, 0.95);
  max-width: 36rem;
}

#game.game-section--kid .game-container--kid {
  font-family: var(--game-kid-font);
  color: var(--game-kid-ink);
  background: linear-gradient(168deg,
      #e0f2fe 0%,
      #dbeafe 38%,
      #cffafe 72%,
      #bae6fd 100%);
  border: 3px solid rgba(56, 189, 248, 0.55);
  border-radius: 28px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.5) inset,
    0 20px 50px rgba(14, 116, 144, 0.18);
}

#game.game-section--kid .game-kid-hero {
  position: relative;
  text-align: center;
  padding: 0.5rem 0.35rem 1.25rem;
  margin-bottom: 0.5rem;
}

#game.game-section--kid .game-kid-deco {
  position: relative;
  height: 3rem;
  margin-bottom: 0.35rem;
  pointer-events: none;
}

#game.game-section--kid .game-kid-bubble {
  position: absolute;
  font-size: clamp(1.75rem, 6vw, 2.35rem);
  line-height: 1;
  animation: gameKidFloat 3.2s ease-in-out infinite;
}

#game.game-section--kid .game-kid-bubble--heart {
  left: 8%;
  top: 0;
  animation-delay: 0s;
}

#game.game-section--kid .game-kid-bubble--blood {
  right: 10%;
  top: 0.15rem;
  animation-delay: 0.4s;
}

#game.game-section--kid .game-kid-bubble--spark {
  left: 50%;
  top: -0.25rem;
  animation-name: gameKidFloatCenter;
  animation-delay: 0.2s;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
}

@keyframes gameKidFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes gameKidFloatCenter {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-8px);
  }
}

#game.game-section--kid .game-kid-title {
  margin: 0 0 0.5rem;
  font-family: 'Baloo 2', var(--game-kid-font);
  font-weight: 800;
  font-size: clamp(1.5rem, 5vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #0c4a6e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

#game.game-section--kid .game-kid-sub {
  margin: 0 auto 1.15rem;
  max-width: 28rem;
  font-family: 'Poppins', var(--game-kid-font);
  font-size: clamp(0.92rem, 2.6vw, 1.05rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--game-kid-ink-soft);
}

#game.game-section--kid .game-kid-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  align-items: stretch;
}

#game.game-section--kid .game-kid-cta {
  flex: 1 1 140px;
  max-width: 220px;
  min-height: 52px;
  padding: 0.75rem 1rem;
  font-family: 'Baloo 2', var(--game-kid-font);
  font-weight: 800;
  font-size: clamp(1rem, 2.8vw, 1.15rem);
  letter-spacing: 0.02em;
  border-radius: 18px;
  border: 3px solid transparent;
  cursor: pointer;
  box-shadow: 0 10px 0 rgba(15, 23, 42, 0.12), 0 14px 28px rgba(8, 47, 73, 0.15);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

#game.game-section--kid .game-kid-cta:hover {
  transform: translateY(-3px);
  filter: brightness(1.03);
  box-shadow: 0 12px 0 rgba(15, 23, 42, 0.1), 0 20px 36px rgba(8, 47, 73, 0.18);
}

#game.game-section--kid .game-kid-cta:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(15, 23, 42, 0.12), 0 8px 18px rgba(8, 47, 73, 0.12);
}

#game.game-section--kid .game-kid-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.55), 0 10px 0 rgba(15, 23, 42, 0.12);
}

#game.game-section--kid .game-kid-cta--mulai {
  background: linear-gradient(180deg, #fef08a 0%, var(--game-kid-yellow) 45%, var(--game-kid-yellow-deep) 100%);
  border-color: #eab308;
  color: #422006;
}

#game.game-section--kid .game-kid-cta--belajar {
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
  border-color: var(--game-kid-vein);
  color: #075985;
}

#game.game-section--kid .game-kid-cta--quiz {
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  border-color: var(--game-kid-heart);
  color: #9f1239;
}

#game.game-section--kid .game-kid-picker {
  text-align: center;
  margin: 0.25rem 0 0.35rem;
}

#game.game-section--kid .game-kid-picker-title {
  margin: 0 0 0.35rem;
  font-family: 'Baloo 2', var(--game-kid-font);
  font-weight: 800;
  font-size: 1.15rem;
  color: #0369a1;
}

#game.game-section--kid .game-kid-picker-hint {
  margin: 0 0 0.85rem;
  font-family: 'Poppins', var(--game-kid-font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--game-kid-ink-soft);
}

#game.game-section--kid .game-kid-picker-hint strong {
  color: #b45309;
}

#game.game-section--kid .game-mode-grid {
  margin-top: 0.35rem;
}

#game.game-section--kid .game-mode-card {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--game-kid-ink);
  border-radius: 20px;
  padding: 1.1rem 1rem 1.15rem;
  box-shadow: 0 8px 20px rgba(14, 116, 144, 0.1);
}

#game.game-section--kid .game-mode-card:hover {
  border-color: rgba(14, 165, 233, 0.65);
  box-shadow: 0 12px 28px rgba(14, 116, 144, 0.14);
}

#game.game-section--kid .game-mode-card--selected {
  border-color: rgba(34, 197, 94, 0.85);
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.25),
    0 12px 32px rgba(34, 197, 94, 0.2);
  background: linear-gradient(165deg, rgba(240, 253, 244, 0.95) 0%, rgba(255, 255, 255, 0.92) 100%);
}

#game.game-section--kid .game-mode-title {
  font-family: 'Baloo 2', var(--game-kid-font);
  font-size: 1.08rem;
  color: #0c4a6e;
}

#game.game-section--kid .game-mode-desc {
  color: var(--game-kid-ink-soft);
  font-size: 0.88rem;
}

#game.game-section--kid .game-mode-desc strong {
  color: #0f172a;
}

#game.game-section--kid .game-mode-icon {
  font-size: 2rem;
}

#game.game-section--kid .game-mode-tag {
  color: #fecaca;
}

#game.game-section--kid .game-play .game-question,
#game.game-section--kid .game-end .final-message {
  color: var(--game-kid-ink);
}

#game.game-section--kid .game-play .game-score,
#game.game-section--kid .game-end .final-score {
  color: #b45309;
  font-weight: 800;
  font-family: 'Baloo 2', var(--game-kid-font);
}

#game.game-section--kid .game-option {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--game-kid-ink);
  font-family: 'Poppins', var(--game-kid-font);
  border-radius: 16px;
}

#game.game-section--kid .game-option:hover {
  border-color: var(--game-kid-yellow-deep);
}

#game.game-section--kid .game-option.correct {
  border-color: var(--game-kid-ok);
  background: rgba(34, 197, 94, 0.18);
  color: #14532d;
}

#game.game-section--kid .game-option.wrong {
  border-color: #ef4444;
  background: rgba(254, 226, 226, 0.85);
  color: #991b1b;
}

#game.game-section--kid .game-feedback.correct {
  color: #166534;
  background: rgba(34, 197, 94, 0.15);
}

#game.game-section--kid .game-feedback.wrong {
  color: #b91c1c;
}

#game.game-section--kid .game-arena-col--live {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
}

#game.game-section--kid .live-panel-title,
#game.game-section--kid .live-name {
  color: var(--game-kid-ink);
}

#game.game-section--kid .live-row {
  background: rgba(241, 245, 249, 0.95);
  border-color: rgba(148, 163, 184, 0.25);
}

#game.game-section--kid .live-panel-tag {
  color: #15803d;
}

#game.game-section--kid .game-session-pill {
  color: #1d4ed8;
  background: linear-gradient(135deg, rgba(191, 219, 254, 0.85) 0%, rgba(186, 230, 253, 0.75) 100%);
}

#game.game-section--kid .game-q-progress {
  color: var(--game-kid-ink-soft);
}

#game.game-section--kid .game-play--puzzle .puzzle-dropzone {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(56, 189, 248, 0.45);
}

#game.game-section--kid .game-play--puzzle .puzzle-bank-wrap {
  background: rgba(255, 255, 255, 0.8);
}

#game.game-section--kid .puzzle-tile {
  background: linear-gradient(180deg, #fff 0%, #e0f2fe 100%);
  border-color: rgba(14, 165, 233, 0.4);
  color: var(--game-kid-ink);
  font-family: 'Baloo 2', var(--game-kid-font);
}

/* Puzzle multi-tahap: HUD, maskot, feedback pop, selesai */
#game.game-section--kid .puzzle-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  justify-content: center;
  align-items: stretch;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 22px rgba(14, 116, 144, 0.1);
}

#game.game-section--kid .puzzle-hud>div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 14px;
  background: rgba(224, 242, 254, 0.5);
}

#game.game-section--kid .puzzle-hud-label {
  font-family: 'Poppins', var(--game-kid-font);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0369a1;
}

#game.game-section--kid .puzzle-hud-value {
  font-family: 'Baloo 2', var(--game-kid-font);
  font-size: 1.35rem;
  font-weight: 800;
  color: #b45309;
}

#game.game-section--kid .puzzle-hud-max {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--game-kid-ink-soft);
}

#game.game-section--kid .puzzle-hud-timer-num--warn {
  color: #dc2626 !important;
  animation: puzzleTimerPulse 0.8s ease-in-out infinite;
}

@keyframes puzzleTimerPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

#game.game-section--kid .puzzle-hud-timer--live .puzzle-hud-timer-num {
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
}

#game.game-section--kid .puzzle-timer-help {
  margin: -0.35rem 0 0.65rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--game-kid-ink-soft);
}

/* Popup cara bermain sebelum puzzle */
#game.game-section--kid .puzzle-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 238;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}

#game.game-section--kid .puzzle-intro-overlay[hidden] {
  display: none !important;
}

#game.game-section--kid .puzzle-intro-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(14, 116, 144, 0.45) 0%, rgba(30, 58, 138, 0.5) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#game.game-section--kid .puzzle-intro-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(92vh, 640px);
  overflow-y: auto;
  padding: 1.15rem 1.25rem 1.35rem;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 55%, #e0f2fe 100%);
  border: 3px solid #38bdf8;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 24px 56px rgba(8, 47, 73, 0.28);
  text-align: center;
  animation: puzzleIntroCardIn 0.5s cubic-bezier(0.34, 1.35, 0.64, 1) both;
}

@keyframes puzzleIntroCardIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

#game.game-section--kid .puzzle-intro-scene {
  position: relative;
  height: 100px;
  margin: 0 0 0.65rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.9) 0%, rgba(186, 230, 253, 0.5) 100%);
  border: 2px dashed rgba(56, 189, 248, 0.45);
  overflow: hidden;
}

#game.game-section--kid .puzzle-intro-flow {
  width: 100%;
  height: 100%;
  display: block;
}

#game.game-section--kid .puzzle-intro-path {
  animation: puzzleVeinDash 2.2s linear infinite;
}

@keyframes puzzleVeinDash {
  to {
    stroke-dashoffset: -56;
  }
}

#game.game-section--kid .puzzle-intro-float {
  position: absolute;
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.9);
}

#game.game-section--kid .puzzle-intro-float--1 {
  left: 8%;
  top: 18%;
  animation: puzzleFloatA 3.2s ease-in-out infinite;
}

#game.game-section--kid .puzzle-intro-float--2 {
  right: 12%;
  top: 22%;
  animation: puzzleFloatB 2.8s ease-in-out infinite 0.4s;
}

#game.game-section--kid .puzzle-intro-float--3 {
  left: 42%;
  top: 8%;
  animation: puzzleFloatC 3.5s ease-in-out infinite 0.2s;
}

#game.game-section--kid .puzzle-intro-float--4 {
  right: 18%;
  bottom: 12%;
  font-family: 'Baloo 2', var(--game-kid-font);
  font-weight: 800;
  font-size: 0.95rem;
  color: #0284c7;
  animation: puzzleO2Pop 2.4s ease-in-out infinite;
}

@keyframes puzzleFloatA {

  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-10px) rotate(4deg);
  }
}

@keyframes puzzleFloatB {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-6px, 8px) scale(1.12);
  }
}

@keyframes puzzleFloatC {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }

  50% {
    transform: scale(1.15) rotate(12deg);
    opacity: 0.85;
  }
}

@keyframes puzzleO2Pop {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

#game.game-section--kid .puzzle-intro-title {
  margin: 0 0 0.4rem;
  font-family: 'Baloo 2', var(--game-kid-font);
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  color: #0c4a6e;
}

#game.game-section--kid .puzzle-intro-lead {
  margin: 0 0 0.75rem;
  font-family: 'Poppins', var(--game-kid-font);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--game-kid-ink-soft);
  text-align: left;
}

#game.game-section--kid .puzzle-intro-list {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  text-align: left;
  font-family: 'Poppins', var(--game-kid-font);
  font-size: 0.88rem;
  line-height: 1.55;
  color: #334155;
}

#game.game-section--kid .puzzle-intro-list li {
  margin-bottom: 0.4rem;
}

#game.game-section--kid .puzzle-intro-timer-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #fef9c3 0%, #fde047 100%);
  border: 2px solid #eab308;
  font-family: 'Poppins', var(--game-kid-font);
  font-size: 0.88rem;
  font-weight: 600;
  color: #713f12;
  text-align: left;
  line-height: 1.45;
}

#game.game-section--kid .puzzle-intro-timer-ico {
  font-size: 1.35rem;
  flex-shrink: 0;
  animation: puzzleTimerIcoWiggle 1.5s ease-in-out infinite;
}

@keyframes puzzleTimerIcoWiggle {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-8deg);
  }

  75% {
    transform: rotate(8deg);
  }
}

#game.game-section--kid .puzzle-intro-start-btn {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

#game.game-section--kid .puzzle-mascots {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.5rem, 4vw, 1.75rem);
  margin: 0 auto 0.85rem;
  min-height: 4.5rem;
}

#game.game-section--kid .puzzle-char {
  position: relative;
  flex: 0 0 auto;
}

#game.game-section--kid .puzzle-char-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: 'Comic Neue', var(--game-kid-font);
  white-space: nowrap;
  background: #fff;
  border: 2px solid #fb7185;
  color: #9f1239;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  opacity: 0.95;
}

#game.game-section--kid .puzzle-mascots--talk .puzzle-char-bubble--heart {
  animation: puzzleBubblePop 0.5s ease;
}

@keyframes puzzleBubblePop {
  0% {
    transform: translateX(-50%) scale(0.85);
  }

  60% {
    transform: translateX(-50%) scale(1.05);
  }

  100% {
    transform: translateX(-50%) scale(1);
  }
}

#game.game-section--kid .puzzle-heart-svg {
  width: clamp(52px, 14vw, 72px);
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(251, 113, 133, 0.35));
}

#game.game-section--kid .puzzle-heart-shape {
  transform-origin: 32px 28px;
  animation: puzzleHeartBeat 1.1s ease-in-out infinite;
}

#game.game-section--kid .puzzle-mascots--cheer .puzzle-heart-shape {
  animation: puzzleHeartBeat 0.55s ease-in-out infinite;
}

@keyframes puzzleHeartBeat {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

#game.game-section--kid .puzzle-heart-eye {
  animation: puzzleBlink 3.5s ease-in-out infinite;
}

@keyframes puzzleBlink {

  0%,
  90%,
  100% {
    transform: scaleY(1);
  }

  94%,
  96% {
    transform: scaleY(0.1);
  }
}

#game.game-section--kid .puzzle-rbc-body {
  width: clamp(48px, 12vw, 64px);
  height: clamp(48px, 12vw, 64px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fecaca, #ef4444 55%, #b91c1c);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.35);
  animation: puzzleRbcWalk 2.4s ease-in-out infinite;
}

#game.game-section--kid .puzzle-mascots--cheer .puzzle-rbc-body {
  animation: puzzleRbcBounce 0.5s ease infinite;
}

#game.game-section--kid .puzzle-mascots--oops .puzzle-rbc-body {
  animation: puzzleRbcShake 0.4s ease infinite;
}

@keyframes puzzleRbcWalk {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(10px);
  }
}

@keyframes puzzleRbcBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes puzzleRbcShake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

#game.game-section--kid .puzzle-rbc-face {
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  line-height: 1;
}

#game.game-section--kid .puzzle-lungs-svg {
  width: clamp(64px, 18vw, 88px);
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(14, 165, 233, 0.25));
}

#game.game-section--kid .puzzle-lung {
  transform-origin: center;
  animation: puzzleLungBreath 2.8s ease-in-out infinite;
}

#game.game-section--kid .puzzle-lung--r {
  animation-delay: 0.15s;
}

#game.game-section--kid .puzzle-mascots--cheer .puzzle-lung {
  animation: puzzleLungBreath 1.2s ease-in-out infinite;
}

@keyframes puzzleLungBreath {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.07);
  }
}

#game.game-section--kid .puzzle-alt-head {
  text-align: center;
  margin-bottom: 0.75rem;
}

#game.game-section--kid .puzzle-slot-caption {
  display: block;
  font-family: 'Baloo 2', var(--game-kid-font);
  font-weight: 800;
  font-size: 0.82rem;
  color: #0c4a6e;
  margin-bottom: 0.2rem;
  text-align: center;
  line-height: 1.2;
}

#game.game-section--kid .puzzle-feedback-pop {
  margin: 0.75rem auto;
  max-width: 22rem;
  padding: 1rem 1.15rem;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(165deg, #fffbeb 0%, #fef3c7 100%);
  border: 3px solid #fbbf24;
  box-shadow: 0 14px 36px rgba(180, 83, 9, 0.18);
  animation: puzzlePopIn 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

#game.game-section--kid .puzzle-feedback-pop.hidden {
  display: none !important;
}

@keyframes puzzlePopIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

#game.game-section--kid .puzzle-feedback-emoji {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

#game.game-section--kid .puzzle-feedback-line1 {
  margin: 0;
  font-family: 'Baloo 2', var(--game-kid-font);
  font-weight: 800;
  font-size: 1.25rem;
  color: #92400e;
}

#game.game-section--kid .puzzle-feedback-line2 {
  margin: 0.35rem 0 0;
  font-family: 'Poppins', var(--game-kid-font);
  font-size: 0.92rem;
  font-weight: 600;
  color: #78350f;
}

#game.game-section--kid .puzzle-feedback-inline {
  margin-top: 0.5rem;
  border-radius: 14px;
}

#game.game-section--kid .puzzle-complete {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
}

#game.game-section--kid .puzzle-complete.hidden {
  display: none !important;
}

#game.game-section--kid .puzzle-complete-card {
  width: 100%;
  max-width: 380px;
  padding: 1.75rem 1.35rem;
  border-radius: 26px;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, #e0f2fe 100%);
  border: 3px solid #38bdf8;
  box-shadow: 0 24px 60px rgba(8, 47, 73, 0.25);
  animation: puzzlePopIn 0.55s ease both;
}

#game.game-section--kid .puzzle-complete-trophy {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  animation: puzzleTrophy 1.2s ease-in-out infinite;
}

@keyframes puzzleTrophy {

  0%,
  100% {
    transform: rotate(-6deg) scale(1);
  }

  50% {
    transform: rotate(6deg) scale(1.05);
  }
}

#game.game-section--kid .puzzle-complete-title {
  margin: 0 0 0.35rem;
  font-family: 'Baloo 2', var(--game-kid-font);
  font-size: 1.5rem;
  color: #0c4a6e;
}

#game.game-section--kid .puzzle-complete-sub,
#game.game-section--kid .puzzle-complete-score {
  margin: 0 0 0.5rem;
  font-family: 'Poppins', var(--game-kid-font);
  color: var(--game-kid-ink-soft);
}

#game.game-section--kid .puzzle-complete-score strong {
  color: #b45309;
  font-size: 1.15em;
}

#game.game-section--kid .puzzle-complete-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1rem;
}

#game.game-section--kid .puzzle-actions .puzzle-big-btn {
  min-height: 52px;
  font-size: 1.05rem !important;
  padding: 0.85rem 1.15rem !important;
  border-radius: 18px !important;
}

#game.game-section--kid .puzzle-complete-actions .puzzle-big-btn {
  min-height: 50px;
  font-size: 1rem !important;
}

#game.game-section--kid .game-play--adventure .adv-panel {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(224, 242, 254, 0.9) 100%);
  border-color: rgba(56, 189, 248, 0.45);
}

#game.game-section--kid .game-play--adventure .adv-text {
  color: var(--game-kid-ink-soft);
}

#game.game-section--kid .game-play--adventure .adv-panel h3 {
  color: #0c4a6e;
  font-family: 'Baloo 2', var(--game-kid-font);
}

#game.game-section--kid .game-start h3,
#game.game-section--kid .game-end h3 {
  color: #047857;
  font-family: 'Baloo 2', var(--game-kid-font);
}

#game.game-section--kid .game-start p,
#game.game-section--kid .game-end p {
  color: var(--game-kid-ink-soft);
}

#game.game-section--kid .game-alt-head h3 {
  color: #0c4a6e;
  font-family: 'Baloo 2', var(--game-kid-font);
}

#game.game-section--kid .game-alt-head p {
  color: var(--game-kid-ink-soft);
}

#game.game-section--kid .game-alt-actions .btn-primary {
  background: linear-gradient(180deg, #fef08a 0%, var(--game-kid-yellow) 50%, var(--game-kid-yellow-deep) 100%) !important;
  color: #422006 !important;
  border-radius: 16px !important;
  font-family: 'Baloo 2', var(--game-kid-font) !important;
  font-weight: 800 !important;
}

#game.game-section--kid .game-alt-actions .btn-secondary {
  border-color: rgba(56, 189, 248, 0.55) !important;
  color: #0369a1 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  font-family: 'Poppins', var(--game-kid-font) !important;
  font-weight: 700 !important;
}

#game.game-section--kid .game-end .btn-primary {
  background: linear-gradient(180deg, #fef08a 0%, var(--game-kid-yellow) 50%, var(--game-kid-yellow-deep) 100%) !important;
  color: #422006 !important;
  border-radius: 18px !important;
  font-family: 'Baloo 2', var(--game-kid-font) !important;
  font-weight: 800 !important;
}

#game.game-section--kid .game-end-rank {
  color: var(--game-kid-ink);
  font-family: 'Poppins', var(--game-kid-font);
}

#game.game-section--kid .game-end-rank strong {
  color: #b45309;
}

@media (prefers-reduced-motion: reduce) {
  #game.game-section--kid .game-kid-bubble {
    animation: none;
  }

  #game.game-section--kid .puzzle-heart-shape,
  #game.game-section--kid .puzzle-heart-eye,
  #game.game-section--kid .puzzle-rbc-body,
  #game.game-section--kid .puzzle-lung,
  #game.game-section--kid .puzzle-complete-trophy,
  #game.game-section--kid .puzzle-hud-timer-num--warn,
  #game.game-section--kid .puzzle-char-bubble--heart {
    animation: none !important;
  }

  #game.game-section--kid .puzzle-feedback-pop,
  #game.game-section--kid .puzzle-complete-card {
    animation: none;
  }

  #game.game-section--kid .puzzle-intro-card,
  #game.game-section--kid .puzzle-intro-path,
  #game.game-section--kid .puzzle-intro-float,
  #game.game-section--kid .puzzle-intro-timer-ico,
  #game.game-section--kid .puzzle-board::before {
    animation: none !important;
  }
}

/* ===== Game — Arena lomba + live score ===== */
.game-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border);
  max-width: 560px;
  margin: 0 auto;
}

.game-container--arena {
  max-width: min(1100px, 100%);
  padding: clamp(1rem, 3vw, 2rem);
}

.game-start-hero {
  text-align: center;
  margin-bottom: 1.25rem;
}

.game-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.5);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.game-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: livePulse 1.2s ease-in-out infinite;
}

@keyframes livePulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.65;
    transform: scale(0.85);
  }
}

.game-start-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.75rem !important;
  line-height: 1.45;
}

.game-mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
  text-align: left;
}

@media (min-width: 720px) {
  .game-mode-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

.game-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 1rem 1rem 1.1rem;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg-elevated, rgba(30, 41, 59, 0.55));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.game-mode-card:hover {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.game-mode-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.game-mode-card--selected {
  border-color: rgba(34, 197, 94, 0.75);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.2),
    0 10px 32px rgba(34, 197, 94, 0.12);
}

.game-mode-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.game-mode-title {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.game-mode-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.game-mode-desc strong {
  color: var(--text);
}

.game-mode-tag {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fecaca;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.game-alt-head {
  margin-bottom: 1rem;
}

.game-alt-head h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.game-alt-head p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.game-play--puzzle .puzzle-board {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

#game.game-section--kid .puzzle-board::before {
  content: '';
  position: absolute;
  inset: -10px;
  z-index: 0;
  border-radius: 22px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 15% 25%, rgba(251, 113, 133, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 75%, rgba(56, 189, 248, 0.14) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(254, 240, 138, 0.08) 0%, transparent 65%);
  animation: puzzleBoardAtmos 5s ease-in-out infinite;
}

#game.game-section--kid .puzzle-slots,
#game.game-section--kid .puzzle-bank-wrap {
  position: relative;
  z-index: 1;
}

@keyframes puzzleBoardAtmos {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.92;
    transform: scale(1.01);
  }
}

.puzzle-slots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .puzzle-slots {
    grid-template-columns: repeat(3, 1fr);
  }
}

.puzzle-slot {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.puzzle-slot-num {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.puzzle-dropzone {
  min-height: 3.25rem;
  border-radius: 12px;
  border: 2px dashed rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.puzzle-dropzone--hover {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.08);
}

.puzzle-bank-wrap {
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.25);
}

.puzzle-bank-title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.puzzle-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 3rem;
}

.puzzle-tile {
  cursor: grab;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.95) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  user-select: none;
  touch-action: none;
}

.puzzle-tile:active {
  cursor: grabbing;
}

.game-play--puzzle .game-feedback {
  margin-top: 1rem;
}

.game-alt-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

@media (min-width: 520px) {
  .game-alt-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .game-alt-actions .btn-primary,
  .game-alt-actions .btn-secondary {
    flex: 1 1 auto;
    min-width: 140px;
  }
}

.game-play--adventure .adv-panel {
  border-radius: 18px;
  padding: 1.35rem 1.25rem 1.5rem;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  text-align: center;
}

.adv-rbc-wrap {
  margin-bottom: 0.75rem;
}

.adv-rbc {
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  line-height: 1;
  display: inline-block;
  animation: advRbcFloat 2.8s ease-in-out infinite;
}

@keyframes advRbcFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.adv-panel h3 {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
}

.adv-text {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: left;
}

.adv-step {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.adv-panel--s0 {
  border-color: rgba(248, 113, 113, 0.35);
}

.adv-panel--s1 {
  border-color: rgba(248, 113, 113, 0.45);
}

.adv-panel--s2 {
  border-color: rgba(56, 189, 248, 0.4);
}

.adv-panel--s3 {
  border-color: rgba(34, 197, 94, 0.4);
}

.adv-panel--done {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.95) 0%, rgba(30, 27, 15, 0.55) 100%);
}

/* ===== Petualangan Si Sel Darah Merah (Rara) ===== */
.game-play--adventure {
  padding: 0;
}

#game.game-section--kid .game-play--adventure {
  color: #0f172a;
}

.rara-game {
  font-family: 'Baloo 2', 'Poppins', system-ui, sans-serif;
  max-width: 440px;
  margin: 0 auto;
  padding-bottom: 0.5rem;
}

.rara-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.25rem;
}

.rara-btn-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 2px solid #38bdf8;
  background: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(14, 116, 144, 0.15);
}

.rara-title-chip {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0c4a6e;
}

.rara-stars-inline {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 800;
  color: #b45309;
  min-width: 4.5rem;
  text-align: right;
}

.rara-screen.hidden {
  display: none !important;
}

.rara-screen {
  animation: raraScreenIn 0.35s ease both;
}

@keyframes raraScreenIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.rara-hero {
  position: relative;
  text-align: center;
  padding: 1rem 0.5rem 1.25rem;
  border-radius: 22px;
  background: linear-gradient(165deg, #ffe4e6 0%, #fce7f3 50%, #e0f2fe 100%);
  border: 3px solid #fb7185;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.rara-hero-heart {
  position: absolute;
  left: 8%;
  top: 12%;
  font-size: 2rem;
  animation: raraHeartBeat 1s ease-in-out infinite;
  opacity: 0.85;
}

.rara-hero-rara {
  position: absolute;
  right: 10%;
  top: 18%;
  font-size: 1.75rem;
  animation: raraRaraBounce 1.4s ease-in-out infinite;
}

@keyframes raraHeartBeat {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
  }
}

@keyframes raraRaraBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.rara-game-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.2rem, 4.5vw, 1.55rem);
  color: #9f1239;
}

.rara-tagline {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

.rara-home-goals {
  font-size: 0.82rem;
  color: #475569;
  text-align: center;
  margin: 0 0 0.85rem;
  line-height: 1.45;
}

.rara-big-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 0.5rem;
  min-height: 48px;
  font-size: 1rem !important;
  font-weight: 800 !important;
  border-radius: 16px !important;
}

.rara-story-card {
  background: #fff;
  border: 3px solid #7dd3fc;
  border-radius: 22px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  text-align: left;
  box-shadow: 0 12px 28px rgba(14, 116, 144, 0.12);
}

.rara-story-rara-jump {
  text-align: center;
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  animation: raraJump 0.9s ease-in-out infinite;
}

@keyframes raraJump {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

.rara-story-h {
  margin: 0 0 0.5rem;
  text-align: center;
  color: #0c4a6e;
}

.rara-story-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #334155;
  margin: 0 0 0.65rem;
}

.rara-goals-list {
  margin: 0 0 0.65rem;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.45;
}

.rara-dialog-bubble {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: #fef9c3;
  border: 2px solid #facc15;
  font-weight: 700;
  font-size: 0.88rem;
  color: #854d0e;
  font-style: italic;
}

.rara-levels-h {
  margin: 0 0 0.35rem;
  text-align: center;
  color: #0c4a6e;
}

.rara-levels-sub {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 0.75rem;
}

.rara-level-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rara-level-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 16px;
  border: 2px solid #38bdf8;
  background: linear-gradient(180deg, #fff 0%, #f0f9ff 100%);
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-weight: 700;
  color: #0c4a6e;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rara-level-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(14, 116, 144, 0.15);
}

.rara-level-btn--locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.rara-level-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fde047;
  border-radius: 12px;
  font-weight: 900;
  color: #713f12;
}

.rara-level-name {
  flex: 1;
  font-size: 0.88rem;
}

.rara-level-stars {
  flex-shrink: 0;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.rara-play-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  padding: 0 0.15rem;
}

.rara-lvl-label {
  font-weight: 800;
  font-size: 0.88rem;
  color: #0369a1;
}

.rara-canvas-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid #38bdf8;
  background: #0f172a;
  box-shadow: 0 14px 32px rgba(8, 47, 73, 0.2);
}

#rara-canvas {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.rara-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  z-index: 2;
}

.rara-overlay.hidden {
  display: none !important;
}

.rara-overlay-inner {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 0.35rem;
}

.rara-overlay-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 900;
  color: #9f1239;
  text-align: center;
}

.rara-overlay-desc {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.45;
  text-align: center;
}

.rara-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rara-choice {
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  border: 2px solid #94a3b8;
  background: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
}

.rara-choice--ok {
  border-color: #22c55e;
  background: #f0fdf4;
}

.rara-choice--shake {
  animation: raraShake 0.4s ease;
}

@keyframes raraShake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

.rara-organ-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.rara-organ-btn {
  flex: 1 1 90px;
  min-height: 48px;
  border-radius: 14px;
  border: 2px solid #0ea5e9;
  background: #e0f2fe;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
}

.rara-mini-q {
  font-size: 0.84rem;
  font-weight: 600;
  color: #0c4a6e;
  margin: 0 0 0.5rem;
  text-align: center;
}

.rara-edu-tip {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: #ecfdf5;
  border: 2px solid #34d399;
  font-size: 0.84rem;
  font-weight: 600;
  color: #065f46;
}

.rara-mobile-pad {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0.35rem;
  margin-top: 0.55rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.rara-pad-btn {
  min-height: 48px;
  border-radius: 14px;
  border: 2px solid #38bdf8;
  background: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.rara-pad-btn--act {
  background: #fef08a;
  border-color: #eab308;
}

.rara-control-hint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: #64748b;
  text-align: center;
}

.rara-lvl-result-card,
.rara-final-card {
  text-align: center;
  padding: 1rem 0.75rem;
}

.rara-lvl-stars {
  font-size: 1.75rem;
  margin: 0 0 0.35rem;
}

.rara-lvl-msg {
  font-size: 0.92rem;
  color: #334155;
  margin: 0 0 0.85rem;
}

.rara-lvl-actions,
.rara-final-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rara-final-trophy {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
  animation: raraTrophy 1.2s ease-in-out infinite;
}

@keyframes raraTrophy {

  0%,
  100% {
    transform: rotate(-5deg);
  }

  50% {
    transform: rotate(5deg) scale(1.05);
  }
}

.rara-final-h {
  margin: 0 0 0.35rem;
  color: #0c4a6e;
}

.rara-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin: 0.5rem 0;
}

.rara-badge {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047, #fbbf24);
  border: 2px solid #d97706;
  font-size: 0.78rem;
  font-weight: 800;
  color: #422006;
}

.rara-badge--soft {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.rara-final-quote {
  font-style: italic;
  font-weight: 600;
  color: #0369a1;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {

  .rara-screen,
  .rara-hero-heart,
  .rara-hero-rara,
  .rara-story-rara-jump,
  .rara-choice--shake,
  .rara-final-trophy {
    animation: none !important;
  }
}

.game-btn-arena {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  font-size: 1.05rem;
}

.game-countdown {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 20, 28, 0.92);
  backdrop-filter: blur(8px);
}

.game-countdown-num {
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 40px rgba(34, 197, 94, 0.45);
  line-height: 1;
}

.live-count-pop {
  animation: countPop 0.45s ease-out;
}

@keyframes countPop {
  0% {
    transform: scale(0.5);
    opacity: 0.6;
  }

  60% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.game-countdown-label {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Jeda antar sesi — animasi skor */
.game-session-break {
  position: fixed;
  inset: 0;
  z-index: 225;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.game-session-break[hidden],
.game-session-break.hidden {
  display: none !important;
}

.session-break-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(34, 197, 94, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    rgba(10, 14, 22, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.session-break-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.5rem 1.75rem;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.12),
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  animation: sessionCardIn 0.65s cubic-bezier(0.34, 1.3, 0.64, 1) both;
  overflow: hidden;
}

@keyframes sessionCardIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(24px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.session-break-sparkle {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 180deg at 50% 50%, transparent 0deg, rgba(34, 197, 94, 0.08) 60deg, transparent 120deg);
  animation: sessionSparkle 8s linear infinite;
  pointer-events: none;
}

@keyframes sessionSparkle {
  to {
    transform: rotate(360deg);
  }
}

.session-break-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #86efac;
}

.session-break-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ea580c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.session-break-sub {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.session-break-score-block {
  margin: 0.5rem 0 1rem;
  padding: 1rem 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.12) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.session-break-score-num {
  font-size: clamp(2.75rem, 12vw, 4rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #4ade80;
  text-shadow: 0 0 40px rgba(74, 222, 128, 0.35);
  animation: scoreGlow 1.5s ease-in-out infinite alternate;
}

@keyframes scoreGlow {
  from {
    filter: brightness(1);
  }

  to {
    filter: brightness(1.15);
  }
}

.session-break-score-num.is-counting {
  animation: scoreBump 0.28s ease;
}

@keyframes scoreBump {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(1);
  }
}

.session-break-score-meta {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.session-break-rank {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.45;
}

.session-break-rank strong {
  color: var(--accent);
}

.session-break-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.session-break-cd {
  margin-top: 1rem;
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
  min-height: 3.5rem;
  line-height: 1;
}

.session-break-cd:not(.hidden) {
  animation: sessionCdPop 0.5s ease;
}

@keyframes sessionCdPop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.game-session-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.game-session-pill {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(34, 197, 94, 0.2) 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #93c5fd;
}

.game-session-pill--2 {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28) 0%, rgba(245, 158, 11, 0.2) 100%);
  color: #e9d5ff;
}

.game-session-strip .game-q-progress {
  margin-bottom: 0;
}

.game-play--arena .game-arena-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .game-play--arena .game-arena-layout {
    grid-template-columns: 1fr;
  }

  .game-arena-col--live {
    order: -1;
  }
}

.game-q-progress {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.game-score--you {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.game-arena-col--live {
  position: sticky;
  top: 0.5rem;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 0.9rem 1rem;
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
}

.live-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.live-panel-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}

.live-panel-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #86efac;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.live-leaderboard {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 0.2rem;
}

.live-row {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  padding: 0.45rem 0.55rem 0.5rem;
  border: 1px solid transparent;
  transition: transform 0.35s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.live-row--me {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
}

.live-row--moved {
  animation: rowNudge 0.55s ease;
}

@keyframes rowNudge {
  0% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(-4px);
  }

  100% {
    transform: translateX(0);
  }
}

.live-row-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
}

.live-rank {
  flex-shrink: 0;
  width: 1.75rem;
  text-align: center;
  font-weight: 800;
}

.live-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.live-you {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  vertical-align: middle;
}

.live-score {
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  animation: scoreTick 0.35s ease;
}

@keyframes scoreTick {
  0% {
    transform: scale(1.15);
    color: #fff;
  }

  100% {
    transform: scale(1);
  }
}

.live-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  margin-top: 0.35rem;
  overflow: hidden;
}

.live-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-end-rank {
  font-size: 1.15rem;
  color: var(--text);
  margin: 0 0 0.75rem;
  text-align: center;
}

.game-end-rank strong {
  color: var(--accent);
}

.game-start h3,
.game-end h3 {
  margin: 0 0 0.5rem;
  color: var(--primary);
}

.game-start p,
.game-end p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dim);
}

.hidden {
  display: none !important;
}

.game-play .game-score {
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.game-question {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.game-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game-option {
  background: var(--bg-section);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  transition: all 0.2s;
}

.game-option:hover {
  border-color: var(--primary);
}

.game-option.correct {
  border-color: var(--primary);
  background: rgba(34, 197, 94, 0.2);
}

.game-option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.game-option:disabled {
  cursor: default;
  opacity: 0.8;
}

.game-feedback {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 500;
}

.game-feedback.correct {
  background: rgba(34, 197, 94, 0.2);
  color: var(--primary);
}

.game-feedback.wrong {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.game-end .final-score {
  font-size: 1.25rem;
  color: var(--accent);
}

.game-end .final-message {
  color: var(--text);
  margin-bottom: 1rem;
}

/* ===== Guru: hasil asesmen ===== */
.guru-hasil-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.guru-rekap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.guru-rekap-grid[hidden] {
  display: none !important;
}

.guru-rekap-card {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  text-align: center;
}

.guru-rekap-card-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  margin: 0 0 0.25rem;
}

.guru-rekap-card-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.3;
}

.guru-search-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.guru-search-row[hidden] {
  display: none !important;
}

.guru-search-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.guru-search-input {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-section);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.guru-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.guru-dashboard-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.guru-dashboard-split[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .guru-dashboard-split {
    grid-template-columns: 1fr;
  }
}

.guru-subheading {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.guru-subheading-desc {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.guru-siswa-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(55vh, 520px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.guru-siswa-card {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--primary);
}

.guru-siswa-card[hidden] {
  display: none !important;
}

.guru-siswa-card-name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.guru-siswa-card-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.guru-siswa-card-meta strong {
  color: var(--accent);
  font-weight: 700;
}

.guru-table tbody tr[hidden] {
  display: none;
}

.guru-hasil-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.btn-secondary {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-section);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger-outline:hover {
  border-color: #f87171;
  color: #f87171;
}

.guru-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.guru-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.guru-table th,
.guru-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.guru-table th {
  background: var(--bg-section);
  color: var(--accent);
  font-weight: 600;
}

.guru-table tbody tr:hover td {
  background: rgba(34, 197, 94, 0.06);
}

.guru-hasil-empty {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.guru-hasil-empty[hidden] {
  display: none;
}

/* ===== Refleksi (fullscreen, tema selaras media pembelajaran) ===== */
.ref-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0.5rem 0 1.5rem;
}

.ref-panel-hero {
  max-width: 280px;
  min-height: 160px;
}

.ref-panel-lead {
  margin: 0;
  text-align: center;
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  max-width: 36em;
}

.ref-storage-hint {
  width: 100%;
  margin: 0;
  padding: 1rem 1.15rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.97) 0%, rgba(230, 242, 255, 0.94) 100%);
  border: 1px solid rgba(180, 210, 240, 0.65);
  box-shadow:
    0 3px 0 rgba(100, 140, 180, 0.18),
    0 12px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.ref-storage-hint-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f3558;
  letter-spacing: 0.02em;
}

.ref-storage-steps {
  margin: 0 0 0.65rem;
  padding-left: 1.25rem;
  color: #153a5c;
  font-size: 0.9rem;
  line-height: 1.55;
}

.ref-storage-steps li {
  margin-bottom: 0.35rem;
}

.ref-storage-example,
.ref-storage-tech {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1e4970;
}

.ref-storage-example code,
.ref-storage-steps code {
  font-size: 0.88em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(30, 60, 100, 0.08);
}

.ref-video-card {
  width: 100%;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(230, 242, 255, 0.95) 100%);
  border: 1px solid rgba(180, 210, 240, 0.6);
  box-shadow:
    0 3px 0 rgba(100, 140, 180, 0.2),
    0 14px 36px rgba(0, 0, 0, 0.16),
    inset 0 2px 0 rgba(255, 255, 255, 1);
}

.ref-video-label {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f3558;
}

.ref-video-frame {
  border-radius: 12px;
  overflow: hidden;
  background: #0a0e14;
  border: 1px solid rgba(30, 60, 100, 0.2);
}

#refleksi-video {
  width: 100%;
  max-height: min(52vh, 420px);
  display: block;
}

.ref-video-fallback {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #6b2c2c;
  text-align: center;
}

.ref-video-fallback code {
  font-size: 0.92em;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
}

/* Video label di bagian lain (flipbook / legacy) */
.video-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.video-placeholder {
  border-radius: 12px;
  overflow: hidden;
  background: #0a0e14;
  border: 1px dashed var(--border);
}

/* ===== Media Pembelajaran (fullscreen seperti hub, hanya video) ===== */
#media-pembelajaran.section.section--mp.active {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 150;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body:has(#media-pembelajaran.active),
body:has(#refleksi.active) {
  overflow: hidden;
}

.section--mp,
.section--refleksi {
  padding: 0 !important;
}

#refleksi.section.section--refleksi.active {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 150;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mp-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  border-radius: 0;
}

.mp-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #3d6a9e;
  background-image:
    linear-gradient(180deg, rgba(120, 175, 220, 0.35) 0%, rgba(30, 55, 90, 0.45) 55%, rgba(12, 22, 40, 0.58) 100%),
    var(--mp-bg-image),
    var(--mp-bg-fallback);
  background-size: cover;
  background-position: center 36%;
  background-repeat: no-repeat;
}

.mp-deco {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.5;
  box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.08);
}

.mp-deco--left {
  width: min(46vw, 240px);
  height: min(46vw, 240px);
  left: -10%;
  top: 26%;
  background: radial-gradient(circle at 42% 42%, rgba(101, 67, 33, 0.65) 0%, rgba(45, 30, 18, 0.4) 50%, transparent 72%);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.mp-deco--right {
  width: min(42vw, 220px);
  height: min(42vw, 220px);
  right: -8%;
  top: 30%;
  background: radial-gradient(circle at 50% 48%, rgba(50, 75, 120, 0.55) 0%, rgba(25, 40, 70, 0.45) 55%, transparent 75%);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.mp-float-cloud {
  position: absolute;
  z-index: 1;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.mp-float-cloud--a {
  width: 70px;
  height: 44px;
  top: 20%;
  left: 12%;
  transform: rotate(-12deg);
}

.mp-float-cloud--b {
  width: 90px;
  height: 52px;
  top: 42%;
  right: 8%;
  transform: rotate(18deg);
}

.mp-float-cloud--c {
  width: 55px;
  height: 36px;
  bottom: 30%;
  left: 18%;
}

.mp-header {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: max(0.5rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0 max(0.75rem, env(safe-area-inset-left));
  flex-shrink: 0;
}

.mp-nav-pill {
  background: rgba(18, 28, 48, 0.72) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mp-brand {
  text-decoration: none;
  color: inherit;
  cursor: default;
}

.mp-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.75rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.mp-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.mp-menu.hidden {
  display: none !important;
}

.mp-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  padding: 0.5rem 0 1rem;
}

.mp-hero-col {
  flex: 1 1 280px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.mp-cloud {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(230, 242, 255, 0.95) 45%, rgba(200, 225, 255, 0.88) 100%);
  box-shadow:
    0 3px 0 rgba(100, 140, 180, 0.2),
    0 14px 36px rgba(0, 0, 0, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 12px rgba(120, 170, 220, 0.15);
  border: 1px solid rgba(180, 210, 240, 0.6);
}

.mp-cloud--hero {
  width: 100%;
  max-width: 320px;
  min-height: 200px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 52% 48% 50% 50% / 48% 52% 55% 45%;
}

.mp-hero-icon {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  filter: drop-shadow(0 2px 4px rgba(180, 140, 40, 0.35));
}

.mp-hero-label {
  font-size: clamp(0.95rem, 2.8vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #1a4a7a;
  text-transform: uppercase;
}

.mp-hero-tagline {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  max-width: 22em;
}

.mp-organ-col {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 2vw, 1rem);
  align-items: stretch;
  min-width: min(200px, 85vw);
}

.mp-3d-col {
  flex: 1 1 320px;
  max-width: 420px;
  width: 100%;
}

.mp-cloud--organ {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  min-height: 64px;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
  transition: transform 0.2s, filter 0.2s;
  border-radius: 48% 52% 50% 50% / 55% 45% 52% 48%;
}

.mp-cloud--organ:nth-child(2) {
  border-radius: 55% 45% 48% 52% / 50% 50% 48% 52%;
}

.mp-cloud--organ:nth-child(3) {
  border-radius: 50% 50% 55% 45% / 45% 55% 50% 50%;
}

.mp-cloud--organ:nth-child(4) {
  border-radius: 45% 55% 52% 48% / 52% 48% 45% 55%;
}

.mp-cloud--organ:hover {
  transform: scale(1.03) translateX(4px);
  filter: brightness(1.03);
}

.mp-organ-icon {
  font-size: 1.85rem;
  flex-shrink: 0;
}

.mp-organ-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #1a4a7a;
}

.mp-note {
  margin: 1rem auto 0;
  max-width: 640px;
  padding: 0.75rem 1rem;
  background: rgba(255, 235, 59, 0.92);
  color: #1a1a1a;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(200, 170, 0, 0.5);
}

.mp-note code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8em;
}

/* Mode presentasi: hilangkan catatan/tips agar layar bersih */
.welcome-intro-footnote,
.guru-intro-footnote,
.admin-note,
.mp-note,
.game-start-note,
.word-detail-panel .sel-note {
  display: none !important;
}

.mp-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.5rem 0 1rem;
}

.mp-detail.hidden {
  display: none !important;
}

.mp-detail:not(.hidden) {
  animation: mpDetailReveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes mpDetailReveal {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mp-detail:not(.hidden) {
    animation: none;
  }
}

.mp-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: rgba(15, 25, 45, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.mp-back:hover {
  background: rgba(15, 25, 45, 0.75);
}

.mp-detail-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.mp-detail-desc {
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.5;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  max-width: 52em;
}

.mp-detail-video {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0.85rem;
}

@media (max-width: 900px) {
  .mp-detail-video {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mp-layout {
    flex-direction: column;
  }

  .mp-organ-col {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .mp-3d-col {
    max-width: none;
  }

  .mp-cloud--organ {
    flex: 1 1 42%;
    min-width: 140px;
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

.mp-panel {
  background: rgba(15, 22, 32, 0.88);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
  backdrop-filter: blur(10px);
}

.mp-panel-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.mp-panel--3d {
  height: 100%;
}

.mp-3d-hint {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.mp-3d-view {
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  overflow: hidden;
  min-height: 240px;
}

#mp-model-viewer {
  width: 100%;
  height: 280px;
  --progress-bar-color: #22c55e;
  background: radial-gradient(circle at 30% 20%, #0f172a 0%, #020617 75%);
}

.mp-3d-actions {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.mp-3d-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
}

.mp-3d-btn.is-active {
  border-color: rgba(74, 222, 128, 0.8);
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.18);
}

.mp-video-box {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: min(56vh, 520px);
}

.mp-video-box video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.mp-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mp-panel--chat {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.mp-chat-lock {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: #fde68a;
}

.mp-chat-lock.is-ready {
  color: #86efac;
}

.mp-chat-messages {
  flex: 1;
  min-height: 180px;
  max-height: 42vh;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 0.6rem;
  background: rgba(2, 6, 23, 0.45);
}

.mp-chat-row {
  margin-bottom: 0.5rem;
  display: flex;
}

.mp-chat-row:last-child {
  margin-bottom: 0;
}

.mp-chat-bubble {
  max-width: 90%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.mp-chat-row--user {
  justify-content: flex-end;
}

.mp-chat-row--user .mp-chat-bubble {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(96, 165, 250, 0.5);
  color: #dbeafe;
}

.mp-chat-row--bot .mp-chat-bubble {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #dcfce7;
}

.mp-chat-form {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.5rem;
}

.mp-chat-input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 0.6rem 0.7rem;
}

.mp-chat-send {
  border: 1px solid rgba(74, 222, 128, 0.55);
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.2);
  color: #dcfce7;
  font-family: var(--font-sans);
  font-weight: 700;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
}

.mp-chat-send:disabled,
.mp-chat-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

/* ===== Asisten AI global (ikon ? semua halaman) ===== */
.global-help-root {
  position: fixed;
  z-index: 400;
  inset: 0;
  pointer-events: none;
}

/* Nudge/balon chat singkat untuk mengajak murid bertanya ke AI */
.global-help-nudge {
  pointer-events: auto;
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 76px);
  width: min(270px, calc(100vw - 2rem));
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.24));
  animation: globalHelpNudgeIn 520ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.global-help-nudge[hidden] {
  display: none !important;
}

@keyframes globalHelpNudgeIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.global-help-nudge-bubble {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.global-help-nudge-mascot {
  position: absolute;
  left: -14px;
  top: -16px;
  width: 54px;
  height: 54px;
  transform: rotate(-4deg);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.18));
}

.global-help-nudge-cat {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(145deg, #fef08a 0%, #fde68a 45%, #fda4af 120%);
  box-shadow:
    0 14px 20px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.24) inset;
  animation: globalHelpMiniFloat 2.2s ease-in-out infinite;
}

.global-help-nudge-cat-ear {
  position: absolute;
  top: -8px;
  width: 18px;
  height: 18px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(145deg, #fef08a 0%, #fde68a 45%, #fda4af 120%);
  border-radius: 4px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.global-help-nudge-cat-ear--l {
  left: 6px;
}

.global-help-nudge-cat-ear--r {
  right: 6px;
}

.global-help-nudge-cat-face {
  position: absolute;
  inset: 0;
}

.global-help-nudge-cat-eye {
  position: absolute;
  top: 22px;
  left: 18px;
  width: 7px;
  height: 10px;
  border-radius: 999px;
  background: #0f172a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  animation: globalHelpMiniBlink 4.1s infinite;
}

.global-help-nudge-cat-eye--r {
  left: auto;
  right: 18px;
  animation-delay: 0.2s;
}

.global-help-nudge-cat-nose {
  position: absolute;
  top: 33px;
  left: 50%;
  width: 8px;
  height: 6px;
  transform: translateX(-50%);
  background: #fb7185;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(251, 113, 133, 0.35);
}

.global-help-nudge-cat-mouth {
  position: absolute;
  top: 38px;
  left: 50%;
  width: 18px;
  height: 10px;
  transform: translateX(-50%);
}

.global-help-nudge-cat-mouth::before,
.global-help-nudge-cat-mouth::after {
  content: '';
  position: absolute;
  top: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid #0f172a;
  border-top: none;
  border-left: none;
  border-radius: 0 0 10px 0;
  opacity: 0.7;
}

.global-help-nudge-cat-mouth::before {
  left: 0;
  transform: rotate(180deg);
}

.global-help-nudge-cat-mouth::after {
  right: 0;
}

.global-help-nudge-cat-cheek {
  position: absolute;
  top: 35px;
  width: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(251, 113, 133, 0.6);
}

.global-help-nudge-cat-cheek--l {
  left: 10px;
}

.global-help-nudge-cat-cheek--r {
  right: 10px;
}

.global-help-nudge-cat-paw {
  position: absolute;
  right: -6px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(145deg, #fef08a 0%, #fde68a 45%, #fda4af 120%);
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.14);
  transform-origin: 30% 70%;
  animation: globalHelpMiniWave 1.35s ease-in-out infinite;
}

@keyframes globalHelpMiniFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-3px) rotate(-2deg);
  }
}

@keyframes globalHelpMiniBlink {

  0%,
  94%,
  100% {
    transform: scaleY(1);
  }

  96% {
    transform: scaleY(0.1);
  }
}

@keyframes globalHelpMiniWave {

  0%,
  100% {
    transform: rotate(6deg);
  }

  50% {
    transform: rotate(-16deg);
  }
}

.global-help-nudge-bubble::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -10px;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  transform: rotate(45deg);
}

.global-help-nudge-title {
  margin: 0 0 0.25rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.global-help-nudge-text {
  margin: 0;
  color: rgba(15, 23, 42, 0.88);
  font-weight: 700;
  line-height: 1.25;
}

.global-help-nudge-close {
  pointer-events: auto;
  position: absolute;
  top: -10px;
  right: -10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(145deg, #fb7185, #f97316);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 12px 22px rgba(244, 63, 94, 0.25);
}

.global-help-nudge-close:focus-visible {
  outline: 3px solid var(--kid-focus);
  outline-offset: 3px;
}

.global-help-fab {
  pointer-events: auto;
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 35%),
    linear-gradient(145deg, #22c55e 0%, #16a34a 45%, #0ea5e9 120%);
  color: #fff;
  box-shadow:
    0 10px 26px rgba(14, 165, 233, 0.22),
    0 14px 34px rgba(34, 197, 94, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  animation: globalHelpFloat 2.6s ease-in-out infinite;
}

.global-help-fab:hover {
  transform: translateY(-2px) scale(1.06);
  filter: saturate(1.08);
  box-shadow:
    0 16px 38px rgba(14, 165, 233, 0.24),
    0 18px 44px rgba(34, 197, 94, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

.global-help-fab:active {
  transform: translateY(0) scale(0.98);
}

@keyframes globalHelpFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.global-help-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.global-help-sparkle {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: rotate(15deg) scale(0.8);
  opacity: 0;
  filter: drop-shadow(0 6px 10px rgba(250, 204, 21, 0.25));
  animation: globalHelpSparkle 2.2s ease-in-out infinite;
}

.global-help-sparkle::before,
.global-help-sparkle::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(145deg, #fde047, #fb7185);
  transform: rotate(45deg);
}

.global-help-sparkle::after {
  transform: rotate(-45deg);
  opacity: 0.9;
}

.global-help-sparkle--1 {
  top: -6px;
  left: 8px;
  animation-delay: 0.1s;
}

.global-help-sparkle--2 {
  top: 10px;
  right: -6px;
  animation-delay: 0.8s;
}

.global-help-sparkle--3 {
  bottom: -6px;
  left: -4px;
  animation-delay: 1.3s;
}

.global-help-sparkle--4 {
  bottom: 6px;
  right: 10px;
  animation-delay: 1.75s;
}

@keyframes globalHelpSparkle {
  0% {
    opacity: 0;
    transform: translateY(6px) rotate(15deg) scale(0.6);
  }

  18% {
    opacity: 1;
    transform: translateY(0) rotate(15deg) scale(1);
  }

  45% {
    opacity: 0.9;
    transform: translateY(-2px) rotate(15deg) scale(0.95);
  }

  70%,
  100% {
    opacity: 0;
    transform: translateY(-8px) rotate(15deg) scale(0.7);
  }
}

.global-help-fab-mascot {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.global-help-fab-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  left: auto;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-family: var(--font-sans), system-ui, sans-serif;
  background: linear-gradient(145deg, #f97316, #facc15);
  color: #1e293b;
  box-shadow: 0 8px 18px rgba(250, 204, 21, 0.25);
  transform: rotate(-10deg);
  z-index: 3;
}

.global-help-cat {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.1)),
    linear-gradient(145deg, #fef08a 0%, #fde68a 40%, #fda4af 120%);
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.24) inset;
  animation: globalHelpCatBounce 2.2s ease-in-out infinite;
}

.global-help-cat::before,
.global-help-cat::after {
  content: '';
  position: absolute;
  top: -6px;
  width: 16px;
  height: 16px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(145deg, #fef08a 0%, #fde68a 45%, #fda4af 120%);
  border-radius: 4px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.global-help-cat::before {
  left: 2px;
}

.global-help-cat::after {
  right: 2px;
}

@keyframes globalHelpCatBounce {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-3px) rotate(-2deg);
  }
}

.global-help-cat-inner {
  position: absolute;
  inset: 0;
}

.global-help-cat-forehead {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 18px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
}

.global-help-cat-eyes {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 2;
}

.global-help-cat-eyes>span {
  width: 8px;
  height: 10px;
  border-radius: 999px;
  background: #0f172a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  animation: globalHelpBlink 4.2s infinite;
}

.global-help-cat-eyes>span:nth-child(2) {
  animation-delay: 0.25s;
}

@keyframes globalHelpBlink {

  0%,
  94%,
  100% {
    transform: scaleY(1);
  }

  96% {
    transform: scaleY(0.1);
  }
}

.global-help-cat-nose {
  position: absolute;
  top: 26px;
  left: 50%;
  width: 8px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #fb7185;
  box-shadow: 0 2px 8px rgba(251, 113, 133, 0.25);
  z-index: 2;
}

.global-help-cat-mouth {
  position: absolute;
  top: 30px;
  left: 50%;
  width: 16px;
  height: 8px;
  transform: translateX(-50%);
  border-bottom: 3px solid rgba(15, 23, 42, 0.9);
  border-radius: 0 0 999px 999px;
  z-index: 2;
}

.global-help-cat-whiskers {
  position: absolute;
  top: 28px;
  width: 16px;
  height: 10px;
  z-index: 1;
  opacity: 0.9;
}

.global-help-cat-whiskers--l {
  left: 4px;
  background:
    linear-gradient(0deg, transparent 0 2px, rgba(15, 23, 42, 0.7) 2px 3px, transparent 3px 5px, rgba(15, 23, 42, 0.7) 5px 6px, transparent 6px 10px);
  transform: rotate(-10deg);
}

.global-help-cat-whiskers--r {
  right: 4px;
  background:
    linear-gradient(0deg, transparent 0 2px, rgba(15, 23, 42, 0.7) 2px 3px, transparent 3px 5px, rgba(15, 23, 42, 0.7) 5px 6px, transparent 6px 10px);
  transform: rotate(10deg);
}

.global-help-cat-cheek {
  position: absolute;
  top: 26px;
  width: 10px;
  height: 7px;
  border-radius: 999px;
  background: rgba(253, 164, 175, 0.8);
  z-index: 1;
}

.global-help-cat-cheek--l {
  left: 10px;
}

.global-help-cat-cheek--r {
  right: 10px;
}

.global-help-fab-label {
  position: absolute;
  right: 76px;
  bottom: 14px;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 0.8rem;
  font-weight: 800;
  font-family: var(--font-sans), system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.global-help-fab-label::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  width: 10px;
  height: 10px;
  background: rgba(15, 23, 42, 0.9);
  border-right: 1px solid rgba(148, 163, 184, 0.22);
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  transform: translateY(-50%) rotate(45deg);
}

.global-help-backdrop {
  pointer-events: auto;
  position: fixed;
  inset: 0;
  z-index: 398;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.global-help-panel {
  pointer-events: auto;
  position: fixed;
  z-index: 399;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(5.5rem, calc(1rem + env(safe-area-inset-bottom)));
  left: auto;
  top: auto;
  width: min(420px, calc(100vw - 2rem));
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 18% 12%, rgba(250, 204, 21, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 18%, rgba(34, 197, 94, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 55% 105%, rgba(14, 165, 233, 0.14) 0%, transparent 45%),
    linear-gradient(165deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.global-help-panel[hidden] {
  display: none !important;
}

.global-help-backdrop[hidden] {
  display: none !important;
}

.global-help-panel-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
}

.global-help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.global-help-title {
  margin: 0;
  font-size: 1.15rem;
  font-family: var(--font-sans), system-ui, sans-serif;
  font-weight: 700;
  color: #f1f5f9;
}

.global-help-sub {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #94a3b8;
}

.global-help-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.global-help-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.global-help-messages {
  flex: 1;
  min-height: 120px;
  max-height: 36vh;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.global-help-msg {
  display: flex;
  width: 100%;
}

.global-help-msg--user {
  justify-content: flex-end;
}

.global-help-msg--bot {
  justify-content: flex-start;
}

.global-help-bubble {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  font-family: var(--font-sans), system-ui, sans-serif;
}

.global-help-msg--user .global-help-bubble {
  background: rgba(34, 197, 94, 0.25);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #ecfdf5;
}

.global-help-msg--bot .global-help-bubble {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.global-help-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem 1rem 0.75rem;
  align-items: center;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.global-help-input {
  flex: 1 1 140px;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: #f8fafc;
  font-family: var(--font-sans), system-ui, sans-serif;
  font-size: 0.9rem;
}

.global-help-input::placeholder {
  color: #64748b;
}

.global-help-voice {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(59, 130, 246, 0.15);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.global-help-voice.is-listening {
  animation: globalHelpPulse 1s ease infinite;
  border-color: #22c55e;
}

@keyframes globalHelpPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
}

.global-help-send {
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(145deg, #22c55e, #15803d);
  color: #fff;
  font-family: var(--font-sans), system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.global-help-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.global-help-toolbar {
  padding: 0 1rem 0.85rem;
}

.global-help-mute {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-family: var(--font-sans), system-ui, sans-serif;
}

.global-help-mute:hover {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.45);
}

@media (max-width: 480px) {
  .global-help-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-height: 70vh;
    bottom: max(4.75rem, env(safe-area-inset-bottom));
  }

  .global-help-fab-label {
    display: none;
  }

  .global-help-nudge {
    bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 70px);
    width: min(260px, calc(100vw - 1.5rem));
  }

  .global-help-nudge-mascot {
    left: -10px;
    top: -14px;
    width: 50px;
    height: 50px;
  }

  .global-help-nudge-cat {
    width: 50px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-help-fab {
    animation: none;
  }

  .global-help-cat {
    animation: none;
  }

  .global-help-sparkle {
    animation: none;
    opacity: 0;
  }

  .global-help-voice.is-listening {
    animation: none;
  }

  .global-help-nudge {
    animation: none;
  }

  .global-help-nudge-cat,
  .global-help-nudge-cat-eye,
  .global-help-nudge-cat-paw {
    animation: none;
  }
}

/* =======================================================================
   Tema komponen "anak SD" (tanpa mengubah background halaman)
   ======================================================================= */
/* Ikon tombol konsisten via data-icon */
button[data-icon] {
  position: relative;
}

button[data-icon]::before {
  content: '';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  margin-right: 0.45em;
  transform: translateY(0.02em);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.18));
}

button[data-icon='enter']::before {
  content: '🚪';
}

button[data-icon='next']::before {
  content: '➡️';
}

button[data-icon='back']::before {
  content: '⬅️';
}

button[data-icon='home']::before {
  content: '🏠';
}

button[data-icon='cloud']::before {
  content: '☁️';
}

button[data-icon='cloud-back']::before {
  content: '☁️';
}

button[data-icon='sound']::before {
  content: '🔊';
}

button[data-icon='logout']::before {
  content: '🚪';
}

/* Khusus "kembali": jika sudah ada panah teks, ikon tetap kecil dan rapi */
button[data-icon='back']::before,
button[data-icon='cloud-back']::before {
  margin-right: 0.4em;
  opacity: 0.95;
}

button,
a,
[role='button'] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--kid-focus);
  border-color: rgba(250, 204, 21, 0.8) !important;
}

/* Tombol: lebih besar, bulat, dan jelas */
.btn-primary,
.btn-secondary,
.btn-masuk,
.btn-role,
.name-pill-submit,
.btn-flip,
.nav-btn,
.menu-toggle,
.mp-back,
.btn-menu-materi,
.btn-menu-utama,
.materi-spd-back,
.materi-spd-bubble,
.hub-cloud,
.game-btn-arena {
  font-weight: 800;
  letter-spacing: 0.01em;
  border-radius: var(--kid-radius);
}

.btn-primary,
.btn-masuk,
.name-pill-submit,
.game-btn-arena {
  background: var(--kid-primary-grad) !important;
  border: none !important;
  color: #062113 !important;
  box-shadow: var(--kid-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary:hover,
.btn-masuk:hover,
.name-pill-submit:hover,
.game-btn-arena:hover {
  transform: translateY(-2px);
  box-shadow: var(--kid-shadow-strong);
  filter: saturate(1.05);
}

.btn-primary:active,
.btn-masuk:active,
.name-pill-submit:active,
.game-btn-arena:active {
  transform: translateY(0);
}

.btn-secondary {
  border-width: 2px !important;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
}

.btn-secondary:hover {
  border-color: rgba(250, 204, 21, 0.55) !important;
  transform: translateY(-1px);
}

/* Navigasi tab (atas): lebih mudah untuk anak SD */
.nav-btn {
  border-width: 2px;
  border-radius: 14px;
  padding: 0.62rem 0.95rem;
  font-size: 0.95rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.nav-btn.active {
  background: var(--kid-warm-grad) !important;
  color: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.menu-toggle {
  border-width: 2px;
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

/* Menu top links: jadi chip yang enak dibaca */
.landing-link {
  border-radius: 14px;
  font-weight: 800;
}

/* Input nama: lebih jelas */
.name-pill-input {
  font-size: 1rem;
  font-weight: 700;
}

/* Awan menu: lebih kontras & playful (tanpa ubah background) */
.hub-cloud {
  border-width: 2px !important;
  border-radius: 28px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.hub-cloud:hover {
  transform: translateY(-4px) scale(1.02);
  filter: saturate(1.05);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.2);
}

.hub-cloud:active {
  transform: translateY(-1px) scale(0.99);
}

/* CTA Materi SPD */
.materi-spd-bubble {
  border-width: 2px !important;
  border-radius: 26px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

/* Flipbook control buttons */
.btn-flip {
  border-width: 2px !important;
  border-radius: 14px;
  font-weight: 800;
}

/* Opsi game: seperti kartu jawaban */
.game-option {
  border-width: 2px !important;
  border-radius: 16px;
  font-weight: 750;
}

/* Target sentuh minimal */
button,
.landing-link,
.hub-cloud,
.nav-btn,
.btn-flip,
.game-option,
.word-chip,
.materi-spd-bubble {
  min-height: 44px;
}

/* =======================================================================
   Responsive / Tambahan untuk Mobile
   ======================================================================= */
@media (max-width: 768px),
(max-height: 600px) {

  /* Utility & Layout Resets */
  .landing-hero,
  .role-main,
  .name-main,
  .admin-main,
  .login-main,
  .hub-main,
  .materi-spd-main {
    max-width: 100%;
    padding: 1rem;
    height: auto;
    overflow-x: hidden;
  }

  .landing-page,
  .role-page,
  .name-page,
  .hub-page,
  .materi-spd-page {
    justify-content: flex-start !important;
    padding-top: max(3rem, env(safe-area-inset-top));
  }

  /* Typography */
  .landing-headline {
    font-size: 2rem;
    text-align: center;
  }

  .materi-spd-page-title {
    font-size: 1.25rem;
    text-align: center;
  }

  .intro-h3 {
    font-size: 1.1rem;
  }

  .landing-ar {
    font-size: 1.25rem;
  }

  /* Navigation & Headers */
  .landing-nav-pill,
  .hub-nav-pill,
  .materi-spd-nav-pill {
    flex-wrap: wrap;
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
  }

  .landing-brand {
    margin-bottom: 0px;
    width: auto;
    flex: 1 1 100%;
    text-align: center;
  }

  .landing-links {
    display: flex;
    /* Ganti dari none ke flex wrap */
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 0.5rem;
    padding-top: 0.5rem;
  }

  /* Sembunyikan toggle karena links langsung terlihat (karena flex-wrap) */
  .landing-menu-toggle {
    display: none;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .header-brand-block {
    justify-content: center;
    text-align: center;
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .nav-btn {
    flex: 1 1 calc(50% - 0.5rem);
    text-align: center;
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  /* Buttons & Inputs */
  .btn-masuk,
  .btn-role,
  .name-pill-submit,
  .game-btn-arena,
  .materi-spd-bubble {
    width: 100%;
    min-width: unset;
  }

  .role-buttons {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }

  /* Hub Clouds Override (Biar tidak muter-muter absolute di layar HP) */
  .hub-cluster {
    position: relative !important;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    transform: none !important;
    height: auto !important;
    align-items: center;
  }

  .hub-cloud {
    position: relative !important;
    transform: none !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 90%;
    margin-bottom: 0.5rem;
    justify-content: center;
  }

  /* Flipbook */
  .flipbook-container {
    flex-direction: column;
    padding: 1rem 0;
    width: 100%;
    align-items: center;
  }

  .flipbook-viewport {
    width: 100%;
    min-height: 400px;
  }

  .flipbook-controls {
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.5rem;
  }

  .flipbook-stage {
    transform: scale(0.85);
    transform-origin: top center;
  }

  /* Media Pembelajaran */
  .mp-shell {
    padding: 0.5rem;
  }

  .mp-stage {
    flex-direction: column;
    height: auto;
  }

  .mp-menu {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 250px;
    overflow-y: auto;
  }

  .mp-viewer {
    min-height: 300px;
    height: auto;
  }

  .mp-media-placeholder,
  .mp-video {
    min-height: 220px;
  }

  .mp-video {
    width: 100%;
  }

  /* Columns & Grids */
  .materi-spd-duo {
    flex-direction: column;
    gap: 1.5rem;
  }

  .materi-spd-col {
    width: 100%;
  }

  .intro-grid {
    flex-direction: column;
    gap: 1rem;
    display: flex;
  }

  .intro-infogrid {
    grid-template-columns: 1fr 1fr;
  }

  /* Modals */
  .landing-modal {
    width: 95%;
    max-width: none;
    padding: 1.25rem;
    top: 50%;
    transform: translate(-50%, -50%) !important;
    left: 50%;
    max-height: 85vh;
    overflow-y: auto;
  }

  /* Admin & Forms */
  .admin-table-wrap {
    overflow-x: auto;
    display: block;
    width: 100%;
  }

  .name-pill-field {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }

  .name-form-block {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
  }

  .name-pill-label {
    margin-bottom: 0.5rem;
    text-align: left;
    width: 100%;
  }

  .name-pill-input {
    border-radius: 8px;
    width: 100%;
  }

  /* Intro / Mascot */
  .welcome-intro-inner,
  .guru-intro-card {
    padding: 1rem;
    width: 100%;
  }

  .welcome-mascot {
    width: 70%;
    max-width: 200px;
  }

  .guru-intro-top {
    flex-direction: column;
    text-align: center;
  }

  /* Utilities */
  .btn-kembali-landing {
    width: 100%;
    display: block;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .landing-headline {
    font-size: 1.6rem;
  }

  .landing-quote {
    font-size: 0.9rem;
  }

  .landing-brand-text {
    font-size: 0.65rem;
    max-width: 180px;
    white-space: normal;
  }

  .intro-infogrid {
    grid-template-columns: 1fr;
  }

  .btn-role,
  .btn-masuk,
  .name-pill-submit {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  /* Game Arena */
  .game-arena {
    padding: 0.5rem;
  }

  .game-option {
    font-size: 0.9rem;
    padding: 0.5rem;
    min-height: unset;
  }

  /* Hub Cloud Text */
  .hub-cloud-text {
    font-size: 0.9rem;
  }
}

/* --- NEW LANDING PAGE HALAMAN 1 --- */
.new-landing {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at center 35%, #245882 0%, #153856 80%, #0d263b 100%);
  color: #fff;
  z-index: 200;
}

.new-header {
  position: absolute;
  top: 1.5rem;
  left: 0;
  width: 100%;
  padding: 0 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
}

.new-brand {
  display: flex;
  align-items: center;
}

.new-brand-logo {
  height: 38px;
  margin-right: 0.6rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.new-brand-text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.new-menu-container {
  position: relative;
}

.new-menu-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: background 0.2s, transform 0.2s;
}

.new-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.landing-links {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(20, 56, 86, 0.98);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  list-style: none;
  margin: 0;
  padding: 0.8rem;
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 200px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  z-index: 100;
  animation: menuFadeIn 0.3s cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.landing-links.is-active {
  display: flex;
}

.landing-link {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #fff;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, padding-left 0.2s;
}

.landing-link:hover {
  background: rgba(255, 255, 255, 0.1);
  padding-left: 1.5rem;
}

.new-menu-toggle span {
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 400;
}

.new-hero-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.new-hero-left {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 55%;
  height: 100vh;
  z-index: 1;
}

.asset-masjid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.2));
  -webkit-mask-image: linear-gradient(to right, black 65%, transparent 100%);
  mask-image: linear-gradient(to right, black 65%, transparent 100%);
}

.new-hero-right {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 55%;
  height: 100vh;
  z-index: 2;
}

.asset-karakter {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  display: block;
  filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.35));
  -webkit-mask-image: linear-gradient(to left, black 65%, transparent 100%);
  mask-image: linear-gradient(to left, black 65%, transparent 100%);
}

.new-hero-center {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.new-hero-title {
  margin: 0;
  line-height: 1.15;
  text-align: center;
}

.greeting-gold {
  font-family: 'Baloo 2', sans-serif;
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(180deg, #fff2a8 0%, #ffd061 45%, #e1aa1b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0px 3px 1px #462c04) drop-shadow(0px 6px 12px rgba(0, 0, 0, 0.6));
}

.greeting-gold-top {
  font-size: clamp(1.8rem, 3.8vw, 2.8rem);
}

.new-hero-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  margin-top: 0.5rem;
  margin-bottom: 0;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}

.new-btn-mulai {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: linear-gradient(180deg, #71ba42 0%, #519027 100%);
  color: white;
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  padding: 0.6rem 2.5rem;
  border: 4px solid #3c6e1a;
  border-radius: 999px;
  box-shadow: 0 0 20px rgba(113, 186, 66, 0.4), 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, filter 0.2s;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: btnGlow 2s ease-in-out infinite alternate;
}

@keyframes btnGlow {
  from {
    box-shadow: 0 0 10px rgba(113, 186, 66, 0.4), 0 6px 16px rgba(0, 0, 0, 0.4);
  }

  to {
    box-shadow: 0 0 25px rgba(113, 186, 66, 1), 0 8px 20px rgba(0, 0, 0, 0.5);
  }
}

.new-btn-mulai:hover {
  transform: translateX(-50%) scale(1.05);
  filter: brightness(1.1);
}

.new-landing-footer {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 5;
  color: rgba(255, 255, 255, 0.5);
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  font-family: var(--font-sans);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

@media (max-width: 900px) {
  .new-menu-container {
    display: block;
  }

  .new-hero-container {
    flex-direction: column;
    justify-content: center;
  }

  .new-hero-center {
    top: 15%;
  }

  .greeting-gold {
    font-size: 2.6rem;
  }

  .greeting-gold-top {
    font-size: 2.2rem;
  }

  .new-hero-subtitle {
    font-size: 1.2rem;
  }

  .new-hero-left {
    width: 65%;
    left: -5%;
    bottom: -2%;
  }

  .new-hero-right {
    width: 75%;
    right: -10%;
    bottom: -2%;
  }

  .new-btn-mulai {
    bottom: 8%;
    font-size: 1.2rem;
    padding: 0.7rem 2.5rem;
  }
}

@media (max-width: 600px) {
  .new-brand-text {
    font-size: 1.1rem;
  }

  .new-menu-toggle {
    font-size: 1rem;
  }

  .new-hero-center {
    top: 12%;
  }

  .greeting-gold {
    font-size: 2.2rem;
  }

  .greeting-gold-top {
    font-size: 1.8rem;
  }

  .new-hero-left {
    width: 80%;
    left: -10%;
  }

  .new-hero-right {
    width: 90%;
    right: -15%;
  }
}

/* --- HALAMAN 2: LOGIN & PETA PETUALANGAN --- */
.login-map-page {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: #0d1e33;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
  font-family: var(--font-sans);
}

.login-map-page .new-header {
  position: relative;
  height: 70px;
  background: #0d2641;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.login-map-page .ai-widget-container {
  display: none !important;
}

.login-map-main {
  flex: 1;
  display: flex;
  height: calc(100vh - 70px);
}

.login-map-sidebar {
  width: 28%;
  min-width: 320px;
  background: #113457;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
}

.sidebar-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #fbbf24;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.login-map-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group label {
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  display: block;
}

.login-input {
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  font-size: 1.2rem;
  color: #333;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-pos-1 {
  margin-top: 1.5rem;
  background: linear-gradient(180deg, #7ad23f 0%, #519027 100%);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  padding: 1rem;
  border: 3px solid #3c6e1a;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.login-map-content {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0d1e33;
}

.map-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.map-img-asset {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: fill; /* Force-fill for edge-to-edge as requested */
  filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.4));
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.map-guidance {
  display: none;
}

/* --- HALAMAN 3: VIRTUAL LAB & CHATBOT AI --- */
.global-menu-btn {
  background: #fbbf24;
  color: #1e293b;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  transition: all 0.3s;
}

.global-menu-btn:hover {
  background: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.menu-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.global-dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 220px;
  z-index: 1000;
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);
  transform-origin: top right;
  animation: menuPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes menuPop {
  from { opacity: 0; transform: scale(0.8) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.menu-item-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  font-weight: 700;
  font-family: var(--font-sans);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.menu-item-card:hover {
  background: #fbbf24;
  color: #1e293b;
  transform: translateX(8px);
  border-color: #fbbf24;
}

.is-hidden {
  display: none !important;
}

.vlab-page {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #0d1e33 url('assets/bg3.jpeg') center center no-repeat;
  background-size: cover;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
  font-family: var(--font-sans);
}

.new-menu-toggle {
  background: #fbbf24;
  color: #1e293b;
  border: none;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  padding: 0.5rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: all 0.2s;
  font-size: 1rem;
}

.new-menu-toggle:hover {
  background: #f59e0b;
  transform: translateY(-2px);
}

/* Menu Overlay */
.vlab-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(13, 30, 51, 0.95);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.vlab-menu-content {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 3rem;
  width: 90%;
  max-width: 500px;
  position: relative;
  text-align: center;
}

.vlab-menu-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
}

.vlab-menu-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #fbbf24;
}

.vlab-menu-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vlab-menu-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem;
  border-radius: 15px;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.vlab-menu-item:hover {
  background: #fbbf24;
  color: #1e293b;
  transform: translateX(10px);
}

.vlab-menu-divider {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.vlab-main {
  flex: 1;
  display: flex;
  padding: 0;
  position: relative;
}

.vlab-interaction-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  position: relative;
  background: transparent;
}

.vlab-center-visual {
  display: none; /* Hidden because it's now a background */
}

.organ-left-side {
  position: absolute;
  left: 22%;
  top: 45%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 10;
}

.organ-right-side {
  position: absolute;
  right: 22%;
  top: 45%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 10;
}

.btn-organ {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  border: 4px solid #fff;
  border-radius: 25px;
  color: #fff;
  padding: 0.7rem 1.5rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  box-shadow: 0 8px 15px rgba(0,0,0,0.3);
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  min-width: 160px;
}

.btn-organ:hover {
  transform: scale(1.1) rotate(-2deg);
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-color: #fff;
  box-shadow: 0 12px 20px rgba(245, 158, 11, 0.4);
}

.btn-organ:active {
  transform: scale(0.95);
}

.btn-organ span {
  font-size: 1.4rem;
  transition: transform 0.3s;
}

.btn-organ:hover span {
  transform: translateX(5px);
}

.organ-left-side .btn-organ:hover span {
  transform: translateX(-5px);
}

.btn-organ:hover {
  background: #22d3ee;
  color: #0d1e33;
  transform: scale(1.05);
}

.vlab-bottom-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}

.vlab-right-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: flex-end;
  z-index: 10;
}

.aiman-robot-container {
  position: absolute;
  right: 20px;
  bottom: 20px; /* Ujung bawah as requested */
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.3s;
}

.aiman-floating-robot {
  width: 140px;
  height: auto;
  filter: drop-shadow(0 0 15px rgba(34, 211, 238, 0.4));
  animation: aimanFloat 2.5s ease-in-out infinite;
  cursor: pointer;
}

@keyframes aimanFloat {
  0%, 100% { transform: translateY(0) scale(1.0); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.aiman-hover-label {
  background: #fbbf24;
  color: #0d1e33;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  opacity: 0.8;
  transition: opacity 0.3s;
}

.aiman-robot-container:hover .aiman-hover-label {
  opacity: 1;
}

.vlab-chatbot-box {
  background: #fff;
  border-radius: 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 300px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  position: absolute;
  right: 140px; /* Positioned beside the robot */
  bottom: 40px;
  z-index: 90;
  animation: chatSlideIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

@keyframes chatSlideIn {
  from { opacity: 0; transform: scale(0.8) translate(20px, 20px); }
  to { opacity: 1; transform: scale(1) translate(0, 0); }
}

.vlab-chatbot-box.is-hidden {
  display: none;
}

.chatbot-header {
  background: #3b82f6;
  color: #fff;
  padding: 0.6rem 1rem;
  font-weight: 800;
}

.aiman-name {
  color: #fff;
}

.chatbot-bubble {
  background: #fff;
  color: #1e293b;
  padding: 1rem;
  min-height: 80px;
  font-weight: 600;
  font-size: 0.9rem;
}

.chatbot-input-area {
  display: flex;
  gap: 0;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.5rem;
}

.chatbot-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.5rem;
  color: #333;
  font-size: 0.9rem;
}

.btn-chat-send {
  background: #22d3ee;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tombol Petualangan di Vlab */
.vlab-bottom-center {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
}

.btn-petualangan {
  background: var(--kid-warm-grad);
  color: #fff;
  border: 4px solid #fff;
  border-radius: 60px;
  padding: 1.2rem 4rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 12px 35px rgba(249, 115, 22, 0.5);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-shadow: 0 3px 6px rgba(0,0,0,0.3);
  white-space: nowrap;
  animation: pulseAdventure 2.5s infinite alternate;
}

@keyframes pulseAdventure {
  from { box-shadow: 0 12px 35px rgba(249, 115, 22, 0.5); transform: scale(1); }
  to { box-shadow: 0 20px 50px rgba(249, 115, 22, 0.7); transform: scale(1.03); }
}

.btn-petualangan:hover {
  transform: translateY(-12px) scale(1.08);
  box-shadow: 0 25px 60px rgba(249, 115, 22, 0.8);
  filter: brightness(1.15);
  animation: none;
}

.btn-petualangan:active {
  transform: translateY(-2px) scale(0.95);
}

.btn-petualangan-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

@media (max-width: 768px) {
  .btn-petualangan {
    padding: 1rem 2.5rem;
    font-size: 1.4rem;
  }
  .btn-petualangan-icon {
    font-size: 1.8rem;
  }
  .vlab-bottom-center {
    bottom: 110px;
    width: 90%;
    display: flex;
    justify-content: center;
  }
}

.vlab-footer {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --- ADVENTURE MAP PINS --- */
.map-image-container {
  position: relative;
  background: #0d1e33;
}

.login-map-page.adventure-mode .login-map-sidebar {
  display: none;
}

.login-map-page.adventure-mode .login-map-content {
  width: 100vw;
  height: 100vh;
}

.map-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
  display: none; /* Sembunyikan saat di halaman login */
}

.login-map-page.adventure-mode .map-overlay-layer {
  display: block; /* Munculkan hanya saat masuk petualangan */
}


.map-pin {
  position: absolute;
  pointer-events: auto;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
}

.map-pin:hover {
  transform: scale(1.2) translateY(-5px);
  z-index: 100;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.6));
}

.pin-num {
  width: 65px;
  height: 65px;
  border: 5px solid #fff;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.8rem;
  box-shadow: inset 0 -5px 10px rgba(0,0,0,0.3), 0 8px 20px rgba(0,0,0,0.4);
  position: relative;
}

.pin-num::after {
  content: '';
  position: absolute;
  top: 5%;
  left: 20%;
  width: 25%;
  height: 25%;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
}

.pin-label {
  background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
  color: #1e293b;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  border: 4px solid #3b82f6;
  position: relative;
}

.pin-label::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 12px solid #3b82f6;
}

/* Kid-Friendly Colors */
.pin-pos-1 .pin-num { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.pin-pos-1 .pin-label { border-color: #3b82f6; }
.pin-pos-1 .pin-label::before { border-bottom-color: #3b82f6; }

.pin-pos-2 .pin-num { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.pin-pos-2 .pin-label { border-color: #06b6d4; }
.pin-pos-2 .pin-label::before { border-bottom-color: #06b6d4; }

.pin-pos-3 .pin-num { background: linear-gradient(135deg, #eab308, #ca8a04); }
.pin-pos-3 .pin-label { border-color: #eab308; }
.pin-pos-3 .pin-label::before { border-bottom-color: #eab308; }

.pin-pos-4 .pin-num { background: linear-gradient(135deg, #22c55e, #16a34a); }
.pin-pos-4 .pin-label { border-color: #22c55e; }
.pin-pos-4 .pin-label::before { border-bottom-color: #22c55e; }

.pin-pos-5 .pin-num { background: linear-gradient(135deg, #ec4899, #db2777); }
.pin-pos-5 .pin-label { border-color: #ec4899; }
.pin-pos-5 .pin-label::before { border-bottom-color: #ec4899; }

/* Positions following a natural scenic path - corrected for 16:9 landscape */
.pin-pos-1 { bottom: 12%; left: 8%; animation: floatPin 3s infinite ease-in-out; }
.pin-pos-2 { bottom: 38%; left: 28%; animation: floatPin 3.5s infinite ease-in-out 0.3s; }
.pin-pos-3 { bottom: 63%; left: 50%; animation: floatPin 3.2s infinite ease-in-out 0.6s; }
.pin-pos-4 { bottom: 32%; left: 74%; animation: floatPin 3.8s infinite ease-in-out 0.9s; }
.pin-pos-5 { bottom: 72%; left: 88%; animation: floatPin 3s infinite ease-in-out 1.2s; }

@keyframes floatPin {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes pinGlow {
  0% { box-shadow: 0 0 10px rgba(255,255,255,0.2); }
  100% { box-shadow: 0 0 30px rgba(255,255,255,0.6); }
}

.map-pin .pin-num {
  animation: pinGlow 1.5s infinite alternate ease-in-out;
}


.vlab-brand-hide {
  display: inline;
}

/* --- HALAMAN 3: PRE-TEST (UJI BASHIROH) --- */
.pretest-page {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: #0d1226;
  display: flex;
  flex-direction: column;
}

.pretest-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.quiz-container {
  width: 95%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  z-index: 5;
  padding: 1rem;
}

.quiz-top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.quiz-user-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.quiz-avatar-mini {
  width: 40px;
  height: 40px;
  background: #fbbf24;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 2px solid #fff;
}

.quiz-user-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.quiz-lives {
  display: flex;
  gap: 0.4rem;
}

.heart-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.5));
  transition: transform 0.3s;
}

.heart-icon.lost {
  filter: grayscale(1) opacity(0.3);
  transform: scale(0.8);
}

.quiz-box {
  background: #fff;
  border-radius: 40px;
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  width: 100%;
  color: #1e293b;
  position: relative;
  border: 8px solid #3b82f6;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quiz-progress-track {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.progress-dot {
  width: 40px;
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: all 0.3s;
}

.progress-dot.active {
  background: #3b82f6;
  width: 60px;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.progress-dot.correct { background: #22c55e; }
.progress-dot.wrong { background: #ef4444; }

.question-text {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 2.5rem;
  line-height: 1.3;
  color: #1e293b;
  font-weight: 800;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.btn-option {
  background: #f8fafc;
  border: 4px solid #e2e8f0;
  border-radius: 25px;
  padding: 1.2rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-option:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #3b82f6;
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.btn-option.correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}

.btn-option.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.quiz-feedback-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 32px;
  animation: feedbackIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

@keyframes feedbackIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.feedback-emoji { font-size: 5rem; margin-bottom: 1rem; }
.feedback-text { font-size: 2rem; font-weight: 900; }

/* Result Page */
.quiz-result-card {
  text-align: center;
  display: none;
}

.result-score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--kid-warm-grad);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  color: #fff;
  border: 8px solid #fff;
  box-shadow: 0 15px 35px rgba(249, 115, 22, 0.4);
}

.result-score-num { font-size: 3.5rem; font-weight: 900; line-height: 1; }
.result-score-label { font-size: 1rem; font-weight: 700; opacity: 0.9; }

.result-pujian {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 1rem;
}

.result-desc {
  font-size: 1.1rem;
  color: #64748b;
  max-width: 400px;
  margin: 0 auto 2.5rem;
}

.btn-finish-quiz {
  background: #22c55e;
  color: #fff;
  padding: 1.2rem 3rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
}


.sel-character {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.honesty-scale {
  width: 40px;
  height: 40px;
}

.aiman-narrative {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 1rem;
}

.aiman-robot-mini {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 0 10px #22d3ee);
}

.aiman-text {
  background: #1e293b;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 20px 20px 20px 0;
  border: 1px solid #22d3ee;
  max-width: 400px;
  font-size: 1rem;
  line-height: 1.4;
}

.btn-goto-vlab {
  background: linear-gradient(180deg, #7ad23f 0%, #519027 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 1rem 3rem;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  animation: btnGlow 2s infinite alternate;
}

.indicator-pill {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.indicator-pill.active {
  background: #fbbf24;
  color: #1e293b;
  border-color: #f59e0b;
}

@media (max-width: 768px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .vlab-interaction-area {
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding-bottom: 2rem;
  }
  .vlab-brand-hide {
    display: none;
  }
  .organ-column {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 1024px) {
  .login-map-main {
    flex-direction: column;
    overflow-y: auto;
  }
  .login-map-sidebar {
    width: 100%;
    padding: 2rem;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .map-img-asset {
    max-height: none;
  }
  .login-map-content {
    padding: 2rem 1rem;
  }
}

/* ===== UJI BASYIROH (POS 2) STYLES ===== */
.pretest-page {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: url('https://images.unsplash.com/photo-1518531933037-91b2f5f229cc?auto=format&fit=crop&q=80&w=2000') no-repeat center center;
  background-size: cover;
  display: flex;
  flex-direction: column;
}

.pretest-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.6) 0%, rgba(15, 23, 42, 0.4) 100%);
  pointer-events: none;
}

.pretest-main-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.quiz-adventure-box {
  width: 100%;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  border-radius: 40px;
  padding: 30px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
  border: 4px solid #fff;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.quiz-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  padding: 15px 25px;
  border-radius: 999px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

.quiz-player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #1e293b;
}

.quiz-progress-pills {
  display: flex;
  gap: 8px;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: 0.3s;
}

.progress-dot.active {
  background: #3b82f6;
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.progress-dot.correct { background: #22c55e; }

.quiz-hearts {
  display: flex;
  gap: 5px;
  font-size: 1.2rem;
}

.heart-icon.lost {
  filter: grayscale(1) opacity(0.3);
}

.question-header {
  text-align: center;
  margin-bottom: 25px;
}

.question-number-tag {
  background: #3b82f6;
  color: white;
  padding: 5px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.question-text {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.6rem;
  color: #1e293b;
  margin-top: 15px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.btn-option {
  background: #fff;
  border: 2px solid #e2e8f0;
  padding: 20px;
  border-radius: 20px;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #334155;
}

.btn-option:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.btn-option.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #166534 !important;
}

.btn-option.wrong {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

/* Clear Feedback Overlay */
.quiz-feedback-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(5px);
}

.feedback-content {
  background: white;
  padding: 40px;
  border-radius: 40px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  transform: scale(0.8);
  animation: feedbackPop 0.5s cubic-bezier(0.17, 0.89, 0.32, 1.27) forwards;
  min-width: 300px;
}

@keyframes feedbackPop {
  to { transform: scale(1); }
}

.feedback-emoji {
  font-size: 5rem;
  display: block;
  margin-bottom: 15px;
  animation: emojiBounce 1s infinite;
}

@keyframes emojiBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.feedback-text {
  font-family: 'Baloo 2', sans-serif;
  font-size: 2.2rem;
  margin: 0;
}

.quiz-feedback-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.opt-letter {
  background: #f1f5f9;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 800;
  color: #64748b;
}

/* Kak Aiman Guide */
.aiman-guide-box {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}

.aiman-bubble {
  flex: 1;
  background: #1e293b;
  color: white;
  padding: 15px 20px;
  border-radius: 20px;
  position: relative;
  font-size: 0.95rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.bubble-tail {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid #1e293b;
}

.aiman-mini {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
  animation: float 3s ease-in-out infinite;
}

/* Result Card */
.quiz-result-card {
  text-align: center;
  padding: 40px 0;
}

.result-icon { font-size: 5rem; margin-bottom: 15px; }

.result-score-display {
  background: #3b82f6;
  color: white;
  padding: 20px 40px;
  border-radius: 30px;
  display: inline-block;
  margin: 20px 0;
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.4);
}

.score-num { font-size: 3rem; font-weight: 800; display: block; line-height: 1; }
.score-label { text-transform: uppercase; font-size: 0.9rem; font-weight: 700; opacity: 0.9; }

.btn-pretest-finish {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border: none;
  padding: 18px 45px;
  border-radius: 50px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 0 #14532d;
  margin-top: 25px;
}

.btn-tutup-pretest {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 2px solid #ef4444;
  padding: 8px 15px;
  border-radius: 12px;
  margin-right: 20px;
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 768px) {
  .options-grid { grid-template-columns: 1fr; }
  .quiz-hud { flex-direction: column; gap: 10px; border-radius: 20px; }
  .aiman-guide-box { flex-direction: column; }
  .bubble-tail { display: none; }
}

/* ===== GERBANG UTAMA: POS 1 PUZZLE ===== */
.gerbang-utama-page {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #7dd3fc 0%, #38bdf8 50%, #0284c7 100%);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  font-family: 'Baloo 2', sans-serif;
  overflow-y: auto; /* Enable vertical scroll */
  -webkit-overflow-scrolling: touch;
}

/* Animated Clouds Background */
.cloud-container {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.cloud {
  position: absolute;
  background: white;
  filter: blur(20px);
  border-radius: 50%;
  opacity: 0.6;
  animation: moveCloud linear infinite;
}

.cloud-1 { width: 400px; height: 150px; top: 10%; left: -400px; animation-duration: 60s; }
.cloud-2 { width: 300px; height: 100px; top: 30%; left: -300px; animation-duration: 45s; animation-delay: 5s; }
.cloud-3 { width: 500px; height: 180px; bottom: 15%; left: -500px; animation-duration: 75s; animation-delay: 2s; }
.cloud-4 { width: 350px; height: 120px; bottom: 40%; left: -350px; animation-duration: 55s; animation-delay: 10s; }

@keyframes moveCloud {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 500px)); }
}

.sky-bg-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(255,255,255,0.4) 0%, transparent 60%),
              linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
  pointer-events: none;
  z-index: 3;
}

.gerbang-content-wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-radius: 40px;
  padding: 60px 50px 40px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.15), 
              inset 0 0 0 2px rgba(255, 255, 255, 0.5),
              0 0 0 6px rgba(251, 191, 36, 0.3); /* Subtle Golden Outer Border */
  text-align: center;
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-tutup-puzzle {
  position: absolute;
  top: 22px;
  left: 25px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  padding: 10px 22px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Baloo 2', sans-serif;
  z-index: 20;
}

.btn-tutup-puzzle:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

/* Header Info */
.puzzle-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-top: 10px;
}

.ref-label {
  font-weight: 900;
  color: #b45309;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  padding: 8px 20px;
  border-radius: 30px;
  border: 2px solid #fbbf24;
}

.progress-counter {
  font-weight: 900;
  font-size: 1.8rem;
  color: #475569;
  background: #f1f5f9;
  padding: 5px 20px;
  border-radius: 20px;
  border: 3px solid #e2e8f0;
}

/* Puzzle Title */
.puzzle-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: #1e3a5f;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Ayat Display Box (Reference) */
.ayat-ref-box {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border: 4px solid #fbbf24; /* Golden Border */
  border-radius: 30px;
  padding: 30px 40px;
  margin-bottom: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  box-shadow: 0 15px 40px rgba(251, 191, 36, 0.15), 
              inset 0 0 20px rgba(251, 191, 36, 0.05);
  position: relative;
  overflow: hidden;
}

.ayat-ref-box::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.8), transparent);
  transform: rotate(45deg);
  animation: shineRef 4s infinite;
  pointer-events: none;
}

@keyframes shineRef {
  0% { transform: translateX(-100%) rotate(45deg); }
  20%, 100% { transform: translateX(100%) rotate(45deg); }
}

.ayat-main-text {
  font-family: 'Amiri', serif;
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  color: #1e293b;
  direction: rtl;
  line-height: 1.6;
  text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Puzzle Instruction */
.puzzle-instruction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  font-weight: 900;
  font-size: 1rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.puzzle-instruction small {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.curved-arrow {
  font-size: 1.8rem;
  color: #3b82f6;
  animation: arrowBounce 1.5s infinite ease-in-out;
  display: inline-block;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* Card Tiles Bank */
.puzzle-word-cards-bank {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
  min-height: 90px;
  padding: 5px;
}

.word-puzzle-item {
  width: clamp(140px, 16vw, 190px);
  height: clamp(70px, 9vw, 95px);
  color: white;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Amiri', serif;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-weight: 800;
  cursor: grab;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2), inset 0 3px 0 rgba(255,255,255,0.4);
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3px solid rgba(255,255,255,0.5);
  user-select: none;
  text-align: center;
  padding: 5px 25px;
}

.word-puzzle-item:hover { 
  transform: translateY(-8px) scale(1.08); 
  box-shadow: 0 20px 40px rgba(0,0,0,0.25); 
  filter: brightness(1.1);
}

.word-puzzle-item:active { cursor: grabbing; }

.word-card-teal  { background: linear-gradient(135deg, #0d9488, #0f766e); box-shadow: 0 8px 0 #042f2e, 0 10px 25px rgba(13,148,136,0.4); }
.word-card-blue  { background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 8px 0 #1e3a8a, 0 10px 25px rgba(37,99,235,0.4); }
.word-card-green { background: linear-gradient(135deg, #059669, #047857); box-shadow: 0 8px 0 #064e3b, 0 10px 25px rgba(5,150,105,0.4); }
.word-card-orange{ background: linear-gradient(135deg, #ea580c, #c2410c); box-shadow: 0 8px 0 #7c2d12, 0 10px 25px rgba(234,88,12,0.4); }

/* Slots Area (Target) */
.puzzle-slots-area {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 25px;
  width: 100%;
}

.slot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.drop-slot-dotted {
  width: clamp(130px, 15vw, 180px);
  height: clamp(65px, 8vw, 85px);
  border: 3px dashed #94a3b8;
  border-radius: 20px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.drop-slot-dotted:empty::before {
  content: "?";
  font-size: 1.8rem;
  color: #cbd5e1;
  font-weight: 900;
  font-family: 'Baloo 2', sans-serif;
}

.drop-slot-dotted.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: scale(1.05);
}

.drop-slot-dotted.filled {
  border: 3px solid #3b82f6;
  background: #f0f9ff;
}

.drop-slot-dotted.correct {
  border: 3px solid #22c55e !important;
  background: #f0fdf4 !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.drop-slot-dotted.wrong {
  border: 3px solid #ef4444 !important;
  background: #fef2f2 !important;
  animation: shakeSlot 0.4s ease;
}

@keyframes shakeSlot {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.slot-label {
  font-weight: 800;
  color: #94a3b8;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Baloo 2', sans-serif;
}

/* Action Buttons */
.puzzle-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.btn-cek-jawaban {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 0 #15803d;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: 0.2s;
  font-family: 'Baloo 2', sans-serif;
}

.btn-cek-jawaban:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #15803d;
}

.btn-cek-jawaban:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #15803d;
}

.btn-reset-puzzle {
  background: white;
  color: #f97316;
  border: 3px solid #f97316;
  padding: 16px 35px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s;
  font-family: 'Baloo 2', sans-serif;
}

.btn-reset-puzzle:hover {
  background: #fff7ed;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #ea580c;
}

/* Feedback Bubble */
.puzzle-feedback-msg {
  display: block;
  background: #f1f5f9;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 800;
  color: #334155;
  margin-top: 20px;
  border: 2px solid #e2e8f0;
  font-size: 1rem;
  font-family: 'Baloo 2', sans-serif;
  transition: all 0.3s;
}

/* Aiman Mascot (bottom right of card) */
.aiman-float-mini {
  position: absolute;
  bottom: -20px;
  right: 20px;
  width: clamp(80px, 10vw, 120px);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
  pointer-events: none;
}

/* Success Card Overlay */
.ayat-finish-card {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  padding: 20px;
  animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ayat-finish-card > :not(.ayat-finish-inner) {
  /* Direct child elements go into a styled card */
}

/* Re-style the finish card inner content as a styled box */
.ayat-finish-card h2,
.ayat-finish-card .meaning-label,
.ayat-finish-card .meaning-translate,
.ayat-finish-card .btn-misi-lanjut {
  /* These are direct children of ayat-finish-card now */
}

.ayat-finish-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* The finish card wraps content in a white box */
.ayat-finish-card .success-title ~ * {
  margin-top: 10px;
}

/* Actual finish card container - wraps visible content */
.ayat-finish-card {
  flex-direction: column;
}

.ayat-finish-card > * {
  /* Scoped inside the centered white popup box */
}

/* Whitebox popup for success */
#gerbang-puzzle-result:not(.is-hidden) {
  display: flex;
  align-items: center;
  justify-content: center;
}

#gerbang-puzzle-result > h2,
#gerbang-puzzle-result > .meaning-label,
#gerbang-puzzle-result > .meaning-translate,
#gerbang-puzzle-result > .btn-misi-lanjut {
  /* All inside a white card - handled by background on the element */
}

/* Override: make the finish card a proper centered modal */
.ayat-finish-card {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  overflow-y: auto; /* Allow scrolling for modal content */
  padding: 20px;
}

.finish-inner-card {
  background: white;
  width: min(550px, 90%);
  padding: 50px 40px;
  border-radius: 40px;
  text-align: center;
  box-shadow: 0 40px 100px rgba(0,0,0,0.4), 
              0 0 0 8px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  border: 4px solid #fcd34d;
  animation: modalPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.finish-inner-card::before {
  content: '✨';
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 2rem;
  opacity: 0.5;
  animation: rotateSparkle 3s infinite linear;
}

.finish-inner-card::after {
  content: '✨';
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-size: 2rem;
  opacity: 0.5;
  animation: rotateSparkle 3s infinite linear reverse;
}

@keyframes rotateSparkle {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  to { transform: rotate(360deg) scale(1); }
}

.ayat-finish-card .success-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  color: #16a34a;
  margin-bottom: 15px;
  font-weight: 900;
  animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.meaning-label {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 2px;
  padding: 5px 15px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  display: inline-block;
}

.meaning-translate {
  font-style: italic;
  color: #1e293b;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  line-height: 1.6;
  margin-bottom: 30px;
  max-width: 500px;
  text-align: center;
}

.btn-misi-lanjut {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  padding: 18px 45px;
  border-radius: 50px;
  font-weight: 900;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 8px 0 #15803d;
  font-family: 'Baloo 2', sans-serif;
  transition: 0.2s;
}

.btn-misi-lanjut:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 0 #15803d;
}

.btn-mulai-lagi {
  background: white;
  color: #0284c7;
  border: 3px solid #0284c7;
  padding: 18px 35px;
  border-radius: 50px;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  font-family: 'Baloo 2', sans-serif;
  transition: 0.2s;
}

.btn-mulai-lagi:hover {
  background: #f0f9ff;
  transform: translateY(-3px);
  box-shadow: 0 8px 0 #075985;
}

.btn-mulai-lagi:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #075985;
}

/* Animations */
@keyframes modalPop {
  0% { transform: scale(0.8) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Puzzle Responsive */
@media (max-width: 768px) {
  .gerbang-content-wrap {
    padding: 50px 20px 30px;
    border-radius: 30px;
  }

  .puzzle-info-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    margin-bottom: 20px;
  }

  .ayat-ref-box {
    padding: 15px 20px;
    margin-bottom: 20px;
  }

  .puzzle-slots-area,
  .puzzle-word-cards-bank {
    gap: 10px;
    justify-content: center;
  }

  .puzzle-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .btn-cek-jawaban, .btn-reset-puzzle {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .aiman-float-mini {
    width: 70px;
    bottom: -15px;
    right: 10px;
  }
}

/* ===== MISI SIRKULASI MODAL ===== */
.misi-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.misi-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
}

.misi-card {
  position: relative;
  background: #fff;
  width: min(650px, 100%);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 35px 70px rgba(0,0,0,0.5);
  border: 4px solid #fef9c3;
  animation: modalPop 0.5s cubic-bezier(0.17, 0.89, 0.32, 1.27);
}

@keyframes modalPop {
  0% { transform: scale(0.8) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.misi-badge-wrapper {
  text-align: center;
  margin-top: -15px;
}

.misi-badge {
  background: #f59e0b;
  color: white;
  padding: 8px 25px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  display: inline-block;
}

.pulse {
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.misi-title {
  font-family: 'Baloo 2', sans-serif;
  text-align: center;
  margin: 25px 0 15px;
  color: #1e293b;
  font-size: 1.8rem;
  padding: 0 20px;
}

.misi-body {
  padding: 0 30px 20px;
}

.misi-intro {
  color: #64748b;
  font-weight: 600;
  text-align: center;
  margin-bottom: 25px;
  line-height: 1.5;
}

.misi-jalur {
  display: flex;
  gap: 20px;
  padding: 20px;
  border-radius: 25px;
  margin-bottom: 15px;
  align-items: center;
  transition: 0.3s;
}

.misi-jalur.kecil { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-left: 8px solid #3b82f6; }
.misi-jalur.besar { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); border-left: 8px solid #ef4444; }

.jalur-icon {
  font-size: 2.5rem;
}

.jalur-info h3 {
  font-family: 'Baloo 2', sans-serif;
  margin: 0;
  font-size: 1.25rem;
  color: #1e3a8a;
}

.jalur-flow {
  font-size: 0.9rem;
  color: #64748b;
  display: block;
}

.jalur-info p {
  margin: 8px 0 0;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.4;
}

.misi-footer {
  padding: 20px 30px 30px;
  text-align: center;
}

.btn-misi-go {
  background: #22c55e;
  color: white;
  border: none;
  padding: 15px 45px;
  border-radius: 999px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 8px 0 #15803d;
  transition: 0.2s;
}

.btn-misi-go:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-misi-go:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #15803d;
}

.btn-kembali-peta {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  padding: 8px 15px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  margin-right: 20px;
}

/* ===== POS 3: VIDEO INTRO ZONA ILMU ===== */
.pos3-video-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2500;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.video-overlay-bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
}

.video-window-card {
  position: relative;
  z-index: 10;
  width: 95%;
  max-width: 900px;
  margin: auto;
  background: white;
  border-radius: 30px;
  padding: 40px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
  border: 4px solid #fbbf24;
  animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-close-video {
  position: absolute;
  top: 20px;
  left: 20px;
  background: #f1f5f9;
  border: none;
  padding: 8px 15px;
  border-radius: 12px;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  z-index: 20;
}

.video-header {
  text-align: center;
  margin-bottom: 25px;
}

.video-tag {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.video-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 2rem;
  color: #1e293b;
  margin-top: 10px;
}

.video-frame-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.main-video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pos3-video-finish-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  animation: fadeIn 0.4s ease;
}

.pos3-finish-inner {
  text-align: center;
  color: white;
  padding: 30px;
  max-width: 450px;
}

.pos3-finish-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: 15px;
  animation: bounce 2s infinite;
}

.btn-pos3-to-vlab {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  padding: 18px 40px;
  border-radius: 50px;
  font-weight: 900;
  font-size: 1.2rem;
  font-family: 'Baloo 2', sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 0 #15803d;
  margin-top: 25px;
  transition: 0.2s;
}

.btn-pos3-to-vlab:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 0 #15803d;
}

.video-footer-hint {
  text-align: center;
}

.btn-skip-video {
  background: #f1f5f9;
  color: #64748b;
  border: 2px solid #e2e8f0;
  padding: 12px 25px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 100;
  position: relative;
  pointer-events: auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-skip-video:hover {
  background: #e2e8f0;
  color: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.video-footer-hint {
  text-align: center;
  margin-top: 20px;
  color: #64748b;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  position: relative;
  z-index: 150;
  padding-bottom: 25px;
  pointer-events: auto;
}

.aiman-loading {
  font-style: italic;
  color: #94a3b8;
  animation: pulseAlpha 1.5s infinite;
}

@keyframes pulseAlpha {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (max-width: 640px) {
  .video-window-card { padding: 30px 15px; }
  .video-title { font-size: 1.5rem; }
}

/* ===== POS 1: VIDEO INTRO GERBANG UTAMA ===== */
.pos1-video-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2500;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.pos1-video-finish-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  animation: fadeIn 0.4s ease;
}

.pos1-finish-inner {
  text-align: center;
  color: white;
  padding: 30px;
  max-width: 450px;
}

.pos1-finish-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: 15px;
  animation: bounce 2s infinite;
}

.btn-pos1-to-gerbang {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  padding: 18px 40px;
  border-radius: 50px;
  font-weight: 900;
  font-size: 1.2rem;
  font-family: 'Baloo 2', sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 0 #15803d;
  margin-top: 25px;
  transition: 0.2s;
}

.btn-pos1-to-gerbang:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 0 #15803d;
}

.btn-pos1-to-gerbang:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #15803d;
}

/* Enhancing kid-friendly aesthetics for video pages */
.pos1-video-page .video-window-card,
.pos3-video-page .video-window-card {
  border: 8px solid #fcd34d;
  background: linear-gradient(to bottom, #ffffff, #f0f9ff);
  overflow: hidden;
}

.pos1-video-page .video-tag {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.pos1-video-page .video-title {
  color: #065f46;
  font-weight: 900;
}

/* ===== MOBILE RESPONSIVENESS OVERRIDES ===== */
@media (max-width: 768px) {
  /* Role Selection */
  .role-cards-container {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  .role-card {
    width: 100%;
    max-width: 320px;
  }
  .role-selection-title {
    font-size: 2.2rem;
  }

  /* Hub / Menu Awan */
  .hub-main {
    padding: 1rem;
  }
  .hub-cluster {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    position: static !important;
    transform: none !important;
    width: 100% !important;
    padding: 20px 0;
  }
  .hub-cloud {
    position: static !important;
    width: 90% !important;
    max-width: 320px;
    transform: none !important;
  }

  /* Vlab Interaction */
  .vlab-interaction-area {
    flex-direction: column;
    gap: 20px;
  }
  .organ-column-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    position: static !important;
  }
  .btn-organ {
    width: calc(50% - 10px);
    min-width: 140px;
  }

  /* Chatbot */
  .vlab-chatbot-box {
    width: calc(100vw - 40px);
    right: 20px;
    bottom: 90px;
    height: 400px;
  }
}

@media (max-width: 480px) {
  .new-header {
    padding: 10px 15px;
  }
  .new-brand-logo { height: 50px; }
  .new-brand-logo-pasca { height: 60px; }
  .new-brand-text { font-size: 1rem; }

  .new-hero-title { font-size: 2.2rem; }
  .bismillah-text { font-size: 2.2rem; }
  .greeting-gold-top { font-size: 1.8rem; }
  .new-hero-subtitle { font-size: 1.1rem; }
  .new-btn-mulai { padding: 15px 30px; font-size: 1.2rem; }

  /* Map Container */
  .map-image-container {
    padding: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .map-render-area {
    min-width: 600px; /* Force minimum width to make it scrollable if too small */
  }

  /* Modals */
  .posttest-container {
    padding: 20px;
    height: 95vh;
  }
  #posttest-question-text { font-size: 1.1rem; }
  .posttest-opt { font-size: 0.9rem; padding: 10px; min-height: 50px; }
  .posttest-options-grid { grid-template-columns: 1fr; }

  /* Islamic Popups */
  .islamic-popup-card {
    padding: 30px 20px;
    border-width: 4px;
  }
  .islamic-popup-title { font-size: 1.5rem; }
  .islamic-popup-text { font-size: 1rem; }
}

.pos1-video-page .video-frame-container {
  border: 6px solid #bbf7d0;
  background: #064e3b;
}