/* Core Stylesheet: Hopetown Horizons 3D Web Flipbook */

:root {
  /* Colors - Light Theme */
  --primary-color: #0b1a30; /* Deep Academy Navy */
  --accent-color: #c9982f;  /* Gold Accent */
  --bg-color: #f3f6fa;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --page-bg: #ffffff;
  --card-bg: #f8fafc;
  --text-main: #2d3748;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --crease-shadow: rgba(0, 0, 0, 0.15);
  --cover-bg-opacity: 0.32;
  
  /* Fonts */
  --font-display: 'Cinzel', serif;
  --font-copy: 'Montserrat', sans-serif;
  
  /* Layout Dimensions */
  --book-width: 1200px;
  --book-height: 750px;
}

.dark-theme {
  /* Colors - Dark Theme */
  --primary-color: #1a2b4c;
  --accent-color: #e5b64c;
  --bg-color: #0f172a;
  --panel-bg: rgba(30, 41, 59, 0.85);
  --page-bg: #1e293b;
  --card-bg: #0f172a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --crease-shadow: rgba(0, 0, 0, 0.5);
  --cover-bg-opacity: 0.20;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-copy);
  background-color: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  display: flex;
  flex-direction: column;
}

/* Welcome Overlay */
.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--bg-color) 0%, rgba(11, 26, 48, 0.95) 100%);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.welcome-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.welcome-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 40px;
  border-radius: 24px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 20px 40px var(--shadow-color);
  transform: scale(1) translateY(0) rotate(0deg);
  transition: transform 0.9s cubic-bezier(0.68, -0.6, 0.32, 1.6), filter 0.9s ease, opacity 0.9s ease;
  backdrop-filter: blur(12px);
  opacity: 1;
}

.welcome-overlay.fade-out .welcome-card {
  transform: scale(0.1) rotate(-15deg) translateY(-80px);
  filter: blur(20px);
  opacity: 0;
}

.welcome-badge {
  display: inline-block;
  background-color: var(--accent-color);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-main);
}

.welcome-shraddha {
  font-weight: 800;
  background: linear-gradient(
    120deg,
    #e11d48 0%,   /* Vibrant Ruby Rose */
    #ff7675 25%,  /* Coral Rose */
    #ffe4e6 50%,  /* Light Rose Shimmer */
    #ff7675 75%,  /* Coral Rose */
    #e11d48 100%  /* Vibrant Ruby Rose */
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: shine-text 4s linear infinite;
  display: inline-block;
  filter: drop-shadow(0 0 1.5px rgba(225, 29, 72, 0.3));
}

.dark-theme .welcome-shraddha {
  background: linear-gradient(
    120deg,
    #f43f5e 0%,   /* Bright Ruby Rose */
    #fda4af 25%,  /* Light Rose */
    #ffffff 50%,  /* Pure White Shimmer */
    #fda4af 75%,  /* Light Rose */
    #f43f5e 100%  /* Bright Ruby Rose */
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 2.5px rgba(244, 63, 94, 0.5));
}

.welcome-sparks-wrap {
  position: relative;
  display: inline-block;
}

.welcome-sparks {
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(
    120deg,
    #b27e10 0%,   /* Rich Gold */
    #f39c12 25%,  /* Warm Amber */
    #fff4d0 50%,  /* Shimmering White-Gold */
    #e67e22 75%,  /* Copper Orange */
    #b27e10 100%  /* Rich Gold */
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: shine-text 3s linear infinite, cinematic-glow 3s infinite alternate ease-in-out;
  display: inline-block;
}

.dark-theme .welcome-sparks {
  background: linear-gradient(
    120deg,
    #f39c12 0%,   /* Warm Amber */
    #f1c40f 25%,  /* Spark Gold */
    #ffffff 50%,  /* Bright Shimmer */
    #e67e22 75%,  /* Copper Orange */
    #f39c12 100%  /* Warm Amber */
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

@keyframes cinematic-glow {
  0% {
    filter: drop-shadow(0 0 2px rgba(243, 156, 18, 0.4)) drop-shadow(0 0 8px rgba(243, 156, 18, 0.2));
  }
  100% {
    filter: drop-shadow(0 0 6px rgba(243, 156, 18, 0.8)) drop-shadow(0 0 20px rgba(230, 126, 34, 0.5)) drop-shadow(0 0 40px rgba(243, 156, 18, 0.3));
    transform: scale(1.03);
  }
}

/* Staggered Sparkles for Welcome Title */
.welcome-sparks-wrap .sparkle {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  animation: welcome-sparkle-twinkle 3s infinite ease-in-out;
}

.welcome-sparks-wrap .sparkle.s-1 {
  top: -16px;
  left: -20px;
  font-size: 1.5rem;
  animation-delay: 0s;
}

.welcome-sparks-wrap .sparkle.s-2 {
  top: -10px;
  right: -25px;
  font-size: 1.1rem;
  animation-delay: 0.6s;
}

.welcome-sparks-wrap .sparkle.s-3 {
  bottom: -12px;
  right: 15px;
  font-size: 1.3rem;
  animation-delay: 1.2s;
}

.welcome-sparks-wrap .sparkle.s-4 {
  bottom: -6px;
  left: 20px;
  font-size: 1.0rem;
  animation-delay: 1.8s;
}

.welcome-sparks-wrap .sparkle.s-5 {
  top: 15px;
  right: -10px;
  font-size: 1.2rem;
  animation-delay: 2.4s;
}

@keyframes welcome-sparkle-twinkle {
  0%, 100% {
    transform: scale(0.2) rotate(0deg);
    opacity: 0;
    filter: drop-shadow(0 0 0px #f1c40f);
  }
  50% {
    transform: scale(1.4) rotate(180deg);
    opacity: 1;
    filter: drop-shadow(0 0 10px #f1c40f) drop-shadow(0 0 20px #e67e22);
  }
}

.welcome-description {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 30px;
}

.welcome-btn {
  background: linear-gradient(135deg, var(--accent-color) 0%, #a67c22 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 16px var(--shadow-color);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.welcome-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px var(--shadow-color);
}

.welcome-btn:active {
  transform: translateY(1px);
}

.btn-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 20px;
}

/* Header Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  border-bottom: 1px solid var(--border-color);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.logo-area:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

.logo-spark {
  font-size: 1.5rem;
  display: inline-block;
  transition: transform 0.3s ease;
}

.logo-area:hover .logo-spark {
  animation: spark-spin 0.6s ease-in-out;
}

@keyframes spark-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-color);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: 50px;
}

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.nav-btn:hover {
  background-color: var(--border-color);
}

.nav-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.page-indicator {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 90px;
  text-align: center;
}

.go-to-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.go-to-divider {
  color: var(--border-color);
  font-weight: 300;
  margin-right: 4px;
}

.go-to-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.go-to-select {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 28px 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 155px;
  text-overflow: ellipsis;
  /* Premium select arrow styling */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c5e43' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 11px;
}

.go-to-select:hover {
  border-color: var(--accent-color);
}

.go-to-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(44, 94, 67, 0.15);
}

.action-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.music-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 50px;
}

.tool-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: background-color 0.2s, transform 0.2s;
}

.tool-btn:hover {
  background-color: var(--border-color);
}

.tool-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.volume-slider-container {
  display: flex;
  align-items: center;
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
}

.music-controls:hover .volume-slider-container,
.volume-slider-container:focus-within,
.volume-slider-container.active {
  width: 80px;
}

.volume-slider {
  width: 70px;
  height: 4px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* Book Viewport */
.book-viewport {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2000px;
  padding: 20px 0;
}

.book {
  position: relative;
  width: var(--book-width);
  height: var(--book-height);
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

/* Base Page Elements */
.page {
  position: absolute;
  width: 50%;
  height: 100%;
  top: 0;
  right: 0;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  z-index: 1;
  pointer-events: none; /* Disable mouse events on inactive pages */
}

/* Allow click events only on current active page sheet */
.page.active {
  pointer-events: auto;
}

.page.flipped {
  transform: rotateY(-180deg);
}

.page-side {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: var(--page-bg);
  backface-visibility: hidden;
  border: 1px solid var(--border-color);
  padding: 24px; /* Reduced padding from 40px to increase usable page area */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px var(--shadow-color);
}

.page-side.front {
  z-index: 2;
  border-radius: 0 16px 16px 0;
}

.page-side.back {
  transform: rotateY(180deg);
  border-radius: 16px 0 0 16px;
  z-index: 1;
}

/* Creeper Border Overlay */
.page-side::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 20px solid transparent;
  border-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTIwIDEyMCI+CiAgPHN0eWxlPgogICAgLnZpbmUgeyBzdHJva2U6ICMyYzVlNDM7IHN0cm9rZS13aWR0aDogMS44OyBmaWxsOiBub25lOyBzdHJva2UtbGluZWNhcDogcm91bmQ7IHN0cm9rZS1saW5lam9pbjogcm91bmQ7IH0KICAgIC50ZW5kcmlsIHsgc3Ryb2tlOiAjNDE3YTVhOyBzdHJva2Utd2lkdGg6IDEuMDsgZmlsbDogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IHJvdW5kOyB9CiAgICAubGVhZi1kYXJrIHsgZmlsbDogIzNhNmI1MTsgfQogICAgLmxlYWYtbGlnaHQgeyBmaWxsOiAjNjA5Yzc5OyB9CiAgICAucGV0YWwgeyBmaWxsOiAjZTU4YzdjOyB9CiAgICAuY2VudGVyIHsgZmlsbDogI2YzYzE1OTsgfQogIDwvc3R5bGU+CgogIDwhLS0gPT09PT09PT09PT09PT09PT0gQ09STkVSOiBUb3AtTGVmdCAoMCwwIHRvIDQwLDQwKSA9PT09PT09PT09PT09PT09PSAtLT4KICA8IS0tIE1haW4gVmluZSAtLT4KICA8cGF0aCBjbGFzcz0idmluZSIgZD0iTSAyMCw0MCBDIDIwLDI1IDI1LDIwIDQwLDIwIiAvPgogIDwhLS0gU2Vjb25kYXJ5IFZpbmUgLS0+CiAgPHBhdGggY2xhc3M9InZpbmUiIGQ9Ik0gMjAsMzAgQyAxNSwyMiAyMiwxNSAzMCwyMCIgLz4KICA8IS0tIFNwaXJhbCBUZW5kcmlsIC0tPgogIDxwYXRoIGNsYXNzPSJ0ZW5kcmlsIiBkPSJNIDIwLDI1IEMgMTAsMjUgMTAsMTIgMTUsMTAgQyAyMCw4IDI0LDEyIDIyLDE2IEMgMjAsMTggMTcsMTYgMTgsMTQiIC8+CiAgPCEtLSBMZWF2ZXMgLS0+CiAgPHBhdGggY2xhc3M9ImxlYWYtZGFyayIgZD0iTSAyNSwyMiBDIDIyLDE3IDE4LDIyIDIwLDI3IEMgMjIsMzIgMzAsMjggMjUsMjIgWiIgLz4KICA8cGF0aCBjbGFzcz0ibGVhZi1saWdodCIgZD0iTSAzMiwxOCBDIDI5LDEzIDM0LDggMzgsMTIgQyA0MiwxNiAzNywyMyAzMiwxOCBaIiAvPgogIDwhLS0gRmxvd2VyIGF0ICgxNSwgMTUpIC0tPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTUiIGN5PSIxMS41IiByPSIyLjIiIC8+CiAgPGNpcmNsZSBjbGFzcz0icGV0YWwiIGN4PSIxMS41IiBjeT0iMTUiIHI9IjIuMiIgLz4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9IjE4LjUiIGN5PSIxNSIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTIuNSIgY3k9IjE4IiByPSIyLjIiIC8+CiAgPGNpcmNsZSBjbGFzcz0icGV0YWwiIGN4PSIxNy41IiBjeT0iMTgiIHI9IjIuMiIgLz4KICA8Y2lyY2xlIGNsYXNzPSJjZW50ZXIiIGN4PSIxNSIgY3k9IjE1IiByPSIxLjUiIC8+CgogIDwhLS0gPT09PT09PT09PT09PT09PT0gQ09STkVSOiBUb3AtUmlnaHQgKDgwLDAgdG8gMTIwLDQwKSA9PT09PT09PT09PT09PT09PSAtLT4KICA8IS0tIE1haW4gVmluZSAtLT4KICA8cGF0aCBjbGFzcz0idmluZSIgZD0iTSA4MCwyMCBDIDk1LDIwIDEwMCwyNSAxMDAsNDAiIC8+CiAgPCEtLSBTZWNvbmRhcnkgVmluZSAtLT4KICA8cGF0aCBjbGFzcz0idmluZSIgZD0iTSAxMDAsMzAgQyAxMDUsMjIgOTgsMTUgOTAsMjAiIC8+CiAgPCEtLSBTcGlyYWwgVGVuZHJpbCAtLT4KICA8cGF0aCBjbGFzcz0idGVuZHJpbCIgZD0iTSAxMDAsMjUgQyAxMTAsMjUgMTEwLDEyIDEwNSwxMCBDIDEwMCw4IDk2LDEyIDk4LDE2IEMgMTAwLDE4IDEwMywxNiAxMDIsMTQiIC8+CiAgPCEtLSBMZWF2ZXMgLS0+CiAgPHBhdGggY2xhc3M9ImxlYWYtZGFyayIgZD0iTSA5NSwyMiBDIDk4LDE3IDEwMiwyMiAxMDAsMjcgQyA5OCwzMiA5MCwyOCA5NSwyMiBaIiAvPgogIDxwYXRoIGNsYXNzPSJsZWFmLWxpZ2h0IiBkPSJNIDg4LDE4IEMgOTEsMTMgODYsOCA4MiwxMiBDIDc4LDE2IDgzLDIzIDg4LDE4IFoiIC8+CiAgPCEtLSBGbG93ZXIgYXQgKDEwNSwgMTUpIC0tPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTA1IiBjeT0iMTEuNSIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTAxLjUiIGN5PSIxNSIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTA4LjUiIGN5PSIxNSIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTAyLjUiIGN5PSIxOCIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTA3LjUiIGN5PSIxOCIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9ImNlbnRlciIgY3g9IjEwNSIgY3k9IjE1IiByPSIxLjUiIC8+CgogIDwhLS0gPT09PT09PT09PT09PT09PT0gQ09STkVSOiBCb3R0b20tUmlnaHQgKDgwLDgwIHRvIDEyMCwxMjApID09PT09PT09PT09PT09PT09IC0tPgogIDwhLS0gTWFpbiBWaW5lIC0tPgogIDxwYXRoIGNsYXNzPSJ2aW5lIiBkPSJNIDEwMCw4MCBDIDEwMCw5NSA5NSwxMDAgODAsMTAwIiAvPgogIDwhLS0gU2Vjb25kYXJ5IFZpbmUgLS0+CiAgPHBhdGggY2xhc3M9InZpbmUiIGQ9Ik0gMTAwLDkwIEMgMTA1LDk4IDk4LDEwNSA5MCwxMDAiIC8+CiAgPCEtLSBTcGlyYWwgVGVuZHJpbCAtLT4KICA8cGF0aCBjbGFzcz0idGVuZHJpbCIgZD0iTSAxMDAsOTUgQyAxMTAsOTUgMTEwLDEwOCAxMDUsMTEwIEMgMTAwLDExMiA5NiwxMDggOTgsMTA0IEMgMTAwLDEwMiAxMDMsMTA0IDEwMiwxMDYiIC8+CiAgPCEtLSBMZWF2ZXMgLS0+CiAgPHBhdGggY2xhc3M9ImxlYWYtZGFyayIgZD0iTSA5NSw5OCBDIDk4LDEwMyAxMDIsOTggMTAwLDkzIEMgOTgsODggOTAsOTIgOTUsOTggWiIgLz4KICA8cGF0aCBjbGFzcz0ibGVhZi1saWdodCIgZD0iTSA4OCwxMDIgQyA5MSwxMDcgODYsMTEyIDgyLDEwOCBDIDc4LDEwNSA4Myw5NyA4OCwxMDIgWiIgLz4KICA8IS0tIEZsb3dlciBhdCAoMTA1LCAxMDUpIC0tPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTA1IiBjeT0iMTAxLjUiIHI9IjIuMiIgLz4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9IjEwMS41IiBjeT0iMTA1IiByPSIyLjIiIC8+CiAgPGNpcmNsZSBjbGFzcz0icGV0YWwiIGN4PSIxMDguNSIgY3k9IjEwNSIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTAyLjUiIGN5PSIxMDgiIHI9IjIuMiIgLz4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9IjEwNy41IiBjeT0iMTA4IiByPSIyLjIiIC8+CiAgPGNpcmNsZSBjbGFzcz0iY2VudGVyIiBjeD0iMTA1IiBjeT0iMTA1IiByPSIxLjUiIC8+CgogIDwhLS0gPT09PT09PT09PT09PT09PT0gQ09STkVSOiBCb3R0b20tTGVmdCAoMCw4MCB0byA0MCwxMjApID09PT09PT09PT09PT09PT09IC0tPgogIDwhLS0gTWFpbiBWaW5lIC0tPgogIDxwYXRoIGNsYXNzPSJ2aW5lIiBkPSJNIDQwLDEwMCBDIDI1LDEwMCAyMCw5NSAyMCw4MCIgLz4KICA8IS0tIFNlY29uZGFyeSBWaW5lIC0tPgogIDxwYXRoIGNsYXNzPSJ2aW5lIiBkPSJNIDIwLDkwIEMgMTUsOTggMjIsMTA1IDMwLDEwMCIgLz4KICA8IS0tIFNwaXJhbCBUZW5kcmlsIC0tPgogIDxwYXRoIGNsYXNzPSJ0ZW5kcmlsIiBkPSJNIDIwLDk1IEMgMTAsOTUgMTAsMTA4IDE1LDExMCBDIDIwLDExMiAyNCwxMDggMjIsMTA0IEMgMjAsMTAyIDE3LDEwNCAxOCwxMDYiIC8+CiAgPCEtLSBMZWF2ZXMgLS0+CiAgPHBhdGggY2xhc3M9ImxlYWYtZGFyayIgZD0iTSAyNSw5OCBDIDIyLDEwMyAxOCw5OCAyMCw5MyBDIDIyLDg4IDMwLDkyIDI1LDk4IFoiIC8+CiAgPHBhdGggY2xhc3M9ImxlYWYtbGlnaHQiIGQ9Ik0gMzIsMTAyIEMgMjksMTA3IDM0LDExMiAzOCwxMDggQyA0MiwxMDQgMzcsOTcsMzIsMTAyIFoiIC8+CiAgPCEtLSBGbG93ZXIgYXQgKDE1LCAxMDUpIC0tPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTUiIGN5PSIxMDEuNSIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTEuNSIgY3k9IjEwNSIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTguNSIgY3k9IjEwNSIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTIuNSIgY3k9IjEwOCIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTcuNSIgY3k9IjEwOCIgcj0iMi4yIiAvPgogIDxjaXJjbGUgY2xhc3M9ImNlbnRlciIgY3g9IjE1IiBjeT0iMTA1IiByPSIxLjUiIC8+CgogIDwhLS0gPT09PT09PT09PT09PT09PT0gU0lERTogVG9wICg0MCwwIHRvIDgwLDQwKSA9PT09PT09PT09PT09PT09PSAtLT4KICA8IS0tIFdhdmUgVmluZSAtLT4KICA8cGF0aCBjbGFzcz0idmluZSIgZD0iTSA0MCwyMCBDIDUwLDEyIDU1LDI4IDY1LDIwIEMgNzAsMTYgNzUsMjIgODAsMjAiIC8+CiAgPCEtLSBMZWF2ZXMgLS0+CiAgPHBhdGggY2xhc3M9ImxlYWYtZGFyayIgZD0iTSA0OCwxNyBDIDQ0LDEyIDQ1LDYgNTAsOSBDIDU1LDEyIDUyLDIyIDQ4LDE3IFoiIC8+CiAgPHBhdGggY2xhc3M9ImxlYWYtbGlnaHQiIGQ9Ik0gNjgsMjMgQyA3MiwyOCA3OCwyNCA3NSwxOSBDIDcyLDE0IDY0LDE4IDY4LDIzIFoiIC8+CiAgPCEtLSBUZW5kcmlsIC0tPgogIDxwYXRoIGNsYXNzPSJ0ZW5kcmlsIiBkPSJNIDU4LDE4IEMgNTgsMTAgNjQsOCA2MiwxMiIgLz4KICA8IS0tIEZsb3dlciBhdCAoNjMsIDIwKSAtLT4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9IjYzIiBjeT0iMTYuNSIgY3I9IjIuMCIgLz4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9IjU5LjUiIGN5PSIyMCIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iNjYuNSIgY3k9IjIwIiByPSIyLjAiIC8+CiAgPGNpcmNsZSBjbGFzcz0icGV0YWwiIGN4PSI4OS41IiBjeT0iMjAiIHI9IjIuMCIgLz4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9IjY1LjUiIGN5PSIyMyIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9ImNlbnRlciIgY3g9IjYzIiBjeT0iMjAiIHI9IjEuMiIgLz4KCiAgPCEtLSA9PT09PT09PT09PT09PT09PSBTSURFOiBCb3R0b20gKDQwLDgwIHRvIDgwLDEyMCkgPT09PT09PT09PT09PT09PT0gLS0+CiAgPCEtLSBXYXZlIFZpbmUgLS0+CiAgPHBhdGggY2xhc3M9InZpbmUiIGQ9Ik0gNDAsMTAwIEMgNTAsOTIgNTUsMTA4IDY1LDEwMCBDIDcwLDk2IDc1LDEwMiA4MCwxMDAiIC8+CiAgPCEtLSBMZWF2ZXMgLS0+CiAgPHBhdGggY2xhc3M9ImxlYWYtZGFyayIgZD0iTSA0OCw5NyBDIDQ0LDkyIDQ1LDg2IDUwLDg5IEMgNTUsOTIgNTIsMTAyIDQ4LDk3IFoiIC8+CiAgPHBhdGggY2xhc3M9ImxlYWYtbGlnaHQiIGQ9Ik0gNjgsMTAzIEMgNzIsMTA4IDc4LDEwNCA3NSw5OSBDIDcyLDk0IDY0LDk4IDY4LDEwMyBaIiAvPgogIDwhLS0gVGVuZHJpbCAtLT4KICA8cGF0aCBjbGFzcz0idGVuZHJpbCIgZD0iTSA1OCw5OCBDIDU4LjkwIDY0LDg4IDYyLDkyIiAvPgogIDwhLS0gRmxvd2VyIGF0ICg2MywgMTAwKSAtLT4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9IjYzIiBjeT0iOTYuNSIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iNTkuNSIgY3k9IjEwMCIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iNjYuNSIgY3k9IjEwMCIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iNjAuNSIgY3k9IjEwMyIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iNjUuNSIgY3k9IjEwMyIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9ImNlbnRlciIgY3g9IjYzIiBjeT0iMTAwIiByPSIxLjIiIC8+CgogIDwhLS0gPT09PT09PT09PT09PT09PT0gU0lERTogTGVmdCAoMCw0MCB0byA0MCw4MCkgPT09PT09PT09PT09PT09PT0gLS0+CiAgPCEtLSBXYXZlIFZpbmUgLS0+CiAgPHBhdGggY2xhc3M9InZpbmUiIGQ9Ik0gMjAsNDAgQyAxMiw1MCAyOCw1NSAyMCw2NSBDIDE2LDcwIDIyLDc1IDIwLDgwIiAvPgogIDwhLS0gTGVhdmVzIC0tPgogIDxwYXRoIGNsYXNzPSJsZWFmLWRhcmsiIGQ9Ik0gMTcsNDggQyAxMiw0NCA2LDQ1IDksNTAgQyAxMiw1NSAyMiw1MiAxNyw0OCBaIiAvPgogIDxwYXRoIGNsYXNzPSJsZWFmLWxpZ2h0IiBkPSJNIDIzLDY4IEMgMjgsNzIgMjQsNzggMTksNzkgQyAxNCw3MiAxOCw2NCAyMyw2OCBaIiAvPgogIDwhLS0gVGVuZHJpbCAtLT4KICA8cGF0aCBjbGFzcz0idGVuZHJpbCIgZD0iTSAxOCw1OCBDIDEwLDU4IDgsNjQgMTIsNjIiAvPgogIDwhLS0gRmxvd2VyIGF0ICgyMCwgNjMpIC0tPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMjAiIGN5PSI1OS41IiByPSIyLjAiIC8+CiAgPGNpcmNsZSBjbGFzcz0icGV0YWwiIGN4PSIxNi41IiBjeT0iNjMiIHI9IjIuMCIgLz4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9IjIzLjUiIGN5PSI2MyIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTcuNSIgY3k9IjY2IiByPSIyLjAiIC8+CiAgPGNpcmNsZSBjbGFzcz0icGV0YWwiIGN4PSIyMi41IiBjeT0iNjYiIHI9IjIuMCIgLz4KICA8Y2lyY2xlIGNsYXNzPSJjZW50ZXIiIGN4PSIyMCIgY3k9IjYzIiByPSIxLjIiIC8+CgogIDwhLS0gPT09PT09PT09PT09PT09PT0gU0lERTogUmlnaHQgKDgwLDQwIHRvIDEyMCw4MCkgPT09PT09PT09PT09PT09PT0gLS0+CiAgPHBhdGggY2xhc3M9InZpbmUiIGQ9Ik0gMTAwLDQwIEMgOTIsNTAgMTA4LDU1IDEwMCw2NSBDIDk2LDcwIDEwMiw3NSAxMDAsODAiIC8+CiAgPCEtLSBMZWF2ZXMgLS0+CiAgPHBhdGggY2xhc3M9ImxlYWYtZGFyayIgZD0iTSA5Nyw0OCBDIDkyLDQ0IDg2LDQ1IDg5LDUwIEMgOTIsNTUgMTAyLDUyIDk3LDQ4IFoiIC8+CiAgPHBhdGggY2xhc3M9ImxlYWYtbGlnaHQiIGQ9Ik0gMTAzLDY4IEMgMTA4LDcyIDEwNCw3OCA5OSw3NSBDIDk0LDcyIDk4LDY0IDEwMyw2OCBaIiAvPgogIDwhLS0gVGVuZHJpbCAtLT4KICA8cGF0aCBjbGFzcz0idGVuZHJpbCIgZD0iTSA5OCw1OCBDIDkwLDU4IDg4LDY0IDkyLDYyIiAvPgogIDwhLS0gRmxvd2VyIGF0ICgxMDAsIDYzKSAtLT4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9IjEwMCIgY3k9IjU5LjUiIHI9IjIuMCIgLz4KICA8Y2lyY2xlIGNsYXNzPSJwZXRhbCIgY3g9Ijk2LjUiIGN5PSI2MyIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iMTAzLjUiIGN5PSI2MyIgcj0iMi4wIiAvPgogIDxjaXJjbGUgY2xhc3M9InBldGFsIiBjeD0iOTcuOSIgY3k9IjY2IiByPSIyLjAiIC8+CiAgPGNpcmNsZSBjbGFzcz0icGV0YWwiIGN4PSIxMDIuNSIgY3k9IjY2IiByPSIyLjAiIC8+CiAgPGNpcmNsZSBjbGFzcz0iY2VudGVyIiBjeD0xMDAiIGN5PSI2MyIgcj0iMS4yIiAvPgo8L3N2Zz4K") 40 round;
  pointer-events: none;
  z-index: 10;
}

/* Page Top Logo styling (Pages 2-9) */
.page-top-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 15px; /* Moved up from 28px to save vertical space */
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
}

.page-top-logo a {
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.page-top-logo img {
  width: 36px; /* Slightly reduced from 42px to save space */
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-color);
  object-fit: cover;
  background-color: var(--page-bg);
  box-shadow: 0 2px 6px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-top-logo img:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px var(--shadow-color);
}

.page-side.has-top-logo {
  padding-top: 60px; /* Reduced from 82px to save vertical space */
}

/* Faded Background for Cover and Back Cover */

.page-side-back-cover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("../issues/2026-06/media/hopetown_building.jpg"); background-size: cover; background-position: center;
  background-size: 250% auto;
  background-position: 6% 45%; /* Shifted higher up to clear the logo entirely */
  background-repeat: no-repeat;
  opacity: var(--cover-bg-opacity);
  z-index: 0;
  pointer-events: none;
}

/* Realistic Shadows & Binder Details */
.book::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 20px;
  height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(to right, transparent, var(--crease-shadow) 40%, var(--crease-shadow) 60%, transparent);
  z-index: 10;
  pointer-events: none;
}

