/* ===================================================================
   BILI KIDS - 3D ANIMATED STORYBOOKS (CUENTOS 3D ANIMADOS)
   Realistic Page-Turn Flipbook System, Pixar Style Art & Story Engine
   =================================================================== */

:root {
  --font-title: 'Fredoka One', cursive, sans-serif;
  --font-story: 'Playfair Display', Georgia, serif;
  --font-ui: 'Nunito', sans-serif;

  --book-width: 960px;
  --book-height: 620px;
  --page-bg: #fffdf8;
  --page-border: #f0e6d2;

  --c-bili: #2980b9;
  --c-bili-light: #5dade2;
  --c-leo: #e67e22;
  --c-leo-light: #f39c12;
  --c-luna: #9b59b6;
  --c-luna-light: #af7ac5;
  --c-friends: #27ae60;
  --c-gold: #f1c40f;
  --c-dark: #2c3e50;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-ui);
  background-color: #f8fafc;
  min-height: 100vh;
  color: #0f172a;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* --- HEADER BAR --- */
.app-header {
  background: rgba(20, 28, 36, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 20px;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.logo-area .home-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.brand-logo {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.logo-text {
  font-family: var(--font-title);
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

.logo-text .highlight {
  color: #ffcc00;
}

.badge-tag {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #e74c3c, #f39c12);
  padding: 4px 10px;
  border-radius: 12px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Navigation Switcher */
.suite-switcher {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 6px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  color: #d0d7de;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.25s ease;
}

.nav-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
}

.nav-pill.active {
  background: linear-gradient(135deg, #e67e22, #f39c12);
  color: #fff;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.35);
}

/* Header Utilities */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-circle-btn, .pill-lang-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.pill-lang-btn {
  border-radius: 20px;
  width: auto;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 800;
  gap: 6px;
}

.icon-circle-btn:hover, .pill-lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* --- MAIN CONTAINER & SCREENS --- */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen {
  display: none;
  width: 100%;
}

.screen.active {
  display: block;
}

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

/* ===================================================================
   SCREEN 1: 3D BOOKSHELF / STORY SELECTOR
   =================================================================== */
.shelf-hero-banner {
  text-align: center;
  padding: 30px 20px 15px;
}

.hero-badge {
  display: inline-block;
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.35);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.shelf-title {
  font-family: var(--font-title);
  font-size: 2.8rem;
  color: #fff;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  margin-bottom: 8px;
}

.shelf-subtitle {
  font-size: 1.1rem;
  color: #bdc3c7;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Interactive Category Filter Tabs */
.shelf-filter-tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 25px auto 10px;
  padding: 0 20px;
  flex-wrap: wrap;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 10px 22px;
  border-radius: 25px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-2px);
}

.filter-tab.active {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  border-color: #f39c12;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.45);
  transform: translateY(-2px) scale(1.03);
}

/* Realistic 3D Bookshelf Structure */
.bookshelf-scene {
  max-width: 1240px;
  margin: 20px auto 50px;
  padding: 0 20px;
  perspective: 1200px;
}

/* Shelf Tier Containers */
.shelf-tier-container {
  margin-bottom: 50px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.shelf-tier-container.tier-hidden {
  display: none;
}

.shelf-tier-header {
  margin-bottom: 16px;
  padding: 0 10px;
}

.tier-badge-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tier-pill-badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.tier-badge-video {
  background: linear-gradient(135deg, #e67e22, #f39c12);
}

.tier-badge-classic {
  background: linear-gradient(135deg, #2980b9, #8e44ad);
}

.tier-badge-2d {
  background: linear-gradient(135deg, #059669, #10b981);
}

.tier-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.tier-subtitle {
  font-size: 14px;
  color: #94a3b8;
  font-weight: 600;
}

.wooden-shelf-rack {
  position: relative;
  background: linear-gradient(to bottom, transparent 85%, rgba(0,0,0,0.5) 100%);
  padding-bottom: 25px;
}

.books-gallery {
  display: grid;
  gap: 24px;
  align-items: flex-end;
  justify-items: center;
  padding: 20px 10px;
}

/* Video Books Gallery (2 books, centered and prominent) */
.video-books-gallery {
  grid-template-columns: repeat(auto-fit, minmax(260px, 300px));
  justify-content: center;
  gap: 40px;
}

/* Classic Books Gallery (4 books) */
.classic-books-gallery {
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  justify-content: center;
  gap: 24px;
}

/* 2D Books Gallery (4 books) */
.books-2d-gallery {
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  justify-content: center;
  gap: 24px;
}

.wooden-shelf-bar {
  height: 28px;
  background: linear-gradient(to right, #5c3818 0%, #8b5a2b 15%, #a06535 50%, #8b5a2b 85%, #5c3818 100%);
  border-radius: 6px;
  box-shadow: 0 12px 25px rgba(0,0,0,0.7), inset 0 3px 5px rgba(255,255,255,0.25), inset 0 -4px 6px rgba(0,0,0,0.4);
  position: relative;
}

.wooden-shelf-bar::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 20px;
  right: 20px;
  height: 15px;
  background: linear-gradient(to bottom, rgba(40,20,10,0.8), transparent);
}

/* Individual Book Item in Shelf */
.book-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 270px;
  cursor: pointer;
}

.book-3d-wrapper {
  perspective: 1000px;
  width: 100%;
}

.book-cover-3d {
  position: relative;
  height: 380px;
  border-radius: 8px 16px 16px 8px;
  box-shadow: -8px 12px 25px rgba(0, 0, 0, 0.6), inset 4px 0 8px rgba(255, 255, 255, 0.15);
  transform: rotateY(-8deg) translateZ(10px);
  transform-style: preserve-3d;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
}

.book-card-item:hover .book-cover-3d {
  transform: rotateY(-2deg) translateY(-14px) scale(1.03);
  box-shadow: -15px 22px 35px rgba(0, 0, 0, 0.7), 0 0 30px rgba(241, 196, 15, 0.3);
}

.cover-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, rgba(0,0,0,0.5), rgba(255,255,255,0.1) 40%, rgba(0,0,0,0.4));
  z-index: 10;
}

.cover-emboss-border {
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 6px 12px 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}

.cover-character-preview {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  margin-top: 5px;
  background: #fff;
}

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

.book-tag-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.25);
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.book-tag-badge.highlight-gold {
  background: linear-gradient(135deg, #f1c40f, #e67e22);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.book-cover-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  margin: 6px 0 2px;
}

.book-cover-sub {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.book-cover-star {
  font-size: 0.75rem;
  color: #f1c40f;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 10px;
  border-radius: 10px;
}

/* Individual Book Theme Colors */
.book-cover-bili {
  background: linear-gradient(145deg, #1b4f72, #2980b9 45%, #5dade2);
}
.book-cover-leo {
  background: linear-gradient(145deg, #7e3e06, #e67e22 45%, #f39c12);
}
.book-cover-luna {
  background: linear-gradient(145deg, #4a235a, #8e44ad 45%, #bb8fce);
}
.book-cover-friends {
  background: linear-gradient(145deg, #196f3d, #27ae60 40%, #58d68d);
  border: 2px solid #f1c40f;
}

/* Action Button under Books */
.btn-read-book {
  background: #fff;
  color: #2c3e50;
  border: none;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
  transition: all 0.25s ease;
  width: 90%;
}

.btn-read-book:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 22px rgba(0,0,0,0.5);
  background: #f1c40f;
  color: #000;
}

/* ===================================================================
   SCREEN 2: REALISTIC 3D FLIPBOOK READER
   =================================================================== */
#screenReader {
  padding: 15px 20px 30px;
}

.reader-top-bar {
  max-width: var(--book-width);
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.btn-reader-action {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reader-action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.reader-story-info {
  text-align: center;
}

.story-mini-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #f39c12;
  color: #fff;
  padding: 2px 8px;
  border-radius: 8px;
}

.reader-header-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: #fff;
  margin-top: 2px;
}

.reader-playback-controls {
  display: flex;
  gap: 8px;
}

.btn-voice-narrator {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  border: none;
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.35);
  transition: all 0.2s ease;
}

.btn-voice-narrator:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46, 204, 113, 0.5);
}

.btn-voice-narrator.speaking {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(231, 76, 60, 0.5); }
  50% { box-shadow: 0 0 22px rgba(231, 76, 60, 0.85); }
}

.btn-auto-turn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-auto-turn.active {
  background: #f39c12;
  border-color: #f39c12;
  box-shadow: 0 2px 10px rgba(243, 156, 18, 0.4);
}

/* ===================================================================
   TRUE REALISTIC 3D BOOK ENGINE
   =================================================================== */
.book-stage {
  max-width: var(--book-width);
  height: var(--book-height);
  margin: 0 auto;
  perspective: 2000px;
  position: relative;
}

.book-3d-chassis {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  transform-style: preserve-3d;
  border-radius: 12px 18px 18px 12px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.65),
    0 5px 15px rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px rgba(255, 255, 255, 0.15);
  background: #20150b; /* Hardcover leather base */
}

/* Hardcover Spine & Bookmark */
.book-spine-hinge {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 18px;
  transform: translateX(-50%);
  background: linear-gradient(
    to right, 
    rgba(0,0,0,0.3) 0%, 
    rgba(255,255,255,0.15) 30%, 
    rgba(0,0,0,0.35) 50%, 
    rgba(255,255,255,0.15) 70%, 
    rgba(0,0,0,0.3) 100%
  );
  z-index: 50;
  pointer-events: none;
}

.book-ribbon-bookmark {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 16px;
  height: 660px;
  transform: translateX(-50%);
  background: linear-gradient(to right, #c0392b, #e74c3c, #962d22);
  box-shadow: 2px 4px 8px rgba(0,0,0,0.4);
  z-index: 55;
  pointer-events: none;
  clip-path: polygon(0 0, 100% 0, 100% 95%, 50% 90%, 0 95%);
}

/* Base Static Left & Right Pages */
.book-page {
  flex: 1;
  height: 100%;
  background: var(--page-bg);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 35px rgba(216, 203, 178, 0.4);
}

.book-page-left {
  border-radius: 8px 0 0 8px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.book-page-right {
  border-radius: 0 8px 8px 0;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.page-inner {
  width: 100%;
  height: 100%;
  padding: 24px 28px;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Inner Spine Gradient Shadows (Simulates page depth curvature) */
.page-spine-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45px;
  pointer-events: none;
  z-index: 40;
}

.page-spine-shadow.left {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.15) 0%, rgba(0,0,0,0.05) 50%, transparent 100%);
}

.page-spine-shadow.right {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.15) 0%, rgba(0,0,0,0.05) 50%, transparent 100%);
}

/* Left Page: Pixar 3D Illustration Frame */
.illustration-frame {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.1), 0 4px 15px rgba(0,0,0,0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #f5f0e6;
}

.pixar-scene-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  animation: pixarCameraBreathe 12s ease-in-out infinite alternate;
}

@keyframes pixarCameraBreathe {
  0% { transform: scale(1.0) translate(0, 0); }
  50% { transform: scale(1.035) translate(-4px, -3px); }
  100% { transform: scale(1.015) translate(3px, 2px); }
}

.ambient-particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* Live 3D Scene Action Layer */
.scene-action-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene-diorama {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 25px;
}

.diorama-backdrop-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background 0.6s ease;
}

.diorama-hero-character {
  max-height: 220px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.45));
  animation: heroBreathing 3.6s ease-in-out infinite;
  z-index: 5;
  transition: transform 0.4s ease;
}

