/* Meiword Junior — Child-First Playful Styling (Ages 3–6) */

:root {
  --jn-bg: #F8F9FE;
  --jn-card-bg: #FFFFFF;
  --jn-primary: #FF5E7E;
  --jn-primary-deep: #E03D60;
  --jn-secondary: #4ECDC4;
  --jn-accent-yellow: #FFD166;
  --jn-accent-blue: #118AB2;
  --jn-accent-green: #06D6A0;
  --jn-text-dark: #263238;
  --jn-text-muted: #546E7A;
  --jn-radius-lg: 32px;
  --jn-radius-xl: 40px;
  --jn-shadow-chunky: 0 10px 0 rgba(0, 0, 0, 0.08), 0 20px 40px rgba(0, 0, 0, 0.06);
  --jn-shadow-btn: 0 6px 0 rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Hanya area bermain yang tidak bisa diblok; teks panduan orang tua tetap
   bisa dipilih/disalin. */
.player-page,
.player-page * {
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- accessibility helpers ---------- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 10000;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--jn-primary-deep);
  color: #fff !important;
  font-weight: 800;
  font-size: 0.88rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: top 0.2s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: calc(16px + env(safe-area-inset-top, 0px));
  outline: 3px solid #FFD166;
  outline-offset: 2px;
}
#main-content:focus,
#playerStage:focus {
  outline: none;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #1E1B4B;
  outline-offset: 3px;
}


body {
  margin: 0;
  padding: 0;
  font-family: 'Bricolage Grotesque', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--jn-bg);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(255, 94, 126, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(78, 205, 196, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255, 209, 102, 0.06) 0%, transparent 50%);
  color: var(--jn-text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* ========================================================
   ANIMATED DRIFTING SKY CLOUDS (Lightweight & Playful)
   ======================================================== */
.junior-sky-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.sky-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.1);
  will-change: transform;
}

.sky-cloud::before,
.sky-cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.sky-cloud::before {
  width: 52%;
  height: 110%;
  top: -50%;
  left: 14%;
}

.sky-cloud::after {
  width: 36%;
  height: 75%;
  top: -32%;
  right: 18%;
}

.cloud-1 {
  width: 170px;
  height: 52px;
  top: 9%;
  left: -200px;
  opacity: 0.7;
  animation: driftClouds 54s linear infinite;
}

.cloud-2 {
  width: 230px;
  height: 68px;
  top: 34%;
  left: -260px;
  opacity: 0.55;
  animation: driftClouds 74s linear infinite;
  animation-delay: -25s;
}

.cloud-3 {
  width: 150px;
  height: 46px;
  top: 64%;
  left: -180px;
  opacity: 0.65;
  animation: driftClouds 60s linear infinite;
  animation-delay: -38s;
}

.cloud-4 {
  width: 200px;
  height: 60px;
  top: 84%;
  left: -230px;
  opacity: 0.48;
  animation: driftClouds 82s linear infinite;
  animation-delay: -12s;
}

@keyframes driftClouds {
  0% {
    transform: translate3d(-10vw, 0, 0);
  }
  100% {
    transform: translate3d(120vw, 0, 0);
  }
}

/* Ensure interactive main layout stays above clouds */
.junior-top-bar,
main,
footer,
.player-container,
.guide-wrap {
  position: relative;
  z-index: 1;
}

/* ========================================================
   PORTAL / HOME STYLES (junior/index.html)
   ======================================================== */

/* ========================================================
   PORTAL / HOME STYLES (junior/index.html)
   ======================================================== */

.junior-top-bar {
  padding: 16px 20px 8px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.junior-nav-island {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(30, 41, 59, 0.06), 0 2px 6px rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 8px 18px;
  width: 100%;
}

.junior-logo-badge {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.junior-logo-badge:hover {
  transform: scale(1.04);
}

.junior-logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

/* Program lockup: official mark + wordmark, used by Little pages */
.program-brand-lockup {
  gap: 9px;
}

.program-brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(15, 23, 42, 0.10));
}