/* Corner Curl Hover Effects */
.page::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.05) 50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 20;
}

/* Page Layout Templates */

/* 1. Cover Page styling */
.layout-cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  background: linear-gradient(185deg, transparent 0%, rgba(201, 152, 47, 0.05) 100%);
  padding: 50px 30px;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.cover-header {
  border-bottom: 2px solid var(--accent-color);
  width: 100%;
  padding-bottom: 16px;
  margin-top: 95px; /* Shifted up slightly to give the mascot logo more room at the bottom */
}

.cover-subtitle {
  font-size: 0.95rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 8px;
}

.cover-title {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.title-shraddha {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: block;
}

.dark-theme .title-shraddha {
  background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.title-sparks-wrap {
  position: relative;
  display: inline-block;
  margin-top: 2px;
}

.title-sparks {
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(
    120deg, 
    #7b001c 0%,   /* Deep Royal Maroon */
    #e11d48 25%,  /* Vibrant Ruby Rose */
    #ffe4e6 50%,  /* Shimmering Light Rose Highlight */
    #e11d48 75%,  /* Vibrant Ruby Rose */
    #7b001c 100%  /* Deep Royal Maroon */
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: shine-text 3s linear infinite;
  display: inline-block;
}

.dark-theme .title-sparks {
  background: linear-gradient(
    120deg, 
    #991b1b 0%,   /* Rich Crimson Maroon */
    #f43f5e 25%,  /* Bright Ruby Rose */
    #ffe4e6 50%,  /* Light Rose Shimmer */
    #f43f5e 75%,  /* Bright Ruby Rose */
    #991b1b 100%  /* Rich Crimson Maroon */
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

@keyframes shine-text {
  to {
    background-position: 200% center;
  }
}

.sparkle {
  position: absolute;
  font-size: 1.2rem;
  pointer-events: none;
  opacity: 0;
  animation: sparkle-twinkle 2.5s infinite ease-in-out;
}

.sparkle.s-1 {
  top: -12px;
  left: -24px;
  animation-delay: 0s;
}

.sparkle.s-2 {
  top: -18px;
  right: -20px;
  font-size: 0.9rem;
  animation-delay: 0.8s;
}

.sparkle.s-3 {
  bottom: -8px;
  right: 20px;
  font-size: 1rem;
  animation-delay: 1.6s;
}

@keyframes sparkle-twinkle {
  0%, 100% {
    transform: scale(0.3) rotate(0deg);
    opacity: 0;
    filter: drop-shadow(0 0 0px var(--accent-color));
  }
  50% {
    transform: scale(1.3) rotate(180deg);
    opacity: 1;
    filter: drop-shadow(0 0 6px #ffc107);
  }
}

.cover-image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 30px 0;
}

.cover-image-container a {
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  width: 100%;
  height: 100%;
}

.cover-image {
  max-width: 100%;
  max-height: 300px; /* Sized to fit perfectly in viewport without clipping (scaled 1.25x) */
  object-fit: contain;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.2));
  cursor: pointer;
  opacity: 0.88; /* Harmonized with cover background tone while remaining clearly visible and legible */
  mix-blend-mode: multiply; /* Smoothly aligns logo colors with cover background */
  transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.cover-image:hover {
  transform: scale(1.03);
  filter: drop-shadow(0px 8px 16px rgba(0, 0, 0, 0.3));
  opacity: 1; /* Restores full color vibrancy on hover */
  mix-blend-mode: normal;
}

.cover-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* 2. Text layout (Editorial/Principal) */
.page-title {
  font-family: var(--font-display);
  font-size: 1.7rem; /* Reduced from 2.2rem to fit content */
  color: var(--primary-color);
  margin-bottom: 6px;
  font-weight: 800;
}

/* Category Color-Themed Page Titles */
.page-side-academics .page-title { color: #0056b3; }
.page-side-safety .page-title { color: #d9534f; }
.page-side-arts .page-title,
.page-side-image .page-title { color: #9b59b6; }
.page-side-student-corner .page-title,
.page-side-sports .page-title { color: #e67e22; }
.page-side-kindness .page-title,
.page-side-kindness-concept .page-title,
.page-side-highlights .page-title,
.page-side-language .page-title,
.page-side-language-corner .page-title,
.page-side-text .page-title,
.page-side-message .page-title,
.page-side-culture .page-title { color: #27ae60; }
.page-side-riddles .page-title { color: #c9982f; }

/* Dark Theme Contrast-Enhanced Page Titles */
.dark-theme .page-side-academics .page-title { color: #5dade2; }
.dark-theme .page-side-safety .page-title { color: #f1948a; }
.dark-theme .page-side-arts .page-title,
.dark-theme .page-side-image .page-title { color: #bb8fce; }
.dark-theme .page-side-student-corner .page-title,
.dark-theme .page-side-sports .page-title { color: #f5b041; }
.dark-theme .page-side-kindness .page-title,
.dark-theme .page-side-kindness-concept .page-title,
.dark-theme .page-side-highlights .page-title,
.dark-theme .page-side-language .page-title,
.dark-theme .page-side-language-corner .page-title,
.dark-theme .page-side-text .page-title,
.dark-theme .page-side-message .page-title,
.dark-theme .page-side-culture .page-title { color: #58d68d; }
.dark-theme .page-side-riddles .page-title { color: #f4d03f; }

.page-subtitle {
  font-size: 0.85rem;
  color: var(--accent-color);
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 12px; /* Reduced from 24px */
}

.text-content {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Callout Exam Box */
.cvc-container {
  margin-top: auto;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 4px 10px var(--shadow-color);
}

.cvc-title {
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 4px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cvc-flex {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.cvc-text-col {
  flex: 1.3;
}

.cvc-desc {
  font-size: 0.8rem;
  line-height: 1.4;
  font-style: italic;
  margin: 0;
  color: var(--text-muted);
}

.cvc-video-col {
  flex: 1;
  max-width: 140px;
}

.cvc-video-col .video-player-container {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow-color);
  background-color: #000;
  margin-bottom: 0;
}

/* 2.5 Text Page Layout adjustments (Principal's Message) */
.page-side-text {
  padding-top: 60px !important;
}
.page-side-text .page-subtitle {
  margin-bottom: 6px;
}
.page-side-text .text-content {
  gap: 6px;
  font-size: 0.86rem;
  line-height: 1.4;
}

/* 3. Academic Layout / Magnum challenge */
.page-side-academics {
  padding-top: 64px !important;
}
.page-side-academics .page-subtitle {
  margin-bottom: 8px;
}
.page-side-academics .text-content {
  gap: 6px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.page-side-academics .magnum-box-wrapper {
  margin-top: 8px;
}
.page-side-academics .magnum-box {
  padding: 8px 12px;
}
.page-side-academics .magnum-title {
  font-size: 1.05rem;
}
.page-side-academics .magnum-text {
  font-size: 0.72rem;
  line-height: 1.25;
}
.page-side-academics .magnum-image-container {
  width: 60px;
  height: 60px;
}
.page-side-academics .magnum-btn {
  padding: 3px 10px;
  font-size: 0.72rem;
}
.page-side-academics .magnum-support {
  font-size: 0.6rem;
}
.magnum-box-wrapper {
  margin-top: auto;
}

.magnum-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #741d1d 0%, #a63f22 50%, #c9982f 100%);
  border: 1px solid var(--accent-color);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 4px 15px rgba(116, 29, 29, 0.3);
  color: white;
  position: relative;
  overflow: hidden;
}

.magnum-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.magnum-badge {
  background-color: #ffd700;
  color: #741d1d;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  animation: pulse 2s infinite alternate;
}

.magnum-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fff !important;
  font-weight: 800;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.magnum-text {
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.95) !important;
}

.magnum-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.magnum-btn {
  background-color: #ffd700;
  color: #741d1d;
  border: none;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.2s, background-color 0.2s;
  display: inline-flex;
  align-items: center;
}

.magnum-btn:hover {
  background-color: #fff;
  transform: translateY(-1px);
}

.magnum-support {
  font-size: 0.65rem;
  opacity: 0.8;
  white-space: nowrap;
}

.magnum-support a {
  color: #ffd700;
  text-decoration: underline;
}

.magnum-image-container {
  width: 75px;
  height: 75px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.magnum-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* 4. Sports & Video layout */
.sports-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: flex-start;
}

.sports-description {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: auto;
  margin-bottom: 20px; /* Aligns description text lines precisely with page 5's Mentoring Buddy block */
}

.video-player-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 16px var(--shadow-color);
  background-color: #000;
  position: relative;
  aspect-ratio: 16/9;
}

.video-player {
  width: 100%;
  height: 100%;
  display: block;
}

/* Custom Sports Photo Gallery Slider */
.gallery-container {
  position: relative;
  width: 100%;
  height: 210px; /* Scaled to 210px to reduce empty space and increase image size */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px var(--shadow-color);
}

.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
}

.gallery-slide {
  min-width: 100%;
  height: 100%;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #050b14; /* Deep neutral color to fill margins of non-standard aspects */
}

.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s;
}

.gallery-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.gallery-btn.prev { left: 10px; }
.gallery-btn.next { right: 10px; }
.gallery-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* 5. Library / Reading Buddy double layout */
.sub-section {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.sub-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.section-flex {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
}

.section-text-col {
  flex: 1;
}

.section-video-col {
  width: 140px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 2px 6px var(--shadow-color);
}

.sub-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 6px;
}

/* 6. Safety manifest layout */
.page-side-safety {
  padding-top: 52px !important;
}

.safety-manifest {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.safety-item {
  display: flex;
  gap: 8px;
  background-color: var(--bg-color);
  padding: 4px 10px;
  border-radius: 8px;
  border-left: 3px solid var(--accent-color);
  box-shadow: 0 2px 4px var(--shadow-color);
}

/* Force inner SVGs of interactive widgets to scale down to fit container height */
.physics-turning-interactive svg,
.doorway-etiquette-interactive svg,
.shoe-trip-interactive svg {
  height: 44px !important;
}

.safety-icon {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
}

.safety-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.safety-title {
  font-weight: 800;
  font-size: 0.76rem;
}

.safety-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
}

/* Ron Clark Corner Card */
.ron-clark-card {
  margin-top: auto;
  background-color: var(--primary-color);
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 10px var(--shadow-color);
}

.rc-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-color);
  margin-bottom: 10px;
  font-weight: 800;
}

.rc-list {
  list-style: none;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.4;
}

.rc-list li {
  position: relative;
  padding-left: 14px;
}

.rc-list li::before {
  content: "★";
  position: absolute;
  left: 0;
  color: var(--accent-color);
}

/* 7. Highlights double video layout */
.highlights-grid {
  display: flex;
  flex-direction: row; /* Horizontal layout for desktop/tablet to prevent vertical clipping */
  gap: 14px;
  flex: 1;
  align-items: flex-end;
  margin-top: auto; /* Pushes the video grid to the absolute bottom of the page */
  margin-bottom: 10px; /* Space just above the page number */
}

.highlight-video-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* Page 10 SPIC MACAY Odissi Video Grid: Strict No-Overflow Layout */
.odissi-video-container {
  overflow-x: hidden !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.odissi-video-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  overflow-x: hidden !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.odissi-video-grid .highlight-video-card {
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.video-label {
  font-size: 0.85rem;
  font-weight: 800;
}

/* 8. Back Cover & Email Subscribe */
.layout-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 40px 30px;
  background: linear-gradient(5deg, transparent 0%, rgba(201, 152, 47, 0.03) 100%);
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.back-logo {
  max-width: 90px;
  height: auto;
  cursor: pointer;
  opacity: 0.45; /* Faded to align beautifully with the background watermark building */
  transition: transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
}

.back-logo:hover {
  transform: scale(1.05);
  opacity: 1; /* Fully visible on hover */
}

.back-header-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px; /* Logo is brought a little more down close to 'Hopetown' */
  margin-top: auto; /* Push down to sit just above the subscribe box */
  width: 100%;
}

.back-cover-title {
  font-size: 2.2rem !important;
  margin: 0 !important;
  gap: 2px !important;
}

.back-cover-title .title-shraddha {
  font-size: 2.2rem !important;
}

.back-cover-title .title-sparks-wrap {
  font-size: 2.2rem !important;
}

.back-cover-title .sparkle {
  font-size: 0.8rem !important;
}

.back-subtitle {
  font-size: 0.8rem;
  color: var(--accent-color);
  font-weight: 600;
  margin-top: 4px; /* Reduced vertical space between title and subtitle */
  margin-bottom: 0;
  letter-spacing: 0.5px;
}

.subscribe-form-container {
  width: 100%;
  margin: 16px 0;
  background-color: var(--panel-bg);
  backdrop-filter: blur(8px);
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.sub-header {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.sub-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.form-group {
  display: flex;
  gap: 8px;
}

.form-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  background-color: var(--page-bg);
  color: var(--text-main);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--accent-color);
}

.form-submit-btn {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0 20px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.form-submit-btn:hover {
  background-color: #b7791f;
}

.form-submit-btn:active {
  transform: scale(0.98);
}

.form-message {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
}

.form-message.success { color: #2e7d32; }
.form-message.error { color: #c62828; }

.back-footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 9. Kindness Concept Layout */
.kindness-concept-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.kindness-concept-text {
  font-size: 0.82rem; /* Reduced to ensure three long paragraphs fit */
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px; /* Tightened paragraph gap */
}

.kindness-concept-text p {
  margin-bottom: 2px;
}

.kindness-concept-media {
  margin-top: auto;
  height: 150px; /* Scaled proportionally (1.25x) with page height to avoid page clipping */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px var(--shadow-color);
  background-color: #000;
  width: 100%;
}

.kindness-concept-media img,
.kindness-concept-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 10. Kindness Layout */
.kindness-page-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-start; /* Stack items tightly from top to bottom */
  gap: 6px;
}

.kindness-iframe-container {
  width: 100%;
  height: 255px; /* Expanded to 255px to minimize the gap to the sparks list */
  background: #050505;
  border: 1px solid var(--border-color);
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 10px var(--shadow-color);
}

.kindness-sparks-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kindness-spark-item {
  display: flex;
  gap: 8px;
  background-color: var(--bg-color);
  padding: 4px 8px;
  border-radius: 6px;
  border-left: 3px solid var(--accent-color);
  box-shadow: 0 1px 3px var(--shadow-color);
}

.kindness-spark-icon {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

.kindness-spark-details {
  display: flex;
  flex-direction: column;
}

.kindness-spark-title {
  font-weight: 800;
  font-size: 0.74rem;
  color: var(--text-main);
}

.kindness-spark-desc {
  font-size: 0.66rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.kindness-reflections-card {
  background-color: var(--primary-color);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 3px 8px var(--shadow-color);
}

.kindness-reflections-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--accent-color);
  margin-bottom: 2px;
  font-weight: 800;
}

.kindness-reflections-list {
  list-style: none;
  font-size: 0.66rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}

.kindness-reflections-list li {
  position: relative;
  padding-left: 10px;
}

.kindness-reflections-list li::before {
  content: "★";
  position: absolute;
  left: 0;
  color: var(--accent-color);
}

/* Footer Bottom Bar */
.bottom-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive Styles for Tablet & Mobile */
@media (max-width: 1200px) {
  :root {
    --book-width: 100%;
    --book-height: 80vh;
  }
}

@media (max-width: 768px) {
  /* On Mobile/Small screens, convert the 3D book spread into a single page list */
  body {
    overflow-y: auto;
    height: auto;
  }
  
  .app-container {
    padding: 0 10px;
  }
  
  .top-bar {
    position: sticky;
    top: 0;
    background-color: var(--bg-color);
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  }
  
  .nav-controls {
    display: none; /* No flip buttons needed on list layout */
  }
  
  .book-viewport {
    perspective: none;
    padding: 20px 0;
    height: auto;
    overflow: visible;
  }
  
  .book {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
    transform: none !important;
  }
  
  .book::before {
    display: none; /* Hide center gutter shadow */
  }
  
  .page {
    position: static;
    width: 100%;
    height: auto;
    transform: none !important;
    z-index: auto !important;
    pointer-events: auto;
  }
  
  .page-side {
    position: relative !important;
    width: 100%;
    height: auto;
    border-radius: 16px !important;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px var(--shadow-color);
    padding: 24px;
  }
  
  .page-side.back {
    transform: none; /* Flatten pages */
  }
  
  .page::after {
    display: none; /* Hide curl clicker */
  }
  
  .cover-image {
    max-height: 200px;
  }
  
  .bottom-info {
    display: none;
  }

  /* Robust mobile display for Cover Page (Prevents height collapse) */
  .page-side.page-side-cover {
    padding: 0 !important;
    overflow: hidden !important;
    height: auto !important;
    min-height: 0 !important;
    background: #ffffff !important;
  }

  .page-side.page-side-cover .september-cover-container {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1414 / 2000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
  }

  .page-side.page-side-cover .september-cover-container img,
  .page-side.page-side-cover .september-cover-container picture {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }
}

/* Print Page layout styles for 2.jpg */
.layout-print-page {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--page-bg);
  overflow: visible;
  padding: 0;
}

.print-page-img {
  width: 100%;
  height: calc(100% - 30px); /* Pushed down to clear the header area */
  margin-top: 30px;          /* Blank header space for logo and buttons */
  object-fit: fill; /* Stretches to fill A4 viewport exactly */
  filter: saturate(1.08) contrast(1.02) brightness(1.02);
  transition: filter 0.3s ease;
}

.print-page-img:hover {
  filter: saturate(1.12) contrast(1.04) brightness(1.03);
}

/* Image Quote Overlay styling (e.g. Kaneez Gani artwork) */
.image-quote-overlay {
  position: absolute;
  bottom: 105px; /* Shifted slightly down to align perfectly with the center of the drawing's white background */
  left: 24px;
  right: 24px;
  background: transparent; /* No background */
  border: none;
  padding: 0;
  box-shadow: none;
  display: flex;
  justify-content: center; /* Center the block horizontally on the page */
  z-index: 5;
  pointer-events: none;
}

.image-quote-content-box {
  display: inline-block;
  text-align: right; /* Right align both quote lines and the author line */
  max-width: 90%;
}

.image-quote-text {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-style: italic;
  line-height: 0.95; /* Brought first and second lines of the quote closer together */
  margin-bottom: 4px; /* Clean spacing to the author name */
  color: #0b1a30; /* Dark Navy for high contrast on the white paper background of the art */
  white-space: pre-line; /* Renders line breaks naturally */
  letter-spacing: 0.2px;
  text-align: right;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); /* Soft white highlight behind text for absolute clarity */
}

.image-quote-author {
  font-family: var(--font-copy);
  font-size: 0.72rem;
  font-weight: 700;
  color: #7b001c; /* Maroon color to match school brand and look beautiful on white */
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: right;
  display: block;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); /* Soft white highlight behind text for absolute clarity */
}

/* Student Corner Layout Sizing & Styling */
.page-side-student-corner {
  padding-top: 35px !important; /* Move content up to prevent bottom clipping */
}

.page-side-student-corner .page-title {
  text-align: left !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  align-self: flex-start !important;
  width: 100% !important;
}

.page-side-student-corner .page-subtitle {
  text-align: left !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  align-self: flex-start !important;
  width: 100% !important;
  margin-bottom: 4px !important; /* Reduced to move the video up */
}

.student-corner-container {
  display: flex;
  flex-direction: column;
  gap: 12px; /* Precise 1-line space between children */
  flex: 1;
  justify-content: flex-start; /* Move elements up so they sit directly below the video panel */
  margin-top: 2px; /* Reduced to move the video up */
}

.student-video-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 12px var(--shadow-color);
  background-color: #000;
  aspect-ratio: 16/9;
}

.student-bottom-layout {
  display: flex;
  width: 100%;
  gap: 16px;
  align-items: flex-start;
  margin-top: 0; /* Let parent container's gap create the 1-line space below video panel */
  margin-left: 0;
  padding-left: 0;
}

.student-poster-container {
  width: 200px;
  height: 264px;
  flex-shrink: 0;
  margin-left: 0; /* Guarantee alignment with the left of the video player */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 12px var(--shadow-color);
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.student-poster-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.student-poster-img:hover {
  transform: scale(1.03);
}

.student-description {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
  font-style: italic;
  text-align: left;
  margin-top: 0;
}

.student-right-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  height: 100%;
}

.positive-kindness-container {
  display: flex;
  flex-direction: column;
  background: #ffffff; /* Solid white background to match image canvas across light/dark themes */
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 4px 8px var(--shadow-color);
  gap: 8px;
}

.positive-kindness-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kindness-heart-icon {
  font-size: 0.95rem;
}

.positive-kindness-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-color);
  letter-spacing: 0.3px;
}

.positive-kindness-img {
  width: 100%;
  height: auto;
  aspect-ratio: 377/219;
  object-fit: contain;
  border-radius: 8px;
}

/* Adjust poster height on small screens */
@media (max-width: 768px) {
  .student-bottom-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  .student-poster-container {
    width: 200px;
    height: 264px;
    max-width: 100%;
  }
  .student-description {
    text-align: center;
  }
}

/* Speaker Audio Button on Art Page (positioned in line with top logo) */
.art-audio-btn {
  position: absolute;
  top: -9px;    /* Centered in the top logo line (accounts for page padding) */
  right: 0px;   /* Right alignment with right of the art */
  z-index: 25;
  background: var(--panel-bg);
  border: 1.5px solid var(--accent-color);
  width: 36px;  /* Match the 36px height of the logo */
  height: 36px; /* Match the 36px height of the logo */
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px var(--shadow-color);
  transition: transform 0.2s, background-color 0.2s, color 0.2s, box-shadow 0.2s;
  color: var(--accent-color);
  padding: 0;
  backdrop-filter: blur(4px);
}

.art-audio-btn:hover {
  transform: scale(1.1);
  background-color: var(--accent-color);
  color: white;
  box-shadow: 0 6px 14px var(--shadow-color);
}

.audio-btn-icon {
  width: 22px;
  height: 22px;
}

/* Audio Playing Animation Equalizer Bars */
.audio-playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 20px;
  height: 16px;
}

.audio-playing-bars .bar {
  width: 3.5px;
  height: 100%;
  background-color: currentColor;
  border-radius: 2px;
  animation: bounce-bar 0.8s ease-in-out infinite alternate;
}

.audio-playing-bars .bar:nth-child(1) {
  animation-duration: 0.6s;
}

.audio-playing-bars .bar:nth-child(2) {
  animation-duration: 0.9s;
  animation-delay: 0.15s;
}

.audio-playing-bars .bar:nth-child(3) {
  animation-duration: 0.7s;
  animation-delay: 0.3s;
}

@keyframes bounce-bar {
  0% {
    height: 20%;
  }
  100% {
    height: 100%;
  }
}

/* Full Video Streaming Modal Styles */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.video-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 960px;
  aspect-ratio: 16/9;
  background-color: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

.video-modal:not(.hidden) .video-modal-content {
  transform: scale(1);
}

.video-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  transition: background-color 0.2s, transform 0.2s;
}

.video-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.video-modal-close svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.video-modal-player-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.video-modal-player-wrapper .video-player {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Spelling Quiz Interactive Section */
.quiz-interactive-section {
  margin: 8px 0 6px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quiz-input-group {
  display: flex;
  gap: 6px;
}

.quiz-input-field {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid #cccccc;
  border-radius: 4px;
  background-color: #ffffff;
  color: #222222;
  font-size: 0.72rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.quiz-input-field:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.quiz-submit-btn {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0 12px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.quiz-submit-btn:hover {
  background-color: #c59b27;
}

.quiz-submit-btn:active {
  transform: scale(0.97);
}

.quiz-feedback {
  font-size: 0.68rem;
  line-height: 1.3;
  padding: 4px 8px;
  border-radius: 3px;
  margin-top: 2px;
}

.quiz-feedback.success {
  background-color: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.15);
}

.quiz-feedback.error {
  background-color: rgba(244, 67, 54, 0.1);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.15);
}

.quiz-feedback.info {
  background-color: rgba(33, 150, 243, 0.1);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.15);
}

/* Confetti canvas overlay styling */
.quiz-confetti-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* Safety Item Shake Animation on Hover */
.safety-item {
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.safety-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px var(--shadow-color);
  animation: card-wiggle 0.5s ease-in-out;
}

@keyframes card-wiggle {
  0%, 100% { transform: translateY(-2px) rotate(0deg); }
  20% { transform: translateY(-2px) rotate(-1deg); }
  40% { transform: translateY(-2px) rotate(0.8deg); }
  60% { transform: translateY(-2px) rotate(-0.5deg); }
  80% { transform: translateY(-2px) rotate(0.3deg); }
}

/* Art Like Button */
.art-like-btn {
  position: absolute;
  top: -9px;
  right: 46px; /* Positioned left of the speaker button (0px + 36px width + 10px gap) */
  z-index: 25;
  background: var(--panel-bg);
  border: 1.5px solid #ff4b5c;
  width: 58px;
  height: 36px; /* Match the 36px height of the logo and speaker button */
  border-radius: 18px; /* Rounded pill style (height / 2) */
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 10px var(--shadow-color);
  transition: transform 0.2s, background-color 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
  color: #ff4b5c;
  padding: 0 8px;
  backdrop-filter: blur(4px);
}

.art-like-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 14px rgba(255, 75, 92, 0.25);
  background-color: rgba(255, 75, 92, 0.05);
}

.art-like-btn.liked {
  background-color: #ff4b5c;
  color: #fff;
  border-color: #ff4b5c;
}

.art-like-btn.liked:hover {
  background-color: #e04351;
}

.like-btn-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.like-count {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
}

/* Floating Heart Animation */
.floating-heart {
  position: fixed;
  pointer-events: none;
  font-size: 1.2rem;
  z-index: 9999;
  animation: float-up-fade 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes float-up-fade {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(var(--rot)) scale(1.2);
    opacity: 0;
  }
}

/* Interactive Parapet Window Grill Shutter Widget */
.grill-hazard-interactive {
  position: relative;
  width: 100%;
  height: 38px;
  background: var(--page-bg);
  border: 1.5px dashed var(--border-color);
  border-radius: 6px;
  margin-top: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: visible; /* Let tooltip float above card boundaries */
  box-shadow: inset 0 2px 5px var(--shadow-color);
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.grill-hazard-interactive:hover {
  border-color: #ff4b5c;
  background-color: rgba(255, 75, 92, 0.02);
}

.grill-bars-container {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  width: 80%;
  height: 100%;
  pointer-events: none;
}

.grill-bar {
  width: 3px;
  height: 100%;
  background: linear-gradient(to right, #777, #bbb, #555);
  box-shadow: 1px 0 2px rgba(0,0,0,0.3);
  border-radius: 1px;
}

.grill-hand {
  position: absolute;
  font-size: 1.4rem;
  left: 15%;
  pointer-events: none;
  opacity: 0.85;
  transition: transform 0.2s;
}

.grill-hazard-interactive:hover .grill-hand {
  animation: hand-slide-grill 2s ease-in-out infinite alternate;
}

@keyframes hand-slide-grill {
  0% {
    left: 15%;
    transform: rotate(0deg);
  }
  100% {
    left: 75%;
    transform: rotate(-15deg);
  }
}

.grill-tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #ff4b5c;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.68rem;
  width: 210px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1), transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 99;
  box-shadow: 0 4px 12px rgba(255, 75, 92, 0.3);
  font-weight: 600;
  line-height: 1.3;
}

.grill-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ff4b5c;
}

/* Show tooltip on hover or active class */
.grill-hazard-interactive:hover .grill-tooltip,
.grill-hazard-interactive.active .grill-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Grill pinch vibration shake on click */
.grill-hazard-interactive.vibrating {
  animation: grill-vibrate 0.4s linear;
  background-color: #ffeef0 !important;
  border-color: #ff4b5c !important;
}

@keyframes grill-vibrate {
  0%, 100% { transform: translateX(0); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: translateX(-3px); }
  25%, 50%, 75% { transform: translateX(3px); }
}

/* Interactive Shoelace Tripping Hazard Widget */
.shoe-trip-interactive {
  position: relative;
  width: 100%;
  height: 52px;
  background: var(--page-bg);
  border: 1.5px dashed var(--border-color);
  border-radius: 6px;
  margin-top: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: inset 0 2px 5px var(--shadow-color);
  transition: background-color 0.2s, border-color 0.2s;
  overflow: visible; /* Let tooltip float above card boundaries */
}

.shoe-trip-interactive:hover {
  border-color: #ff4b5c;
  background-color: rgba(255, 75, 92, 0.02);
}

.shoe-trip-svg-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.shoe-trip-svg {
  overflow: visible;
}

.walking-shoe {
  transform-origin: 65px 55px;
}

.stepping-foot {
  transform-origin: 135px 55px;
  transform: translate(0, -28px);
  opacity: 0;
}

.impact-burst {
  transform-origin: 109px 38px;
  transform: scale(0);
  opacity: 0;
}

.dragging-lace {
  transform-origin: 50px 42px;
}

.dragging-lace-2 {
  transform-origin: 50px 42px;
}

/* Tooltip warning styling */
.shoe-tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #ff4b5c;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.68rem;
  width: 215px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1), transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 99;
  box-shadow: 0 4px 12px rgba(255, 75, 92, 0.3);
  font-weight: 600;
  line-height: 1.3;
}

.shoe-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ff4b5c;
}

/* Show tooltip on hover or active class */
.shoe-trip-interactive:hover .shoe-tooltip,
.shoe-trip-interactive.active .shoe-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Loop animations when clicked */
.shoe-trip-interactive.clicked .walking-shoe {
  animation: walking-shoe-trip 2.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.shoe-trip-interactive.clicked .stepping-foot {
  animation: stepping-foot-step 2.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.shoe-trip-interactive.clicked .impact-burst {
  animation: impact-burst-pop 2.6s ease-out forwards;
}

@keyframes walking-shoe-trip {
  0% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(25px, 0) rotate(0deg); } /* Walks forward, dragging laces */
  24% { transform: translate(25px, 0) rotate(0deg); } /* Laces get stepped on and locked */
  32% { transform: translate(28px, -4px) rotate(15deg); } /* Shoe gets pulled back/up */
  40% { transform: translate(32px, 8px) rotate(42deg); } /* Faceplants / Trips forward! */
  45%, 65% { transform: translate(32px, 8px) rotate(42deg); } /* Stays tripped on the ground */
  80%, 100% { transform: translate(0, 0) rotate(0deg); } /* Resets to start position */
}

@keyframes stepping-foot-step {
  0% { transform: translate(0, -28px); opacity: 0; }
  12% { transform: translate(-88px, -28px); opacity: 1; } /* Foot slides left above laces */
  20% { transform: translate(-88px, 14px); } /* Steps down, pinning the trailing lace */
  65% { transform: translate(-88px, 14px); opacity: 1; } /* Pins lace through the trip */
  80%, 100% { transform: translate(0, -28px); opacity: 0; } /* Lifts foot and resets */
}

@keyframes impact-burst-pop {
  0%, 28% { transform: scale(0); opacity: 0; }
  35% { transform: scale(1.15); opacity: 1; } /* Pop/burst is triggered at crash thud */
  40%, 65% { transform: scale(1); opacity: 1; }
  75%, 100% { transform: scale(0); opacity: 0; }
}

/* Germ particles styling and accumulation animation */
.germ-particle {
  opacity: 0;
  transform: scale(0);
  transform-origin: center;
}

.shoe-trip-interactive.clicked .germ-particle {
  animation: germ-accumulate-sweep 2.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes germ-accumulate-sweep {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  15% {
    opacity: 0.4;
    transform: scale(0.6);
  } /* Laces sweep the floor, germs start sticking */
  24%, 100% {
    opacity: 1;
    transform: scale(1);
  } /* Laces get heavily soiled and trip happens */
}

/* Interactive Physics of Turning Corridor Widget */
.physics-turning-interactive {
  position: relative;
  width: 100%;
  height: 52px;
  background: var(--page-bg);
  border: 1.5px dashed var(--border-color);
  border-radius: 6px;
  margin-top: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: inset 0 2px 5px var(--shadow-color);
  transition: background-color 0.2s, border-color 0.2s;
  overflow: visible; /* Let tooltip float above card boundaries */
}

.physics-turning-interactive:hover {
  border-color: var(--accent-color);
  background-color: rgba(44, 94, 67, 0.02);
}

.turning-svg-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.turning-svg {
  overflow: visible;
}

.sharp-crash {
  transform-origin: 36px 42px;
  transform: scale(0);
  opacity: 0;
}

.sharp-crash .lightning-bolt {
  filter: drop-shadow(0 0 3px #ffd700);
}

.physics-turning-interactive.clicked .sharp-crash .lightning-bolt {
  animation: lightning-flicker 0.15s ease-in-out infinite alternate;
}

@keyframes lightning-flicker {
  0% { opacity: 0.3; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}

.safety-pass {
  transform-origin: 150px 36px;
  transform: scale(0);
  opacity: 0;
}

/* Tooltip warning styling */
.turning-tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--accent-color);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.68rem;
  width: 215px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1), transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 99;
  box-shadow: 0 4px 12px rgba(44, 94, 67, 0.3);
  font-weight: 600;
  line-height: 1.3;
}

.turning-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--accent-color);
}

/* Show tooltip on hover or active class */
.physics-turning-interactive:hover .turning-tooltip,
.physics-turning-interactive.active .turning-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Loop animations when clicked */
.physics-turning-interactive.clicked .sharp-dot-a {
  animation: sharp-dot-a-run 2s ease-in-out forwards;
}

.physics-turning-interactive.clicked .sharp-dot-b {
  animation: sharp-dot-b-run 2s ease-in-out forwards;
}

.physics-turning-interactive.clicked .sharp-crash {
  animation: sharp-crash-burst 2s ease-out forwards;
}

.physics-turning-interactive.clicked .rounded-dot-a {
  animation: rounded-dot-a-run 2s ease-in-out forwards;
}

.physics-turning-interactive.clicked .rounded-dot-b {
  animation: rounded-dot-b-run 2s ease-in-out forwards;
}

.physics-turning-interactive.clicked .safety-pass {
  animation: safety-pass-pop 2s ease-out forwards;
}

/* Sharp Side Keyframes */
@keyframes sharp-dot-a-run {
  0% { cx: 12; cy: 42; opacity: 1; }
  22% { cx: 36; cy: 42; opacity: 1; } /* Collision point */
  28% { cx: 29; cy: 42; opacity: 0.6; } /* Bounce back */
  70%, 100% { cx: 12; cy: 42; opacity: 0; }
}

@keyframes sharp-dot-b-run {
  0% { cx: 36; cy: 72; opacity: 1; }
  22% { cx: 36; cy: 42; opacity: 1; } /* Collision point */
  28% { cx: 36; cy: 49; opacity: 0.6; } /* Bounce back */
  70%, 100% { cx: 36; cy: 72; opacity: 0; }
}

@keyframes sharp-crash-burst {
  0%, 20% { transform: scale(0); opacity: 0; }
  22% { transform: scale(1.2); opacity: 1; } /* Burst at crash */
  28%, 62% { transform: scale(1); opacity: 1; }
  75%, 100% { transform: scale(0); opacity: 0; }
}

/* Rounded Side Keyframes */
@keyframes rounded-dot-a-run {
  0% { cx: 112; cy: 36; opacity: 1; }
  20% { cx: 144; cy: 36; opacity: 1; } /* Outer lane */
  35% { cx: 144; cy: 50; }
  55% { cx: 144; cy: 72; opacity: 1; } /* Passes safely */
  75%, 100% { cx: 112; cy: 36; opacity: 0; }
}

@keyframes rounded-dot-b-run {
  0% { cx: 132; cy: 72; opacity: 1; }
  20% { cx: 132; cy: 60; opacity: 1; } /* Inner lane */
  35% { cx: 122; cy: 48; }
  55% { cx: 112; cy: 48; opacity: 1; } /* Passes safely */
  75%, 100% { cx: 132; cy: 72; opacity: 0; }
}

@keyframes safety-pass-pop {
  0%, 40% { transform: scale(0); opacity: 0; }
  46% { transform: scale(1.2); opacity: 1; } /* Pop up as they pass */
  52%, 65% { transform: scale(1); opacity: 1; }
  75%, 100% { transform: scale(0); opacity: 0; }
}

/* Interactive Doorway Etiquette Widget */
.doorway-etiquette-interactive {
  position: relative;
  width: 100%;
  height: 52px;
  background: var(--page-bg);
  border: 1.5px dashed var(--border-color);
  border-radius: 6px;
  margin-top: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: inset 0 2px 5px var(--shadow-color);
  transition: background-color 0.2s, border-color 0.2s;
  overflow: visible; /* Let tooltip float above card boundaries */
}

.doorway-etiquette-interactive:hover {
  border-color: var(--accent-color);
  background-color: rgba(44, 94, 67, 0.02);
}

.doorway-svg-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.doorway-svg {
  overflow: visible;
}

.etiquette-door {
  transform-origin: 85px 40px;
  transform: rotate(0deg);
  transition: transform 0.4s ease;
}

.etiquette-boy {
  transform-origin: 72px 70px;
}

.boy-label {
  transform-origin: 72px 70px;
}

.etiquette-girl {
  transform-origin: 100px 70px;
}

.girl-label {
  transform-origin: 100px 70px;
}

.etiquette-checkmark {
  transform-origin: 130px 20px;
  transform: scale(0);
  opacity: 0;
}

/* Tooltip warning styling */
.doorway-tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--accent-color);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.68rem;
  width: 215px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1), transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 99;
  box-shadow: 0 4px 12px rgba(44, 94, 67, 0.3);
  font-weight: 600;
  line-height: 1.3;
}

