/* ==========================================================================
   SparkNest Academy - Physical Education Page Stylesheet
   ========================================================================== */

/* --- Custom Variables & Styling Tokens --- */
:root {
  --pe-primary: #10b981;
  /* Emerald Green */
  --pe-primary-light: #d1fae5;
  --pe-secondary: #0ea5e9;
  /* Sky Blue */
  --pe-secondary-light: #e0f2fe;
  --pe-accent: #f59e0b;
  /* Amber Gold */
  --pe-accent-light: #fef3c7;
  --pe-danger: #ef4444;
  /* Coral Red */

  /* Glassmorphism styling defaults */
  --pe-glass-bg: rgba(255, 255, 255, 0.75);
  --pe-glass-border: rgba(255, 255, 255, 0.5);
  --pe-glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
}

/* --- Base Customizations for PE Page --- */
.pe-body {
  background: #f0fdf4;
  /* Very light green playground base */
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  overflow-x: hidden;
}

/* --- Breadcrumbs --- */
.breadcrumb {
  margin: 20px 24px 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: #10b981;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--muted);
}

.bc-sep {
  color: #cbd5e1;
}

.bc-current {
  color: var(--muted);
}

/* --- Hero Section: Sports Adventure Playground --- */
.pe-hero {
  position: relative;
  background: linear-gradient(180deg, #38bdf8 0%, #075985 40%, #047857 70%, #065f46 100%);
  border-radius: 32px;
  /* margin: 16px 24px; */
  /* padding: 80px 48px; */
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(4, 120, 87, 0.15);
  color: #fff;
  z-index: 1;
}

/* Sky layers & Rainbow */
.pe-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
}

.pe-rainbow {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  border-radius: 300px 300px 0 0;
  border: 15px solid transparent;
  border-top-color: rgba(239, 68, 68, 0.4);
  box-sizing: border-box;
  opacity: 0.8;
  filter: blur(2px);
}

.pe-rainbow::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 300px 300px 0 0;
  border: 15px solid transparent;
  border-top-color: rgba(245, 158, 11, 0.4);
}

.pe-rainbow::after {
  content: '';
  position: absolute;
  top: -25px;
  left: -25px;
  right: -25px;
  bottom: -25px;
  border-radius: 300px 300px 0 0;
  border: 15px solid transparent;
  border-top-color: rgba(59, 130, 246, 0.4);
}

.pe-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 100px;
  filter: blur(1px);
}

.pe-cloud.c1 {
  width: 140px;
  height: 45px;
  top: 10%;
  left: 10%;
  animation: float-cloud 45s linear infinite;
}

.pe-cloud.c2 {
  width: 180px;
  height: 55px;
  top: 25%;
  right: 10%;
  animation: float-cloud 35s linear infinite reverse;
}

@keyframes float-cloud {
  0% {
    transform: translateX(-100px);
  }

  100% {
    transform: translateX(calc(100vw - 200px));
  }
}

.pe-kite {
  position: absolute;
  font-size: 2.2rem;
  top: 15%;
  left: 25%;
  animation: hover-kite 6s ease-in-out infinite alternate;
}

@keyframes hover-kite {
  0% {
    transform: translate(0, 0) rotate(5deg);
  }

  100% {
    transform: translate(30px, -20px) rotate(-10deg);
  }
}

.pe-butterfly {
  position: absolute;
  font-size: 1.4rem;
  animation: fly-butterfly 4s ease-in-out infinite alternate;
}

.pe-butterfly.b1 {
  bottom: 35%;
  left: 8%;
  animation-delay: 0.5s;
}

.pe-butterfly.b2 {
  bottom: 42%;
  right: 12%;
  animation-delay: 1.5s;
}

@keyframes fly-butterfly {
  0% {
    transform: translate(0, 0) scaleX(1);
  }

  50% {
    transform: translate(15px, -15px) scaleX(-1);
  }

  100% {
    transform: translate(-10px, -25px) scaleX(1);
  }
}