.program-brand-type {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.program-brand-parent {
  font-family: 'Bricolage Grotesque', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  color: #475569;
}

.program-brand-name {
  font-family: 'Bricolage Grotesque', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #e11d48;
}

.player-nav-brand .program-brand-mark {
  width: 36px;
  height: 36px;
}

.player-nav-brand .program-brand-type {
  gap: 1px;
}

.player-nav-brand .program-brand-parent {
  font-size: 0.5rem;
}

.player-nav-brand .program-brand-name {
  font-size: 1.02rem;
}

.junior-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.junior-parent-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  border: 1.5px solid #FDBA74;
  color: #C2410C;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(249, 115, 22, 0.12);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.junior-parent-guide-btn:hover {
  background: linear-gradient(135deg, #FFEDD5, #FED7AA);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.18);
}

.junior-parent-guide-btn:active {
  transform: translateY(1px);
}

.guide-icon-svg {
  flex-shrink: 0;
  color: #EA580C;
}

.junior-back-main-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.junior-back-main-btn:hover {
  background: #FFF;
  color: #0F172A;
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

.junior-hero {
  text-align: center;
  padding: 24px 20px 16px;
  max-width: 800px;
  margin: 0 auto;
}

.junior-tag {
  display: inline-block;
  background: #FFF;
  border: 2px solid #FFD166;
  color: #B45309;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(255, 209, 102, 0.25);
}

.junior-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin: 0 0 10px;
  line-height: 1.15;
  background: linear-gradient(135deg, #FF5E7E, #FF9900);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.junior-hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #546E7A;
  margin: 0 auto;
  font-weight: 500;
  line-height: 1.5;
}

/* Topics Grid */
.junior-topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 24px;
  width: 100%;
}

.topic-chunky-card {
  background: var(--jn-card-bg);
  border-radius: var(--jn-radius-lg);
  padding: 24px 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  border: 3px solid transparent;
  box-shadow: var(--jn-shadow-chunky);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.topic-chunky-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(255, 94, 126, 0.4);
  box-shadow: 0 16px 0 rgba(0, 0, 0, 0.08), 0 30px 50px rgba(0, 0, 0, 0.1);
}

.topic-chunky-card:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08), 0 10px 20px rgba(0, 0, 0, 0.05);
}

.topic-icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
}

.topic-chunky-card:hover .topic-icon-wrap {
  transform: scale(1.1) rotate(6deg);
}

.topic-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--jn-text-dark);
}

.topic-sub {
  font-size: 0.92rem;
  color: var(--jn-text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.topic-count-pill {
  margin-top: auto;
  background: #F1F5F9;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 6px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Tablet: keep the topic picker to two comfortable columns */
@media (min-width: 561px) and (max-width: 900px) {
  .junior-topics-grid {
    max-width: 720px;
    gap: 18px;
  }

  .topic-chunky-card {
    padding: 20px 18px;
  }

  .topic-icon-wrap {
    width: 76px;
    height: 76px;
    font-size: 2.8rem;
    margin-bottom: 12px;
  }
}

/* ========================================================
   PLAYER CANVAS STYLES (junior/play.html)
   ======================================================== */

.player-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 16px 20px calc(108px + env(safe-area-inset-bottom, 16px));
  box-sizing: border-box;
}

.player-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  box-shadow: 0 10px 30px rgba(30, 41, 59, 0.06), 0 2px 8px rgba(0, 0, 0, 0.03);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  position: sticky;
  top: 12px;
  z-index: 80;
}

.player-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-back-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--jn-text-dark);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.player-back-btn:hover {
  background: #FFF;
  border-color: #CBD5E1;
  transform: scale(1.08);
}

.player-back-btn:active {
  transform: scale(0.92);
}

.player-nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.player-nav-brand:hover {
  transform: scale(1.05);
}

.player-topic-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.player-topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.topic-dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulseLiveDot 2s infinite;
}

@keyframes pulseLiveDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

.player-topic-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  color: var(--jn-text-dark);
}

.player-progress-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  min-height: 12px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #E2E8F0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-dot.active {
  width: 24px;
  background: linear-gradient(135deg, #FF5E7E, #FF9900);
  box-shadow: 0 0 10px rgba(255, 94, 126, 0.45);
}

.player-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Play Time Timer Badge */
.player-timer-badge {
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  color: #B45309;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.12);
  transition: all 0.15s ease;
}

.player-timer-badge:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
}

.player-timer-badge.warning {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
  animation: pulseTimer 1.2s infinite;
}

