@charset "UTF-8";

/**
 * Site 005: Mythical Labyrinth - Ancient Ruins Theme
 * Senior Front-end Designer: Antigravity
 * 
 * Design Philosophy:
 * - Immersive adventure game aesthetic
 * - Depth via gradients, shadows, and glassmorphism
 * - Fluid, magical animations
 * - Perfect print utility
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Cinzel:wght@700&display=swap');

:root {
  /* Color Palette - Ancient Forest & Mystical Runes */
  --color-bg: #020617;
  --color-surface: rgba(15, 23, 42, 0.7);
  --color-surface-brighter: rgba(30, 41, 59, 0.8);
  --color-primary: #10b981;
  /* Emerald */
  --color-primary-glow: rgba(16, 185, 129, 0.4);
  --color-accent: #f59e0b;
  /* Amber/Golden */
  --color-accent-glow: rgba(245, 158, 11, 0.4);
  --color-text-main: #f1f5f9;
  --color-text-muted: #94a3b8;

  /* Maze Specifics */
  --maze-wall: #1e293b;
  --maze-wall-top: #334155;
  --maze-path: #0f172a;
  --maze-stone-shadow: rgba(0, 0, 0, 0.5);

  /* Effects */
  --glass-blur: 12px;
  --glass-border: rgba(255, 255, 255, 0.08);
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Global Aesthetics
   ======================================== */

body {
  background: var(--color-bg);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.1) 0%, transparent 40%);
  background-color: var(--color-bg);
  background-attachment: fixed;
  position: relative;
  color: var(--color-text-main);
  font-family: 'Outfit', sans-serif;
  margin: 0;
  overflow-x: hidden;
}

/* Page Loader Animation */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}

.loader-content {
  text-align: center;
}

.loader-rune {
  width: 60px;
  height: 60px;
  border: 3px solid var(--color-primary);
  border-radius: 12px;
  margin: 0 auto 20px;
  position: relative;
  animation: rune-spin 2s infinite linear;
}

.loader-rune::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px solid var(--color-accent);
  border-radius: 4px;
  animation: rune-spin 1.5s infinite reverse linear;
}

@keyframes rune-spin {
  from {
    transform: rotate(0deg);
    box-shadow: 0 0 10px var(--color-primary-glow);
  }

  to {
    transform: rotate(360deg);
    box-shadow: 0 0 20px var(--color-primary-glow);
  }
}

.page-loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

/* ========================================
   Layout Overrides - Width Constraints
   ======================================== */
.maze-page,
.maze-home,
.maze-list,
.homepage.maze-home,
.list-page.maze-list,
main.maze-page,
main.maze-home,
main.maze-list {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 60px 20px;
  position: relative;
  animation: slide-up 0.8s ease-out;
  width: 100%;
  box-sizing: border-box;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Breadcrumbs */
.breadcrumb ol {
  display: flex;
  list-style: none;
  padding: 0;
  margin-bottom: 30px;
  gap: 10px;
  font-size: 0.9rem;
}

.breadcrumb li a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

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

.breadcrumb li::after {
  content: '/';
  margin-left: 10px;
  color: var(--color-text-muted);
}

.breadcrumb li:last-child::after {
  display: none;
}

.breadcrumb li[aria-current="page"] {
  color: var(--color-text-muted);
}

.labyrinth-decor {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100px;
  pointer-events: none;
  opacity: 0.1;
  background-size: contain;
  background-repeat: repeat-x;
}

.decorations--top {
  top: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='40' viewBox='0 0 100 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40 L50 10 L100 40' stroke='white' fill='none' stroke-width='1'/%3E%3C/svg%3E");
}

/* ========================================
   Typography & Headers
   ======================================== */
.page-header {
  text-align: center;
  margin-bottom: 50px;
}

.page-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 3.5rem;
  letter-spacing: 2px;
  background: linear-gradient(to bottom, #fff, var(--color-text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.page-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Category & Node Cards */
.categories-grid,
.nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin: 40px 0;
}

.category-card,
.node-card {
  background: var(--color-surface);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 25px;
  transition: var(--transition-smooth);
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover,
.node-card:hover {
  background: var(--color-surface-brighter);
  border-color: var(--color-primary);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.category-card h3,
.node-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--color-primary);
  margin-top: 0;
}

.category-card .card-header,
.node-card .card-header {
  margin-bottom: 15px;
}

.category-card .card-title,
.node-card .card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--color-primary);
  margin: 0;
}

.category-card .card-description,
.node-card .card-description {
  color: var(--color-text-muted);
  line-height: 1.7;
  margin: 15px 0;
}