/* Floating Sports Props */
.pe-float-prop {
  position: absolute;
  font-size: 2.5rem;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
  z-index: 2;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pe-float-prop:hover {
  transform: scale(1.2);
}

.pe-ball-football {
  top: 20%;
  left: 15%;
  animation: float-bounce 5s ease-in-out infinite alternate;
}

.pe-ball-basketball {
  top: 35%;
  right: 20%;
  animation: float-spin 8s linear infinite;
}

.pe-prop-trophy {
  top: 12%;
  right: 35%;
  animation: float-bounce 6s ease-in-out 1s infinite alternate;
}

.pe-prop-whistle {
  bottom: 30%;
  left: 45%;
  animation: float-bounce 4s ease-in-out 0.5s infinite alternate;
}

.pe-prop-bottle {
  bottom: 20%;
  right: 30%;
  animation: float-bounce 7s ease-in-out 1.5s infinite alternate;
}

@keyframes float-bounce {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-20px);
  }
}

@keyframes float-spin {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-15px) rotate(180deg);
  }

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

/* Dynamic Click Animations (added via JS toggle) */
.click-bounce {
  animation: hit-bounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes hit-bounce {

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

  30% {
    transform: scale(0.8, 1.2) translateY(-40px);
  }

  50% {
    transform: scale(1.2, 0.8) translateY(10px);
  }

  70% {
    transform: scale(0.95, 1.05) translateY(-5px);
  }
}

.click-spin {
  animation: hit-spin 0.6s ease-out !important;
}

@keyframes hit-spin {
  0% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(360deg) scale(1.3);
  }

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

.click-sparkle {
  animation: hit-sparkle 0.8s ease-in-out !important;
}

@keyframes hit-sparkle {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.3);
    filter: brightness(1.7) drop-shadow(0 0 20px #fbbf24);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

/* Animated Children Characters (SVGs or Stylized Emojis with containers) */
.pe-hero-children {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 40px;
  position: relative;
  z-index: 2;
}

.pe-child-actor {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 3.8rem;
  position: relative;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  animation: child-idle 2s ease-in-out infinite alternate;
}

.pe-child-actor span {
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  margin-top: 10px;
  text-transform: uppercase;
}

.pe-child-actor.runner {
  animation: child-run 0.6s linear infinite alternate;
}

.pe-child-actor.jumper {
  animation: child-jump 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

.pe-child-actor.yogi {
  animation: child-yoga 4s ease-in-out infinite alternate;
}

@keyframes child-idle {
  0% {
    transform: translateY(0) scale(1);
  }

  100% {
    transform: translateY(-8px) scale(1.02);
  }
}

@keyframes child-run {
  0% {
    transform: translateY(0) rotate(-5deg);
  }

  100% {
    transform: translateY(-6px) rotate(5deg);
  }
}

@keyframes child-jump {

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

  40% {
    transform: translateY(-30px) scaleY(1.05);
  }

  70% {
    transform: translateY(5px) scaleY(0.9);
  }
}

@keyframes child-yoga {

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

  50% {
    transform: translateY(-4px) scale(1.03);
  }
}

/* Hero Content Area */
.pe-hero-content {
  max-width: 750px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 3;
}

.pe-hero-content .welcome-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 40px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.pe-hero-content h1 {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 12px;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  letter-spacing: -1px;
}

.pe-hero-content h1 span {
  color: #f59e0b;
  /* Golden accents */
}

.pe-hero-subtitle {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fef08a;
  /* soft gold */
  margin-bottom: 18px;
  letter-spacing: 2px;
}

.pe-hero-desc {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #f0fdf4;
  margin-bottom: 36px;
  font-weight: 500;
}

.pe-hero-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.pe-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 36px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
}

.pe-btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 10px 25px rgba(217, 119, 6, 0.4);
}

.pe-btn-primary:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.55);
}

.pe-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}

.pe-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-4px);
}

.pe-btn-accent {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

.pe-btn-accent:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 30px rgba(16, 185, 129, 0.55);
}

/* --- Section Layout Title --- */
.pe-section-heading {
  text-align: center;
  margin: 50px auto 30px;
  max-width: 800px;
}

.pe-section-heading h2 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}

.pe-section-heading p {
  font-size: 1.05rem;
  color: var(--muted);
}

/* --- Statistics Dashboard --- */
.pe-stats-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin: 0 24px 40px;
}

.pe-stat-card {
  background: var(--pe-glass-bg);
  border: 1px solid var(--pe-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 24px 18px;
  text-align: center;
  box-shadow: var(--pe-glass-shadow);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pe-stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.pe-stat-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.pe-stat-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--muted);
  line-height: 1;
}

.pe-stat-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

/* --- "What You'll Learn" Flip Cards --- */
.pe-learn-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin: 0 24px 40px;
}

.pe-learn-card {
  perspective: 1000px;
  height: 320px;
  cursor: pointer;
}