@keyframes pulseTimer {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Mode Dropdown Wrapper */
.mode-dropdown-wrap {
  position: relative;
}

.player-mode-btn {
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--jn-text-dark);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.player-mode-btn:hover {
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

.player-mode-btn:active {
  transform: scale(0.96);
}

.mode-btn-icon {
  display: flex;
  align-items: center;
  color: var(--jn-primary);
}

.dropdown-arrow-svg {
  transition: transform 0.2s ease;
  color: #64748B;
}

.player-mode-btn[aria-expanded="true"] .dropdown-arrow-svg {
  transform: rotate(180deg);
}

/* Dropdown Menu Modal/Sheet */
.mode-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: #FFFFFF;
  border-radius: 20px;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 14px 35px rgba(30, 41, 59, 0.14), 0 4px 10px rgba(0, 0, 0, 0.04);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 120;
  animation: dropdownPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-dropdown-menu.show {
  display: flex;
}

@keyframes dropdownPop {
  0% { opacity: 0; transform: translateY(-8px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.mode-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mode-dropdown-item:hover {
  background: #F8FAFC;
}

.mode-dropdown-item.active {
  background: #FFF7ED;
}

.mode-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mode-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mode-item-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1E293B;
}

.mode-item-desc {
  font-size: 0.78rem;
  color: #64748B;
  margin-top: 1px;
}

.mode-item-check {
  display: none;
}

.mode-dropdown-item.active .mode-item-check {
  display: block;
}

/* Speed Button */
.player-speed-btn {
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: #FFF;
  border: 2px solid #E2E8F0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--jn-text-dark);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: all 0.15s ease;
}

.player-speed-btn:hover {
  border-color: #CBD5E1;
}

.player-speed-btn.slow {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
}

.player-speed-btn:active {
  transform: scale(0.95);
}

/* Rest Screen Modal (Screen Time & Health Limit) */
.junior-rest-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.rest-modal-card {
  background: #FFFFFF;
  border-radius: 36px;
  max-width: 480px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  position: relative;
  border: 4px solid #F1F5F9;
  animation: modalBounceIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalBounceIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.rest-cloud-anim {
  margin: 0 auto 12px;
}

.rest-cloud-graphic {
  font-size: 4.5rem;
  line-height: 1;
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
}

.rest-cloud-zzz {
  position: absolute;
  top: -10px;
  right: -8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #8B5CF6;
  animation: zzzFloat 2s infinite ease-in;
}

.rest-cloud-zzz.z2 {
  top: -24px;
  right: -2px;
  font-size: 1.5rem;
  animation-delay: 0.5s;
}

.rest-cloud-zzz.z3 {
  top: -38px;
  right: 12px;
  font-size: 1.8rem;
  animation-delay: 1s;
}

@keyframes zzzFloat {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-24px) scale(1.2); }
}

.rest-badge-pill {
  display: inline-block;
  background: #EEF2FF;
  border: 1.5px solid #C7D2FE;
  color: #4F46E5;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.rest-modal-title {
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  font-weight: 800;
  color: #1E293B;
  margin: 0 0 10px;
  line-height: 1.25;
}

.rest-modal-text {
  font-size: 0.98rem;
  color: #64748B;
  line-height: 1.6;
  margin: 0 0 20px;
}

.rest-countdown-box {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  border: 2px dashed #FDBA74;
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 24px;
}

.rest-countdown-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #C2410C;
  margin-bottom: 4px;
}

.rest-countdown-digits {
  font-size: 2.2rem;
  font-weight: 800;
  color: #9A3412;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.parent-gate-wrap {
  border-top: 1px dashed #E2E8F0;
  padding-top: 18px;
}

.btn-parent-gate-open {
  background: transparent;
  border: 1.5px solid #CBD5E1;
  color: #64748B;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-parent-gate-open:hover {
  background: #F8FAFC;
  color: #334155;
}

.parent-gate-quiz {
  margin-top: 14px;
  background: #F8FAFC;
  border-radius: 20px;
  padding: 16px;
}

.parent-quiz-prompt {
  margin-bottom: 12px;
}

.parent-quiz-prompt b {
  display: block;
  font-size: 1.15rem;
  color: #1E293B;
  margin-bottom: 2px;
}

.parent-quiz-prompt span {
  font-size: 0.82rem;
  color: #64748B;
}

.parent-quiz-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn-quiz-answer {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 10px 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1E293B;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quiz-answer:hover {
  border-color: #3B82F6;
  background: #EFF6FF;
}

.parent-quiz-feedback {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #EF4444;
}

.parent-unlocked-controls {
  margin-top: 14px;
  background: #F0FDF4;
  border: 1.5px solid #86EFAC;
  border-radius: 20px;
  padding: 16px;
}

.unlocked-msg {
  font-weight: 800;
  color: #15803D;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.unlocked-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-unlocked-action {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn-unlocked-action:active {
  transform: scale(0.96);
}

.btn-unlocked-action.add-time {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-unlocked-action.reset-time {
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: #475569;
}

/* ========================================================
   MOBILE RESPONSIVENESS (No Overlapping, Spacious Layout)
   ======================================================== */
@media (max-width: 560px) {
  .junior-top-bar {
    padding: 10px 14px 6px;
  }
  .junior-nav-island {
    padding: 6px 12px;
    border-radius: 20px;
  }
  .junior-logo-img {
    height: 32px;
  }
  .program-brand-lockup {
    gap: 7px;
  }
  .program-brand-mark {
    width: 34px;
    height: 34px;
  }
  .program-brand-parent {
    font-size: 0.5rem;
    letter-spacing: 0.14em;
  }
  .program-brand-name {
    font-size: 1.02rem;
  }
  .junior-nav-actions {
    gap: 6px;
  }
  .junior-parent-guide-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 5px;
  }
  .junior-back-main-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    gap: 4px;
  }

  /* Compact topic picker so more choices fit above the fold */
  .junior-topics-grid {
    gap: 14px;
    margin: 18px auto 40px;
    padding: 0 16px;
  }

  .topic-chunky-card {
    padding: 18px 16px;
    border-radius: 20px;
  }

  .topic-icon-wrap {
    width: 70px;
    height: 70px;
    font-size: 2.5rem;
    margin-bottom: 10px;
  }

  .topic-title {
    font-size: 1.2rem;
  }

  .topic-sub {
    font-size: 0.85rem;
    margin-bottom: 10px;
  }

  .topic-count-pill {
    font-size: 0.78rem;
    padding: 5px 12px;
  }

  /* Mobile player: comfortable scrolling with floating elevated bottom controls */
  body.player-page {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .player-container {
    padding: 10px 14px calc(92px + env(safe-area-inset-bottom, 20px));
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .player-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "left right"
      "topic topic";
    align-items: center;
    gap: 8px 10px;
    padding: 8px 10px 9px;
    border-radius: 20px;
    margin-bottom: 8px;
    position: sticky;
    top: 6px;
    z-index: 80;
    flex-shrink: 0;
  }

  .player-nav-left {
    grid-area: left;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .player-nav-brand {
    display: none;
  }

  .player-back-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }

  .player-topic-info {
    grid-area: topic;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid #eef2f7;
    text-align: left;
    overflow: visible;
  }

  .player-topic-badge {
    flex: 0 1 auto;
    min-width: 0;
    padding: 2px 8px;
    margin-bottom: 0;
    max-width: 100%;
  }

  .player-topic-title {
    font-size: 0.9rem;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .player-nav-right {
    grid-area: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-shrink: 0;
  }

  .player-timer-badge {
    height: 38px;
    padding: 0 8px;
    font-size: 0.78rem;
    gap: 4px;
  }

  .player-speed-btn {
    height: 38px;
    padding: 0 8px;
    font-size: 0.78rem;
  }

  .speed-label {
    display: none;
  }

  .player-mode-btn {
    height: 38px;
    padding: 0 10px;
    font-size: 0.8rem;
    gap: 4px;
  }

  .mode-dropdown-menu {
    min-width: 230px;
    right: -4px;
  }

  .player-progress-dots {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
  }

  .progress-dot {
    width: 6px;
    height: 6px;
  }

  .progress-dot.active {
    width: 16px;
  }

  /* Stage & Card sizing on mobile */
  .player-stage {
    flex: 1;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
  }

  .flashcard-giant {
    width: 100%;
    max-width: 380px;
    min-height: 340px;
    aspect-ratio: auto;
    padding: 22px 18px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 0 rgba(0, 0, 0, 0.05), 0 20px 30px rgba(0, 0, 0, 0.07);
    border-radius: 30px;
    position: relative;
    margin: 0 auto;
  }

  .card-top-hint {
    font-size: 0.8rem;
    gap: 6px;
  }

  .card-emoji-giant {
    font-size: clamp(4.2rem, 14vw, 5.8rem);
    margin: 8px auto;
    line-height: 1.1;
  }

  .card-word-title {
    font-size: clamp(2rem, 7vw, 2.5rem);
    margin: 0;
    line-height: 1.15;
  }

  .card-meaning {
    font-size: clamp(1.05rem, 3.8vw, 1.25rem);
    margin: 4px 0 6px;
  }

  /* Floating Bottom Controls on Mobile */
  .player-bottom-bar {
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 16px));
    gap: 12px;
  }

  .btn-chunky-nav {
    height: 52px;
    padding: 0 26px;
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.15);
  }

  .btn-autoplay {
    height: 52px;
    width: 52px;
  }

  /* Quiz mode on mobile */
  .quiz-view-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
  }

  .quiz-prompt-bubble {
    padding: 12px 18px;
    margin-bottom: 16px;
    font-size: 1.15rem;
  }

  .quiz-options-grid {
    gap: 12px;
  }

  .quiz-choice-card {
    padding: 14px 10px;
  }

  .quiz-choice-card .choice-emoji {
    font-size: clamp(3.2rem, 10vw, 4.4rem);
    margin-bottom: 6px;
  }

  .quiz-choice-card .choice-word {
    font-size: 1.05rem;
  }
}

