/* ==========================================================================
   CSS PRINCIPALE - GIOCO MATEMATICO 3D (MATEMATICANDO)
   ========================================================================== */

:root {
  /* Tavolozza Colori HSL - Tema Aurora Boreale */
  --bg-color-1: #051417;
  --bg-color-2: #0a3137;
  --bg-color-3: #12555c;
  
  --text-primary: #ffffff;
  --text-muted: #94a3b8;
  
  --panel-bg: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-shadow: rgba(0, 0, 0, 0.4);
  
  /* Colori di Stato */
  --color-success: #1dd1a1;
  --color-error: #ff6b6b;
  --color-warning: #feca57;
  --color-accent: #54a0ff;
  
  /* Variabile di controllo per i cubi 3D (aggiornata via JS) */
  --cube-size: 65px;
  
  /* Gradients per i Numeri da 1 a 10 (3D Glossy Palette) */
  --grad-num-1: linear-gradient(to bottom, #ff5e97, #e01e5a); /* Pink */
  --grad-num-2: linear-gradient(to bottom, #4fc3f7, #0288d1); /* Light Blue */
  --grad-num-3: linear-gradient(to bottom, #81c784, #388e3c); /* Green */
  --grad-num-4: linear-gradient(to bottom, #ffb74d, #f57c00); /* Orange */
  --grad-num-5: linear-gradient(to bottom, #ba68c8, #7b1fa2); /* Purple */
  --grad-num-6: linear-gradient(to bottom, #fff176, #fbc02d); /* Yellow */
  --grad-num-7: linear-gradient(to bottom, #4db6ac, #00796b); /* Mint/Teal */
  --grad-num-8: linear-gradient(to bottom, #a1887f, #5d4037); /* Brown */
  --grad-num-9: linear-gradient(to bottom, #e57373, #d32f2f); /* Red */
  --grad-num-10: linear-gradient(to bottom, #9575cd, #512da8); /* Deep Violet */
}

/* ==========================================================================
   RESET & SETUP BASE
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Fredoka', 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--bg-color-1) 0%, var(--bg-color-2) 50%, var(--bg-color-3) 100%);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Overlay luminoso stile Aurora Boreale */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 80% 20%, rgba(29, 209, 161, 0.12) 0%, transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(0, 210, 211, 0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   SFONDO ANIMATO CON PARTICELLE
   ========================================================================== */

.bg-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-symbol {
  position: absolute;
  font-weight: 700;
  font-size: var(--size, 24px);
  left: var(--x, 50%);
  top: var(--y, 100%);
  animation: floatUp var(--duration, 20s) linear infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-20vh) rotate(360deg) scale(1.2);
    opacity: 0;
  }
}

.floating-image {
  position: absolute;
  width: var(--size, 80px);
  height: var(--size, 80px);
  left: var(--x, 50%);
  top: var(--y, 100%);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  animation: floatUpImage var(--duration, 20s) linear infinite;
  animation-delay: var(--delay, 0s);
  pointer-events: none;
}

@keyframes floatUpImage {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 0.11;
  }
  90% {
    opacity: 0.11;
  }
  100% {
    transform: translateY(-20vh) rotate(360deg) scale(1.2);
    opacity: 0;
  }
}

/* ==========================================================================
   INTERFACCIA UTENTE (UI) & GLASSMORPHISM
   ========================================================================== */

.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 32px 0 var(--panel-shadow);
  border-radius: 20px;
}

/* Modals globali */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  width: 90%;
  max-width: 650px;
  padding: 40px;
  text-align: center;
  background: rgba(11, 35, 38, 0.8); /* Tonalità scura petrolio coerente */
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(19, 85, 92, 0.3);
  z-index: 101;
  transform: scale(1);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow-y: auto;
  max-height: 90vh;
}

.modal-overlay.hidden .modal-content {
  transform: scale(0.8);
}

/* Logo splash screen */
.game-title-img {
  max-width: 95%;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-bottom: 25px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

.game-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 35px;
  line-height: 1.6;
}

/* Livelli - Pulsanti di Selezione 3D Tattili */
.level-selection-container h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.level-buttons {
  display: flex;
  gap: 15px;
  margin-bottom: 40px;
  justify-content: center;
}

.btn-level {
  flex: 1;
  max-width: 160px;
  padding: 20px 10px;
  background: linear-gradient(135deg, #16363a 0%, #0d2528 100%); /* Sfondo solido per dare l'idea di un blocco solido */
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  
  /* Meccanica 3D - Spessore tasto aumentato a 12px */
  transform-style: preserve-3d;
  perspective: 600px;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.25),
              box-shadow 0.25s ease,
              border-color 0.25s ease,
              border-bottom-width 0.25s ease,
              border-bottom-color 0.25s ease;
  transform: translateY(0) translateZ(0);
  border-bottom: 12px solid var(--btn-depth-color, #0b1c1e); /* Spessore solido */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* Colori specifici per lo spessore 3D a seconda del livello */
#btn-l1 {
  --btn-depth-color: #0c5743;
  --btn-depth-hover: #083f30;
}
#btn-l2 {
  --btn-depth-color: #9c6c10;
  --btn-depth-hover: #734e09;
}
#btn-l3 {
  --btn-depth-color: #9c2e2e;
  --btn-depth-hover: #752020;
}

/* Hover: Il bottone si alza e si inclina vistosamente in 3D */
.btn-level:hover {
  background: linear-gradient(135deg, #204b50 0%, #112f33 100%);
  transform: translateY(-8px) rotateX(18deg) rotateY(12deg) translateZ(15px);
  border-bottom-color: var(--btn-depth-hover);
  border-bottom-width: 16px; /* Lo spessore visuale percepito aumenta in inclinazione */
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Attivo (Selezionato): Il bottone rimane quasi completamente schiacciato e si illumina */
.btn-level.active {
  border-bottom-width: 3px;
  transform: translateY(6px) translateZ(5px);
  border-color: var(--active-color);
  border-bottom-color: var(--active-shadow);
  box-shadow: 0 3px 15px var(--active-glow), inset 0 0 10px rgba(255, 255, 255, 0.15);
}

.btn-level.active:hover {
  transform: translateY(4px) rotateX(8deg) rotateY(5deg) translateZ(8px);
  border-bottom-width: 4px;
  box-shadow: 0 6px 20px var(--active-glow);
}

/* Click fisico di compressione estremo */
.btn-level:active {
  transform: translateY(10px) translateZ(-5px);
  border-bottom-width: 1px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
}

/* Palette colori per i livelli attivi */
#btn-l1.active {
  --active-color: var(--color-success);
  --active-shadow: #062b21;
  --active-glow: rgba(29, 209, 161, 0.45);
  background: rgba(29, 209, 161, 0.1);
}
#btn-l2.active {
  --active-color: var(--color-warning);
  --active-shadow: #4d3305;
  --active-glow: rgba(254, 202, 87, 0.45);
  background: rgba(254, 202, 87, 0.1);
}
#btn-l3.active {
  --active-color: var(--color-error);
  --active-shadow: #541616;
  --active-glow: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.1);
}

.btn-level .lvl-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.btn-level .lvl-text {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.btn-level .lvl-text small {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Bottone Principale Play */
.btn-primary {
  padding: 16px 45px;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff9f43, #ff6b6b);
  color: #fff;
  box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4), 0 0 20px rgba(255, 159, 67, 0.2);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-primary:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 107, 107, 0.5), 0 0 25px rgba(255, 159, 67, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.pulse {
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
  70% { box-shadow: 0 0 0 18px rgba(255, 107, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

/* ==========================================================================
   PANNELLO DI GIOCO REALE
   ========================================================================== */

.game-container {
  width: 100%;
  height: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  padding: 15px;
  z-index: 10;
  box-sizing: border-box;
}

.game-container.hidden {
  display: none !important;
}

/* UI Header Panel */
.ui-panel {
  display: flex;
  width: 100%;
  padding: 12px 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  margin-bottom: 25px;
  gap: 15px;
  z-index: 12;
  background-color: #e6f9d4;
  border-radius: 24px;
  border: none !important;
  box-shadow: 0 0 0 4px #ffffff, 
              0 0 0 8px #fdf2b5, 
              0 0 0 12px #b5d6fd, 
              0 10px 25px rgba(0, 0, 0, 0.25);
}

.ui-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background-color: #ffffff;
  border-radius: 18px;
  min-width: 90px;
  border: 3px solid #e1f2d5 !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.ui-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7d5a3c;
  margin-bottom: 6px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
}

.ui-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #422918;
  font-family: 'Fredoka', sans-serif;
}

/* Evidenziatore del Target */
.ui-box.highlight {
  background-color: #ffffff !important;
  border: 3px solid #feca57 !important;
  box-shadow: 0 4px 12px rgba(254, 202, 87, 0.35), inset 0 0 0 100px rgba(254, 202, 87, 0.06);
  min-width: 150px;
}

.ui-value.target-badge {
  font-size: 2.6rem;
  color: #e67e22;
  line-height: 1;
  text-shadow: none;
}

/* Badge dell'Operazione */
.op-badge {
  font-size: 2.4rem;
  line-height: 1;
  text-shadow: none;
}

#box-operation {
  min-width: 100px;
}

/* Scatola Progressione / Challenge */
.progress-box {
  flex: 1;
  max-width: 300px;
  align-items: stretch;
}

.ui-value-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.progress-bar-bg {
  flex: 1;
  height: 14px;
  background: #f0ebd8;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(112, 68, 35, 0.15);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #74b9ff, #1dd1a1);
  border-radius: 8px;
  transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

/* Combo Box */
.combo-badge {
  font-size: 2.2rem;
  color: #9c88ff;
  line-height: 1;
  text-shadow: 0 0 10px rgba(156, 136, 255, 0.5);
}

.combo-bounce {
  animation: pop-bounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* Pulsanti e Controlli */
.ui-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  border: 2px solid #ffffff !important;
  background: #ffffff !important;
  color: #7d5a3c !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-icon:hover {
  background: #fdf2b5 !important;
  color: #7d5a3c !important;
  border-color: #ffffff !important;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-icon:active {
  transform: translateY(-1px) scale(0.98);
}

.svg-icon {
  width: 26px;
  height: 26px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   TIMER CIRCOLARE (LIVELLO 3)
   ========================================================================== */

.timer-badge {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 15px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.timer-svg {
  position: absolute;
  width: 42px;
  height: 42px;
  transform: rotate(-90deg);
}

.timer-bg-circle {
  fill: none;
  stroke: #f0ebd8;
  stroke-width: 3.5;
}

.timer-progress-circle {
  fill: none;
  stroke: var(--color-error);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.1s linear;
}

#timer-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-error);
  z-index: 2;
  font-family: 'Fredoka', sans-serif;
}

/* ==========================================================================
   STRUTTURA GRIGLIA DI GIOCO 3D
   ========================================================================== */

.grid-container-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
  perspective: 1200px; /* Consente la prospettiva 3D per l'intero tabellone */
  z-index: 10;
}

.grid-3d {
  display: grid;
  gap: 16px;
  justify-content: center;
  align-content: center;
  margin: auto;
  transform-style: preserve-3d;
  transition: all 0.5s ease-in-out;
}

/* Configurazione Responsive della Griglia */
@media (orientation: landscape) {
  .grid-3d {
    grid-template-columns: repeat(8, var(--cube-size));
    grid-template-rows: repeat(6, var(--cube-size));
  }
}

@media (orientation: portrait) {
  .grid-3d {
    grid-template-columns: repeat(6, var(--cube-size));
    grid-template-rows: repeat(8, var(--cube-size));
  }
}

/* ==========================================================================
   IL CUBO 3D (GEOMETRIA E TRASFORMAZIONI)
   ========================================================================== */

.cube-container {
  width: var(--cube-size);
  height: var(--cube-size);
  perspective: 600px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15),
              opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* Stili di spawn sequenziale (telescrivente) */
.cube-container.hidden-cube {
  visibility: hidden;
  opacity: 0;
  transform: scale(0.3) rotateX(-90deg);
  pointer-events: none;
  transition: none; /* No transition while hidden to allow instant state reset */
}

.cube-container.spawn-in {
  visibility: visible;
  opacity: 1;
  transform: scale(1) rotateX(0deg);
}

.cube.spawn-spin {
  animation: spawn-spin-anim 0.5s cubic-bezier(0.25, 0.8, 0.25, 1.1);
}

@keyframes spawn-spin-anim {
  0% { transform: rotateY(0deg) scale(0.6); }
  100% { transform: rotateY(360deg) scale(1); }
}

.cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* Facce del Cubo */
.cube-face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--cube-size) * 0.44);
  font-weight: 700;
  color: var(--text-primary);
  border-radius: 20%; /* Arrotondati e morbidi */
  border: 3px solid rgba(255, 255, 255, 0.35); /* Bordo bianco premium */
  box-shadow: 
    inset 0 -6px 8px rgba(0, 0, 0, 0.3), /* Ombra inferiore per effetto 3D */
    inset 0 6px 8px rgba(255, 255, 255, 0.55), /* Luce superiore */
    0 4px 8px rgba(0, 0, 0, 0.3); /* Ombra esterna del blocco */
  backface-visibility: visible;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); /* Effetto chunky per i numeri */
  overflow: hidden; /* Taglia il riflesso lucido nei bordi */
  transition: all 0.3s ease;
}

/* Effetto lucido (glossy sheen) posizionato in alto */
.cube-face::before {
  content: '';
  position: absolute;
  top: 4%;
  left: 6%;
  width: 88%;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 12px 12px 6px 6px;
  pointer-events: none;
  z-index: 1;
}

/* Posizionamento 3D Spaziale delle facce */
.cube-face.front {
  transform: rotateY(0deg) translateZ(calc(var(--cube-size) / 2));
}

.cube-face.back {
  background: #111424;
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.2);
  transform: rotateY(180deg) translateZ(calc(var(--cube-size) / 2));
  background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 0);
  background-size: 8px 8px;
}