.pe-learn-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.pe-learn-card:hover .pe-learn-card-inner {
  transform: rotateY(180deg);
}

.pe-learn-card-front,
.pe-learn-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 24px;
  border: 1px solid var(--pe-glass-border);
  box-shadow: var(--pe-glass-shadow);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.pe-learn-card-front {
  background: var(--pe-glass-bg);
}

.pe-learn-card-back {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
  transform: rotateY(180deg);
  border-color: rgba(255, 255, 255, 0.25);
}

.pe-learn-ill {
  font-size: 4rem;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.pe-learn-card-front h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--muted);
}

.pe-learn-card-back h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 8px;
  width: 80%;
}

.pe-learn-topics {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pe-learn-topics li {
  font-size: 0.95rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* --- Explore Units (Lesson Cards) --- */
.pe-units-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 0 24px 50px;
}

.pe-unit-card {
  background: var(--pe-glass-bg);
  border: 1px solid var(--pe-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 30px 24px;
  box-shadow: var(--pe-glass-shadow);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.pe-unit-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 15px 35px rgba(16, 185, 129, 0.15);
}

/* Unit Badge/XP Indicator */
.pe-unit-xp {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #fef3c7;
  color: #d97706;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #fde68a;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pe-unit-badge {
  font-size: 3.5rem;
  margin: 15px 0;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s;
}

.pe-unit-card:hover .pe-unit-badge {
  transform: scale(1.15) rotate(5deg);
}

.pe-unit-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}

.pe-unit-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}

.pe-unit-status {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 16px;
  margin-top: auto;
}

.pe-unit-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.pe-unit-bar {
  width: 50%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.pe-unit-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 10px;
  width: 0;
  /* Animated dynamically */
  transition: width 1s ease-out;
}

.pe-unit-play-btn {
  width: 36px;
  height: 36px;
  background: #10b981;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

.pe-unit-card:hover .pe-unit-play-btn {
  transform: scale(1.1);
  background: #059669;
}

/* Completed unit styling */
.pe-unit-card.completed .pe-unit-bar-fill {
  background: #10b981;
}

.pe-unit-card.completed .pe-unit-play-btn {
  background: #059669;
}

/* --- Daily Challenge Section --- */
.pe-challenge-wrapper {
  margin: 0 24px 50px;
}

.pe-challenge-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 50%, #fef3c7 100%);
  border: 2px dashed #f59e0b;
  border-radius: 32px;
  padding: 48px;
  box-shadow: 0 15px 35px rgba(245, 158, 11, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  overflow: hidden;
}

.pe-challenge-card::before {
  content: '⚡';
  position: absolute;
  top: -20px;
  left: -20px;
  font-size: 8rem;
  opacity: 0.05;
  transform: rotate(-15deg);
}

.pe-challenge-left {
  display: flex;
  align-items: center;
  gap: 30px;
}

.pe-challenge-icon {
  font-size: 5rem;
  background: var(--card);
  width: 120px;
  height: 120px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
  border: 1px solid #fde68a;
  animation: sn-float 4s ease-in-out infinite alternate;
}

.pe-challenge-info h3 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}

.pe-challenge-info p {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 15px;
}

.pe-challenge-reward {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #fde68a;
  font-weight: 800;
  color: #d97706;
  font-size: 0.95rem;
}

.pe-challenge-right button {
  padding: 18px 45px;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 50px;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.35);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pe-challenge-right button:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.5);
}

/* --- Gamification & Badge Cabinet --- */
.pe-gamify-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  margin: 0 24px 50px;
}

.pe-gamify-card {
  background: var(--pe-glass-bg);
  border: 1px solid var(--pe-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 32px;
  padding: 36px;
  box-shadow: var(--pe-glass-shadow);
}

.pe-gamify-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.pe-gamify-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Badge Cabinet Layout */
.pe-badge-cabinet {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.pe-badge-slot {
  background: rgba(0, 0, 0, 0.02);
  border: 1.5px dashed rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: all 0.3s;
}

.pe-badge-icon {
  font-size: 3.2rem;
  filter: grayscale(1) opacity(0.4);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pe-badge-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
}

/* Unlocked badge states */
.pe-badge-slot.unlocked {
  background: var(--card);
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.05);
}

.pe-badge-slot.unlocked .pe-badge-icon {
  filter: grayscale(0) opacity(1) drop-shadow(0 6px 10px rgba(16, 185, 129, 0.15));
  animation: unlocked-shine 2s linear infinite;
}

.pe-badge-slot.unlocked .pe-badge-label {
  color: var(--muted);
}

@keyframes unlocked-shine {

  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(251, 191, 36, 0.4));
  }
}