@media (max-width: 420px) {
  .junior-parent-guide-btn span {
    display: none;
  }
  .junior-parent-guide-btn {
    padding: 8px;
    border-radius: 50%;
  }
  .junior-back-main-btn span {
    display: none;
  }
  .junior-back-main-btn {
    padding: 8px;
    border-radius: 50%;
  }
}

/* Card Canvas Area */
.player-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 380px;
}

/* Big Chunky Flashcard */
.flashcard-giant {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 4 / 5;
  max-height: 540px;
  background: #FFF;
  border-radius: var(--jn-radius-xl);
  box-shadow: 0 16px 0 rgba(0, 0, 0, 0.07), 0 30px 60px rgba(0, 0, 0, 0.1);
  border: 4px solid #FFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 32px 24px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.flashcard-giant.jiggle {
  animation: jellySquish 0.55s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes jellySquish {
  0% { transform: scale(1, 1); }
  25% { transform: scale(1.08, 0.92) rotate(-2deg); }
  50% { transform: scale(0.94, 1.08) rotate(2deg); }
  75% { transform: scale(1.03, 0.98) rotate(-1deg); }
  100% { transform: scale(1, 1) rotate(0); }
}

.card-top-hint {
  font-size: 0.88rem;
  font-weight: 700;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-emoji-giant {
  font-size: clamp(5.5rem, 15vw, 8.5rem);
  line-height: 1;
  margin: auto 0;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.08));
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-bottom-info {
  width: 100%;
}

.card-word-title {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 800;
  margin: 0;
  color: var(--jn-text-dark);
  letter-spacing: -0.5px;
}

.card-meaning {
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  font-weight: 700;
  color: #C72A4E;
  margin: 4px 0 10px;
}

.card-action-tip {
  background: #FFF9E6;
  border: 2px dashed #FFD166;
  color: #92400E;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  display: inline-block;
  max-width: calc(100% - 80px);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Sound Button on Card */
.card-sound-fab {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--jn-accent-yellow);
  border: none;
  box-shadow: 0 6px 0 #E0A800;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.card-sound-fab:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #E0A800;
}

/* Bottom Controls — Locked & Elevated Floating Bar across ALL Devices (Mobile, Tablet, Desktop) */
.player-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(248, 249, 254, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1.5px solid rgba(226, 232, 240, 0.9);
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 16px));
  margin: 0;
  gap: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 -8px 24px rgba(30, 41, 59, 0.08);
  box-sizing: border-box;
}

