/* ============================================================
   SOFIA 6-8 ANNI — CSS Completo
   Palette: blu-notte, bosco, caldo
   ============================================================ */

/* ---- RESET & VARIABLES ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --blu-notte: #1B2A4A;
  --blu: #2C5F8A;
  --verde-bosco: #2A5C3F;
  --arancione: #D4663A;
  --giallo: #E8B830;
  --azzurro: #5BA4C9;
  --rosa-antico: #C47A6E;
  --salvia: #7A8B6F;
  --grigio: #3A3A3A;
  --crema: #FDF8F0;
  --bg-blu: #EEF3F8;
  --bg-arancione: #FDF3EF;
  --bianco: #FFFFFF;
  --font-title: 'Baloo 2', cursive;
  --font-body: 'Quicksand', sans-serif;
  --font-accent: 'Fredoka', sans-serif;
  --nav-height: 64px;
  --successo: #4CAF50;
  --errore: #D4663A;
  --stella: #E8B830;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--crema);
  color: var(--grigio);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.6;
}

/* ---- NAVIGATION ---- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(253,248,240,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(122,139,111,0.12);
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-height); transition: box-shadow 0.3s;
}
.site-nav.scrolled { box-shadow: 0 2px 20px rgba(27,42,74,0.1); }

.nav-logo {
  font-family: var(--font-title);
  font-size: 1.3rem; color: var(--blu-notte);
  text-decoration: none; display: flex; align-items: center; gap: 0.5rem;
}
.nav-logo span { color: var(--arancione); }
.nav-logo-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blu-notte); color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 1.1rem;
}

.nav-links {
  list-style: none; display: flex; gap: 1.5rem; align-items: center;
}
.nav-links a {
  text-decoration: none; color: var(--salvia);
  font-weight: 500; font-size: 0.9rem; transition: color 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--arancione); }

.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-hamburger span {
  width: 24px; height: 2px; background: var(--blu-notte);
  transition: all 0.3s; border-radius: 2px;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -280px;
    width: 280px; height: 100vh;
    background: var(--crema); flex-direction: column;
    padding: 5rem 2rem 2rem; gap: 1.5rem;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .nav-links.open { right: 0; }
  .nav-links a { font-size: 1.1rem; }
}

/* ---- HERO ---- */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-blu) 0%, var(--crema) 50%, var(--bg-arancione) 100%);
  padding: calc(var(--nav-height) + 2rem) 2rem 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -30%;
  width: 80vw; height: 80vw;
  background: radial-gradient(circle, rgba(44,95,138,0.06) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content {
  display: flex; align-items: center; gap: 4rem;
  max-width: 1100px; z-index: 1; width: 100%;
}
.hero-cover {
  flex-shrink: 0; width: 320px; height: 320px;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(27,42,74,0.2), 0 8px 20px rgba(0,0,0,0.1);
  transform: rotate(-3deg); transition: transform 0.5s;
}
.hero-cover:hover { transform: rotate(0deg) scale(1.03); }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }

.hero-text h1 {
  font-family: var(--font-title);
  font-size: clamp(2.3rem, 4.5vw, 3.2rem); color: var(--blu-notte);
  line-height: 1.1; margin-bottom: 0.5rem;
}
.hero-text h1 span { display: block; font-size: 0.55em; color: var(--blu); }
.hero-text .collana {
  font-family: var(--font-accent);
  color: var(--arancione); font-size: 1rem;
  letter-spacing: 1px; margin-bottom: 1rem;
}
.hero-text p {
  font-size: 1.15rem; color: var(--salvia);
  max-width: 500px; line-height: 1.7; margin-bottom: 2rem;
}
.badge {
  display: inline-block; background: var(--arancione); color: white;
  padding: 0.4rem 1.2rem; border-radius: 20px;
  font-family: var(--font-accent); font-size: 0.9rem;
  margin-right: 0.5rem; margin-bottom: 0.5rem;
}
.badge.blue { background: var(--blu); }