.cube-face.right {
  filter: brightness(0.7);
  transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2));
}

.cube-face.left {
  filter: brightness(0.7);
  transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2));
}

.cube-face.top {
  filter: brightness(0.85);
  transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2));
}

.cube-face.bottom {
  filter: brightness(0.6);
  transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2));
}

/* Stili specifici per i Numeri (Gradients) */
.num-1 .cube-face:not(.back) { background: var(--grad-num-1); }
.num-2 .cube-face:not(.back) { background: var(--grad-num-2); }
.num-3 .cube-face:not(.back) { background: var(--grad-num-3); }
.num-4 .cube-face:not(.back) { background: var(--grad-num-4); }
.num-5 .cube-face:not(.back) { background: var(--grad-num-5); }
.num-6 .cube-face:not(.back) { background: var(--grad-num-6); }
.num-7 .cube-face:not(.back) { background: var(--grad-num-7); }
.num-8 .cube-face:not(.back) { background: var(--grad-num-8); }
.num-9 .cube-face:not(.back) { background: var(--grad-num-9); }
.num-10 .cube-face:not(.back) { background: var(--grad-num-10); }

/* Ottimizzazioni per contrasto testo (Giallo e Marrone) */
.num-6 .cube-face {
  color: #5c3826 !important; /* Testo scuro sul giallo */
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}
.num-8 .cube-face {
  color: #ffd900 !important; /* Testo dorato sul marrone */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* Hover sul Cubo */
.cube-container:hover .cube {
  transform: rotateY(15deg) rotateX(15deg) scale(1.05);
}

/* ==========================================================================
   STATI ED EFFETTI INTERATTIVI (SELEZIONE, SUCCESSO, ERRORE)
   ========================================================================== */

/* 1. Selezione */
.cube-container.selected {
  position: relative;
  z-index: 50;
  transform: translateZ(60px);
}

.cube-container.selected .cube {
  transform: rotateY(180deg) scale(1.08);
}

.cube-container.selected .cube-face.back {
  background: linear-gradient(to bottom, #ffd900, #ff9900);
  color: #5c3826 !important;
  border-color: #ffffff;
  box-shadow: 
    inset 0 -6px 8px rgba(0, 0, 0, 0.3),
    inset 0 6px 8px rgba(255, 255, 255, 0.5),
    0 0 25px rgba(245, 176, 65, 0.8);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4) !important;
}

/* 2. Successo */
.cube-container.success {
  position: relative;
  z-index: 50;
  animation: success-bounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cube-container.success .cube-face.back {
  background: linear-gradient(to bottom, #55efc4, #10ac84) !important;
  color: #fff !important;
  border-color: #ffffff !important;
  box-shadow: 
    inset 0 -6px 8px rgba(0, 0, 0, 0.3),
    inset 0 6px 8px rgba(255, 255, 255, 0.5),
    0 0 30px rgba(29, 209, 161, 0.9) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
}

@keyframes success-bounce {
  0%, 100% { transform: translateZ(60px) scale(1); }
  30% { transform: translateZ(90px) scale(1.3) translateY(-20px); }
  50% { transform: translateZ(60px) scale(0.9) translateY(5px); }
  70% { transform: translateZ(75px) scale(1.1) translateY(-5px); }
}

/* 3. Errore */
.cube-container.error {
  position: relative;
  z-index: 50;
  animation: error-shake 0.5s linear;
}

.cube-container.error .cube-face.back {
  background: linear-gradient(to bottom, #ff7675, #ff4757) !important;
  color: #fff !important;
  border-color: #ffffff !important;
  box-shadow: 
    inset 0 -6px 8px rgba(0, 0, 0, 0.3),
    inset 0 6px 8px rgba(255, 255, 255, 0.5),
    0 0 30px rgba(255, 107, 107, 0.9) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
}

@keyframes error-shake {
  0%, 100% { transform: translateZ(60px) translateX(0); }
  15%, 45%, 75% { transform: translateZ(60px) translateX(-8px) rotateY(180deg); }
  30%, 60%, 90% { transform: translateZ(60px) translateX(8px) rotateY(180deg); }
}

/* 4. Suggerimento (Hint) */
.cube-container.hint-pulse {
  animation: hint-glow 1.5s infinite alternate;
}

@keyframes hint-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(254, 202, 87, 0.8)); }
  100% { transform: scale(1.1) translateZ(10px); filter: drop-shadow(0 0 20px rgba(254, 202, 87, 1)); }
}

/* Spin completo */
.spin-animation {
  animation: full-spin 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes full-spin {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(360deg); }
}

/* ==========================================================================
   BARRA EQUAZIONE (FEEDBACK VISIVO BASSO)
   ========================================================================== */

.equation-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: max-content;
  margin: 0 auto;
  padding: 12px 35px;
  border-radius: 50px;
  margin-top: 15px;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.eq-num, .eq-op, .eq-equals, .eq-res {
  font-size: 1.8rem;
  font-weight: 700;
  display: inline-block;
}

.eq-num {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  min-width: 45px;
  height: 45px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.eq-num.active-val {
  background: rgba(254, 202, 87, 0.2);
  border-color: var(--color-warning);
  color: var(--color-warning);
  animation: pulse-border 1.5s infinite;
}

.eq-op {
  color: var(--color-accent);
}

.eq-equals {
  color: var(--text-muted);
}

.eq-res {
  color: var(--color-warning);
  text-shadow: 0 0 8px rgba(254, 202, 87, 0.4);
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--color-warning); }
  50% { border-color: rgba(254, 202, 87, 0.3); }
}