/* Tablet & Desktop Layout with Locked Bottom Controls (No Submerging / No Scrolling) */
@media (min-width: 561px) {
  body.player-page {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .player-container {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    max-width: 960px;
    padding: 14px 24px calc(110px + env(safe-area-inset-bottom, 16px));
  }

  .player-header {
    flex-shrink: 0;
    margin-bottom: 12px;
    top: 10px;
    padding: 8px 16px;
    border-radius: 28px;
  }

  .player-nav-brand {
    display: flex !important;
  }

  .player-nav-brand img {
    height: 32px;
    width: auto;
  }

  .player-back-btn {
    width: 44px;
    height: 44px;
  }

  .player-topic-title {
    font-size: 1.05rem;
    font-weight: 800;
  }

  .speed-label {
    display: inline !important;
    font-size: 0.84rem;
    font-weight: 700;
  }

  .player-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    overflow: visible;
  }

  .flashcard-giant {
    max-height: min(580px, calc(100dvh - 200px));
    aspect-ratio: 4 / 5;
    height: auto;
    width: 100%;
    max-width: min(540px, 86vw);
    padding: clamp(22px, 3.2vh, 38px) clamp(20px, 3vw, 32px);
    margin: auto 0;
    border-radius: 36px;
    box-shadow: 0 16px 0 rgba(0, 0, 0, 0.07), 0 30px 60px rgba(0, 0, 0, 0.1);
  }

  .card-emoji-giant {
    font-size: clamp(5rem, 14vh, 9rem);
    margin: auto 0;
  }

  .card-word-title {
    font-size: clamp(2.2rem, 5.5vh, 3.6rem);
  }

  .card-meaning {
    font-size: clamp(1.1rem, 2.6vh, 1.5rem);
    margin: 6px 0 8px;
  }

  .card-action-tip {
    font-size: 0.92rem;
    padding: 5px 16px;
  }

  .card-sound-fab {
    width: 54px;
    height: 54px;
    bottom: 20px;
    right: 20px;
  }

  .quiz-view-wrap {
    width: 100%;
    max-width: min(600px, 90vw);
    margin: auto;
    max-height: calc(100dvh - 200px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .quiz-prompt-bubble {
    font-size: 1.3rem;
    padding: 14px 22px;
    margin-bottom: 18px;
  }

  .quiz-options-grid {
    gap: 16px;
  }

  .quiz-choice-card {
    padding: clamp(16px, 2.8vh, 24px) 18px;
    border-radius: 22px;
  }

  .quiz-choice-card .choice-emoji {
    font-size: clamp(3.6rem, 8vh, 5rem);
    margin-bottom: 8px;
  }

  .quiz-choice-card .choice-word {
    font-size: 1.2rem;
    font-weight: 800;
  }

  .player-bottom-bar {
    padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 16px));
    gap: 16px;
  }

  .btn-chunky-nav {
    height: clamp(56px, 6.8vh, 64px);
    padding: 0 32px;
    font-size: 1.15rem;
  }

  .btn-autoplay {
    height: clamp(56px, 6.8vh, 64px);
    width: clamp(56px, 6.8vh, 64px);
  }
}