.category-card .card-footer,
.node-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--glass-border);
}

.category-card .view-link,
.node-card .view-link {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.category-card .view-link::after,
.node-card .view-link::after {
  content: '→';
  font-size: 1.2rem;
  transition: var(--transition-smooth);
}

.category-card:hover .view-link::after,
.node-card:hover .view-link::after {
  transform: translateX(5px);
}

.subcategory-card {
  /* Inherit category-card styles */
}

/* Sections - Categories & Subcategories */
.categories,
.subcategories {
  margin-bottom: 60px;
}

.title-text {
  display: inline-block;
}

.difficulty-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid currentColor;
  background: rgba(0, 0, 0, 0.3);
}

.difficulty-badge.easy {
  color: #34d399;
}

.difficulty-badge.medium {
  color: #fbbf24;
}

.difficulty-badge.hard {
  color: #f87171;
}

.difficulty-badge.expert {
  color: #c084fc;
}

/* ========================================
   Action Area - Enhanced
   ======================================== */
.intro,
.subcategories,
.body-content {
  background: var(--color-surface) !important;
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 35px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.intro::before,
.subcategories::before,
.body-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-accent));
  box-shadow: 0 0 15px var(--color-primary-glow);
}

/* Magical Glow Effect for Intro */
.intro::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: intro-pulse 8s infinite ease-in-out;
}

@keyframes intro-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1) rotate(5deg);
  }
}

.info-label {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-primary);
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--color-primary);
  margin-bottom: 20px;
  box-shadow: 0 0 20px var(--color-primary-glow);
  position: relative;
  z-index: 1;
}

.intro p,
.body-content p {
  color: var(--color-text-main) !important;
  line-height: 1.8;
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
  background: transparent !important;
}

.intro h2,
.intro h3,
.body-content h2,
.body-content h3 {
  font-family: 'Cinzel', serif;
  color: var(--color-accent) !important;
  background: transparent !important;
  margin-top: 25px;
  margin-bottom: 15px;
}

.intro strong,
.body-content strong {
  color: var(--color-primary) !important;
  font-weight: 600;
  background: transparent !important;
}

/* ========================================
   Puzzle Selector - Mystical Grid
   ======================================== */
.set-switcher {
  background: var(--color-surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 30px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.set-switcher::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--color-primary), var(--color-accent), var(--color-primary));
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.set-switcher-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 25px;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 0 10px var(--color-accent-glow);
}

.set-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.set-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: var(--transition-smooth);
  cursor: pointer;
  overflow: hidden;
}

.set-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--color-primary-glow), transparent);
  opacity: 0;
  transition: var(--transition-smooth);
}

.set-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 25px var(--color-primary-glow);
}

.set-btn:hover::before {
  opacity: 0.3;
}

.set-btn.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow:
    0 0 30px var(--color-primary-glow),
    inset 0 0 20px rgba(16, 185, 129, 0.2);
  transform: scale(1.08);
}

.set-btn.active::before {
  opacity: 0.5;
}

.set-btn.active::after {
  content: '✦';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.9rem;
  color: var(--color-accent);
  text-shadow: 0 0 8px var(--color-accent-glow);
  animation: rune-twinkle 2s infinite ease-in-out;
}

@keyframes rune-twinkle {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(45deg);
  }
}

.actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 50px;
}

.btn {
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  border: 1px solid transparent;
}

.btn-print {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-print:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px var(--color-primary-glow);
}

.btn-answers,
.btn-refresh {
  background: var(--color-surface);
  color: var(--color-text-main);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
}

.btn-answers:hover,
.btn-refresh:hover {
  background: var(--color-surface-brighter);
  border-color: var(--color-primary);
  transform: translateY(-3px);
}

/* ========================================
   THE MAZE GRID - MASTERPIECE
   ======================================== */
.worksheet-content {
  background: transparent;
  padding: 0;
}

.maze-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  margin-top: 20px;
}

/* Large mazes: keep sidebar, scale maze down */