@keyframes heroBreathing {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}

.diorama-prop {
  position: absolute;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
  z-index: 6;
  animation: propFloat 4s ease-in-out infinite;
}

@keyframes propFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(4deg); }
}

.diorama-prop.sparkle-pulse {
  animation: sparklePulse 2.2s ease-in-out infinite;
}

.diorama-prop.prop-float {
  animation: propFloat 3.8s ease-in-out infinite;
}

.diorama-prop.prop-bounce {
  animation: propBounce 2s ease-in-out infinite;
}

@keyframes propBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-16px) scale(1.1) rotate(6deg); }
  60% { transform: translateY(-8px) scale(1.05) rotate(-4deg); }
}

.diorama-prop.prop-wave {
  animation: propWave 2.8s ease-in-out infinite;
}

@keyframes propWave {
  0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); }
  50% { transform: translateX(12px) translateY(-6px) rotate(8deg); }
}

@keyframes sparklePulse {
  0%, 100% { transform: scale(0.95); opacity: 0.85; filter: drop-shadow(0 0 8px rgba(255,255,255,0.6)); }
  50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 25px rgba(255,215,0,0.95)); }
}

.diorama-ground-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent);
  border-radius: 0 0 12px 12px;
  z-index: 2;
}

.diorama-badge-scene {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(20, 28, 36, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scene-vignette-shadow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
  z-index: 15;
}

.page-badge-number {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 10px;
  z-index: 20;
}

/* Right Page: Text & Story Layout */
.page-text-layout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--c-dark);
}