.doorway-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--accent-color);
}

/* Show tooltip on hover or active class */
.doorway-etiquette-interactive:hover .doorway-tooltip,
.doorway-etiquette-interactive.active .doorway-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Loop animations when clicked */
.doorway-etiquette-interactive.clicked .etiquette-door {
  animation: door-swing-open 2.8s ease-in-out forwards;
}

.doorway-etiquette-interactive.clicked .etiquette-boy {
  animation: boy-hold-door 2.8s ease-in-out forwards;
}

.doorway-etiquette-interactive.clicked .boy-label {
  animation: boy-hold-door-label 2.8s ease-in-out forwards;
}

.doorway-etiquette-interactive.clicked .etiquette-girl {
  animation: girl-pass-first 2.8s ease-in-out forwards;
}

.doorway-etiquette-interactive.clicked .girl-label {
  animation: girl-pass-first-label 2.8s ease-in-out forwards;
}

.doorway-etiquette-interactive.clicked .etiquette-checkmark {
  animation: checkmark-pop-ladies 2.8s ease-out forwards;
}

/* Doorway Etiquette Keyframes */
@keyframes door-swing-open {
  0%, 10% { transform: rotate(0deg); }
  20%, 70% { transform: rotate(-90deg); } /* Door swung open */
  80%, 100% { transform: rotate(0deg); } /* Door closes back */
}