.maze-wrapper {
  background: var(--color-surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 2px solid var(--glass-border);
  border-radius: 32px;
  padding: 40px;
  display: flex;
  justify-content: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.game-container {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 80px);
  max-width: 600px;
  height: calc(100% - 80px);
  pointer-events: none;
  z-index: 10;
}

.player-token {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.player-core {
  width: 80%;
  height: 80%;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--color-primary);
  position: relative;
  z-index: 2;
}

.player-glow {
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
  animation: player-pulse 2s infinite ease-in-out;
  z-index: 1;
}

@keyframes player-pulse {

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

  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.maze-grid {
  display: grid;
  width: 100%;
  max-width: 600px;
  padding: 8px;
  background: #0f172a;
  border-radius: 12px;
  box-shadow: inset 0 0 20px black;
  gap: 0;
  border: 1px solid #334155;
}

/* Smaller cell font for large mazes */
.maze-grid[data-width="31"] .maze-cell,
.maze-grid[data-width="35"] .maze-cell {
  font-size: 0.6rem;
}

.maze-grid[data-width="41"] .maze-cell,
.maze-grid[data-width="51"] .maze-cell {
  font-size: 0.45rem;
}

.maze-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

/* Path Cells */
.maze-cell.path {
  background: var(--maze-path);
  background-image: radial-gradient(circle at center, #1e293b 0.5px, transparent 1px);
  background-size: 8px 8px;
}

.path-internal {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  pointer-events: none;
}

/* Wall Cells - 3D Carved Stone */
.maze-cell.wall {
  background: var(--maze-wall);
  box-shadow:
    inset 1px 1px 2px var(--maze-wall-top),
    inset -1px -1px 2px rgba(0, 0, 0, 0.4);
  position: relative;
  border-radius: 2px;
}

.maze-cell.wall::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 1px;
}

/* Start/End Markers */
.maze-cell.start,
.maze-cell.end {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.2rem;
  z-index: 2;
}

.maze-cell.start {
  color: var(--color-primary);
  text-shadow: 0 0 10px var(--color-primary-glow);
}

.maze-cell.end {
  color: var(--color-accent);
  text-shadow: 0 0 10px var(--color-accent-glow);
}

/* Solution Path Highlighting */
.maze-cell.solution-path {
  background: var(--color-primary) !important;
  box-shadow: 0 0 8px var(--color-primary-glow);
  position: relative;
}

.maze-cell.solution-path::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: rgba(16, 185, 129, 0.6);
  border-radius: 2px;
  animation: solution-glow 1.5s infinite ease-in-out;
}

@keyframes solution-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Brighter solution for large mazes */
.maze-grid[data-width="31"] .maze-cell.solution-path,
.maze-grid[data-width="35"] .maze-cell.solution-path,
.maze-grid[data-width="41"] .maze-cell.solution-path,
.maze-grid[data-width="51"] .maze-cell.solution-path {
  background: #10b981 !important;
  box-shadow: 0 0 4px #10b981;
}

.maze-grid[data-width="41"] .maze-cell.solution-path::before,
.maze-grid[data-width="51"] .maze-cell.solution-path::before {
  inset: 0;
}

/* Modal System */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: 32px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: scale(0.8) translateY(20px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 50px var(--color-primary-glow);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.success-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 30px 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
}

.success-stat .label {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.success-stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* Controls Guide */
.controls-guide {
  margin-bottom: 25px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.control-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.key {
  background: #334155;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 0 #1e293b;
}

.control-item .label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Sidebar & Info */
.maze-info {
  background: var(--color-surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 25px;
  height: fit-content;
}

.maze-info h3 {
  font-family: 'Cinzel', serif;
  color: var(--color-accent);
  margin-top: 0;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 15px;
}

.maze-info ul li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.puzzle-stats {
  margin-top: 25px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 15px;
}

.stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-label {
  color: var(--color-text-muted);
}

.stat-value {
  color: var(--color-primary);
  font-weight: 700;
}

/* Responsive & Interactive */
@media (max-width: 1024px) {
  .maze-container {
    grid-template-columns: 1fr;
  }

  .maze-page,
  .maze-home,
  .maze-list {
    padding: 40px 20px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .maze-wrapper {
    padding: 15px;
  }

  .game-container {
    top: 15px;
    width: calc(100% - 30px);
    height: calc(100% - 30px);
  }

  .maze-page,
  .maze-home,
  .maze-list {
    padding: 30px 15px;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }

  .set-buttons {
    grid-template-columns: repeat(5, 1fr);
  }

  .set-btn {
    height: 60px;
    font-size: 1.2rem;
  }
}

.maze-cell.path:hover {
  background: rgba(255, 255, 255, 0.05);
  cursor: crosshair;
}

/* ========================================
   PRINT STYLES - CRITICAL
   ======================================== */
/* ========================================
   HOMEPAGE & LIST PAGE STYLES
   ======================================== */

/* Hero Section - Homepage */
.hero {
  text-align: center;
  padding: 80px 40px;
  margin-bottom: 60px;
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.hero::before {
  content: '';
  position: absolute;
  inset: -100%;
  background:
    radial-gradient(circle at 30% 50%, rgba(16, 185, 129, 0.15), transparent 50%),
    radial-gradient(circle at 70% 50%, rgba(245, 158, 11, 0.15), transparent 50%);
  animation: hero-glow 10s infinite ease-in-out;
}

@keyframes hero-glow {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
}

.hero h1 {
  font-family: 'Cinzel', serif;
  font-size: 4rem;
  letter-spacing: 3px;
  background: linear-gradient(to bottom, #fff, var(--color-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 40px var(--color-primary-glow);
}

.hero .subtitle {
  font-size: 1.3rem;
  color: var(--color-text-muted);
  margin-bottom: 35px;
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-badges .badge {
  padding: 10px 24px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--color-primary);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hero-badges .badge:hover {
  background: rgba(16, 185, 129, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--color-primary-glow);
}

/* Category Grid - Enhanced */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin: 50px 0;
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  text-align: center;
  color: var(--color-accent);
  margin-bottom: 50px;
  letter-spacing: 2px;
  text-shadow: 0 0 20px var(--color-accent-glow);
}

/* Features Section */
.features {
  margin: 60px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature-card {
  background: var(--color-surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 35px;
  text-align: center;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.1), transparent);
  opacity: 0;
  transition: var(--transition-smooth);
}

.feature-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(245, 158, 11, 0.2));
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  font-size: 2.5rem;
  color: var(--color-primary);
  box-shadow: 0 0 30px var(--color-primary-glow);
  position: relative;
}

.feature-icon::after {
  content: '';
  position: absolute;
  inset: -10px;
  border: 1px solid var(--color-primary);
  border-radius: 50%;
  opacity: 0.3;
}

.feature-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--color-accent);
  margin-bottom: 15px;
}

.feature-card p {
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Worksheets Grid - List Page */
.worksheets {
  margin: 60px 0;
}

.worksheet-info {
  background: var(--color-surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 35px;
  text-align: center;
}

.worksheet-info p {
  color: var(--color-text-main);
  margin: 0;
  font-size: 1.05rem;
}

.worksheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.worksheet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px 20px;
  text-decoration: none;
  transition: var(--transition-smooth);
  min-height: 140px;
  position: relative;
  overflow: hidden;
}

.worksheet-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--color-primary-glow), transparent);
  opacity: 0;
  transition: var(--transition-smooth);
}

.worksheet-card:hover {
  border-color: var(--color-primary);
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 12px 30px var(--color-primary-glow);
}

.worksheet-card:hover::before {
  opacity: 0.3;
}

.worksheet-number {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 15px var(--color-primary-glow);
}

.worksheet-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  position: relative;
  z-index: 1;
}