/* Landscape Tablet & Short Viewport Optimization (Prevents Squeezing in Landscape) */
@media (min-width: 561px) and (max-height: 620px) {
  .player-header {
    padding: 6px 14px;
    margin-bottom: 6px;
    top: 6px;
  }
  .player-stage {
    padding: 4px 0;
  }
  .flashcard-giant {
    max-height: calc(100dvh - 142px) !important;
    max-width: min(560px, 86vw) !important;
    aspect-ratio: auto !important;
    padding: 14px 24px !important;
  }
  .card-emoji-giant {
    font-size: clamp(3.5rem, 18vh, 5rem) !important;
    margin: 4px auto !important;
  }
  .card-word-title {
    font-size: clamp(1.8rem, 7vh, 2.5rem) !important;
  }
  .card-meaning {
    font-size: 1.05rem !important;
    margin: 2px 0 4px !important;
  }
  .card-sound-fab {
    width: 46px !important;
    height: 46px !important;
    bottom: 12px !important;
    right: 12px !important;
  }
  .player-bottom-bar {
    padding: 8px 18px calc(8px + env(safe-area-inset-bottom, 8px)) !important;
    gap: 12px !important;
  }
  .btn-chunky-nav,
  .btn-autoplay {
    height: 48px !important;
  }
  .quiz-view-wrap {
    max-height: calc(100dvh - 142px) !important;
  }
  .quiz-prompt-bubble {
    padding: 8px 16px !important;
    margin-bottom: 10px !important;
    font-size: 1.1rem !important;
  }
  .quiz-choice-card {
    padding: 10px 14px !important;
  }
  .quiz-choice-card .choice-emoji {
    font-size: clamp(2.6rem, 11vh, 3.6rem) !important;
    margin-bottom: 4px !important;
  }
}