@keyframes boy-hold-door {
  0% { transform: translate(0, 0); }
  18% { transform: translate(6px, -30px); } /* Boy walks to handle */
  70% { transform: translate(6px, -30px); } /* Holds the door */
  80%, 100% { transform: translate(26px, -55px); } /* Walks through behind girl */
}

@keyframes boy-hold-door-label {
  0% { transform: translate(0, 0); }
  18% { transform: translate(6px, -30px); }
  70% { transform: translate(6px, -30px); }
  80%, 100% { transform: translate(26px, -55px); }
}

@keyframes girl-pass-first {
  0%, 20% { transform: translate(0, 0); }
  55%, 100% { transform: translate(0, -55px); } /* Walks straight through first */
}

@keyframes girl-pass-first-label {
  0%, 20% { transform: translate(0, 0); }
  55%, 100% { transform: translate(0, -55px); }
}

@keyframes checkmark-pop-ladies {
  0%, 35% { transform: scale(0); opacity: 0; }
  45% { transform: scale(1.15); opacity: 1; } /* Pops up as G passes */
  50%, 75% { transform: scale(1); opacity: 1; }
  85%, 100% { transform: scale(0); opacity: 0; }
}

/* Interactive Language Corner Styles */
.lang-corner-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  flex: 1;
  min-height: 0;
}