.perline { display: flex; gap: 8px; margin: 1.5rem 0; }
.perline .p {
  width: 10px; height: 10px; border-radius: 50%;
  animation: float 3s ease-in-out infinite;
}
.perline .p:nth-child(1) { background: var(--arancione); animation-delay: 0s; }
.perline .p:nth-child(2) { background: var(--azzurro); animation-delay: 0.3s; }
.perline .p:nth-child(3) { background: var(--verde-bosco); animation-delay: 0.6s; }
.perline .p:nth-child(4) { background: var(--giallo); animation-delay: 0.9s; }
.perline .p:nth-child(5) { background: var(--rosa-antico); animation-delay: 1.2s; }
.perline .p:nth-child(6) { background: var(--blu); animation-delay: 1.5s; }
.perline .p:nth-child(7) { background: var(--azzurro); animation-delay: 1.8s; }

@media (max-width: 768px) {
  .hero-content { flex-direction: column; text-align: center; gap: 2rem; }
  .hero-cover { width: 240px; height: 240px; }
  .perline { justify-content: center; }
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 2rem; border-radius: 30px;
  font-family: var(--font-accent); font-size: 1.1rem;
  text-decoration: none; color: white;
  background: var(--blu-notte);
  box-shadow: 0 4px 15px rgba(27,42,74,0.3);
  transition: all 0.3s; cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(27,42,74,0.4); }
.btn-orange, .btn.orange { background: var(--arancione); box-shadow: 0 4px 15px rgba(212,102,58,0.3); }
.btn-orange:hover, .btn.orange:hover { box-shadow: 0 6px 20px rgba(212,102,58,0.4); }
.btn-primary { background: var(--blu-notte); }
.btn-secondary { background: transparent; color: var(--blu-notte); border: 2px solid var(--blu-notte); box-shadow: none; }
.btn-secondary:hover { background: var(--blu-notte); color: white; }

/* ---- SECTIONS ---- */
section { padding: 5rem 2rem; }
.container { max-width: 1100px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 2.5rem); color: var(--blu-notte);
}
.section-title p { font-size: 1.1rem; color: var(--salvia); margin-top: 0.5rem; }

/* ---- PAGE HEADER ---- */
.page-header {
  padding: calc(var(--nav-height) + 2rem) 2rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-blu) 0%, var(--crema) 100%);
}
.page-header h1 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 2.8rem); color: var(--blu-notte);
  margin-bottom: 0.5rem;
}
.page-subtitle {
  font-size: 1.1rem; color: var(--salvia); max-width: 600px;
  margin: 0 auto; line-height: 1.6;
}

/* ---- CHAPTER CARDS (La storia) ---- */
#storia { background: var(--bg-blu); }
.story-container { max-width: 800px; margin: 0 auto; }
.chapter-card {
  background: white; border-radius: 16px; margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05); overflow: hidden; transition: all 0.3s;
}
.chapter-card:hover { box-shadow: 0 4px 20px rgba(27,42,74,0.1); }
.chapter-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.2rem 1.5rem; cursor: pointer;
  user-select: none; transition: background 0.3s;
}
.chapter-header:hover { background: rgba(91,164,201,0.06); }
.chapter-num {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 1.1rem;
  color: white; flex-shrink: 0;
}
.chapter-card:nth-child(12n+1) .chapter-num { background: var(--blu-notte); }
.chapter-card:nth-child(12n+2) .chapter-num { background: var(--arancione); }
.chapter-card:nth-child(12n+3) .chapter-num { background: var(--verde-bosco); }
.chapter-card:nth-child(12n+4) .chapter-num { background: var(--azzurro); }
.chapter-card:nth-child(12n+5) .chapter-num { background: var(--rosa-antico); }
.chapter-card:nth-child(12n+6) .chapter-num { background: var(--blu); }
.chapter-card:nth-child(12n+7) .chapter-num { background: var(--giallo); }
.chapter-card:nth-child(12n+8) .chapter-num { background: var(--blu-notte); }
.chapter-card:nth-child(12n+9) .chapter-num { background: var(--arancione); }
.chapter-card:nth-child(12n+10) .chapter-num { background: var(--verde-bosco); }
.chapter-card:nth-child(12n+11) .chapter-num { background: var(--azzurro); }
.chapter-card:nth-child(12n+12) .chapter-num { background: var(--rosa-antico); }