/* ==========================================================================
   MODAL DI VITTORIA E STATISTICHE
   ========================================================================== */

.victory-box {
  background: linear-gradient(135deg, rgba(23, 18, 52, 0.95), rgba(46, 21, 62, 0.95)) !important;
  border: 3px solid var(--color-warning) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(254, 202, 87, 0.3) !important;
}

.victory-icon {
  font-size: 5rem;
  margin-bottom: 15px;
  animation: trophy-bounce 1.5s infinite ease-in-out;
}

@keyframes trophy-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

#victory-title {
  font-size: 2.8rem;
  color: var(--color-warning);
  margin-bottom: 10px;
  text-shadow: 0 0 15px rgba(254, 202, 87, 0.4);
}

#victory-desc {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 30px;
}

.victory-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 35px;
  background: rgba(255, 255, 255, 0.04);
  padding: 15px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-family: 'Inter', sans-serif;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* Canvas Confetti */
.confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* ==========================================================================
   STILI INFO AUTORE (MODAL E PULSANTI)
   ========================================================================== */

.splash-author-link {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.btn-link-author {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: 'Fredoka', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.btn-link-author:hover {
  color: var(--color-warning);
  border-color: rgba(254, 202, 87, 0.2);
  background: rgba(254, 202, 87, 0.05);
  transform: translateY(-2px);
}

.author-box {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: 92vw;
  max-width: 580px !important;
  aspect-ratio: 580 / 725 !important;
  height: calc(min(92vw, 580px) * 725 / 580) !important;
  padding: 0 !important;
  position: relative;
  overflow: visible !important;
}

.author-box .btn-close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  background: #ff7675;
  color: white;
  border: 3px solid white;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  line-height: 1;
}

.author-box .btn-close-modal:hover {
  background: #ff4d4d;
  transform: scale(1.1) rotate(90deg);
  color: white;
}

.author-frame-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.35));
}