.lang-selector-row {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 6px;
}

.lang-badge-btn {
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 30px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lang-badge-btn:hover {
  background-color: var(--button-hover-bg);
  transform: scale(1.05);
}

.lang-badge-btn.active {
  background-color: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
  box-shadow: 0 2px 6px rgba(44, 94, 67, 0.3);
}

.lang-flag {
  font-size: 1.1rem;
}

.lang-cards-area {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lang-card {
  display: none;
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 4px 10px var(--shadow-color);
  animation: card-fade-in 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
  padding-right: 6px;
}

.lang-card::-webkit-scrollbar {
  width: 6px;
}

.lang-card::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 4px;
}

.lang-card::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

.lang-card::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.lang-card.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.lang-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.lang-symbol-icon {
  font-size: 1.2rem;
}

.lang-greeting-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-color);
  margin: 0;
}

.lang-student-info {
  font-size: 0.78rem;
  color: var(--text-color);
  margin-bottom: 4px;
  opacity: 0.85;
}

.lang-achievement-desc {
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--text-color);
  margin: 0 0 8px 0;
}

.lang-voice-player-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(44, 94, 67, 0.05);
  border-radius: 6px;
  padding: 4px 10px;
  margin-bottom: 10px;
  width: fit-content;
}

.lang-play-btn {
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.lang-play-btn:hover {
  background: var(--accent-hover-color, #1f422e);
}

.lang-play-btn.playing {
  background: #e74c3c;
}

.lang-soundwave-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 16px;
  width: 35px;
  opacity: 0.3;
}

.lang-soundwave-visualizer.active {
  opacity: 1;
}

.soundwave-bar {
  width: 2.5px;
  height: 20%;
  background-color: var(--accent-color);
  border-radius: 1px;
  transition: height 0.1s ease;
}

.lang-soundwave-visualizer.active .soundwave-bar {
  animation: soundwave-bounce 0.7s infinite alternate;
}

.soundwave-bar:nth-child(1) { animation-delay: 0.1s; }
.soundwave-bar:nth-child(2) { animation-delay: 0.3s; }
.soundwave-bar:nth-child(3) { animation-delay: 0.0s; }
.soundwave-bar:nth-child(4) { animation-delay: 0.4s; }
.soundwave-bar:nth-child(5) { animation-delay: 0.2s; }

/* Word Match Game */
.lang-game-container {
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  margin-top: 6px;
}

.lang-game-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-color);
  margin: 0 0 2px 0;
}

.lang-game-prompt {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin: 0 0 6px 0;
}

.lang-game-options {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-match-word {
  background: rgba(44, 94, 67, 0.08);
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-color);
  cursor: default;
}

.lang-match-equals {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.lang-match-targets {
  display: flex;
  gap: 4px;
}

.lang-match-target {
  background: var(--button-bg, #f1f2f6);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-color);
}

.lang-match-target:hover {
  background: var(--button-hover-bg);
  border-color: var(--accent-color);
}

.lang-game-status-msg {
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 4px;
  min-height: 12px;
}

.lang-game-status-msg.success {
  color: #2ecc71;
}

.lang-game-status-msg.error {
  color: #e74c3c;
}

/* Brain Teasers Page Styles */
.riddles-page-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
  height: 0; /* Forces container to fit precisely inside flex parent */
  min-height: 0;
  overflow: hidden;
}

.riddles-list-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  height: 100%;
  min-height: 0;
}

.riddles-list-view {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two-column grid layout */
  gap: 4px 10px; /* Snugger row gap */
  width: 100%;
  overflow-y: auto; /* Enable internal scrolling when cards expand */
  padding-right: 4px; /* Space for thin scrollbar */
  min-height: 0;
  flex-grow: 1;
  margin-bottom: 6px;
}

/* Thin premium scrollbar for riddles list view */
.riddles-list-view::-webkit-scrollbar {
  width: 4px;
}
.riddles-list-view::-webkit-scrollbar-track {
  background: transparent;
}
.riddles-list-view::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.riddles-list-view::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.clickable-riddle-card {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.clickable-riddle-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(44, 94, 67, 0.1);
}

.riddle-card-item {
  background: var(--card-bg);
  border: 1.2px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 6px; /* SNUG padding */
  box-shadow: 0 1.5px 3px var(--shadow-color);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 42px; /* Tighter card height */
  justify-content: space-between;
}

.riddle-question-row {
  display: flex;
  gap: 6px;
  align-items: center; /* Center badge and text vertically */
}

.riddle-q-badge {
  background: var(--accent-color);
  color: #ffffff;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.52rem; /* Compact badge font */
  font-weight: 900;
  flex-shrink: 0;
}

.riddle-question-text {
  font-size: 0.65rem; /* Smaller font-size for compact layout */
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  line-height: 1.25;
}

.riddle-answer-row {
  border-top: 1px dashed var(--border-color);
  padding-top: 3px; /* Reduced spacing */
  min-height: 18px;
  display: flex;
  align-items: center;
}

.riddle-page-instruction-hint {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent-color);
  font-style: italic;
  animation: pulse-hint 2s infinite ease-in-out;
}

@keyframes pulse-hint {
  0% { opacity: 0.75; }
  50% { opacity: 1; }
  100% { opacity: 0.75; }
}

.riddle-answer-text {
  font-size: 0.64rem; /* Compact answer text */
  font-weight: 800;
  color: #2ecc71;
  margin: 0;
  animation: card-fade-in 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* New animations */
@keyframes soundwave-bounce {
  0% { height: 20%; }
  100% { height: 100%; }
}

@keyframes card-fade-in {
  0% { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.shake-error {
  animation: shake-error-anim 0.3s ease;
}

@keyframes shake-error-anim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* Portrait video widget styles for Language Corner */
.lang-video-wrapper {
  width: 100%;
}

.lang-video-wrapper.portrait-video {
  max-width: 130px;
  aspect-ratio: 9 / 16;
  margin: 8px auto 12px auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1.5px solid var(--border-color);
}

.lang-video-wrapper.portrait-video .video-player {
  aspect-ratio: 9 / 16;
  object-fit: cover;
  height: 100%;
  width: 100%;
  display: block;
}

/* Lock aspect ratio in browser-native fullscreen mode to prevent portrait cropping */
.video-player:fullscreen {
  object-fit: contain !important;
  background-color: #000 !important;
}

.video-player:-webkit-full-screen {
  object-fit: contain !important;
  background-color: #000 !important;
}

.video-player:-moz-full-screen {
  object-fit: contain !important;
  background-color: #000 !important;
}

.video-player:-ms-fullscreen {
  object-fit: contain !important;
  background-color: #000 !important;
}

/* Kaneez Poem Word-by-Word Karaoke Animations */
.quote-line {
  display: inline-block;
}

.poem-word {
  display: inline-block;
  transition: all 0.4s ease-in-out;
  margin-right: 0.18rem;
  color: #4c0614; /* Deep Velvet Wine / Dark Burgundy (Maximum Contrast) */
  text-shadow: 0.5px 0.5px 1px rgba(255, 255, 255, 0.9); /* Soft white highlight behind text for absolute clarity */
}

/* When Kaneez is speaking, bounce and scale each word progressively */
.image-quote-overlay.playing-audio .poem-word {
  animation: word-bounce-up 0.9s ease-in-out forwards;
}

@keyframes word-bounce-up {
  0% {
    transform: translateY(0) scale(1);
    color: #4c0614; /* Base Dark Burgundy */
    text-shadow: 0.5px 0.5px 1px rgba(255, 255, 255, 0.9);
  }
  30% {
    transform: translateY(-8px) scale(1.25);
    color: #ff4081; /* Glow to bright vivid pink */
    text-shadow: 0 0 10px #ff4081, 0 0 20px #ff4081, 0 0 30px #ff4081; /* Radiant Pink Neon Glow */
  }
  65%, 100% {
    transform: translateY(0) scale(1);
    color: #4c0614; /* Return to Dark Burgundy */
    text-shadow: 0.5px 0.5px 1px rgba(255, 255, 255, 0.9);
  }
}

/* Moksha Narration Credit Sinusoidal Sparkling Animations */
.sparkle-word {
  display: inline-flex;
  gap: 0.5px;
  margin-left: 2px;
}

.sparkle-letter {
  display: inline-block;
  font-weight: 800;
  transition: transform 0.4s ease, filter 0.4s ease;
}

/* Only animate when the video is playing/speaking */
.narration-credit.playing .sparkle-letter {
  animation: sparkle-sine 1.2s infinite ease-in-out alternate;
}

@keyframes sparkle-sine {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1.0) drop-shadow(0 0 1px currentColor);
  }
  100% {
    transform: translateY(-5px) scale(1.2);
    filter: brightness(1.5) drop-shadow(0 0 6px currentColor) drop-shadow(0 0 12px currentColor);
  }
}

/* Page 16 Post-Video Animated Slideshow Overlay */
.video-slideshow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 15;
  overflow: hidden;
  border-radius: 12px;
  opacity: 1;
  transition: opacity 0.8s ease-in-out;
}

.video-slideshow-overlay.fade-out {
  opacity: 0;
}

.slideshow-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  transform: scale(1);
}

.slideshow-slide.active {
  opacity: 1;
  animation: ken-burns 6s linear forwards;
}

@keyframes ken-burns {
  0% {
    transform: scale(1.0);
  }
  100% {
    transform: scale(1.08);
  }
}

.slideshow-timer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--primary-color, #ff4081);
  width: 100%;
  transform-origin: left;
  animation: timer-progress 16s linear forwards;
  z-index: 20;
}

@keyframes timer-progress {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

/* Premium Color-Morphing Page Number Footers */
.page-number-footer {
  position: absolute;
  bottom: 12px;
  font-size: 0.80rem; /* Bold, clear, and visible */
  font-weight: 800;
  color: var(--page-num-color);
  font-family: var(--font-copy);
  pointer-events: none; /* Make it unclickable so it doesn't block interactions */
  user-select: none;
  z-index: 10;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
  /* Color morphing effect shifting the HSL hue slightly */
  animation: page-num-morph 6s infinite ease-in-out;
}

.dark-theme .page-number-footer {
  color: var(--page-num-color-dark);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.page-number-footer.left-footer {
  left: 24px;
}

.page-number-footer.right-footer {
  right: 24px;
}

@keyframes page-num-morph {
  0% {
    filter: hue-rotate(0deg) saturate(1);
    transform: scale(1);
  }
  50% {
    filter: hue-rotate(25deg) saturate(1.1);
    transform: scale(1.03); /* Subtle micro-interaction pulsing */
  }
  100% {
    filter: hue-rotate(0deg) saturate(1);
    transform: scale(1);
  }
}

@keyframes pulse-warning {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.18);
  }
}

/* Match the Columns Exercise styling on Page 7 */
.match-col-btn {
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.match-col-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px var(--shadow-color) !important;
  border-color: var(--accent-color) !important;
}

.match-col-btn:active {
  transform: translateY(1px);
}

.match-col-btn.matched-lock {
  cursor: default !important;
  pointer-events: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Success Modal Animations & Button styling */
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modal-scale-up {
  from { transform: scale(0.85); }
  to { transform: scale(1); }
}

@keyframes modal-scale-down {
  from { transform: scale(1); }
  to { transform: scale(0.85); }
}

.french-modal-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  filter: brightness(1.05);
}

.french-modal-close-btn:active {
  transform: translateY(1px);
}

/* Scroll indicator cue for scrollable cards */
.lang-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(201, 152, 47, 0.08); /* Light gold accent background */
  border: 1px dashed var(--accent-color);
  border-radius: 6px;
  padding: 5px 10px;
  margin: 8px 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-color);
  animation: scroll-hint-bounce 1.5s infinite ease-in-out;
}

.dark-theme .lang-scroll-hint {
  background: rgba(229, 182, 76, 0.1);
}

@keyframes scroll-hint-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2px);
  }
}

/* Page 3 Academics Word Acrobatics Theater styles */
.acrobatics-theater {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  margin: 6px 0 10px 0;
  box-shadow: 0 4px 10px var(--shadow-color);
  width: 100%;
}

.theater-screen {
  height: 90px;
  background: radial-gradient(circle, #152538 0%, #08101a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1.5px solid var(--border-color);
}

/* Screen overlay scanner/flicker effect for video panel look */
.theater-screen::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 5;
}

.theater-word-container {
  display: flex;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 3px;
  font-family: var(--font-display);
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  position: relative;
  z-index: 2;
  color: #ffffff;
}

.theater-word-span {
  display: inline-block;
  transition: all 0.3s ease;
}

/* Highlight vowels / consonants differently */
.theater-word-span.vowel {
  color: var(--accent-color);
}
.theater-word-span.consonant {
  color: #ffffff;
}

/* Custom Eye letter style for lOOk */
.eye-letter {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 32px;
  background-color: #ffffff;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  color: transparent !important;
  margin: 0 2px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.eye-letter::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #0b1a30;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: look-around-pupil 4s infinite ease-in-out;
}

.dark-theme .eye-letter {
  border-color: var(--accent-color);
}

/* Controls Deck */
.theater-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  background-color: var(--bg-color);
  gap: 8px;
}

.theater-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.theater-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--text-main);
  padding: 4px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: all 0.2s ease;
  min-width: 28px;
  height: 24px;
}

.theater-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background-color: var(--panel-bg);
}

.theater-btn.active {
  background-color: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
}

.theater-select {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 20px 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  height: 24px;
  max-width: 140px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9982f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 9px;
}

.theater-select:hover {
  border-color: var(--accent-color);
}

.theater-description-bar {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  background-color: var(--bg-color);
  padding: 2px 10px 4px 10px;
  border-top: 1px dashed var(--border-color);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* --- WORD ACROBATICS ANIMATIONS --- */

/* 1. Somersault (bOOk) */
.somersault {
  animation: somersault-anim 2.5s infinite ease-in-out;
  transform-origin: center bottom;
}

@keyframes somersault-anim {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-30px) rotate(-90deg) scale(1.1); }
  50% { transform: translateY(-40px) rotate(-180deg) scale(1.2); }
  75% { transform: translateY(-10px) rotate(-270deg) scale(1.1); }
  90%, 100% { transform: translateY(0) rotate(-360deg) scale(1); }
}

/* 2. Bubble Dance (cOOk) */
.bubble-dance {
  animation: bubble-dance-wobble 2s infinite ease-in-out;
}

.bubble-dance .theater-word-span.vowel {
  animation: bubble-letter-spin 1.5s infinite linear;
  display: inline-block;
}

@keyframes bubble-dance-wobble {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-6px) rotate(-4deg); }
  50% { transform: translateY(2px) rotate(4deg); }
  75% { transform: translateY(-4px) rotate(-2deg); }
}

@keyframes bubble-letter-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.25); color: #ffd700; }
  100% { transform: rotate(360deg) scale(1); }
}

/* 3. Jeep Drive (jEEp) */
.jeep-drive {
  animation: jeep-drive-anim 3.5s infinite linear;
}

@keyframes jeep-drive-anim {
  0% { transform: translateX(-180px) translateY(0); }
  15% { transform: translateX(-120px) translateY(-6px); }
  30% { transform: translateX(-60px) translateY(0); }
  45% { transform: translateX(0) translateY(-8px); }
  60% { transform: translateX(60px) translateY(0); }
  75% { transform: translateX(120px) translateY(-6px); }
  90% { transform: translateX(180px) translateY(0); opacity: 1; }
  96% { transform: translateX(210px) translateY(0); opacity: 0; }
  97% { transform: translateX(-210px) translateY(0); opacity: 0; }
  100% { transform: translateX(-180px) translateY(0); opacity: 1; }
}