.chapter-header h3 {
  font-family: var(--font-title); font-size: 1.1rem;
  color: var(--blu-notte); flex: 1;
}
.chapter-toggle { font-size: 1.3rem; color: var(--salvia); transition: transform 0.3s; flex-shrink: 0; }
.chapter-card.open .chapter-toggle { transform: rotate(180deg); }
.chapter-body { max-height: 0; overflow: hidden; transition: max-height 0.5s ease; }
.chapter-card.open .chapter-body { max-height: 800px; }
.chapter-inner {
  padding: 0 1.5rem 1.5rem; display: flex;
  gap: 1.5rem; align-items: flex-start;
}
.chapter-inner img {
  width: 140px; height: 140px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.chapter-inner p { font-size: 1.05rem; line-height: 1.8; color: var(--grigio); }

@media (max-width: 768px) {
  .chapter-inner { flex-direction: column; align-items: center; text-align: center; }
  .chapter-inner img { width: 100%; max-width: 280px; height: auto; aspect-ratio: 1; }
}

/* ---- GAME CARDS ---- */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem; max-width: 1100px; margin: 0 auto;
}
.game-card {
  background: var(--bianco); border-radius: 20px;
  overflow: hidden; border: 2px solid transparent;
  box-shadow: 0 4px 20px rgba(27,42,74,0.08);
  transition: all 0.4s; display: flex; flex-direction: column;
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(27,42,74,0.15); }
.game-card-image {
  width: 100%; height: 200px; object-fit: cover;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.game-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.game-card-level {
  display: inline-block; padding: 0.3rem 1rem; border-radius: 15px;
  font-family: var(--font-accent); font-size: 0.8rem; color: white;
  margin-bottom: 0.8rem; width: fit-content;
}
.level-1 { background: var(--blu); }
.level-2 { background: var(--azzurro); }
.level-3 { background: var(--arancione); }
.level-4 { background: var(--rosa-antico); }
.level-5 { background: var(--verde-bosco); }

.game-card-body h3 {
  font-family: var(--font-title); font-size: 1.2rem;
  color: var(--blu-notte); margin-bottom: 0.5rem;
}
.game-card-body p { font-size: 0.95rem; color: var(--salvia); line-height: 1.6; flex: 1; }
.game-badge-preview {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.8rem; font-size: 0.85rem; color: var(--salvia);
}
.badge-icon { font-size: 1.2rem; }
.game-action-area { margin-top: 1rem; }

.card-counter {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--salvia); margin-top: 0.5rem; opacity: 0.7;
}

/* ---- PROGRESS MAP ---- */
.progress-map {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; flex-wrap: wrap; padding: 1.5rem; margin: 1rem auto;
  max-width: 600px;
}

/* ---- UPLOAD AREA ---- */
.upload-area {
  max-width: 600px; margin: 0 auto 2rem;
  padding: 1.5rem; border: 2px dashed rgba(27,42,74,0.2);
  border-radius: 16px; text-align: center;
  background: rgba(27,42,74,0.02);
}
.upload-area h3 { font-family: var(--font-title); color: var(--blu-notte); font-size: 1.1rem; margin-bottom: 0.5rem; }
.upload-area p { font-size: 0.9rem; color: var(--salvia); margin-bottom: 1rem; }