.author-inner-content {
  position: absolute;
  top: 11%;
  bottom: 20%;
  left: 14%;
  right: 14%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.author-header-top {
  width: 100%;
  margin-bottom: 5px;
}

.author-title {
  text-align: center;
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  user-select: none;
}

.author-title span {
  display: inline-block;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  text-transform: uppercase;
  -webkit-text-stroke: 8px #ffffff;
  paint-order: stroke fill;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.12));
}

/* Colori Pastello Alternati per il Titolo */
.author-title span:nth-child(1) { color: #54a0ff; }
.author-title span:nth-child(2) { color: #8ac34a; }
.author-title span:nth-child(3) { color: #ff7675; }
.author-title span:nth-child(4) { color: #feca57; }
.author-title span:nth-child(5) { color: #ff7675; }
.author-title span:nth-child(6) { color: #a29bfe; }
.author-title span:nth-child(7) { color: #8ac34a; }
.author-title span:nth-child(8) { color: #54a0ff; }
.author-title span:nth-child(9) { color: #feca57; }
.author-title span:nth-child(10) { color: #ff7675; }

.author-flex-body {
  display: flex;
  gap: 20px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  margin-top: 15px;
}

.author-left-col {
  width: 38%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-right-col {
  width: 62%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  min-width: 0;
  padding-top: 8px;
  transform: translateX(-4px); /* Sposta a sinistra di 4px per non sovrapporsi ai fiori a destra */
}

.author-img-wrapper {
  position: relative;
  width: 100%;
  max-width: 160px;
  aspect-ratio: 200 / 260;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.1));
}

.author-img-el {
  position: absolute;
  top: 11.5%;
  left: 11%;
  width: 78%;
  height: 77%;
  object-fit: cover;
  border-radius: 12px;
  z-index: 1;
}

.author-photo-frame-bg-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.author-photo-frame-fg-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.author-banner-link {
  cursor: pointer;
  pointer-events: auto !important;
}

.author-banner-link:hover {
  filter: brightness(1.04);
}

.author-name-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: #422918;
  margin-bottom: 8px;
}

.author-bio-scroll {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(112, 68, 35, 0.25) transparent;
}

.author-bio-scroll::-webkit-scrollbar {
  width: 5px;
}

.author-bio-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.author-bio-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(112, 68, 35, 0.25);
  border-radius: 10px;
}

.author-bio-p {
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  font-size: clamp(0.78rem, 1.8vw, 0.95rem);
  line-height: 1.45;
  color: #422918;
  margin-bottom: 10px;
  user-select: text;
}

.author-bio-p:last-child {
  margin-bottom: 0;
}

.author-site-p {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: #422918;
  margin-top: auto;
  border-top: 1px dashed rgba(112, 68, 35, 0.15);
  padding-top: 8px;
}

.author-site-link {
  color: #0984e3;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.author-site-link:hover {
  color: #d63031;
}

/* --------------------------------------------------------------------------
   Transizione 3D Pop-In per il Modal dell'Autore
   -------------------------------------------------------------------------- */
#author-modal.modal-overlay {
  perspective: 1500px;
}

#author-modal .modal-content.author-box {
  /* Configurazione 3D d'ingresso: ruotato di taglio (90° Y) e arretrato, quasi invisibile */
  transform: scale(0.2) rotateY(90deg) rotateX(25deg) translateZ(-300px);
  opacity: 0;
  transform-origin: center center;
  transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.75s ease-out;
}

/* Quando il modal viene aperto (classe .hidden rimossa) */
#author-modal:not(.hidden) .modal-content.author-box {
  transform: scale(1) rotateY(0deg) rotateX(0deg) translateZ(0);
  opacity: 1;
}

/* Transizione di uscita (chiusura): fa un flip indietro velocizzato dall'altro verso */
#author-modal.modal-overlay.hidden .modal-content.author-box {
  transform: scale(0.2) rotateY(-90deg) rotateX(25deg) translateZ(-300px) !important;
  opacity: 0 !important;
  transition: transform 0.45s ease-in, opacity 0.45s ease-in;
}

/* ==========================================================================
   ADATTAMENTO RESPONSIVO E CORREZIONI LIM / DISPOSITIVI MOBILI
   ========================================================================== */

/* LIM & Schermi Grandi */
@media (min-width: 1200px) {
  :root {
    --cube-size: 80px;
  }
  .ui-value.target-badge {
    font-size: 3rem;
  }
}

/* Tablet e Medi */
@media (max-width: 1024px) {
  :root {
    --cube-size: 70px;
  }
  .game-title-img {
    max-height: 120px;
  }
  .ui-panel {
    padding: 10px 15px;
  }
  .ui-value.target-badge {
    font-size: 2.2rem;
  }
}

/* Smartphone e Schermi Piccoli */
@media (max-width: 768px) {
  :root {
    --cube-size: 52px;
  }
  body {
    padding: 5px;
  }
  .modal-content {
    padding: 25px 15px;
  }
  .game-title-img {
    max-height: 90px;
  }
  .level-buttons {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  /* Bottoni 3D in modalità Portrait (Smartphone) */
  .btn-level {
    width: 100%;
    max-width: 280px;
    flex-direction: row;
    padding: 12px 20px;
    justify-content: flex-start;
    gap: 15px;
    border-bottom-width: 5px;
  }
  
  .btn-level:hover {
    transform: translateY(-2px) rotateX(5deg) rotateY(3deg) translateZ(4px);
    border-bottom-width: 6px;
  }
  
  .btn-level.active {
    transform: translateY(2px) translateZ(1px);
    border-bottom-width: 2px;
  }
  
  .btn-level .lvl-num {
    font-size: 1.6rem;
  }
  .btn-level .lvl-text {
    text-align: left;
    font-size: 0.9rem;
  }
  
  .ui-panel {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 18px;
    margin-top: 10px;
    margin-bottom: 18px;
    border: none !important;
    box-shadow: 0 0 0 2px #ffffff, 
                0 0 0 4px #fdf2b5, 
                0 0 0 6px #b5d6fd, 
                0 6px 15px rgba(0, 0, 0, 0.2) !important;
  }
  
  .ui-box {
    padding: 6px 8px;
    min-width: 60px;
    flex: 1 1 20%;
    border-radius: 12px;
    border-width: 2px !important;
  }
  
  .ui-box.highlight {
    min-width: 100px;
    flex: 2 1 40%;
  }
  
  .ui-value {
    font-size: 1.2rem;
  }
  
  .ui-value.target-badge {
    font-size: 1.6rem;
  }
  
  .op-badge {
    font-size: 1.6rem;
  }
  
  .progress-box {
    max-width: 100%;
    flex: 1 1 100%;
    order: 4;
  }
  
  .ui-controls {
    order: 3;
    flex: 1 1 auto;
    justify-content: flex-end;
  }
  
  .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  
  .timer-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  
  .timer-svg {
    width: 32px;
    height: 32px;
  }
  
  #timer-text {
    font-size: 0.95rem;
  }
  
  .equation-bar {
    padding: 8px 20px;
    margin-top: 8px;
    border-radius: 20px;
  }
  
  .eq-num, .eq-op, .eq-equals, .eq-res {
    font-size: 1.3rem;
  }
  
  .eq-num {
    min-width: 32px;
    height: 32px;
    border-radius: 6px;
  }
}

/* Responsiveness Info Autore */
@media (max-width: 520px) {
  .author-inner-content {
    top: 10%;
    bottom: 18%;
    left: 12%;
    right: 12%;
  }
  .author-title span {
    -webkit-text-stroke: 4px #ffffff;
  }
  .author-flex-body {
    gap: 10px;
    margin-top: 10px;
  }
  .author-box .btn-close-modal {
    width: 34px;
    height: 34px;
    font-size: 1.4rem;
    top: 10px;
    right: 10px;
    border-width: 2px;
  }
}

/* Extra piccoli per telefoni con schermi minuscoli */
@media (max-width: 380px) {
  :root {
    --cube-size: 45px;
  }
  .ui-box {
    padding: 2px 4px;
  }
  .ui-value {
    font-size: 1rem;
  }
}

/* ==========================================================================
   STILI DI PRECARICAMENTO (PRELOADER) & SEO
   ========================================================================== */

/* Screen reader only helper for SEO headings */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Preloader styles */
.preloader-box {
  background: rgba(11, 35, 38, 0.9) !important;
  border: 2px solid rgba(84, 160, 255, 0.25) !important;
  box-shadow: 0 0 40px rgba(84, 160, 255, 0.25), 0 15px 50px rgba(0, 0, 0, 0.7) !important;
  max-width: 500px !important;
  padding: 50px 30px !important;
  border-radius: 24px;
  text-align: center;
}

.preloader-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.25);
  font-family: 'Fredoka', sans-serif;
  animation: preloader-pulse 2s infinite ease-in-out;
}

.preloader-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 30px;
  font-family: 'Inter', sans-serif;
}

