:root {
  --sky-top: #5CC6FF;
  --sky-bottom: #B8E8FF;
  --cream-bg: #FFF6DC;
  --hill-light: #8CD843;
  --hill-dark: #5FB336;
  --btn-back-pink: #FF6B8B;
  --btn-play-orange: #FF9F1C;
  --btn-brown: #A97142;
  --btn-lime: #9BC53D;
  --card-purple: #7C5CBF;
  --card-yellow: #FACC15;
  --card-blue: #6EC6F7;
  --card-coral: #FB6B7A;
  --card-green: #45C958;
  --font-display: 'Fredoka', 'Nunito', cursive, sans-serif;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1E293B;
  font-family: var(--font-body);
  color: #1E293B;
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

/* Main Mobile-First Viewport */
#app-viewport {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  min-height: 680px;
  max-height: 932px;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

@media (min-width: 431px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #app-viewport {
    height: min(96dvh, 890px);
    border-radius: 32px;
    border: 4px solid rgba(255, 255, 255, 0.14);
  }
}

/* Screen Lifecycle */
.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
}

.screen.active {
  display: flex;
  opacity: 1;
  animation: screenFadeIn 0.22s ease-out forwards;
}

@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.screen-inner {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(20px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.screen-inner::-webkit-scrollbar {
  display: none;
}

/* Global Back Button (uses assets/back.svg) */
.btn-back {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 16px;
  z-index: 60;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.btn-back img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.btn-back:active {
  transform: translateY(2px) scale(0.95);
}

/* Reusable Press Effects */
.btn-3d {
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-3d:active {
  transform: translateY(3px);
}

.btn-3d-img {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-3d-img:hover {
  filter: brightness(1.03);
}

.btn-3d-img:active {
  transform: translateY(3px) scale(0.97);
}

/* Display Headers with Thick White Stroke */
.screen-header {
  width: 100%;
  text-align: center;
  margin-top: 44px;
  margin-bottom: 14px;
  padding: 0 20px;
  flex-shrink: 0;
}

.stroke-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 33px;
  line-height: 1.06;
  letter-spacing: 0.5px;
  -webkit-text-stroke: 6px #FFFFFF;
  paint-order: stroke fill;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.16));
}

.title-green {
  color: #49A828;
}

.title-sky-blue {
  color: #368FD9;
}

/* =========================================================
   LAYAR 1: Laman Depan (#screen-home)
   ========================================================= */
.home-bg,
.menu-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  z-index: 1;
  pointer-events: none;
}

.home-content {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(108px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom));
}

.home-title-wrap {
  width: 78%;
  max-width: 318px;
  display: flex;
  justify-content: center;
}

.home-title-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.14));
}

.home-play-btn {
  width: 36%;
  max-width: 148px;
  margin-top: 6px;
}

.home-play-btn img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(249, 115, 22, 0.35));
}

.home-secondary-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.home-pill-btn {
  width: 58%;
  max-width: 236px;
}

.home-pill-btn--biodata {
  width: 52%;
  max-width: 212px;
}

.home-pill-btn img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.18));
}

.pwa-install-btn {
  margin-top: 4px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.92);
  border: 2px solid #FFFFFF;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 0 #0369A1;
}

/* =========================================================
   LAYAR 2: Menu Utama (#screen-menu)
   ========================================================= */
.menu-inner {
  justify-content: flex-start;
  padding-top: calc(96px + env(safe-area-inset-top));
}

.menu-header {
  width: 48%;
  max-width: 196px;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.menu-title-img {
  width: 100%;
  height: auto;
  display: block;
}

.menu-list {
  width: 78%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.menu-img-btn {
  width: 100%;
}

.menu-img-btn img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.16));
}

/* =========================================================
   SCENIC BACKGROUNDS (Layers 3, 5, 6, 8, 9)
   ========================================================= */
.warm-scenic-bg,
.river-scenic-bg,
.biodata-scenic-bg,
.hombo-scenic-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.warm-scenic-bg {
  background: linear-gradient(180deg, #FDE8B0 0%, #FFF7DB 48%, #DFF4A6 100%);
}

.river-scenic-bg,
.biodata-scenic-bg,
.hombo-scenic-bg {
  background: linear-gradient(180deg, #5AC5FF 0%, #9EE1FF 52%, #DCF4FF 100%);
}

.scenic-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================================
   LAYAR 3 & 6: Pilihan Cerita & Edukasi (Sticky Note Cards)
   ========================================================= */
.suku-screen-inner {
  padding-top: calc(16px + env(safe-area-inset-top));
}

.suku-grid {
  width: 82%;
  max-width: 340px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
  padding-bottom: 42px;
}

.suku-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 10px 12px;
  border-radius: 14px 14px 4px 14px;
  text-align: left;
  color: #FFFFFF;
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  border: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  overflow: visible;
}

.suku-card:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

/* Decorative top header curve + paperclip */
.suku-card-clip {
  position: absolute;
  top: -7px;
  left: 10px;
  width: 16px;
  height: 30px;
  z-index: 4;
  pointer-events: none;
}

.suku-card-photo {
  width: 100%;
  aspect-ratio: 480 / 376;
  background: #FFFFFF;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.suku-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.suku-card-label {
  margin-top: 9px;
  padding: 0 4px 2px;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 14px;
  line-height: 1.15;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Folded corner bottom-right */
.suku-card::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 48%, rgba(0, 0, 0, 0.14) 50%, transparent 52%);
  border-top-left-radius: 5px;
  pointer-events: none;
}