/* ---- TEACHER CARDS ---- */
#insegnanti { background: white; }
.teacher-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem; max-width: 1100px; margin: 0 auto;
}
.teacher-card {
  background: var(--crema); border-radius: 16px; padding: 2rem;
  border-left: 4px solid var(--blu-notte); transition: all 0.3s;
}
.teacher-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.teacher-card.arancione { border-left-color: var(--arancione); }
.teacher-card.azzurro { border-left-color: var(--azzurro); }
.teacher-card.verde { border-left-color: var(--verde-bosco); }
.teacher-card.rosa { border-left-color: var(--rosa-antico); }
.teacher-card.giallo { border-left-color: var(--giallo); }
.teacher-card h3 { font-family: var(--font-title); font-size: 1.2rem; color: var(--blu-notte); margin-bottom: 0.5rem; }
.teacher-card.arancione h3 { color: var(--arancione); }
.teacher-card.azzurro h3 { color: var(--azzurro); }
.teacher-card.verde h3 { color: var(--verde-bosco); }
.teacher-card.rosa h3 { color: var(--rosa-antico); }
.teacher-card.giallo h3 { color: var(--giallo); }
.teacher-card p { font-size: 0.95rem; line-height: 1.7; color: var(--grigio); }
.teacher-card .tag {
  display: inline-block; padding: 0.2rem 0.7rem; border-radius: 12px;
  font-size: 0.75rem; font-family: var(--font-accent);
  background: var(--bg-blu); color: var(--blu); margin-top: 1rem;
}

.pedagogy-box {
  max-width: 800px; margin: 3rem auto 0;
  background: var(--bg-blu); border-radius: 20px; padding: 2.5rem; text-align: center;
}
.pedagogy-box blockquote { font-size: 1.2rem; color: var(--blu); font-style: italic; line-height: 1.7; margin-bottom: 1rem; }
.pedagogy-box cite { font-size: 0.9rem; color: var(--salvia); font-style: normal; }

/* ---- TRILOGIA ---- */
#trilogia {
  background: linear-gradient(135deg, var(--blu-notte) 0%, #0F1A30 100%);
  color: white;
}
#trilogia .section-title h2 { color: white; }
#trilogia .section-title p { color: rgba(255,255,255,0.7); }
.trilogy-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2rem; max-width: 900px; margin: 0 auto;
}
.trilogy-card {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; padding: 2rem; text-align: center; transition: all 0.3s;
}
.trilogy-card:hover { background: rgba(255,255,255,0.12); transform: translateY(-5px); }
.trilogy-card.active {
  background: rgba(255,255,255,0.15); border-color: var(--giallo);
  box-shadow: 0 0 30px rgba(232,184,48,0.15);
}
.trilogy-card .age {
  display: inline-block; padding: 0.3rem 1rem; border-radius: 15px;
  font-family: var(--font-accent); font-size: 0.85rem; margin-bottom: 1rem;
}
.trilogy-card.active .age { background: var(--arancione); }
.trilogy-card:not(.active) .age { background: rgba(255,255,255,0.15); }
.trilogy-card h3 { font-family: var(--font-title); font-size: 1.3rem; margin-bottom: 0.5rem; }
.trilogy-card p { font-size: 0.9rem; opacity: 0.8; line-height: 1.6; }
.trilogy-card a { color: inherit; text-decoration: none; }
.coming-soon {
  display: inline-block; margin-top: 0.8rem;
  padding: 0.2rem 0.8rem; border-radius: 10px;
  font-size: 0.75rem; font-family: var(--font-accent);
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
  .trilogy-grid { grid-template-columns: 1fr; max-width: 400px; }
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--grigio); color: rgba(255,255,255,0.6);
  padding: 2.5rem 2rem 1.5rem; position: relative;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--arancione), var(--giallo), var(--azzurro), var(--verde-bosco), var(--rosa-antico));
}
.footer-content { max-width: 1100px; margin: 0 auto; text-align: center; }
.footer-content p { margin-bottom: 0.3rem; font-size: 0.85rem; }
.footer-content a { color: var(--giallo); text-decoration: none; }
.footer-content strong { color: white; }

.visit-counter {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 0 4px 0; margin-top: 16px;
  font-size: 0.82rem; color: rgba(255,255,255,0.45);
}
.visit-counter-text strong { color: rgba(255,255,255,0.65); font-weight: 700; }
.attestati-counter {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 4px 0; font-size: 0.82rem; color: rgba(255,255,255,0.45);
}
.attestati-counter strong { color: rgba(255,255,255,0.65); font-weight: 700; }