/* Fallback for extremely short split-screen landscape */
@media (max-height: 540px) {
  body.player-page {
    height: auto !important;
    overflow-y: auto !important;
  }
  .player-container {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 14px)) !important;
  }
  .flashcard-giant {
    max-height: 380px !important;
    aspect-ratio: auto !important;
    min-height: 0 !important;
    padding: 12px 16px !important;
  }
  .card-emoji-giant {
    font-size: 3.5rem !important;
    margin: 4px auto !important;
  }
}

.btn-chunky-nav {
  height: 64px;
  padding: 0 28px;
  border-radius: 999px;
  border: none;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.btn-nav-prev {
  background: #FFF;
  color: var(--jn-text-dark);
  border: 2px solid #CBD5E1;
  box-shadow: 0 6px 0 #CBD5E1;
}

.btn-nav-prev:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #CBD5E1;
}

.btn-nav-next {
  background: #D62F55;
  color: #FFF;
  box-shadow: 0 6px 0 #A31F3F;
  flex: 1;
  max-width: 260px;
  justify-content: center;
}

.btn-nav-next:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #A31F3F;
}

.btn-autoplay {
  height: 64px;
  width: 64px;
  border-radius: 50%;
  background: #FFF;
  border: 2px solid #E2E8F0;
  box-shadow: 0 6px 0 #CBD5E1;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-autoplay.active {
  background: #06D6A0;
  color: #FFF;
  border-color: #059669;
  box-shadow: 0 6px 0 #047857;
}

/* ========================================================
   QUIZ MODE / "FIND THE PICTURE"
   ======================================================== */

.quiz-view-wrap {
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.quiz-prompt-bubble {
  background: #FFF;
  border: 3px solid #FFD166;
  border-radius: var(--jn-radius-lg);
  padding: 18px 24px;
  box-shadow: var(--jn-shadow-chunky);
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.quiz-prompt-bubble .speaker-icon {
  font-size: 2rem;
  animation: pulse 1.5s infinite;
}

.quiz-prompt-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--jn-text-dark);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quiz-choice-card {
  background: #FFF;
  border-radius: var(--jn-radius-lg);
  padding: 24px 16px;
  border: 4px solid transparent;
  box-shadow: var(--jn-shadow-chunky);
  cursor: pointer;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.quiz-choice-card:hover {
  transform: translateY(-4px);
  border-color: #CBD5E1;
}

.quiz-choice-card:active {
  transform: translateY(2px);
}

.quiz-choice-card .choice-emoji {
  font-size: 4.8rem;
  margin-bottom: 8px;
}

.quiz-choice-card .choice-word {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--jn-text-dark);
}

.quiz-choice-card.correct {
  border-color: #06D6A0 !important;
  background: #ECFDF5 !important;
  animation: bounceCorrect 0.6s ease;
}

.quiz-choice-card.wrong {
  border-color: #EF4444 !important;
  background: #FEF2F2 !important;
  animation: wobbleWrong 0.4s ease;
}

@keyframes bounceCorrect {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes wobbleWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* Confetti overlay */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Timer toast bubble notification */
.timer-toast-bubble {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(30, 41, 59, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  pointer-events: none;
  white-space: nowrap;
  animation: toastFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.timer-toast-bubble.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- Premium Verification Modal (Meiword Junior Gate) ---------- */
#pv-modal.tl-modal {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  box-sizing: border-box;
}
#pv-modal[hidden] { display: none !important; }
#pv-modal .tl-card {
  background: #ffffff; border-radius: 24px; padding: 28px 24px;
  max-width: 420px; width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  box-sizing: border-box; text-align: left;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: #1e1b4b; position: relative;
  animation: pvPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#pv-modal .tl-card h3 {
  margin: 0 0 10px;
  font-family: 'Bricolage Grotesque', Inter, system-ui, sans-serif;
  font-size: 1.22rem; font-weight: 800; color: #1e1b4b;
  display: flex; align-items: flex-start; gap: 10px;
  line-height: 1.35;
}
#pv-modal .tl-card h3 svg,
#pv-modal .icon {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  flex: none !important;
  display: inline-block !important;
  stroke: currentColor;
  stroke-width: 2.2;
  margin-top: 2px;
}
#pv-modal .tl-sub { margin: 0 0 16px; color: #4b5563; font-size: 0.9rem; line-height: 1.5; }
#pv-modal .tl-sub a { color: #4f46e5; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
#pv-modal .tl-input {
  width: 100%; box-sizing: border-box;
  font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace;
  font-size: 1.05rem; font-weight: 700;
  padding: 12px 14px; border: 2px solid #e2e8f0; border-radius: 12px;
  background: #f8fafc; color: #0f172a;
  text-transform: uppercase; letter-spacing: 1.5px;
  outline: none; transition: all 0.15s ease;
}
#pv-modal .tl-input:focus { border-color: #4f46e5; background: #ffffff; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
#pv-modal .tl-error {
  color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 10px; padding: 10px 12px; font-size: 0.85rem;
  font-weight: 600; margin: 12px 0 0; line-height: 1.4;
}
#pv-modal .tl-error[hidden] { display: none !important; }
#pv-modal .tl-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 18px; flex-wrap: wrap;
}
#pv-modal .pv-buy {
  font-size: 0.86rem; font-weight: 800; color: #b45309;
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
#pv-modal .pv-buy:hover { text-decoration: underline; color: #b45309; }
#pv-modal .pv-btn-group { display: flex; gap: 8px; align-items: center; margin-left: auto; }
#pv-modal .tl-btn {
  font-family: Inter, system-ui, sans-serif; font-size: 0.9rem;
  font-weight: 700; padding: 10px 18px; border-radius: 10px;
  border: none; cursor: pointer; transition: all 0.15s ease;
  line-height: 1.2;
}
#pv-modal .tl-btn-primary { background: #1e1b4b; color: #ffffff; }
#pv-modal .tl-btn-primary:hover { background: #312e81; }
#pv-modal .tl-btn-ghost { background: #f1f5f9; color: #475569; }
#pv-modal .tl-btn-ghost:hover { background: #e2e8f0; color: #0f172a; }
#pv-modal .tl-btn:disabled { opacity: 0.6; cursor: not-allowed; }
@media (max-width: 480px) {
  #pv-modal .tl-card { padding: 22px 18px; border-radius: 20px; }
  #pv-modal .tl-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  #pv-modal .pv-btn-group { margin-left: 0; width: 100%; }
  #pv-modal .pv-btn-group .tl-btn { flex: 1; text-align: center; }
  #pv-modal .pv-buy { text-align: center; justify-content: center; }
}