.story-header-ornament {
  text-align: center;
  color: #c49a45;
  font-size: 0.95rem;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.story-text-body {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 10px 0;
}

.text-story-english {
  font-family: var(--font-story);
  font-size: 1.55rem;
  line-height: 1.55;
  color: #24292e;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  transition: color 0.3s ease;
}

.text-story-english.reading-active {
  color: #d35400;
}

/* Phonetic Pronunciation Guide Card */
.story-phonetic-card {
  background: #fdf2f8;
  border-left: 4px solid #db2777;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 10px 0 6px;
}

.phonetic-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #db2777;
  display: block;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.text-story-phonetic {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: #9d174d;
  font-style: italic;
  margin: 0;
}

/* 2D Book Mode Enhancements */
.book-stage.book-mode-2d .pixar-scene-art {
  object-fit: cover;
  object-position: center center;
  background: transparent;
  animation: none;
  padding: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.book-stage.book-mode-2d .illustration-frame {
  background: #fdfaf4;
  border: 1.5px solid #e7ded0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.06);
}

.book-stage.book-mode-2d .page-inner {
  padding: 16px 24px;
}

.book-stage.book-mode-2d .story-header-ornament {
  margin-bottom: 4px;
}

.book-stage.book-mode-2d .story-text-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  overflow: visible;
  max-height: none;
  padding: 4px 6px;
}

.book-stage.book-mode-2d .text-story-english {
  font-family: var(--font-story);
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  line-height: 1.55;
  white-space: pre-line;
  color: #1a2536;
  margin: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.book-stage.book-mode-2d .story-spanish-card {
  background: #faf6ee;
  border-left: 3.5px solid #d97706;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  margin: 8px 0;
  max-height: 160px;
  overflow-y: auto;
}

.book-stage.book-mode-2d .text-story-spanish {
  white-space: pre-line;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #4b5563;
}

.btn-toggle-spanish-2d {
  background: #fdfaf2;
  border: 1.5px solid #d4c4a8;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #78350f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-toggle-spanish-2d:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.btn-toggle-spanish-2d.active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
}

/* Spanish Subtitle Card */
.story-spanish-card {
  background: #f7f4ea;
  border-left: 4px solid #e67e22;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 12px 0;
}

.spanish-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #e67e22;
  display: block;
  margin-bottom: 4px;
}

.text-story-spanish {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  color: #4a5568;
}

/* Key Word Pills */
.story-key-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.vocab-pill {
  background: #eef2f7;
  color: #2980b9;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid #d4e6f1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vocab-pill .trans {
  color: #7f8c8d;
  font-weight: 600;
}

/* Page Footer Row */
.page-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed rgba(0,0,0,0.1);
}