/* 4. Look Around (lOOk pupil animation) */
@keyframes look-around-pupil {
  0%, 100% { transform: translate(-50%, -50%); }
  15% { transform: translate(-90%, -50%); } /* Look Left */
  30% { transform: translate(-50%, -50%); }
  45% { transform: translate(10%, -50%); }  /* Look Right */
  60% { transform: translate(-50%, -50%); }
  75% { transform: translate(-50%, -90%) scaleY(0.1); } /* Blink */
  85% { transform: translate(-50%, -10%); } /* Look Down */
}

/* 5. Heartbeat Pulse (AmmA) */
.heartbeat-pulse {
  animation: heartbeat-anim 1.8s infinite ease-in-out;
}

@keyframes heartbeat-anim {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0px rgba(229,182,76,0)); }
  25% { transform: scale(1.15); color: #ff6b6b; filter: drop-shadow(0 0 8px rgba(255,107,107,0.6)); }
  40% { transform: scale(1.06); }
  60% { transform: scale(1.24); color: #ff4757; filter: drop-shadow(0 0 12px rgba(255,71,87,0.8)); }
}

/* 6. Speed Zoom (accElErAtE) */
.speed-zoom {
  animation: speed-zoom-anim 2.5s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes speed-zoom-anim {
  0% { transform: translateX(-220px) skewX(25deg) scaleX(0.5); opacity: 0; }
  10% { opacity: 0.8; }
  25% { transform: translateX(-80px) skewX(15deg) scaleX(0.8); }
  50% { transform: translateX(80px) skewX(-15deg) scaleX(1.4); filter: blur(1.5px); color: var(--accent-color); }
  75% { transform: translateX(200px) skewX(-25deg) scaleX(0.6); opacity: 0.8; }
  85%, 100% { transform: translateX(240px) skewX(-25deg) scaleX(0.3); opacity: 0; }
}

/* 7. Climb Up (uPpEr) */
.climb-up {
  animation: climb-up-anim 3s infinite ease-in-out;
}

@keyframes climb-up-anim {
  0% { transform: translate(0, 30px); }
  18% { transform: translate(0, 10px); }
  22% { transform: translate(25px, 10px); }
  40% { transform: translate(25px, -10px); }
  44% { transform: translate(50px, -10px); }
  62% { transform: translate(50px, -30px); }
  66% { transform: translate(75px, -30px); }
  85% { transform: translate(75px, 30px); opacity: 0; }
  90%, 100% { transform: translate(0, 30px); opacity: 1; }
}

/* Image Lightbox Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.image-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.image-modal-content {
  position: relative;
  width: 96vw;
  max-width: 1400px;
  height: 92vh;
  max-height: 92vh;
  background-color: #0b0f19;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.image-modal:not(.hidden) .image-modal-content {
  transform: scale(1);
}

.image-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: all 0.2s ease;
}

.image-modal-close:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: scale(1.1);
}

.image-modal-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.image-modal-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  flex: 1;
  position: relative;
  overflow: hidden;
}

#modal-image-display {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  display: block;
  background-color: #000;
}

.image-modal-caption {
  width: 100%;
  text-align: center;
  padding: 12px;
  color: var(--text-main);
  background-color: var(--card-bg);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  border-top: 1px solid var(--border-color);
}

/* Teachers' Corner Styling */
.page-side-teachers-corner {
  background-color: var(--page-bg);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.teachers-corner-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 10px;
  margin-bottom: 5px;
}

.teachers-corner-container::-webkit-scrollbar {
  width: 6px;
}

.teachers-corner-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.dark-theme .teachers-corner-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.teachers-corner-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.teachers-corner-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.page-author-banner {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-top: -6px;
  margin-bottom: 12px;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.teachers-article-content p {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 12px;
  text-align: justify;
  text-indent: 18px;
}

.teachers-article-content p:first-of-type {
  text-indent: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-color);
}


.teachers-article-visual {
  width: 100%;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.teachers-visual-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

/* Students' Corner Gallery Styling */
.page-side-student-gallery {
  background-color: var(--page-bg);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.student-gallery-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 10px;
  margin-bottom: 5px;
}

.student-gallery-container::-webkit-scrollbar {
  width: 6px;
}

.student-gallery-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.dark-theme .student-gallery-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.student-gallery-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.student-gallery-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px var(--shadow-color);
  cursor: pointer;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border-color: var(--accent-color);
}

.gallery-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(2px);
}

.gallery-item:hover .gallery-hover-overlay,
.gallery-item-video:hover .gallery-hover-overlay {
  opacity: 1;
}

.zoom-icon {
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background-color: var(--accent-color);
  padding: 4px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(5px);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover .zoom-icon,
.gallery-item-video:hover .zoom-icon {
  transform: translateY(0);
}

.gallery-columns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: stretch;
}

.gallery-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.student-name-banner {
  font-family: var(--font-copy, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 4px var(--shadow-color);
  width: 95%;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.dark-theme .student-name-banner {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  background-color: rgba(255, 255, 255, 0.05);
}

.student-name-placeholder {
  visibility: hidden;
}

.gallery-item-video {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px var(--shadow-color);
  cursor: pointer;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  width: 100%;
}

.gallery-item-video:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border-color: var(--accent-color);
}

.gallery-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Page 11 Overlay to cover brand name with concept credits */
.page-11-overlay {
  position: absolute;
  top: calc(30px + 10.5%);
  height: 5.5%;
  left: 4.8%;
  right: 4.8%;
  background-color: #ffffff; /* Solid white to blend with the A4 page image background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.page-11-overlay-text {
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 700;
  color: #253d7d; /* Matches the original dark blue page title color */
  letter-spacing: 0.3px;
  text-align: center;
}

.page-11-overlay-text .name-sudha {
  color: #e74c3c; /* Sudha: Red */
}

.page-11-overlay-text .name-devi {
  color: #2980b9; /* Devi: Blue */
}

.page-11-overlay-text .name-renuka {
  color: #27ae60; /* Renuka: Green */
}

/* Page 20 author highlight style */
.page-author-banner .name-vishnupriya {
  color: #e84393; /* Orchid Pink / Magenta */
  font-weight: 800;
  font-style: normal;
}

/* Rotate upside down elements (e.g. My Vacation video) */
.rotate-180 {
  transform: rotate(180deg);
}






/* Circular Logo Styles */
.top-bar-logo {
  height: 38px !important;
  width: auto !important;
  max-width: 140px !important;
  object-fit: contain !important;
  border-radius: 4px !important;
  border: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  transition: transform 0.3s ease, filter 0.3s ease !important;
}

.logo-area:hover .top-bar-logo {
  transform: scale(1.1);
}

.page-top-logo img {
  height: 38px !important;
  width: auto !important;
  max-width: 140px !important;
  border-radius: 4px !important;
  object-fit: contain !important;
  border: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  transition: transform 0.3s ease, filter 0.3s ease !important;
}

/* Page Bottom Center Logo (all pages including covers) */
.page-bottom-logo {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
}

.page-bottom-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  background-color: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.page-bottom-logo img:hover {
  transform: scale(1.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border-color: #f39c12;
}

/* Top Bar Logo Title matching Cover Page Font & Colors */
.top-logo-title {
  font-family: var(--font-display) !important;
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  line-height: 1 !important;
}

.top-logo-title .title-shraddha {
  font-family: var(--font-display) !important;
  font-size: 1.22rem !important;
  font-weight: 800 !important;
}

.top-logo-title .title-sparks {
  font-family: var(--font-display) !important;
  font-size: 1.22rem !important;
  font-weight: 800 !important;
}

.top-logo-title .sparkle {
  font-size: 0.8rem !important;
}

/* ==========================================================================
   September 2026 Fraternity Theme & Corner Styling (HFE 01)
   ========================================================================== */

/* Corner Badges */
.corner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(139, 0, 0, 0.2));
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.teacher-corner-badge {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: #ffffff;
  border: none;
}

.student-corner-badge {
  background: linear-gradient(135deg, #854d0e, #d97706);
  color: #ffffff;
  border: none;
}

.parent-corner-badge {
  background: linear-gradient(135deg, #065f46, #10b981);
  color: #ffffff;
  border: none;
}

/* Modal Form Controls & Custom Layout */
.card-modal-container {
  max-width: 520px !important;
  padding: 24px !important;
  border-radius: 16px !important;
  background: var(--bg-card, #ffffff);
  color: var(--text-color, #1e293b);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.custom-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--primary-color, #8b0000);
  margin-bottom: 2px;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-color, #334155);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-color, #f8fafc);
  color: var(--text-color, #0f172a);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-color, #d4af37);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.full-width-btn {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}

.secondary-btn {
  background: linear-gradient(135deg, #475569, #334155) !important;
}

/* Digital Fraternity Card Preview */
.card-preview-area {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color, #cbd5e1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.digital-fraternity-card {
  background: linear-gradient(135deg, #2a0845, #6441a5);
  color: #ffffff;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #d4af37;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.digital-fraternity-card::before {
  content: '✨';
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 1.2rem;
  opacity: 0.6;
}

.card-top-bar {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #d4af37;
  margin-bottom: 8px;
}

.card-badge-display {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fef08a;
  margin-bottom: 6px;
}

.card-to-display {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-decoration: underline;
  text-decoration-color: #d4af37;
}

.card-text-display {
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.1);
  padding: 8px;
  border-radius: 6px;
}

.card-bottom-bar {
  font-size: 0.7rem;
  color: #cbd5e1;
}

.submit-feedback {
  margin-top: 8px;
  padding: 10px;
  background: #dcfce7;
  color: #166534;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

/* Card Builder Trigger Card in Student Corner */
.fraternity-generator-card {
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.08), rgba(212, 175, 55, 0.12));
  border: 1.5px solid var(--accent-color);
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  text-align: center;
  box-shadow: 0 4px 10px var(--shadow-color);
}

.fraternity-card-btn {
  background: linear-gradient(135deg, #8b0000, #b91c1c);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.fraternity-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.4);
}

/* Parent Corner Layout */
.parent-synergy-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.parent-rule-card {
  background: var(--bg-color, #f8fafc);
  border-left: 3px solid #10b981;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.parent-rule-title {
  font-weight: 800;
  color: #065f46;
}

.parent-submission-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 95, 70, 0.05));
  border: 1.5px solid #10b981;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  margin-top: 10px;
}

/* Pastoral Care Custom Styling */
.pastoral-grid-thumb:hover {
  transform: scale(1.05);
  border-color: #166534 !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 5;
}

.pastoral-corner-badge {
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.3);
}

.pastoral-writeup-card {
  transition: all 0.3s ease;
}

.pastoral-expand-btn:hover {
  background: rgba(22, 101, 52, 0.25) !important;
  transform: translateY(-1px);
}

/* Image Modal Navigation Arrows */
.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 30;
  transition: background-color 0.2s, transform 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.image-modal-nav:hover {
  background: rgba(0, 0, 0, 0.95);
  transform: translateY(-50%) scale(1.12);
  border-color: #ffffff;
}

.image-modal-nav.prev-btn {
  left: 16px;
}

.image-modal-nav.next-btn {
  right: 16px;
}

.image-modal-nav svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* Front Cover Top Logo - Seamless Background Integration */
.page-side-cover .page-top-logo {
  top: 14px;
}

.page-side-cover .page-top-logo img {
  width: 56px;
  height: 56px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  mix-blend-mode: normal !important;
  opacity: 0.95;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
  transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

.page-side-cover .page-top-logo img:hover {
  opacity: 1;
  transform: scale(1.08);
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.6));
}






/* ==========================================================================
   ANIMATED FOURTH ESTATE BADGE & SHIMMER TEXT EFFECTS
   ========================================================================== */
.fourth-estate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.95), rgba(15, 23, 42, 0.95));
  border: 1.5px solid rgba(212, 175, 55, 0.85);
  color: #fef08a;
  font-family: var(--font-display, 'Cinzel', serif);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.35), 0 0 12px rgba(212, 175, 55, 0.3);
  animation: fourthEstateGlow 3s ease-in-out infinite alternate, fourthEstateFloat 4s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fourth-estate-badge:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.6), 0 0 20px rgba(245, 158, 11, 0.5);
}

.fourth-estate-badge::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 70%
  );
  transform: rotate(30deg);
  animation: fourthEstateShimmer 3.5s infinite;
  pointer-events: none;
}

.fourth-estate-text {
  background: linear-gradient(90deg, #d4af37, #fef08a, #ffffff, #fef08a, #d4af37);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: fourthEstateTextGradient 4s linear infinite;
  font-weight: 800;
  letter-spacing: 1.8px;
}

@keyframes fourthEstateGlow {
  0% {
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3), 0 0 8px rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.6);
  }
  100% {
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5), 0 0 18px rgba(245, 158, 11, 0.5);
    border-color: rgba(245, 158, 11, 1);
  }
}

@keyframes fourthEstateFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

@keyframes fourthEstateShimmer {
  0% { transform: translateX(-100%) rotate(30deg); }
  100% { transform: translateX(100%) rotate(30deg); }
}

@keyframes fourthEstateTextGradient {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.page-side-cover::before {
  display: none;
}


/* Quick Page Directory Jump Box Styling */
.page-jump-box {
  transition: all 0.22s ease-in-out !important;
}
.page-jump-box:hover {
  border-color: #d4af37 !important;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.25) !important;
  background: #fffdf5 !important;
}


/* Card Modal Container & Form Styling (Fix Pop-up Truncation & Enable Scrolling) */
.card-modal-container {
  aspect-ratio: auto !important;
  height: auto !important;
  max-height: 90vh !important;
  width: 92% !important;
  max-width: 560px !important;
  overflow-y: auto !important;
  background: #ffffff !important;
  color: #1e293b !important;
  padding: 24px 28px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4) !important;
  border-radius: 16px !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.custom-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.custom-modal-body .modal-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e1b4b;
  margin: 0 0 4px 0;
  font-family: 'Cinzel', serif, var(--font-primary);
}

.custom-modal-body .modal-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.custom-modal-body .form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.custom-modal-body label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.custom-modal-body .form-input,
.custom-modal-body .form-select,
.custom-modal-body .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.84rem;
  font-family: inherit;
  color: #0f172a;
  background-color: #f8fafc;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-modal-body .form-input:focus,
.custom-modal-body .form-select:focus,
.custom-modal-body .form-textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background-color: #ffffff;
}

.custom-modal-body .full-width-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.custom-modal-body .full-width-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.custom-modal-body .card-preview-area {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.digital-fraternity-card {
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  color: #ffffff;
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(67, 56, 202, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-top-bar {
  font-size: 0.68rem;
  font-weight: 700;
  color: #c7d2fe;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.card-badge-display {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fbbf24;
}

.card-to-display {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}

.card-text-display {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #e0e7ff;
  font-style: italic;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  border-radius: 6px;
}

.card-bottom-bar {
  font-size: 0.68rem;
  color: #a5b4fc;
  font-weight: 600;
  margin-top: 4px;
}


/* Hide custom fullscreen modal trigger buttons by default */
.modal-trigger-btn {
  display: none;
}

/* Progress bar spaced cleanly above "Full" */
.principal-keynote-container video::-webkit-media-controls-panel,
.principal-video-container video::-webkit-media-controls-panel {
  padding-bottom: 7px !important;
}

/* Hide time text to prevent text colliding with shifted icons */
.principal-keynote-container video::-webkit-media-controls-current-time-display,
.principal-keynote-container video::-webkit-media-controls-time-remaining-display,
.principal-video-container video::-webkit-media-controls-current-time-display,
.principal-video-container video::-webkit-media-controls-time-remaining-display {
  display: none !important;
}

/* Play/Pause icon: left-aligned with progress bar and cleanly spaced above timeline */
.principal-keynote-container video::-webkit-media-controls-play-button,
.principal-video-container video::-webkit-media-controls-play-button {
  transform: translate(-6px, 0px) !important;
}

/* Disabled square / fullscreen: spaced cleanly above progress bar */
.principal-keynote-container video::-webkit-media-controls-fullscreen-button,
.principal-keynote-container video::-webkit-media-controls-overflow-button,
.principal-video-container video::-webkit-media-controls-fullscreen-button,
.principal-video-container video::-webkit-media-controls-overflow-button {
  transform: translateY(0px) !important;
}

/* Hide volume slider and its popup containers completely so it never pops up or intercepts clicks */
.principal-keynote-container video::-webkit-media-controls-volume-slider,
.principal-keynote-container video::-webkit-media-controls-volume-control-container,
.principal-keynote-container video::-webkit-media-controls-volume-slider-container,
.principal-video-container video::-webkit-media-controls-volume-slider,
.principal-video-container video::-webkit-media-controls-volume-control-container,
.principal-video-container video::-webkit-media-controls-volume-slider-container {
  display: none !important;
  width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Speaker / Volume mute icon: cleanly spaced between Play and right controls, cleanly above progress bar */
.principal-keynote-container video::-webkit-media-controls-mute-button,
.principal-video-container video::-webkit-media-controls-mute-button {
  transform: translate(-42px, 0px) !important;
}

/* Principal's Video Custom Fullscreen Button: Positioned below progress bar and right-aligned with progress bar right corner */
.principal-keynote-container .modal-trigger-btn,
.principal-video-container .modal-trigger-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  position: absolute !important;
  bottom: 2px !important;
  right: 17px !important;
  z-index: 20 !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  outline: none !important;
  background: rgba(0, 0, 0, 0.65) !important;
  color: #ffffff !important;
  padding: 1.5px 6px !important;
  font-size: 0.54rem !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  opacity: 0.85 !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) !important;
  line-height: 1.1 !important;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease !important;
}

.principal-keynote-container .modal-trigger-btn:hover,
.principal-video-container .modal-trigger-btn:hover {
  opacity: 1 !important;
  background: rgba(0, 0, 0, 0.9) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6) !important;
}

/* Fullscreen mode container & image modal scaling - fills 100% of device display */
.image-modal:fullscreen,
.image-modal:-webkit-full-screen,
.image-modal.is-fullscreen {
  background: #000000 !important;
  width: 100vw !important;
  height: 100vh !important;
}

.image-modal:fullscreen .image-modal-content,
.image-modal:-webkit-full-screen .image-modal-content,
.image-modal.is-fullscreen .image-modal-content {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  background: #000000 !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.image-modal:fullscreen #modal-image-display,
.image-modal:-webkit-full-screen #modal-image-display,
.image-modal.is-fullscreen #modal-image-display {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain !important;
}

.image-modal:fullscreen .image-modal-caption,
.image-modal:-webkit-full-screen .image-modal-caption,
.image-modal.is-fullscreen .image-modal-caption {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  background: rgba(0, 0, 0, 0.75) !important;
  color: #ffffff !important;
  z-index: 90 !important;
}

/* --- PAGE 3 TOP 4 RANKING SPARKLING STAR ANIMATION --- */
@keyframes starGlowPulse {
  0% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 2px rgba(255,215,0,0.6)); }
  50% { transform: scale(1.06); filter: brightness(1.22) drop-shadow(0 0 10px rgba(255,215,0,0.95)); }
  100% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 2px rgba(255,215,0,0.6)); }
}