.preloader-progress-container {
  position: relative;
  margin-bottom: 25px;
}

.preloader-progress-bg {
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
  position: relative;
}

.preloader-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-success) 100%);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(29, 209, 161, 0.6);
  transition: width 0.15s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.preloader-percentage {
  margin-top: 12px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-success);
  text-shadow: 0 0 10px rgba(29, 209, 161, 0.4);
  font-family: 'Fredoka', sans-serif;
}

.preloader-status {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: 'Inter', sans-serif;
  min-height: 20px;
  word-break: break-all;
}

.preloader-error-container {
  margin-top: 25px;
  padding: 20px;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 15px;
  animation: preloader-shake 0.5s ease;
}

.preloader-error-text {
  color: var(--color-error);
  font-weight: 600;
  margin-bottom: 15px;
  font-family: 'Inter', sans-serif;
}

@keyframes preloader-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.03); opacity: 1; text-shadow: 0 0 25px rgba(84, 160, 255, 0.4); }
}

@keyframes preloader-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* ==========================================================================
   STILI SCHEDA DIDATTICA (MODAL)
   ========================================================================== */

.didactic-box {
  background: rgba(10, 35, 38, 0.95) !important;
  border: 3px solid rgba(138, 195, 74, 0.4) !important; /* Bordo verde coordinato */
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(138, 195, 74, 0.2) !important;
  max-width: 600px !important;
  text-align: left !important;
  padding: 30px 40px !important;
  position: relative;
}