.btn-page-speaker {
  background: none;
  border: none;
  color: #7f8c8d;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease;
}

.btn-page-speaker:hover {
  color: #e67e22;
}

.page-number-label {
  font-family: var(--font-story);
  font-size: 0.95rem;
  font-style: italic;
  color: #95a5a6;
}

/* ===================================================================
   3D REALISTIC TURNING LEAF ANIMATION (PAGE FLIP EFFECT)
   =================================================================== */
.book-turning-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 50%;
  transform-origin: left center;
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 35;
  display: none;
}

.book-turning-leaf.flipping-forward {
  display: block;
  animation: turnPageForward 0.72s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.book-turning-leaf.flipping-backward {
  display: block;
  left: 0;
  right: auto;
  transform-origin: right center;
  animation: turnPageBackward 0.72s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.leaf-front, .leaf-back {
  position: absolute;
  inset: 0;
  background: var(--page-bg, #fffdfa);
  backface-visibility: hidden;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.leaf-front {
  border-radius: 0 14px 14px 0;
}

.leaf-back {
  transform: rotateY(180deg);
  border-radius: 14px 0 0 14px;
}

.leaf-front .page-inner,
.leaf-back .page-inner {
  width: 100%;
  height: 100%;
  padding: 30px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.leaf-front .illustration-frame,
.leaf-back .illustration-frame {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.leaf-front .scene-illustration,
.leaf-back .scene-illustration {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.leaf-shadow-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
}

.flipping-forward .leaf-front .leaf-shadow-overlay {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.35) 0%, rgba(255, 255, 255, 0.22) 40%, rgba(0, 0, 0, 0.15) 80%, transparent 100%);
  animation: shadowSweep 0.72s ease-in-out forwards;
}

.flipping-forward .leaf-back .leaf-shadow-overlay {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.35) 0%, rgba(255, 255, 255, 0.22) 40%, rgba(0, 0, 0, 0.15) 80%, transparent 100%);
  animation: shadowSweep 0.72s ease-in-out forwards;
}

.flipping-backward .leaf-back .leaf-shadow-overlay {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.35) 0%, rgba(255, 255, 255, 0.22) 40%, rgba(0, 0, 0, 0.15) 80%, transparent 100%);
  animation: shadowSweep 0.72s ease-in-out forwards;
}