@keyframes starShowerFloat {
  0% { transform: translateY(0px) rotate(0deg); opacity: 0.8; }
  50% { transform: translateY(-3px) rotate(12deg); opacity: 1; }
  100% { transform: translateY(0px) rotate(0deg); opacity: 0.8; }
}

.star-glow-animated {
  animation: starGlowPulse 2.4s infinite ease-in-out;
}
.star-float-animated {
  animation: starShowerFloat 3s infinite ease-in-out;
}

/* Dim & Bright Sparkling Star Twinkle Animations for Number 4 */
@keyframes starTwinkleDimBright {
  0% { transform: scale(1); filter: brightness(0.85) drop-shadow(0 0 2px rgba(255,215,0,0.3)); opacity: 0.75; }
  50% { transform: scale(1.08); filter: brightness(1.35) drop-shadow(0 0 14px rgba(255,215,0,0.95)); opacity: 1; }
  100% { transform: scale(1); filter: brightness(0.85) drop-shadow(0 0 2px rgba(255,215,0,0.3)); opacity: 0.75; }
}

@keyframes starDimBrightPulse {
  0% { opacity: 0.35; transform: scale(0.85) rotate(-5deg); filter: brightness(0.7); }
  50% { opacity: 1; transform: scale(1.25) rotate(10deg); filter: brightness(1.5) drop-shadow(0 0 8px #ffd700); }
  100% { opacity: 0.35; transform: scale(0.85) rotate(-5deg); filter: brightness(0.7); }
}

.star-twinkle-animated {
  animation: starTwinkleDimBright 2.2s infinite ease-in-out;
}
.star-dim-bright-fast {
  animation: starDimBrightPulse 1.6s infinite ease-in-out;
  display: inline-block;
}
.star-dim-bright-slow {
  animation: starDimBrightPulse 2.6s infinite ease-in-out 0.8s;
  display: inline-block;
}

/* Brilliant Shimmering Gold Text Sweep Animation */
@keyframes goldShimmerSweep {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

.brilliant-gold-text {
  background: linear-gradient(90deg, #fef08a 0%, #ffffff 25%, #d4af37 50%, #ffffff 75%, #fef08a 100%);
  background-size: 200% auto;
  color: #d4af37;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShimmerSweep 3s linear infinite;
  font-weight: 900 !important;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

/* Graceful Natural Running Bobbing (Human Biomechanics) */
@keyframes gracefulRunBob {
  0%, 100% { transform: translateY(0px); }
  25% { transform: translateY(-3.5px); }
  50% { transform: translateY(1px); }
  75% { transform: translateY(-2px); }
}

.graceful-running-bob {
  animation: gracefulRunBob 0.88s infinite ease-in-out;
}

/* --- OPTION 3: STYLIZED GOLDEN SILHOUETTE RUNNER & SPEED TRAILS --- */
.golden-runner-badge {
  animation: goldenBadgePulse 3.2s ease-in-out infinite;
}

@keyframes goldenBadgePulse {
  0%, 100% {
    border-color: #d4af37;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.45), 0 2px 8px rgba(0, 0, 0, 0.6);
  }
  50% {
    border-color: #fff275;
    box-shadow: 0 4px 20px rgba(255, 224, 130, 0.75), 0 2px 8px rgba(0, 0, 0, 0.6);
  }
}

.golden-runner-figure {
  animation: goldenRunnerBob 0.78s ease-in-out infinite alternate;
  transform-origin: 75px 85px;
}

@keyframes goldenRunnerBob {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-2.5px) rotate(-1deg);
  }
}

.trail-stream {
  stroke-dasharray: 28 14;
  animation: goldenTrailDash 1.05s linear infinite;
}
.stream-1 { animation-delay: 0s; }
.stream-2 { animation-delay: 0.25s; }
.stream-3 { animation-delay: 0.5s; }
.stream-4 { animation-delay: 0.75s; }

@keyframes goldenTrailDash {
  0% {
    stroke-dashoffset: 42;
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.35;
  }
}

.trail-sparkle {
  animation: goldenSparkleTwinkle 1.2s ease-in-out infinite alternate;
}

@keyframes goldenSparkleTwinkle {
  0% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1.3);
  }
}

/* ==========================================================================
   OUTLOOK-STYLE INTERACTIVE WORD HOVER REACTIONS & ILLUMINATIONS
   ========================================================================== */

.word-reaction-trigger {
  display: inline;
  position: relative;
  padding: 1px 4px;
  margin: 0 -1px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  text-decoration: underline dotted rgba(30, 58, 138, 0.4);
  text-underline-offset: 3px;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Default / Blue Reaction (e.g. Congratulations / General) */
.word-reaction-trigger:hover,
.word-reaction-trigger.active {
  background: #cfe4fc; /* Exact Outlook soft sky-blue highlight */
  color: #0369a1;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.28);
  transform: translateY(-1px);
}

/* Celebrate Reaction: Firecrackers & Flower-pot Illuminations */
.word-reaction-trigger.reaction-celebrate {
  color: #c2410c;
  text-decoration-color: rgba(234, 88, 12, 0.45);
}
.word-reaction-trigger.reaction-celebrate:hover,
.word-reaction-trigger.reaction-celebrate.active {
  background: #ffedd5;
  color: #9a3412;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4), 0 2px 6px rgba(234, 88, 12, 0.25);
}

/* Grateful Reaction: Bowing Posture & Deep Gratitude */
.word-reaction-trigger.reaction-grateful {
  color: #b45309;
  text-decoration-color: rgba(217, 119, 6, 0.45);
}
.word-reaction-trigger.reaction-grateful:hover,
.word-reaction-trigger.reaction-grateful.active {
  background: #fef3c7;
  color: #92400e;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.42), 0 2px 6px rgba(217, 119, 6, 0.25);
}

/* Bloom Reaction: Cherry Blossom & Growth */
.word-reaction-trigger.reaction-bloom {
  color: #db2777;
  text-decoration-color: rgba(219, 39, 119, 0.45);
}
.word-reaction-trigger.reaction-bloom:hover,
.word-reaction-trigger.reaction-bloom.active {
  background: #fce7f3;
  color: #9d174d;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.38), 0 2px 6px rgba(219, 39, 119, 0.25);
}

/* Top Four Reaction: Golden Crown & Royal Recognition */
.word-reaction-trigger.reaction-topfour {
  color: #854d0e;
  text-decoration-color: rgba(202, 138, 4, 0.5);
}
.word-reaction-trigger.reaction-topfour:hover,
.word-reaction-trigger.reaction-topfour.active {
  background: #fef9c3;
  color: #713f12;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.45), 0 2px 8px rgba(161, 98, 7, 0.3);
}

/* Happy / Joy Reaction */
.word-reaction-trigger.reaction-happy {
  color: #2563eb;
  text-decoration-color: rgba(37, 99, 235, 0.45);
}
.word-reaction-trigger.reaction-happy:hover,
.word-reaction-trigger.reaction-happy.active {
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.38), 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Outlook Celebratory Particles Floating Upward */
.outlook-particle {
  position: fixed;
  pointer-events: none;
  user-select: none;
  z-index: 999999;
  will-change: transform, opacity;
  animation: outlookParticleRise 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.outlook-confetti-shape {
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.outlook-confetti-circle {
  border-radius: 50% !important;
}
.outlook-confetti-diamond {
  transform: rotate(45deg);
}

.outlook-emoji-particle {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

@keyframes outlookParticleRise {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, 0) scale(0.3) rotate(0deg);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(calc(var(--dx) * 0.35), calc(var(--dy) * 0.45)) scale(1.18) rotate(calc(var(--rot) * 0.3));
  }
  70% {
    opacity: 0.95;
    transform: translate(-50%, -50%) translate(calc(var(--dx) * 0.85), calc(var(--dy) * 0.9)) scale(1) rotate(calc(var(--rot) * 0.8));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--dx), calc(var(--dy) + 16px)) scale(0.55) rotate(var(--rot));
  }
}

/* Flower-Pot / Anar Ambient Illumination Flare */
.outlook-illumination-flare {
  position: fixed;
  pointer-events: none;
  z-index: 999998;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  animation: outlookFlarePulse 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes outlookFlarePulse {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35);
  }
  22% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.15);
  }
  65% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(1.45);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.85);
  }
}

/* ==========================================================================
   PAGE 16 PARENT REFLECTION & STORY SUBMISSION INVITING ANIMATION
   ========================================================================== */

.word-reaction-trigger.reaction-parent-invite {
  color: #065f46;
  text-decoration-color: rgba(16, 185, 129, 0.55);
}

.word-reaction-trigger.reaction-parent-invite:hover,
.word-reaction-trigger.reaction-parent-invite.active {
  background: #d1fae5;
  color: #044e37;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45), 0 2px 8px rgba(6, 95, 70, 0.25);
  transform: translateY(-1px);
}

/* Gentle Welcoming Namaste Folded Hands Animation */
.folded-hands-anim {
  display: inline-block;
  font-size: 1.05rem;
  line-height: 1;
  transform-origin: center bottom;
  animation: namasteGreeting 2.4s ease-in-out infinite;
  filter: drop-shadow(0 1px 4px rgba(212, 175, 55, 0.6));
  cursor: pointer;
  transition: transform 0.2s ease;
}
.folded-hands-anim:hover {
  transform: scale(1.3) rotate(-6deg);
}

@keyframes namasteGreeting {
  0%, 100% {
    transform: scale(1) translateY(0) rotate(0deg);
    filter: drop-shadow(0 1px 3px rgba(212, 175, 55, 0.5));
  }
  30% {
    transform: scale(1.18) translateY(-2px) rotate(-5deg);
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.85)) drop-shadow(0 0 6px rgba(16, 185, 129, 0.6));
  }
  60% {
    transform: scale(1.12) translateY(-1px) rotate(4deg);
    filter: drop-shadow(0 2px 6px rgba(212, 175, 55, 0.7));
  }
}

/* Inviting Floating Diamonds & Sparkles Banner */
.inviting-diamonds-banner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  user-select: none;
}

.floating-diamond {
  display: inline-block;
  line-height: 1;
  animation: floatingDiamondTwinkle 2.6s ease-in-out infinite alternate;
}
.floating-diamond.d-1 {
  font-size: 0.76rem;
  animation-delay: 0s;
}
.floating-diamond.d-2 {
  font-size: 0.66rem;
  animation-delay: 0.7s;
}
.floating-diamond.d-3 {
  font-size: 0.72rem;
  animation-delay: 1.4s;
}

@keyframes floatingDiamondTwinkle {
  0% {
    transform: translateY(0px) scale(0.88);
    opacity: 0.75;
  }
  50% {
    transform: translateY(-2.5px) scale(1.18) rotate(6deg);
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.85)) drop-shadow(0 0 4px rgba(6, 182, 212, 0.7));
  }
  100% {
    transform: translateY(1px) scale(0.95) rotate(-4deg);
    opacity: 0.85;
  }
}

/* Parent Story Submission Card Inviting Breathing Border */
.parent-submission-card {
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.parent-submission-card:hover {
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 6px 18px rgba(6, 95, 70, 0.14), 0 0 14px rgba(212, 175, 55, 0.25) !important;
  transform: translateY(-1.5px);
}

/* Parent Invite Button Shimmer */
.parent-invite-btn {
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.parent-invite-btn:hover {
  transform: scale(1.04) translateY(-1px);
  box-shadow: 0 4px 14px rgba(6, 95, 70, 0.35), 0 0 10px rgba(16, 185, 129, 0.4) !important;
}
.parent-invite-btn.active {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.65), 0 0 30px rgba(245, 158, 11, 0.5) !important;
}

/* Back Cover Specific Styling & Social / Admissions Cards */
.page-side-back-cover::before {
  display: none !important; /* Avoid 404 on missing building image; background is handled in container */
}

.dynamic-back-container .back-cover-title,
.dynamic-back-container .back-cover-title .title-shraddha,
.dynamic-back-container .back-cover-title .title-sparks-wrap {
  font-size: 1.15rem !important;
  line-height: 1.2 !important;
}

.dynamic-back-container .back-header-group {
  margin-top: 0 !important;
}

.connect-action-pill {
  transition: all 0.2s ease-in-out !important;
}
.connect-action-pill:hover {
  transform: translateY(-1.5px) scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14) !important;
  background: rgba(255, 255, 255, 0.70) !important;
}
.back-connect-card a:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.70) !important;
}

.dynamic-back-container .page-jump-box:hover {
  background: rgba(255, 255, 255, 0.65) !important;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
  border-color: rgba(212, 175, 55, 0.8) !important;
}

/* --- MUSSOORIE SCENIC SLIDESHOW & PAGE 28 STYLES --- */
.mussoorie-scenic-window {
  position: relative;
  height: 255px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.14), inset 0 0 0 1px rgba(255,255,255,0.18);
  background: #07131e;
}

.scenic-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.8s ease-in-out;
  pointer-events: none;
}

.scenic-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.scenic-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center center;
}

.scenic-slide.active img.ken-burns-1 {
  animation: kenBurnsSlow1 22s ease-in-out infinite alternate;
}

.scenic-slide.active img.ken-burns-2 {
  animation: kenBurnsSlow2 24s ease-in-out infinite alternate;
}

.scenic-slide.active img.ken-burns-3 {
  animation: kenBurnsSlow3 20s ease-in-out infinite alternate;
}

@keyframes kenBurnsSlow1 {
  0% { transform: scale(1.00) translate(0, 0); }
  50% { transform: scale(1.18) translate(-1.5%, -1%); }
  100% { transform: scale(1.00) translate(0, 0); }
}

@keyframes kenBurnsSlow2 {
  0% { transform: scale(1.18) translate(-1.2%, -1%); }
  50% { transform: scale(1.00) translate(0, 0); }
  100% { transform: scale(1.18) translate(-1.2%, -1%); }
}

@keyframes kenBurnsSlow3 {
  0% { transform: scale(1.00) translate(0.5%, 0); }
  50% { transform: scale(1.20) translate(-1%, -0.8%); }
  100% { transform: scale(1.00) translate(0.5%, 0); }
}


.scenic-mist-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 40px;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 70%);
  filter: blur(8px);
  animation: driftMistSlow 35s linear infinite;
  pointer-events: none;
  z-index: 3;
}

@keyframes driftMistSlow {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.scenic-pills-bar {
  position: absolute;
  bottom: 5px;
  right: 6px;
  z-index: 5;
  display: flex;
  gap: 3px;
  align-items: center;
}

.scenic-pill {
  background: rgba(15, 23, 42, 0.70);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.88);
  padding: 1.5px 6px;
  border-radius: 10px;
  font-size: 0.52rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  line-height: 1.2;
}