/* ---- GAME SPECIFIC ---- */
.game-container { max-width: 800px; margin: 0 auto; padding: 2rem; }
.game-area {
  background: var(--bianco); border-radius: 20px;
  padding: 2rem; box-shadow: 0 4px 20px rgba(27,42,74,0.08);
}
.check-btn {
  display: inline-block; padding: 0.7rem 2rem;
  border-radius: 30px; border: none;
  background: var(--blu); color: white;
  font-family: var(--font-accent); font-size: 1rem;
  cursor: pointer; transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(44,95,138,0.3);
}
.check-btn:hover { background: var(--blu-notte); transform: translateY(-2px); }

/* ---- HOW IT WORKS ---- */
.how-it-works {
  max-width: 700px; margin: 2rem auto 0;
  background: var(--bg-blu); border-radius: 20px; padding: 2rem;
}
.how-it-works h3 { font-family: var(--font-title); color: var(--blu-notte); font-size: 1.2rem; margin-bottom: 1rem; text-align: center; }
.how-step {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 1rem; font-size: 0.95rem; color: var(--grigio);
}
.how-step-num {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--blu-notte); color: white; font-family: var(--font-accent);
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}

/* ---- GIOCHI INTERATTIVI ---- */
#giochi { background: var(--bg-arancione); }

.games-tabs {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem;
  margin-bottom: 2.5rem;
}
.game-tab {
  padding: 0.7rem 1.5rem; border-radius: 30px;
  border: 2px solid var(--blu); background: white; color: var(--blu);
  font-family: var(--font-accent); font-size: 0.95rem;
  cursor: pointer; transition: all 0.3s;
}
.game-tab:hover { background: var(--bg-blu); }
.game-tab.active { background: var(--blu-notte); color: white; border-color: var(--blu-notte); }

.game-panel {
  display: none; max-width: 900px; margin: 0 auto;
  background: white; border-radius: 20px; padding: 2.5rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.game-panel.active { display: block; }
.game-panel h3 { font-family: var(--font-title); color: var(--blu-notte); font-size: 1.5rem; margin-bottom: 0.5rem; }
.game-panel .game-desc { color: var(--salvia); margin-bottom: 2rem; font-size: 1rem; line-height: 1.6; }

/* Crossword */
.crossword-container { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.crossword-grid { display: inline-block; border: 2px solid var(--blu-notte); border-radius: 8px; overflow: hidden; }
.crossword-row { display: flex; }
.crossword-cell {
  width: 40px; height: 40px; border: 1px solid #ddd;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.crossword-cell.empty { background: var(--blu-notte); }
.crossword-cell input {
  width: 100%; height: 100%; border: none; text-align: center;
  font-family: var(--font-accent); font-size: 1.1rem; color: var(--blu-notte);
  text-transform: uppercase; background: transparent; outline: none;
}
.crossword-cell input:focus { background: rgba(91,164,201,0.15); }
.crossword-cell .cell-number {
  position: absolute; top: 1px; left: 3px;
  font-size: 0.55rem; color: var(--salvia); font-family: var(--font-accent); pointer-events: none;
}
.crossword-cell.correct input { background: rgba(42,92,63,0.15); color: var(--verde-bosco); }
.crossword-cell.wrong input { background: rgba(212,102,58,0.15); color: var(--arancione); }
.crossword-clues { max-width: 500px; width: 100%; }
.crossword-clues h4 { font-family: var(--font-title); color: var(--blu); margin-bottom: 0.8rem; font-size: 1.1rem; }
.crossword-clues ol { padding-left: 1.5rem; }
.crossword-clues li { margin-bottom: 0.4rem; font-size: 0.95rem; color: var(--grigio); line-height: 1.5; }

/* Word Search */
.wordsearch-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; }
.ws-grid-wrap { overflow-x: auto; }
.ws-grid { display: inline-grid; gap: 0; user-select: none; -webkit-user-select: none; }
.ws-cell {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-accent); font-size: 0.95rem; color: var(--blu-notte);
  cursor: pointer; border-radius: 4px; transition: all 0.15s;
}
.ws-cell:hover { background: rgba(91,164,201,0.15); }
.ws-cell.selecting { background: rgba(232,184,48,0.3); }
.ws-cell.found { background: var(--azzurro); color: white; }
.ws-words { min-width: 180px; }
.ws-words h4 { font-family: var(--font-title); color: var(--blu); margin-bottom: 0.8rem; font-size: 1.1rem; }
.ws-words ul { list-style: none; }
.ws-words li {
  padding: 0.3rem 0.8rem; margin-bottom: 0.3rem;
  font-family: var(--font-accent); font-size: 0.95rem; color: var(--grigio);
  border-radius: 8px; transition: all 0.3s;
}
.ws-words li.found { text-decoration: line-through; color: var(--verde-bosco); background: rgba(42,92,63,0.08); }
.ws-counter { text-align: center; margin-top: 1rem; font-family: var(--font-accent); color: var(--blu); font-size: 1.1rem; }

/* Anagrams */
.anagram-container { display: flex; flex-direction: column; gap: 2rem; }
.anagram-item { background: var(--crema); border-radius: 16px; padding: 1.5rem; text-align: center; }
.anagram-item h4 { font-family: var(--font-accent); color: var(--salvia); font-size: 0.9rem; margin-bottom: 1rem; }
.anagram-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 52px; }
.anagram-tile {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  background: white; border: 2px solid var(--blu); border-radius: 10px;
  font-family: var(--font-title); font-size: 1.2rem; color: var(--blu-notte);
  cursor: grab; user-select: none; -webkit-user-select: none; transition: all 0.2s;
}
.anagram-tile:hover { transform: scale(1.1); border-color: var(--arancione); }
.anagram-tile.dragging { opacity: 0.5; }
.anagram-item.solved .anagram-tile { background: var(--verde-bosco); color: white; border-color: var(--verde-bosco); cursor: default; }
.anagram-result { font-family: var(--font-accent); font-size: 0.9rem; color: var(--verde-bosco); margin-top: 0.8rem; min-height: 1.2rem; }