.flipping-backward .leaf-front .leaf-shadow-overlay {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.35) 0%, rgba(255, 255, 255, 0.22) 40%, rgba(0, 0, 0, 0.15) 80%, transparent 100%);
  animation: shadowSweep 0.72s ease-in-out forwards;
}

@keyframes shadowSweep {
  0% { opacity: 0; }
  35% { opacity: 0.85; }
  70% { opacity: 0.5; }
  100% { opacity: 0; }
}

@keyframes turnPageForward {
  0% {
    transform: rotateY(0deg);
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
  }
  30% {
    filter: drop-shadow(-18px 12px 30px rgba(0, 0, 0, 0.32));
  }
  50% {
    transform: rotateY(-90deg) scale(1.02);
    filter: drop-shadow(-28px 16px 40px rgba(0, 0, 0, 0.26));
  }
  100% {
    transform: rotateY(-180deg) scale(1);
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
  }
}

@keyframes turnPageBackward {
  0% {
    transform: rotateY(0deg);
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
  }
  30% {
    filter: drop-shadow(18px 12px 30px rgba(0, 0, 0, 0.32));
  }
  50% {
    transform: rotateY(90deg) scale(1.02);
    filter: drop-shadow(28px 16px 40px rgba(0, 0, 0, 0.26));
  }
  100% {
    transform: rotateY(180deg) scale(1);
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
  }
}

/* Interactive Page Click & Corner Peel Indication */
.book-page-right {
  cursor: pointer;
  position: relative;
}

.book-page-right::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.08) 51%, rgba(230, 126, 34, 0.45) 52%, #fffdfa 53%);
  border-radius: 0 0 14px 0;
  opacity: 0.6;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.book-page-right:hover::after {
  width: 60px;
  height: 60px;
  opacity: 1;
  box-shadow: -4px -4px 12px rgba(0, 0, 0, 0.15);
}

.book-page-left {
  cursor: pointer;
  position: relative;
}