.scenic-pill:hover, .scenic-pill.active {
  background: rgba(16, 185, 129, 0.88);
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  transform: scale(1.04);
}

.scenic-caption-bar {
  position: absolute;
  bottom: 5px;
  left: 8px;
  z-index: 5;
  background: rgba(15, 23, 42, 0.70);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 1.5px 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  font-size: 0.55rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
}

/* --- CANOPY HOUSES GRID SCROLLBAR --- */
#canopy-houses-grid::-webkit-scrollbar {
  width: 4px;
}
#canopy-houses-grid::-webkit-scrollbar-track {
  background: rgba(5, 150, 105, 0.05);
  border-radius: 4px;
}
#canopy-houses-grid::-webkit-scrollbar-thumb {
  background: rgba(5, 150, 105, 0.35);
  border-radius: 4px;
}
#canopy-houses-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(5, 150, 105, 0.6);
}

/* --- PRINCIPAL WRITTEN ADDRESS SCROLLBAR (PAGE 3) --- */
#p3-letter-scroll-box {
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 58, 138, 0.25) transparent;
}
#p3-letter-scroll-box::-webkit-scrollbar {
  width: 4px;
}
#p3-letter-scroll-box::-webkit-scrollbar-track {
  background: rgba(30, 58, 138, 0.04);
  border-radius: 4px;
}
#p3-letter-scroll-box::-webkit-scrollbar-thumb {
  background: rgba(30, 58, 138, 0.25);
  border-radius: 4px;
}
#p3-letter-scroll-box::-webkit-scrollbar-thumb:hover {
  background: rgba(30, 58, 138, 0.5);
}

/* --- PRINCIPAL KEYNOTE DROP CAP & WATERMARK (PAGE 3) --- */
.p3-drop-cap-svg {
  flex-shrink: 0;
  display: block;
}

.dark-theme .p3-drop-cap-svg rect {
  fill: #0f172a !important;
  stroke: #ffd700 !important;
}

.dark-theme .p3-drop-cap-svg #p3RomanGrad stop:first-child,
.dark-theme .p3-drop-cap-svg #p3RomanGrad stop:last-child {
  stop-color: #ffd700 !important;
}

.dark-theme .p3-drop-cap-svg #p3RomanGrad stop:nth-child(2) {
  stop-color: #fef08a !important;
}

.dark-theme .p3-address-watermark {
  opacity: 0.12 !important;
  filter: invert(1) hue-rotate(180deg);
}

/* --- PAGE 2: BOTANICAL BLOOM VIGNETTE (OPTION B) --- */
.p2-botanical-vignette {
  margin-top: 6px;
  width: 135px;
  height: 50px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.95));
  border: 1.2px solid rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  padding: 2px;
}

.dark-theme .p2-botanical-vignette {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* --- PAGE 3: BOTANICAL CREEPER ANIMATIONS (LIVING GARDEN BREEZE & DEWDROP SPARKLE) --- */

/* 1. Living Garden Breeze - Ambient Gentle Sway */
@keyframes p3BreezeSway1 {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(3deg) translateY(-0.8px);
  }
}

@keyframes p3BreezeSway2 {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(-3.2deg) translateY(0.8px);
  }
}

@keyframes p3BreezeSway3 {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(2.4deg) translateY(-0.5px);
  }
}

@keyframes p3TendrilSway1 {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(3.5deg) scale(0.98);
  }
}

@keyframes p3TendrilSway2 {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(-3.8deg) scale(1.02);
  }
}

.p3-breeze-tendril-1 {
  transform-box: fill-box;
  transform-origin: 95% 50%;
  animation: p3TendrilSway1 4.6s ease-in-out infinite;
}

.p3-breeze-tendril-2 {
  transform-box: fill-box;
  transform-origin: 95% 50%;
  animation: p3TendrilSway2 5.4s ease-in-out infinite 0.7s;
}

.p3-breeze-leaf-1 {
  transform-box: fill-box;
  transform-origin: 90% 50%;
  animation: p3BreezeSway1 4.2s ease-in-out infinite;
}

.p3-breeze-leaf-2 {
  transform-box: fill-box;
  transform-origin: 90% 50%;
  animation: p3BreezeSway2 5.0s ease-in-out infinite 1.1s;
}

.p3-breeze-leaf-3 {
  transform-box: fill-box;
  transform-origin: 85% 50%;
  animation: p3BreezeSway3 3.8s ease-in-out infinite 1.8s;
}

/* 2. Dewdrop Sparkle / Petal Shimmer */
@keyframes p3PetalShimmer {
  0%, 100% {
    filter: drop-shadow(0 0 1px rgba(255, 215, 0, 0.2));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.8)) drop-shadow(0 0 7px rgba(254, 240, 138, 0.65));
    transform: scale(1.05);
  }
}

.p3-shimmer-bloom-1 {
  transform-box: fill-box;
  transform-origin: center;
  animation: p3PetalShimmer 3.8s ease-in-out infinite;
}

.p3-shimmer-bloom-2 {
  transform-box: fill-box;
  transform-origin: center;
  animation: p3PetalShimmer 4.4s ease-in-out infinite 1.5s;
}

.p3-shimmer-bloom-3 {
  transform-box: fill-box;
  transform-origin: center;
  animation: p3PetalShimmer 5.0s ease-in-out infinite 2.3s;
}

@keyframes p3DewSparkle {
  0%, 100% {
    opacity: 0.25;
    transform: scale(0.65);
  }
  42% {
    opacity: 0.35;
    transform: scale(0.75);
  }
  50% {
    opacity: 1;
    transform: scale(1.35);
    filter: drop-shadow(0 0 3px #ffffff) drop-shadow(0 0 6px #38bdf8);
  }
  58% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

.p3-dewdrop-1 {
  transform-box: fill-box;
  transform-origin: center;
  animation: p3DewSparkle 3.2s ease-in-out infinite;
}

.p3-dewdrop-2 {
  transform-box: fill-box;
  transform-origin: center;
  animation: p3DewSparkle 4.0s ease-in-out infinite 1.2s;
}

.p3-dewdrop-3 {
  transform-box: fill-box;
  transform-origin: center;
  animation: p3DewSparkle 3.6s ease-in-out infinite 2.1s;
}

.p3-dewdrop-4 {
  transform-box: fill-box;
  transform-origin: center;
  animation: p3DewSparkle 4.5s ease-in-out infinite 0.5s;
}

.p3-dewdrop-5 {
  transform-box: fill-box;
  transform-origin: center;
  animation: p3DewSparkle 3.9s ease-in-out infinite 1.7s;
}

/* ==========================================================================
   PAGE 3: METAMORPHOSIS TO TOP 4 BADGE (LARVAE TO BUTTERFLIES 1 AFTER THE OTHER)
   Symbolic of Hopetown girls' nurturing, transformation, and crowning achievement
   ========================================================================== */

/* Top 4 Badge Royal Celebration Halo when Butterflies arrive */
@keyframes p3Top4BadgeCelebration {
  0%, 41% {
    box-shadow: 0 2px 5px rgba(212,175,55,0.3);
    border-color: #d4af37;
  }
  43%, 49% {
    box-shadow: 0 0 14px rgba(96, 165, 250, 0.9), 0 0 22px rgba(30, 58, 138, 0.5), 0 2px 5px rgba(212,175,55,0.4);
    border-color: #93c5fd;
  }
  51%, 89% {
    box-shadow: 0 2px 5px rgba(212,175,55,0.3);
    border-color: #d4af37;
  }
  91%, 96% {
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.95), 0 0 24px rgba(245, 158, 11, 0.6), 0 2px 5px rgba(212,175,55,0.5);
    border-color: #fde047;
  }
  98%, 100% {
    box-shadow: 0 2px 5px rgba(212,175,55,0.3);
    border-color: #d4af37;
  }
}

/* Stardust Glints around Top 4 Badge during Butterfly 1 arrival */
@keyframes p3Top4GlintsSapphire {
  0%, 42% {
    opacity: 0;
    transform: scale(0.6);
  }
  44%, 48% {
    opacity: 1;
    transform: scale(1.05);
    filter: drop-shadow(0 0 4px #60a5fa);
  }
  51%, 100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

/* Stardust Glints around Top 4 Badge during Butterfly 2 arrival */
@keyframes p3Top4GlintsMonarch {
  0%, 90% {
    opacity: 0;
    transform: scale(0.6);
  }
  92%, 95% {
    opacity: 1;
    transform: scale(1.05);
    filter: drop-shadow(0 0 4px #fbbf24);
  }
  98%, 100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

/* 1. Larva 1 on Leaf 3 (0s - 2.5s) */
@keyframes p3Larva1Cycle {
  0%, 6% {
    opacity: 1;
    transform: scale(1);
  }
  8% {
    transform: scale(1.15);
    opacity: 1;
  }
  12% {
    transform: scale(0.6);
    opacity: 0;
  }
  92% {
    opacity: 0;
    transform: scale(0.5);
  }
  96%, 100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Chrysalis 1 Glowing Aura on Leaf 3 */
@keyframes p3Chrysalis1Cycle {
  0%, 5% {
    opacity: 0;
    transform: scale(0.3);
  }
  8%, 12% {
    opacity: 1;
    transform: scale(1.2);
    filter: drop-shadow(0 0 5px rgba(254, 240, 138, 0.9)) drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
  }
  14% {
    opacity: 0;
    transform: scale(1.5);
  }
  100% {
    opacity: 0;
  }
}

/* 2. Larva 2 on Leaf 8 (9s - 11.5s / 50% - 64% of 18s) */
@keyframes p3Larva2Cycle {
  0%, 48% {
    opacity: 0.9;
    transform: scale(1);
  }
  50%, 55% {
    opacity: 1;
    transform: scale(1.05);
  }
  58% {
    transform: scale(1.15);
    opacity: 1;
  }
  62% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* Chrysalis 2 Glowing Aura on Leaf 8 */
@keyframes p3Chrysalis2Cycle {
  0%, 54% {
    opacity: 0;
    transform: scale(0.3);
  }
  57%, 62% {
    opacity: 1;
    transform: scale(1.2);
    filter: drop-shadow(0 0 5px rgba(254, 240, 138, 0.9)) drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
  }
  64% {
    opacity: 0;
    transform: scale(1.5);
  }
  100% {
    opacity: 0;
  }
}

/* 3. Rapid 3D Wing Flutter Flap */
@keyframes p3BfWingFlapL {
  0%, 100% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(0.18);
  }
}

@keyframes p3BfWingFlapR {
  0%, 100% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(0.18);
  }
}

/* 4. Butterfly 1 (Sapphire) — Leaf 3 to Top 4 Badge */
@keyframes p3FlightSapphireToBadge {
  0%, 12% {
    opacity: 0;
    left: calc(100% - 29px);
    top: 25%;
    transform: translate(-50%, -50%) scale(0.2) rotate(10deg);
  }
  14% {
    opacity: 0.95;
    left: calc(100% - 29px);
    top: 25%;
    transform: translate(-50%, -50%) scale(0.85) rotate(-15deg);
  }
  18% {
    opacity: 1;
    left: calc(100% - 46px);
    top: 30%;
    transform: translate(-50%, -50%) scale(1.0) rotate(-35deg);
  }
  24% {
    opacity: 1;
    left: 58%;
    top: 45%;
    transform: translate(-50%, -50%) scale(1.08) rotate(20deg);
  }
  30% {
    opacity: 1;
    left: 32%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1.1) rotate(90deg);
  }
  36% {
    opacity: 1;
    left: 24%;
    top: 34%;
    transform: translate(-50%, -50%) scale(1.05) rotate(-35deg);
  }
  42% {
    opacity: 1;
    left: 42px;
    top: 22px;
    transform: translate(-50%, -50%) scale(1.02) rotate(-55deg);
  }
  45% {
    opacity: 1;
    left: 48px;
    top: 16px;
    transform: translate(-50%, -50%) scale(1.06) rotate(-10deg);
  }
  48% {
    opacity: 0.95;
    left: 46px;
    top: 15px;
    transform: translate(-50%, -50%) scale(1.0) rotate(15deg);
  }
  51% {
    opacity: 0.5;
    left: 44px;
    top: 10px;
    transform: translate(-50%, -50%) scale(0.7) rotate(-20deg);
  }
  53%, 100% {
    opacity: 0;
    left: 42px;
    top: 6px;
    transform: translate(-50%, -50%) scale(0.3);
  }
}

/* 5. Butterfly 2 (Monarch) — Leaf 8 to Top 4 Badge (1 After the Other) */
@keyframes p3FlightMonarchToBadge {
  0%, 62% {
    opacity: 0;
    left: calc(100% - 30px);
    top: 68%;
    transform: translate(-50%, -50%) scale(0.2) rotate(10deg);
  }
  64% {
    opacity: 0.95;
    left: calc(100% - 30px);
    top: 68%;
    transform: translate(-50%, -50%) scale(0.85) rotate(-20deg);
  }
  68% {
    opacity: 1;
    left: calc(100% - 48px);
    top: 62%;
    transform: translate(-50%, -50%) scale(1.0) rotate(-45deg);
  }
  74% {
    opacity: 1;
    left: 54%;
    top: 48%;
    transform: translate(-50%, -50%) scale(1.06) rotate(15deg);
  }
  80% {
    opacity: 1;
    left: 28%;
    top: 38%;
    transform: translate(-50%, -50%) scale(1.1) rotate(80deg);
  }
  86% {
    opacity: 1;
    left: 36%;
    top: 24%;
    transform: translate(-50%, -50%) scale(1.05) rotate(-45deg);
  }
  91% {
    opacity: 1;
    left: 54px;
    top: 16px;
    transform: translate(-50%, -50%) scale(1.06) rotate(-10deg);
  }
  94% {
    opacity: 0.95;
    left: 56px;
    top: 15px;
    transform: translate(-50%, -50%) scale(1.0) rotate(15deg);
  }
  97% {
    opacity: 0.5;
    left: 52px;
    top: 9px;
    transform: translate(-50%, -50%) scale(0.7) rotate(-25deg);
  }
  99%, 100% {
    opacity: 0;
    left: 50px;
    top: 5px;
    transform: translate(-50%, -50%) scale(0.3);
  }
}

.p3-larva-1-anim {
  animation: p3Larva1Cycle 18s ease-in-out infinite;
  transform-origin: 18px 52px;
}
.p3-larva-2-anim {
  animation: p3Larva2Cycle 18s ease-in-out infinite;
  transform-origin: 17px 188px;
}
.p3-chrysalis-1-anim {
  animation: p3Chrysalis1Cycle 18s ease-in-out infinite;
  transform-origin: 18px 52px;
}
.p3-chrysalis-2-anim {
  animation: p3Chrysalis2Cycle 18s ease-in-out infinite;
  transform-origin: 17px 188px;
}
.p3-flying-butterfly-1 {
  animation: p3FlightSapphireToBadge 18s cubic-bezier(0.38, 0.04, 0.22, 1) infinite;
  transform-origin: center;
}
.p3-flying-butterfly-2 {
  animation: p3FlightMonarchToBadge 18s cubic-bezier(0.38, 0.04, 0.22, 1) infinite;
  transform-origin: center;
}
.p3-bf-wing-left {
  animation: p3BfWingFlapL 0.16s ease-in-out infinite;
  transform-origin: 0px 0px;
}
.p3-bf-wing-right {
  animation: p3BfWingFlapR 0.16s ease-in-out infinite;
  transform-origin: 0px 0px;
}
.p3-top4-badge {
  animation: p3Top4BadgeCelebration 18s ease-in-out infinite;
}
.p3-top4-glints-sapphire {
  animation: p3Top4GlintsSapphire 18s ease-in-out infinite;
}
.p3-top4-glints-monarch {
  animation: p3Top4GlintsMonarch 18s ease-in-out infinite;
}

/* --- AUTOMATIC ANIMATION FREEZE DURING VIDEO PLAYBACK FOR 100% SMOOTH FRAME RATE --- */
body.video-is-playing .p3-right-creeper,
body.video-is-playing .p3-right-creeper *,
body.video-is-playing .p3-breeze-leaf-1,
body.video-is-playing .p3-breeze-leaf-2,
body.video-is-playing .p3-breeze-leaf-3,
body.video-is-playing .p3-breeze-tendril-1,
body.video-is-playing .p3-breeze-tendril-2,
body.video-is-playing .p3-larva-1-anim,
body.video-is-playing .p3-larva-2-anim,
body.video-is-playing .p3-chrysalis-1-anim,
body.video-is-playing .p3-chrysalis-2-anim,
body.video-is-playing .p3-flying-butterfly-1,
body.video-is-playing .p3-flying-butterfly-2,
body.video-is-playing .p3-bf-wing-left,
body.video-is-playing .p3-bf-wing-right,
body.video-is-playing .p3-top4-badge,
body.video-is-playing .p3-top4-glints-sapphire,
body.video-is-playing .p3-top4-glints-monarch,
body.video-is-playing #p2-events-scroll-content,
body.video-is-playing .sparkle {
  animation-play-state: paused !important;
}