.worksheet-card:hover .worksheet-label {
  color: var(--color-primary);
}

.worksheet-note {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(16, 185, 129, 0.15));
  border: 1px solid var(--color-accent);
  border-radius: 20px;
  padding: 25px 35px;
  text-align: center;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.2);
}

.worksheet-note p {
  color: var(--color-text-main);
  margin: 0;
  font-size: 1.05rem;
}

.worksheet-note strong {
  color: var(--color-accent);
  font-weight: 700;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .category-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }

  .worksheet-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .worksheet-number {
    font-size: 2rem;
  }
}

/* ========================================
   PRINT STYLES - CRITICAL
   ======================================== */
@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .no-print,
  .page-loader,
  .labyrinth-decor {
    display: none !important;
  }

  .maze-page {
    padding: 0;
    margin: 0;
  }

  .maze-wrapper {
    background: white !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .maze-grid {
    background: black !important;
    padding: 2px !important;
    border: 1px solid black !important;
    box-shadow: none !important;
  }

  .maze-cell {
    width: 0.25in !important;
    height: 0.25in !important;
    border: 1px solid #eee !important;
  }

  .maze-cell.path {
    background: white !important;
  }

  .maze-cell.wall {
    background: black !important;
    box-shadow: none !important;
  }

  .maze-cell.wall::after,
  .maze-cell::before {
    display: none !important;
  }

  .maze-cell.start,
  .maze-cell.end {
    color: black !important;
    text-shadow: none !important;
    border: 1px solid black !important;
  }

  .worksheet-header {
    display: flex !important;
    border-bottom: 1px solid black !important;
    margin-bottom: 20px !important;
  }

  .maze-info {
    border-top: 1px solid #ccc !important;
    margin-top: 20px !important;
    color: black !important;
    background: white !important;
  }
}