.suku-card--purple { background: var(--card-purple); }
.suku-card--yellow { background: #FCCB1A; }
.suku-card--blue   { background: #73C7F8; }
.suku-card--coral  { background: #FB6B7A; }
.suku-card--green  { background: #41CA59; }

/* =========================================================
   LAYAR 5: Kata Pengantar (#screen-foreword)
   ========================================================= */
.foreword-inner {
  padding-top: calc(20px + env(safe-area-inset-top));
}

.foreword-header {
  margin-top: 38px;
  margin-bottom: 12px;
}

.foreword-title {
  font-size: 36px;
  line-height: 1.02;
}

.foreword-word-top {
  color: #4197E0;
}

.foreword-word-bottom {
  color: #F59E0B;
}

.foreword-card {
  position: relative;
  width: 82%;
  max-width: 344px;
  padding: 24px 20px 26px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 2.5px solid rgba(255, 255, 255, 0.96);
  border-radius: 26px 8px 26px 26px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  text-align: center;
  color: #3E2D20;
  font-size: 13.8px;
  font-weight: 800;
  line-height: 1.48;
  margin-bottom: 24px;
}

.foreword-card::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 28px;
  height: 28px;
  background: linear-gradient(225deg, transparent 48%, rgba(255, 255, 255, 0.92) 50%, rgba(203, 213, 225, 0.65) 100%);
  border-bottom-left-radius: 8px;
  pointer-events: none;
}

.foreword-greeting {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 14px;
}

.foreword-card p + p {
  margin-top: 12px;
}

/* =========================================================
   LAYAR 8: Biodata Penulis (#screen-biodata)
   ========================================================= */
.biodata-inner {
  padding-top: calc(18px + env(safe-area-inset-top));
}

.biodata-list {
  width: 84%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
  padding-bottom: 28px;
}

.biodata-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18), 0 10px 18px rgba(0, 0, 0, 0.12);
}

.biodata-card--orange {
  background: linear-gradient(180deg, #FFA23A 0%, #F97316 100%);
  box-shadow: 0 6px 0 #C2530A, 0 10px 18px rgba(0, 0, 0, 0.14);
}

.biodata-card--green {
  background: linear-gradient(180deg, #3BD16F 0%, #16A34A 100%);
  box-shadow: 0 6px 0 #137939, 0 10px 18px rgba(0, 0, 0, 0.14);
}

.biodata-card--pink {
  background: linear-gradient(180deg, #FF708D 0%, #EC4872 100%);
  box-shadow: 0 6px 0 #B82952, 0 10px 18px rgba(0, 0, 0, 0.14);
}

.biodata-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid #FFFFFF;
  background: #FFFFFF;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.18);
}

.biodata-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.biodata-info {
  flex: 1;
  min-width: 0;
}

.biodata-name {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 900;
  color: #1E293B;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  margin-bottom: 3px;
}

.biodata-desc {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.32;
  color: #0F172A;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* =========================================================
   LAYAR 9: Pilihan Permainan (#screen-game-list)
   ========================================================= */
.game-list-inner {
  padding-top: calc(18px + env(safe-area-inset-top));
}

.game-choice-list {
  width: 84%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.game-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: 22px;
  border: 3px solid #FFFFFF;
  text-align: left;
  color: #FFFFFF;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.game-card:active {
  transform: translateY(3px);
}

.game-card--purple {
  background: linear-gradient(180deg, #B85CFF 0%, #8A2BE2 100%);
  box-shadow: 0 6px 0 #6A1B9A, 0 12px 20px rgba(0, 0, 0, 0.18);
}

.game-card--gold {
  background: linear-gradient(180deg, #FAD02C 0%, #D98A00 100%);
  box-shadow: 0 6px 0 #A46200, 0 12px 20px rgba(0, 0, 0, 0.18);
}

.game-card-icon {
  width: 66px;
  height: 66px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.game-card-body {
  flex: 1;
  min-width: 0;
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 4px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.game-card-sub {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.94);
}

.game-card-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FFFFFF;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

/* =========================================================
   Deferred Screen Placeholder (#screen-coming-soon)
   ========================================================= */
.coming-soon-inner {
  justify-content: center;
  padding: 24px;
}

.coming-soon-card {
  width: 88%;
  max-width: 330px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #FFFFFF;
  border-radius: 24px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.coming-soon-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: #FEF08A;
  color: #B45309;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 10px;
}

.coming-soon-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: #1E293B;
  margin-bottom: 8px;
}

.coming-soon-desc {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  color: #475569;
  margin-bottom: 18px;
}

.coming-soon-btn {
  padding: 10px 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FF9F1C 0%, #FF6B00 100%);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 0 #C2530A;
}

/* =========================================================
   iOS Install Modal
   ========================================================= */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ios-modal-card {
  width: 100%;
  max-width: 340px;
  background: #FFFFFF;
  border-radius: 22px;
  padding: 22px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.ios-modal-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  color: #0284C7;
  margin-bottom: 8px;
}

.ios-modal-card p {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
}

.ios-modal-card ol {
  padding-left: 20px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
  color: #334155;
  margin-bottom: 16px;
}

.ios-modal-close {
  width: 100%;
  padding: 10px 16px;
  border-radius: 14px;
  background: #0284C7;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 0 #0369A1;
}

/* Lazy Module Loading Indicator */
.tts-loading-state {
  position: relative;
  z-index: 6;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}

.tts-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: ttsSpin 0.8s linear infinite;
}

@keyframes ttsSpin {
  to {
    transform: rotate(360deg);
  }
}

.screen-rpg-parchment {
  background: #F8E6C4;
}

.rpg-loading-state {
  color: #4A2B16;
  text-shadow: none;
}

.rpg-spinner {
  border-color: rgba(74, 43, 22, 0.25);
  border-top-color: #5E2C08;
}

/* =========================================================
   LAYAR 12: Panduan Modul (#screen-guide)
   ========================================================= */
.guide-inner {
  padding-top: calc(18px + env(safe-area-inset-top));
}

.guide-list {
  width: 86%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
  padding-bottom: 32px;
}

.guide-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 14px 14px 18px;
  background: rgba(255, 255, 255, 0.95);
  border: 2.5px solid #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 6px 0 rgba(15, 23, 42, 0.12), 0 10px 20px rgba(15, 23, 42, 0.12);
}

.guide-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid #FFFFFF;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}

.guide-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.guide-icon-box svg {
  width: 36px;
  height: 36px;
  display: block;
}

.guide-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.guide-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.16);
}

.guide-desc {
  font-size: 12.2px;
  font-weight: 700;
  line-height: 1.38;
  color: #334155;
}

.guide-card--blue .guide-badge,
.guide-card--blue .guide-pill { background: #3B82F6; }
.guide-card--blue .guide-icon-box { background: #DBEAFE; color: #2563EB; }

.guide-card--orange .guide-badge,
.guide-card--orange .guide-pill { background: #F59E0B; }
.guide-card--orange .guide-icon-box { background: #FEF3C7; color: #D97706; }

.guide-card--teal .guide-badge,
.guide-card--teal .guide-pill { background: #10B981; }
.guide-card--teal .guide-icon-box { background: #D1FAE5; color: #059669; }

.guide-card--purple .guide-badge,
.guide-card--purple .guide-pill { background: #8B5CF6; }
.guide-card--purple .guide-icon-box { background: #EDE9FE; color: #7C3AED; }

/* Story Card Tweaks (ID cerita-1..cerita-5) */
.story-card-photo {
  aspect-ratio: 4 / 4.4;
}

.story-card-photo img {
  object-position: center top;
}

.story-card-tag {
  display: block;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.9;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* =========================================================
   LAYAR 4: Detail Cerita — E-Book .webp Reader (#screen-story-detail)
   ========================================================= */
.screen-ebook {
  background: linear-gradient(180deg, #FFF8E7 0%, #FDECC8 100%);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.ebook-topbar {
  position: relative;
  z-index: 20;
  width: 100%;
  min-height: 64px;
  padding: 14px 18px 8px 74px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
}

.ebook-story-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: #5E2C08;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ebook-viewer {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}

.ebook-viewer.is-dragging {
  cursor: grabbing;
}

.ebook-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.32s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

.ebook-track.is-dragging {
  transition: none;
}

.ebook-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  padding: 2px 10px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ebook-page-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(94, 44, 8, 0.16);
  background: #FFFDF7;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.ebook-fallback {
  width: 100%;
  height: 100%;
  max-height: 540px;
  background: #FFFFFF;
  border: 3px solid #FDE68A;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  color: #5E2C08;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.ebook-fallback p {
  font-size: 14px;
  font-weight: 800;
}

.ebook-hud {
  position: relative;
  z-index: 20;
  width: calc(100% - 28px);
  max-width: 360px;
  margin: 6px auto 12px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid #FFFFFF;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.ebook-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, #52C4FF 0%, #0284C7 100%);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 #0369A1;
  flex-shrink: 0;
}

.ebook-nav-btn:disabled {
  opacity: 0.38;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.ebook-nav-btn--finish {
  background: linear-gradient(180deg, #4ADE80 0%, #16A34A 100%);
  box-shadow: 0 3px 0 #15803D;
  font-size: 18px;
}

.ebook-status {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ebook-page-indicator {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 900;
  color: #1E293B;
}

.ebook-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ebook-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #CBD5E1;
  transition: width 0.2s ease, background 0.2s ease;
}

.ebook-dot.is-active {
  width: 14px;
  background: #0284C7;
}
