/* Font locali per evitare dipendenze esterne */
@font-face {
  font-family: 'Fredoka';
  src: local('Arial Rounded MT Bold'), local('Arial Rounded'), local('Arial');
  font-weight: 600;
}

@font-face {
  font-family: 'Quicksand';
  src: local('Segoe UI'), local('Arial'), local('Helvetica');
  font-weight: 500;
}

:root {
  /* Palette "Lovable Pastel Pop" */
  --background: #fdfaf4;      /* Cream */
  --foreground: #2d1b5e;      /* Deep Ink */
  --card: #ffffff;
  --primary: #2d1b5e;
  --secondary: #fff9db;
  --accent: #f59e0b;          /* Orange */
  --border: #2d1b5e;
  --ink: #2d1b5e;
  --radius: 1.5rem;

  /* Section palette */
  --study: #63b3ed;           /* Blue */
  --study-soft: #ebf8ff;
  --games: #f6ad55;           /* Orange */
  --games-soft: #fffaf0;
  --custom: #f687b3;          /* Pink */
  --custom-soft: #fff5f7;
  --xp: #48bb78;              /* Green */
  --coin: #ecc94b;            /* Gold */
}

body.dark {
  --background: #1a103d;
  --foreground: #fdfaf4;
  --card: #2d1b5e;
  --border: #fdfaf4;
  --ink: #000000;
}

body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background: var(--background);
  background-image: 
    radial-gradient(circle at 10% 0%, var(--study-soft) 0%, transparent 40%), 
    radial-gradient(circle at 90% 10%, var(--games-soft) 0%, transparent 40%), 
    radial-gradient(circle at 50% 100%, var(--custom-soft) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--foreground);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* Stile "Toon" Globale */
.toon-card {
  background: var(--card);
  border: 3px solid var(--ink);
  box-shadow: 0 6px 0 0 var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.15s cubic-bezier(.34,1.56,.64,1), box-shadow 0.15s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.toon-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 0 var(--ink);
}

.toon-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 0 var(--ink);
}

.toon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border: 3px solid var(--ink);
  box-shadow: 0 5px 0 0 var(--ink);
  border-radius: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  text-decoration: none;
}

.toon-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 0 var(--ink); }
.toon-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 0 var(--ink); }

.toon-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--card);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 0 var(--ink);
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Utilities */
.text-stroke-ink {
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
}

.animate-float-slow {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}