.didactic-box .btn-close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  background: #ff7675;
  color: white;
  border: 3px solid white;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  line-height: 1;
}

.didactic-box .btn-close-modal:hover {
  background: #ff4d4d;
  transform: scale(1.1) rotate(90deg);
}

.didactic-header {
  text-align: center;
  margin-bottom: 25px;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.15);
  padding-bottom: 15px;
}

.didactic-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
  animation: floatIcon 3s ease-in-out infinite;
}

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

.didactic-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 2rem;
  color: var(--color-warning);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 5px;
}

.didactic-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.didactic-body {
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.6;
}

.didactic-section {
  margin-bottom: 20px;
}

.didactic-section h3 {
  font-family: 'Fredoka', sans-serif;
  color: var(--color-success);
  font-size: 1.2rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.didactic-section p {
  margin-bottom: 10px;
  color: #e2e8f0;
}

.didactic-section ul {
  padding-left: 20px;
  margin-top: 5px;
}

.didactic-section li {
  margin-bottom: 6px;
  color: #cbd5e1;
}

.didactic-section strong {
  color: #fff;
  font-weight: 600;
}

/* Responsive adjustments for Didactic Modal */
@media (max-width: 520px) {
  .didactic-box {
    padding: 20px 25px !important;
    width: 95% !important;
  }
  .didactic-box .btn-close-modal {
    width: 34px;
    height: 34px;
    font-size: 1.4rem;
    top: 12px;
    right: 12px;
    border-width: 2px;
  }
  .didactic-title {
    font-size: 1.6rem;
  }
}