.book-page-left::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 45px;
  height: 45px;
  background: linear-gradient(-135deg, transparent 50%, rgba(0, 0, 0, 0.08) 51%, rgba(230, 126, 34, 0.45) 52%, #fffdfa 53%);
  border-radius: 0 0 0 14px;
  opacity: 0.6;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.book-page-left:hover::after {
  width: 60px;
  height: 60px;
  opacity: 1;
  box-shadow: 4px -4px 12px rgba(0, 0, 0, 0.15);
}

/* ===================================================================
   READER BOTTOM NAVIGATION CONTROLS
   =================================================================== */
.reader-bottom-nav {
  max-width: var(--book-width);
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.btn-turn-page {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  border: none;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 12px 28px;
  border-radius: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(230, 126, 34, 0.4);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-turn-page:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 24px rgba(230, 126, 34, 0.55);
}

.btn-turn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-turn-page.prev {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.btn-turn-page.prev:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}

.page-dots-indicator {
  display: flex;
  gap: 8px;
}

.dot-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
}

.dot-indicator.active {
  background: #f1c40f;
  transform: scale(1.35);
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.8);
}

/* ===================================================================
   SCREEN 3: DIPLOMA CELEBRATION
   =================================================================== */
#screenCelebration {
  padding: 40px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

.celebration-diploma-card {
  background: linear-gradient(135deg, #fffdf8, #fdf7e7);
  border: 12px solid #d4af37;
  border-radius: 20px;
  padding: 40px 30px;
  max-width: 650px;
  width: 100%;
  text-align: center;
  color: #2c3e50;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  position: relative;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.diploma-ribbon-badge {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  display: inline-block;
  padding: 6px 18px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

.diploma-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: #b7791f;
  margin-bottom: 10px;
}

.diploma-msg {
  font-size: 1.15rem;
  line-height: 1.5;
  color: #4a5568;
  margin-bottom: 25px;
}

.diploma-mascot-award {
  margin: 15px auto 25px;
  width: 140px;
  height: 140px;
  background: #fff;
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border: 4px solid #f1c40f;
}

.diploma-hero-mascot {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.diploma-action-row {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.btn-primary-fun, .btn-secondary-fun {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary-fun {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff;
  box-shadow: 0 6px 18px rgba(39, 174, 96, 0.4);
}

.btn-secondary-fun {
  background: #edf2f7;
  color: #2d3748;
}

.btn-primary-fun:hover { transform: translateY(-3px); }
.btn-secondary-fun:hover { background: #e2e8f0; }

.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ===================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   =================================================================== */
@media (max-width: 992px) {
  :root {
    --book-width: 100%;
    --book-height: auto;
  }

  .book-stage {
    height: auto;
    perspective: none;
  }

  .book-3d-chassis {
    flex-direction: column;
    height: auto;
    border-radius: 12px;
  }

  .book-spine-hinge, .book-ribbon-bookmark, .page-spine-shadow {
    display: none;
  }

  .book-page {
    width: 100%;
    border-radius: 12px;
  }

  .illustration-frame {
    height: 300px;
  }

  .book-turning-leaf {
    display: none !important;
  }

  .shelf-title {
    font-size: 2.1rem;
  }
}


/* ===================================================================
   MODERN BILIKIDS LIBRARY & SHELVES (OFFICIAL DESIGN MOCKUP FIDELITY)
   =================================================================== */

.library-page-body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  min-height: 100vh;
}

.library-content-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
  width: 100%;
}

/* Hero Banner */
.library-hero-card {
  width: 100%;
  margin-bottom: 2.2rem;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.library-hero-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Modern Shelf Section */
.modern-shelf-section {
  margin-bottom: 2rem;
}

.modern-shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.shelf-header-left {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.shelf-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #7c3aed;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.28);
  flex-shrink: 0;
}

.shelf-header-icon svg {
  width: 26px;
  height: 26px;
}

.shelf-header-title {
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0 0 2px;
  letter-spacing: -0.3px;
}

.shelf-header-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

.shelf-see-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e1b4b;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 8px 20px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.shelf-see-more-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Shelf Carousel Area */
.modern-shelf-carousel {
  position: relative;
  padding: 0;
}

.modern-shelf-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 14px 8px 18px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modern-shelf-track::-webkit-scrollbar {
  display: none;
}

.shelf-nav-arrow {
  position: absolute;
  top: 48%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shelf-nav-arrow:hover {
  background: #ffffff;
  color: #7c3aed;
  border-color: #c4b5fd;
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.25);
}

.shelf-nav-prev {
  left: -22px;
}

.shelf-nav-next {
  right: -22px;
}

/* Modern Book Card (Faithful to Mockup) */
.modern-book-card {
  flex: 0 0 calc((100% - 80px) / 5);
  min-width: 220px;
  max-width: 255px;
  background: #ffffff;
  border-radius: 24px;
  padding: 7px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08), 0 3px 8px rgba(0, 0, 0, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
}

.modern-book-card:hover {
  transform: translateY(-10px) scale(1.025);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.13), 0 8px 16px rgba(0, 0, 0, 0.06);
}

.book-card-art-wrap {
  width: 100%;
  aspect-ratio: 1199 / 1312;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.book-card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.modern-book-card:hover .book-card-cover-img {
  transform: scale(1.035);
}

/* Physical Book Spine Lighting */
.book-card-spine-crease {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 24px;
  background: linear-gradient(to right, rgba(0,0,0,0.22) 0%, rgba(255,255,255,0.2) 20%, rgba(0,0,0,0.06) 50%, transparent 100%);
  pointer-events: none;
}

/* Bottom Action Badge */
.book-bottom-badge-container {
  padding: 10px 6px 6px;
  display: flex;
  justify-content: center;
}

.book-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  background: #ffffff;
  border: 1.5px solid #38bdf8;
  color: #0284c7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.book-pill-badge.badge-classic {
  border-color: #38bdf8;
  color: #0284c7;
}

.book-pill-badge.badge-pip {
  border-color: #22c55e;
  color: #16a34a;
}

.book-pill-badge.badge-barnaby {
  border-color: #f59e0b;
  color: #d97706;
}

.book-pill-badge.badge-pippa {
  border-color: #0ea5e9;
  color: #0284c7;
}

.book-pill-badge.badge-milo {
  border-color: #a855f7;
  color: #7c3aed;
}

.book-pill-badge.badge-video {
  border-color: #e11d48;
  color: #e11d48;
}

.modern-book-card:hover .book-pill-badge {
  transform: scale(1.05);
}

/* Modern Shelf Board Plank (Depth & Realistic Grounding) */
.modern-shelf-plank {
  height: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 45%, #cbd5e1 100%);
  border-radius: 6px;
  margin-top: 4px;
  margin-bottom: 2.8rem;
  position: relative;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  border-top: 2px solid #ffffff;
}

.modern-shelf-plank::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 2px;
  right: 2px;
  height: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(241, 245, 249, 0.85) 100%);
  border-radius: 6px 6px 0 0;
  transform: perspective(400px) rotateX(25deg);
  transform-origin: bottom;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .modern-book-card {
    flex: 0 0 calc((100% - 60px) / 4);
  }
}

@media (max-width: 900px) {
  .modern-book-card {
    flex: 0 0 calc((100% - 40px) / 3);
  }
  .shelf-header-title {
    font-size: 1.35rem;
  }
}

@media (max-width: 640px) {
  .subpage-navbar {
    padding: 0.65rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .nav-center-menu {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 4px 0;
  }
  .nav-center-menu::-webkit-scrollbar {
    display: none;
  }
  .nav-pill-item {
    flex-shrink: 0;
    min-height: 42px;
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 6px 14px;
  }
  .modern-book-card {
    flex: 0 0 170px;
  }
  .modern-shelf-track {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  .shelf-nav-prev, .shelf-nav-next {
    display: none; /* Native touch swiping is preferred on mobile */
  }
  .reader-top-bar {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
  .reader-header-title {
    font-size: 1.15rem;
  }
  .btn-voice-narrator {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}