/* Profile Section */
.profile-section {
  margin-bottom: 3rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.profile-card, .stats-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.avatar-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.avatar-container {
  position: relative;
}

.avatar-base {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.level-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.avatar-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.credits {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
}

.progress-section {
  margin-top: 1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.progress-bar {
  background: var(--panel-strong);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--accent), #818cf8);
  height: 100%;
  transition: width 0.3s ease;
}

/* Stats Card */
.stats-card h3 {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
}

.daily-stats {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.daily-stat {
  text-align: center;
  flex: 1;
}

.daily-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.daily-label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Footer */
.home-footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .hero-stats {
    gap: 2rem;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-grid {
    grid-template-columns: 1fr;
  }
  
  .daily-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .landing-nav {
    padding: 1rem 1rem;
  }

  .landing-nav > div {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
  }

  .landing-nav .toon-btn {
    min-width: 150px;
    width: 100%;
    max-width: 320px;
  }

  .landing-hero {
    padding: 4rem 1.2rem 3rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .hero-buttons .toon-btn {
    padding: 1rem 1.2rem;
  }

  .features-section,
  .how-section,
  .cta-section,
  .footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .features-header h2,
  .how-section h2,
  .cta-section h2 {
    font-size: 2rem;
  }

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

  .step-card,
  .feature-card {
    padding: 1.8rem;
  }

  .step-number {
    top: 0.5rem;
    left: 0.75rem;
    font-size: 3rem;
  }

  .hero-title,
  .hero-subtitle,
  .feature-card h3,
  .feature-card p,
  .cta-section p {
    max-width: 100%;
  }

  .cta-section .toon-btn {
    width: 100%;
    max-width: 100%;
  }

  .footer {
    padding: 1.5rem 1rem;
    font-size: 0.95rem;
  }
}

.brand-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(79, 70, 229, 0.14);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.14);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.profile-avatar {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(59, 130, 246, 0.16));
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.profile-name {
  display: inline-flex;
  color: var(--text);
  font-weight: 600;
  min-width: 4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link,
.theme-toggle {
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.theme-toggle {
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.nav-link:hover {
  background: rgba(79, 70, 229, 0.08);
}

body.dark .nav-link {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* SIDEBAR HAMBURGER MENU */
.hamburger-btn {
  display: none;
  border: none;
  background: transparent;
  color: var(--text);
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  cursor: pointer;
  z-index: 110;
  padding: 0.5rem;
  position: relative;
}

.hamburger-btn span {
  display: block;
  width: 1.5rem;
  height: 0.2rem;
  background: currentColor;
  margin: 0.35rem 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger-btn:hover {
  background: rgba(79, 70, 229, 0.08);
}

.sidebar {
  position: fixed;
  left: -280px;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #f9f9fb;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
  padding: 2rem 1.2rem;
  overflow-y: auto;
  z-index: 95;
  display: grid;
  gap: 1.5rem;
  align-content: start;
  transition: left 0.3s ease;
}

.sidebar.active {
  left: 0;
}

body.dark .sidebar {
  background: #1a1d2e;
  border-right: 1px solid rgba(148, 163, 184, 0.1);
}

/* Overlay quando il menu è aperto */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 90;
  pointer-events: none;
  transition: background 0.3s ease;
}

body.menu-open::after {
  background: rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

/* Stili Home Hero Centrale */
.home-hero {
  padding: 6rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.main-title {
  font-size: 6rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 8px;
  text-shadow: 4px 4px 0px var(--border);
}

.main-subtitle {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 4px;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .main-title {
    font-size: 3.5rem;
    text-shadow: 3px 3px 0px var(--border);
  }
}


.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centra il contenuto interno */
  text-align: center;
}

/* Griglie Centrate */
.tools-grid, .products-grid, .user-stats, .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
  justify-content: center;
}

/* Hero Section Centrata */
.hero-section, .shop-hero, .hero-card {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto 3rem;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 2.4rem;
  margin-bottom: 2rem;
}

.feature-card h2 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.feature-card p {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1rem;
  max-width: 46rem;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text);
  font-weight: 500;
}

.feature-list li::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent);
  font-size: 0.9rem;
}

.hero-card,
.stats-panel,
.activity-card,
.session-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  padding: 2.4rem;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(2.7rem, 4vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-card p {
  margin: 1.6rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 40rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-button,
.secondary-button {
  border: none;
  border-radius: 18px;
  padding: 1rem 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-button {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.18);
}

.hero-button:hover {
  transform: translateY(-1px);
}

.hero-button:disabled,
.secondary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.guest-note {
  padding: 1rem 1.2rem;
  border-radius: 22px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--text);
  border: 1px solid rgba(79, 70, 229, 0.14);
  font-size: 0.96rem;
}

.secondary-button {
  background: rgba(79, 70, 229, 0.08);
  color: var(--text);
}

.stats-panel {
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}

.stats-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.25rem 1.3rem;
  border-radius: 22px;
  background: rgba(79, 70, 229, 0.06);
  color: var(--text);
  min-height: 112px;
  display: grid;
  gap: 0.5rem;
}

.stat-card strong {
  font-size: 1.8rem;
  display: block;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.95rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.session-card,
.activity-card {
  padding: 1.8rem;
}

.session-card header,
.activity-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.session-card header h2,
.activity-card header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
}

.session-details {
  display: grid;
  gap: 1rem;
}

.session-item {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.session-item strong {
  color: var(--text);
}

.progress-bar {
  width: 100%;
  height: 0.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 68%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #818cf8);
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.activity-item {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: 22px;
  background: rgba(79, 70, 229, 0.05);
}

.activity-item strong {
  margin: 0;
  font-size: 1rem;
}

.activity-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.quick-item {
  padding: 1.4rem;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.quick-item h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.quick-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.5rem 2rem;
  border-radius: 28px;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.14);
}

.home-footer p,
.home-footer a {
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

.home-footer a {
  color: var(--accent);
  text-decoration: none;
}

.home-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 1110px) {
  .hero-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 1.5rem 1rem 2rem;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-card,
  .stats-panel,
  .session-card,
  .activity-card,
  .quick-item,
  .home-footer {
    border-radius: 24px;
  }

  .hero-card {
    padding: 1.8rem;
  }

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

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Minigame Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 900px;
  max-height: 85vh;
  width: 90%;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
}

.modal-body {
  padding: 2rem 2.4rem;
  overflow-y: auto;
  max-height: calc(85vh - 120px);
}

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

.minigame-item {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.minigame-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.minigame-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.16), rgba(59, 130, 246, 0.16));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent);
}

.minigame-item h3 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  color: var(--text);
}

.minigame-item p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.play-button {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
}

/* Game Container Styles */
.game-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

.game-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.back-button {
  background: rgba(79, 70, 229, 0.1);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.back-button:hover {
  background: rgba(79, 70, 229, 0.2);
}

.game-info {
  display: flex;
  align-items: center;
  gap: 2rem;
}

#gameTitle {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.game-stats {
  display: flex;
  gap: 1.5rem;
}

.game-stats span {
  color: var(--muted);
  font-weight: 600;
}

.game-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: auto;
}

/* Memory Game Styles */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 100px);
  gap: 1rem;
  max-width: 500px;
}

.memory-card {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
}

.memory-card:hover {
  transform: scale(1.05);
}

.memory-card.flipped {
  background: var(--panel-strong);
  color: var(--text);
  border: 2px solid var(--border);
}

.memory-card.matched {
  background: linear-gradient(135deg, #10b981, #34d399);
  animation: matchPulse 0.6s ease;
}

@keyframes matchPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .minigame-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-header,
  .modal-body {
    padding: 1.5rem;
  }
  
  .game-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .game-info {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .memory-grid {
    grid-template-columns: repeat(3, 80px);
    gap: 0.75rem;
  }
  
  .memory-card {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
  }
}