/* === Satu set emoji untuk semua device: Noto Color Emoji (gaya Android/HyperOS) ===
   Emoji dirender dari webfont yang sama di semua perangkat, tidak lagi
   mengikuti font emoji bawaan HP. Teks Latin tidak terpengaruh karena
   Noto Color Emoji tidak punya glyph Latin (jatuh ke font berikutnya).
   Jika webfont gagal dimuat, emoji bawaan device jadi cadangan. */
.card-emoji-giant,
.quiz-choice-card .choice-emoji,
.topic-icon-wrap,
.rest-cloud-graphic,
.unlocked-msg,
.jr-emoji {
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Bricolage Grotesque', 'Inter', sans-serif;
}

/* === Perangkat Apple: Apple Color Emoji bawaan ===
   Google Fonts menyajikan Noto Color Emoji format SVG ke browser Apple;
   Safari iOS tidak melukisnya (emoji kosong) dan fallback tidak terpakai
   karena font itu tetap mengklaim glyph emoji. Class .apple-emoji dipasang
   skrip kecil di <head> halaman saat perangkat Apple terdeteksi
   (keputusan Fahrur 2026-10-22: iPhone ikut gaya Apple). */
html.apple-emoji .card-emoji-giant,
html.apple-emoji .quiz-choice-card .choice-emoji,
html.apple-emoji .topic-icon-wrap,
html.apple-emoji .rest-cloud-graphic,
html.apple-emoji .unlocked-msg,
html.apple-emoji .jr-emoji {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

/* Mobile card controls: keep these after the base card rules so they win. */
@media (max-width: 560px) {
  .card-action-tip {
    font-size: 0.82rem;
    padding: 5px 12px;
    margin-top: 4px;
  }

  .card-sound-fab {
    bottom: 14px;
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .card-sound-fab svg {
    width: 24px;
    height: 24px;
  }
}