/* Completion Meter Panel */
.pe-completion-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  height: 100%;
}

.pe-meter-svg {
  position: relative;
  width: 140px;
  height: 140px;
}

.pe-meter-circle-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 14;
}

.pe-meter-circle-fill {
  fill: none;
  stroke: url(#pe-green-gradient);
  stroke-width: 14;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
  /* Set via JS */
  transition: stroke-dashoffset 1s ease-out;
}

.pe-meter-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.pe-meter-val {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--muted);
  line-height: 1;
}

.pe-meter-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}

.pe-meter-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pe-meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.pe-meter-bullet {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.pe-bullet-completed {
  background: #10b981;
}

.pe-bullet-remaining {
  background: #cbd5e1;
}

/* --- Modals & Game Overlays --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.pe-modal-card {
  background: var(--card);
  border-radius: 32px;
  width: 90%;
  max-width: 650px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .pe-modal-card {
  transform: scale(1);
}

.pe-modal-header {
  background: linear-gradient(135deg, #10b981, #047857);
  padding: 24px 30px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pe-modal-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.pe-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.pe-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.pe-modal-body {
  padding: 40px 30px;
}

/* Modal Content Inner Formats */
.pe-game-screen {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.pe-game-illustration {
  font-size: 5rem;
  animation: sn-float 3s ease-in-out infinite alternate;
}

.pe-game-question {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.pe-game-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 15px;
}

.pe-game-opt-btn {
  padding: 16px 24px;
  border-radius: 18px;
  border: 2px solid #e2e8f0;
  background: var(--card);
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pe-game-opt-btn:hover {
  border-color: #10b981;
  background: #f0fdf4;
  color: var(--muted);
  transform: translateY(-2px);
}

/* Daily Challenge Modal Elements */
.pe-jumper-arena {
  background: #f0fdf4;
  border: 2px dashed #10b981;
  border-radius: 24px;
  padding: 30px;
  width: 100%;
  margin-bottom: 20px;
  position: relative;
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
}

.pe-jumper-actor {
  font-size: 5.5rem;
  transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: bottom center;
  z-index: 2;
}

.pe-jumper-actor.jump {
  animation: pe-jumper-jump-anim 0.4s ease-out;
}

@keyframes pe-jumper-jump-anim {

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

  40% {
    transform: translateY(-110px) scaleY(1.05);
  }

  75% {
    transform: translateY(0) scaleY(0.95);
  }
}

.pe-jumper-track {
  width: 100%;
  height: 12px;
  background: #10b981;
  border-radius: 5px;
  margin-top: 10px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.pe-jumper-score {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 10px;
}

.pe-jump-btn {
  padding: 16px 36px;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 50px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

.pe-jump-btn:hover {
  transform: translateY(-2px) scale(1.03);
}

.pe-jump-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

/* Confetti Burst Overlay */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ff0;
  border-radius: 50%;
  animation: confetti-fall 2.5s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-50px) rotate(0);
    opacity: 1;
  }

  100% {
    transform: translateY(400px) rotate(360deg);
    opacity: 0;
  }
}

/* Success Modal View */
.pe-success-view {
  text-align: center;
  padding: 20px 10px;
}

.pe-success-ill {
  font-size: 6.5rem;
  margin-bottom: 24px;
  animation: sn-float 3s ease-in-out infinite alternate;
}

.pe-success-view h3 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 10px;
}

.pe-success-view p {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.pe-success-rewards {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
}

.pe-success-reward-badge {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 12px 24px;
  border-radius: 20px;
  font-weight: 800;
  color: #10b981;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pe-success-action-btn {
  padding: 15px 40px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 50px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

/* --- Responsive Layout Adjustments --- */
@media (max-width: 1200px) {

  .pe-stats-container,
  .pe-learn-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pe-units-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .pe-hero {
    padding: 60px 24px;
  }

  .pe-hero-content h1 {
    font-size: 2.8rem;
  }

  .pe-hero-children {
    gap: 30px;
  }

  .pe-stats-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .pe-learn-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pe-units-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pe-challenge-card {
    flex-direction: column;
    text-align: center;
    padding: 30px;
  }

  .pe-challenge-left {
    flex-direction: column;
    gap: 20px;
  }

  .pe-gamify-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .pe-hero-content h1 {
    font-size: 2.2rem;
  }

  .pe-stats-container,
  .pe-learn-grid,
  .pe-units-grid {
    grid-template-columns: 1fr;
  }

  .pe-badge-cabinet {
    grid-template-columns: repeat(2, 1fr);
  }

  .pe-completion-panel {
    flex-direction: column;
    text-align: center;
  }
}


/* ==========================================================================
   Dark Theme Overrides
   ========================================================================== */
body[data-theme="dark"] .pe-body {
  background: #0b1512;
  /* Deep dark green tint */
  color: #cbd5e1;
}

body[data-theme="dark"] .pe-section-heading h2 {
  color: #34d399;
}

body[data-theme="dark"] .pe-section-heading p {
  color: #94a3b8;
}

body[data-theme="dark"] .pe-hero {
  background: linear-gradient(180deg, #022c22 0%, #064e3b 40%, #065f46 80%, #022c22 100%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .pe-rainbow {
  border-top-color: rgba(239, 68, 68, 0.2);
}

body[data-theme="dark"] .pe-rainbow::before {
  border-top-color: rgba(245, 158, 11, 0.2);
}

body[data-theme="dark"] .pe-rainbow::after {
  border-top-color: rgba(59, 130, 246, 0.2);
}

body[data-theme="dark"] .pe-cloud {
  background: rgba(255, 255, 255, 0.15);
}

body[data-theme="dark"] .pe-stat-card,
body[data-theme="dark"] .pe-learn-card-front,
body[data-theme="dark"] .pe-unit-card,
body[data-theme="dark"] .pe-gamify-card {
  background: rgba(17, 24, 39, 0.7);
  border-color: rgba(119, 137, 176, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .pe-stat-value {
  color: #34d399;
}

body[data-theme="dark"] .pe-stat-label {
  color: #94a3b8;
}

body[data-theme="dark"] .pe-learn-card-front h3 {
  color: #34d399;
}

body[data-theme="dark"] .pe-unit-title {
  color: #f8fafc;
}

body[data-theme="dark"] .pe-unit-subtitle {
  color: #94a3b8;
}

body[data-theme="dark"] .pe-unit-pct {
  color: #94a3b8;
}

body[data-theme="dark"] .pe-unit-bar {
  background: #1f2937;
}

body[data-theme="dark"] .pe-challenge-card {
  background: linear-gradient(135deg, #251c05 0%, #1e1b15 50%, #251c05 100%);
  border-color: #d97706;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .pe-challenge-icon {
  background: #1e1b15;
  border-color: #d97706;
}

body[data-theme="dark"] .pe-challenge-info h3 {
  color: #fcd34d;
}

body[data-theme="dark"] .pe-challenge-info p {
  color: #fbbf24;
}

body[data-theme="dark"] .pe-challenge-reward {
  background: #1e1b15;
  border-color: #d97706;
  color: #fbbf24;
}

body[data-theme="dark"] .pe-gamify-header h3 {
  color: #34d399;
}

body[data-theme="dark"] .pe-gamify-header {
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .pe-badge-slot {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .pe-badge-slot.unlocked {
  background: #111827;
  border-color: rgba(16, 185, 129, 0.35);
}

body[data-theme="dark"] .pe-badge-slot.unlocked .pe-badge-label {
  color: #34d399;
}

body[data-theme="dark"] .pe-meter-val {
  color: #34d399;
}

body[data-theme="dark"] .pe-meter-circle-bg {
  stroke: #1f2937;
}

body[data-theme="dark"] .pe-modal-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .pe-game-question {
  color: #f8fafc;
}

body[data-theme="dark"] .pe-game-opt-btn {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

body[data-theme="dark"] .pe-game-opt-btn:hover {
  background: #064e3b;
  border-color: #10b981;
  color: #fff;
}

body[data-theme="dark"] .pe-jumper-arena {
  background: #022c22;
  border-color: var(--muted);
}

body[data-theme="dark"] .pe-jumper-score {
  color: #34d399;
}

body[data-theme="dark"] .pe-success-view h3 {
  color: #34d399;
}

body[data-theme="dark"] .pe-success-view p {
  color: #cbd5e1;
}

body[data-theme="dark"] .pe-success-reward-badge {
  background: #022c22;
  border-color: var(--muted);
  color: #34d399;
}