/* Secret Message */
.secret-container { text-align: center; }
.secret-text {
  font-size: 1.4rem; line-height: 2.5; color: var(--blu-notte);
  font-family: var(--font-accent); max-width: 700px; margin: 0 auto 2rem;
}
.secret-text select {
  padding: 0.4rem 0.8rem; border: 2px solid var(--azzurro); border-radius: 10px;
  font-family: var(--font-accent); font-size: 1.1rem; color: var(--blu-notte);
  background: white; cursor: pointer; transition: all 0.3s; appearance: auto;
}
.secret-text select:focus { border-color: var(--arancione); outline: none; }
.secret-text select.correct { border-color: var(--verde-bosco); background: rgba(42,92,63,0.08); }
.secret-text select.wrong { border-color: var(--arancione); background: rgba(212,102,58,0.08); }

.celebration {
  display: none; text-align: center; padding: 2rem;
  font-family: var(--font-title); font-size: 1.5rem; color: var(--verde-bosco);
}
.celebration.show { display: block; animation: celebPulse 0.6s ease; }

/* Confetti */
.confetti-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -20px; width: 10px; height: 10px;
  border-radius: 2px; animation: confettiFall linear forwards;
}

@media (max-width: 768px) {
  .game-panel { padding: 1.5rem; }
  .crossword-cell { width: 32px; height: 32px; }
  .crossword-cell input { font-size: 0.9rem; }
  .ws-cell { width: 28px; height: 28px; font-size: 0.8rem; }
  .anagram-tile { width: 36px; height: 36px; font-size: 1rem; }
  .secret-text { font-size: 1.1rem; }
}

/* ---- ANIMATIONS ---- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes celebPulse {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.fade-in { opacity: 0; transform: translateY(20px); transition: all 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .game-card-image { height: 150px; }
  .game-container { padding: 1rem; }
  .game-area { padding: 1.5rem; }
  section { padding: 3rem 1rem; }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--crema); }
::-webkit-scrollbar-thumb { background: var(--azzurro); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--arancione); }
