/* ==========================================================================
   AVENTURA MINȚII - STILURI PENTRU COPII (CSS)
   Design colorat, prietenos, butoane tactile 3D, responsive pentru tabletă/telefon
   ========================================================================== */

:root {
  --primary-color: #ff5e7e;
  --primary-hover: #ff3b61;
  --secondary-color: #4facfe;
  --secondary-hover: #00c6ff;
  --accent-yellow: #feca57;
  --accent-green: #1dd1a1;
  --accent-purple: #9b59b6;
  --accent-orange: #ff9f43;
  
  --bg-gradient: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
  --card-bg: #ffffff;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;
  
  --font-main: 'Segoe UI', system-ui, -apple-system, Roboto, 'Nunito', 'Comic Sans MS', sans-serif;
  --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-btn: 0 6px 0 rgba(0, 0, 0, 0.18);
  --shadow-btn-active: 0 2px 0 rgba(0, 0, 0, 0.18);
}

/* Reset și Setări Generale */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text-dark);
  overflow-x: hidden;
  touch-action: manipulation;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10000;
}

/* Container Principal al Aplicației */
#app-container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  position: relative;
}

@media (min-width: 860px) {
  #app-container {
    margin: 12px auto;
    min-height: calc(100vh - 24px);
    border-radius: var(--radius-lg);
    border: 4px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
  }
}

/* ==========================================================================
   HEADER
   ========================================================================== */
#game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: linear-gradient(90deg, #ff6b6b, #ff8e53);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.35);
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.header-logo:hover {
  transform: scale(1.04);
}

.logo-emoji {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stars-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1.1rem;
}

.stars-counter .star-icon {
  font-size: 1.3rem;
  animation: pulse-soft 2s infinite ease-in-out;
}

.stars-total {
  opacity: 0.85;
  font-size: 0.9rem;
}

/* Butoane de Icon */
.icon-btn {
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.08);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn-small {
  background: #f1f2f6;
  border: 2px solid #dfe4ea;
  border-radius: var(--radius-full);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn-small:hover {
  background: #e4e7eb;
  transform: rotate(30deg);
}

/* ==========================================================================
   BUTOANE CU ASPECT 3D TACTIL
   ========================================================================== */
.btn {
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  outline: none;
}

.btn-primary {
  background: linear-gradient(180deg, #ff6b81, #ee5253);
  color: #ffffff;
  box-shadow: 0 6px 0 #c23616, 0 8px 16px rgba(238, 82, 83, 0.4);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #c23616, 0 4px 8px rgba(238, 82, 83, 0.3);
}

.btn-secondary {
  background: linear-gradient(180deg, #54a0ff, #2e86de);
  color: #ffffff;
  box-shadow: 0 6px 0 #1059b0, 0 8px 16px rgba(46, 134, 222, 0.4);
}

.btn-secondary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1059b0, 0 4px 8px rgba(46, 134, 222, 0.3);
}

.btn-danger {
  background: linear-gradient(180deg, #ff7675, #d63031);
  color: #ffffff;
  box-shadow: 0 5px 0 #9b1e1e;
}

.btn-danger:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #9b1e1e;
}

.btn-large {
  font-size: 1.35rem;
  padding: 16px 36px;
  min-height: 62px;
}

.btn-small {
  font-size: 0.95rem;
  padding: 8px 16px;
  min-height: 38px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.btn-small:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   SISTEM DE ECRANE (SCREENS)
   ========================================================================== */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 16px;
  animation: fadeIn 0.3s ease-out forwards;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ECRANUL 1: START SCREEN
   ========================================================================== */
#screen-start {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
}

.start-hero-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-card);
  border: 4px solid #e1e8f0;
}

.mascot-avatar {
  font-size: 5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.15));
}

.game-title {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(45deg, #ee5253, #ff9f43, #10ac84);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.game-subtitle {
  font-size: 1.15rem;
  color: #576574;
  line-height: 1.5;
  margin-bottom: 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.feature-chip {
  background: #edf2f7;
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid #e2e8f0;
}

.chip-icon {
  font-size: 1.6rem;
}

.chip-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2d3748;
}

.start-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 380px;
  margin: 0 auto;
}

/* ==========================================================================
   ECRANUL 2: HARTA NIVELURILOR (MAP SCREEN)
   ========================================================================== */
#screen-map {
  padding: 14px 16px;
  overflow-y: auto;
  max-height: calc(100vh - 70px);
}

.map-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  background: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.map-title-wrap {
  flex: 1;
}

.map-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #2c3e50;
}

.map-progress-summary {
  font-size: 0.95rem;
  color: #7f8c8d;
}

.worlds-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 24px;
}

/* Cardul unei Lumi (World Section) */
.world-section {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 3px solid #f1f2f6;
  position: relative;
  overflow: hidden;
}

.world-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px dashed #eceff1;
}

.world-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.world-icon {
  font-size: 2rem;
}

.world-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2d3436;
}

.world-levels-range {
  font-size: 0.85rem;
  font-weight: 700;
  background: #dfe6e9;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: #636e72;
}

/* Grila de Niveluri din Lume */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (min-width: 600px) {
  .levels-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Cardul unui Nivel individual */
.level-card {
  position: relative;
  background: #f8f9fa;
  border: 3px solid #dfe4ea;
  border-radius: var(--radius-md);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-height: 100px;
  justify-content: center;
  box-shadow: 0 4px 0 #ced6e0;
}

.level-card:hover:not(.locked) {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 0 #ced6e0, 0 10px 15px rgba(0,0,0,0.1);
  border-color: #54a0ff;
}

.level-card:active:not(.locked) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #ced6e0;
}

.level-card.locked {
  background: #f1f2f6;
  border-color: #dcdde1;
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.level-card.current {
  background: linear-gradient(135deg, #fff3b0 0%, #feca57 100%);
  border-color: #ff9f43;
  box-shadow: 0 6px 0 #ee5253;
  animation: pulse-border 1.8s infinite;
}

@keyframes pulse-border {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.card-num {
  font-size: 1.15rem;
  font-weight: 900;
  color: #2f3542;
}

.card-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.card-type-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #57606f;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

.card-stars {
  font-size: 0.85rem;
  letter-spacing: -2px;
}

.card-lock {
  font-size: 1.6rem;
  color: #a4b0be;
}

/* ==========================================================================
   ECRANUL 3: JOC ACTIV (GAME SCREEN)
   ========================================================================== */
#screen-game {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 12px 16px;
  gap: 12px;
}

#screen-game.active {
  display: flex;
}

.level-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.level-info-tag {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-pill {
  background: #ff6b81;
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.level-name-display {
  font-size: 1.1rem;
  font-weight: 800;
  color: #2f3542;
}

@media (max-width: 500px) {
  .level-name-display {
    display: none;
  }
}

.game-live-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-stars {
  font-size: 1.3rem;
  letter-spacing: -2px;
  background: #fff8e7;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid #fed330;
}

.live-stars .star {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.live-stars .star.lit {
  opacity: 1;
}

/* Bula de Instrucțiuni */
.instruction-bubble {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  border-left: 6px solid #4facfe;
}

.bubble-mascot {
  font-size: 2.3rem;
  flex-shrink: 0;
  animation: gentle-wobble 3s infinite ease-in-out;
}

.bubble-content p {
  font-size: 1.15rem;
  font-weight: 800;
  color: #2c3e50;
  margin-bottom: 2px;
}

.sub-hint {
  font-size: 0.9rem;
  font-weight: 600;
  color: #7f8c8d;
}

/* Container Tablă de Joc */
.game-board-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8f9fb;
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 3px dashed #dcdde1;
  min-height: 380px;
  position: relative;
  overflow: hidden;
}

.game-board {
  width: 100%;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ==========================================================================
   MODULE DE JOC SPECIFICE
   ========================================================================== */

/* 1. MEMORIE CARTONAȘE (PAIRS) */
.pairs-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.pairs-grid.grid-4 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 260px;
}
.pairs-grid.grid-6 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 380px;
}
.pairs-grid.grid-8 {
  grid-template-columns: repeat(4, 1fr);
  max-width: 480px;
}
.pairs-grid.grid-12 {
  grid-template-columns: repeat(4, 1fr);
  max-width: 520px;
}
.pairs-grid.grid-16 {
  grid-template-columns: repeat(4, 1fr);
  max-width: 520px;
}
.pairs-grid.grid-16 .memory-card {
  font-size: 2rem;
}
@media (max-width: 480px) {
  .pairs-grid.grid-16 .memory-card {
    font-size: 1.6rem;
  }
}

.memory-card {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  cursor: pointer;
  box-shadow: 0 6px 0 #0652dd;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s;
  color: #ffffff;
  position: relative;
}

.memory-card:active:not(.matched) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #0652dd;
}

.memory-card.revealed {
  background: #ffffff;
  border: 3px solid #00cec9;
  box-shadow: 0 6px 0 #00b894;
  transform: scale(1.02);
}

.memory-card.matched {
  background: #55efc4;
  border: 3px solid #00b894;
  box-shadow: 0 4px 0 #00947a;
  cursor: default;
  animation: rubberBand 0.5s;
}

.memory-card.mismatch {
  animation: shake 0.4s;
  background: #ff7675;
}

/* 2. SIMON SPUNE */
.simon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.simon-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 280px;
  height: 280px;
  background: #2d3436;
  padding: 16px;
  border-radius: 50%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25), inset 0 0 15px rgba(0,0,0,0.5);
  position: relative;
}

.simon-center-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 5;
  pointer-events: none;
}

.simon-btn {
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  outline: none;
}

.simon-btn.btn-red {
  background: #ff4757;
  border-top-left-radius: 110px;
}
.simon-btn.btn-green {
  background: #2ed573;
  border-top-right-radius: 110px;
}
.simon-btn.btn-blue {
  background: #1e90ff;
  border-bottom-left-radius: 110px;
}
.simon-btn.btn-yellow {
  background: #ffa502;
  border-bottom-right-radius: 110px;
}

.simon-btn.active, .simon-btn:active {
  filter: brightness(1.7);
  box-shadow: 0 0 35px #ffffff;
  transform: scale(0.96);
}

.simon-status-msg {
  font-size: 1.15rem;
  font-weight: 800;
  color: #2f3542;
  padding: 8px 18px;
  background: #fff;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}

/* 3. ȚINE MINTE POZIȚIA (POSITION) */
.position-grid {
  display: grid;
  gap: 12px;
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.position-cell {
  width: 75px;
  height: 75px;
  background: #f1f2f6;
  border: 3px solid #ced6e0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 480px) {
  .position-cell {
    width: 62px;
    height: 62px;
    font-size: 1.8rem;
  }
}

.position-cell.preview-show {
  background: #ffeaa7;
  border-color: #fdcb6e;
  transform: scale(1.04);
}

.position-cell.found {
  background: #55efc4;
  border-color: #00b894;
  transform: scale(1.05);
}

.position-cell.wrong {
  background: #ff7675;
  border-color: #d63031;
  animation: shake 0.4s;
}

.countdown-bar-wrap {
  width: 100%;
  max-width: 320px;
  height: 12px;
  background: #dfe4ea;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 10px;
}

.countdown-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff9f43, #ee5253);
  width: 100%;
  transition: width 0.1s linear;
}

/* 4. COMPLETEAZĂ ȘIRUL (PATTERN) */
.pattern-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.pattern-display-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 20px 26px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 3px solid #dfe4ea;
}

.pattern-item {
  width: 65px;
  height: 65px;
  background: #f8f9fa;
  border: 3px solid #ced6e0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
  box-shadow: 0 4px 0 #ced6e0;
}

.pattern-item.target-slot {
  background: #ffeaa7;
  border: 3px dashed #e17055;
  color: #e17055;
  animation: pulse-soft 1.5s infinite;
}

.options-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #576574;
}

.pattern-options-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.pattern-option-btn {
  width: 75px;
  height: 75px;
  background: #ffffff;
  border: 3px solid #74b9ff;
  border-radius: var(--radius-md);
  font-size: 2.2rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 0 #0984e3;
  transition: all 0.15s ease;
}

.pattern-option-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 #0984e3;
}

.pattern-option-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #0984e3;
}

/* 5. GĂSEȘTE INTRUSUL (ODD ONE OUT) */
.odd-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.odd-items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 440px;
}

@media (min-width: 480px) {
  .odd-items-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.odd-card-btn {
  aspect-ratio: 1;
  background: #ffffff;
  border: 3px solid #dfe4ea;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 2.8rem;
  cursor: pointer;
  box-shadow: 0 6px 0 #ced6e0;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.odd-card-btn .item-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: #57606f;
}

.odd-card-btn:hover {
  transform: translateY(-4px);
  border-color: #ff6b81;
}

.odd-card-btn:active {
  transform: translateY(3px);
}

.odd-card-btn.correct {
  background: #55efc4;
  border-color: #00b894;
  box-shadow: 0 4px 0 #00947a;
}

.odd-card-btn.wrong {
  animation: shake 0.4s;
  background: #ff7675;
}

.odd-explanation-box {
  background: #e3f2fd;
  color: #1976d2;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 1.05rem;
  display: none;
  animation: fadeIn 0.3s;
}

/* 6. LABIRINT LOGIC (MAZE) */
.maze-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.maze-grid {
  display: grid;
  gap: 4px;
  background: #2f3542;
  padding: 10px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.maze-cell {
  width: 52px;
  height: 52px;
  background: #f1f2f6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: background 0.15s;
}

@media (max-width: 400px) {
  .maze-cell {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
}

.maze-cell.wall {
  background: #57606f;
  border: 1px solid #2f3542;
}

.maze-cell.player {
  background: #ffeaa7;
  transform: scale(1.1);
  box-shadow: 0 0 10px #feca57;
}

.maze-cell.goal {
  background: #a8e6cf;
}

.maze-dpad {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(2, 56px);
  gap: 8px;
  margin-top: 8px;
}

.dpad-btn {
  background: #ffffff;
  border: 3px solid #74b9ff;
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 0 #0984e3;
}

.dpad-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #0984e3;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }

/* 7. ORDONARE / SORTING */
.sorting-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.sorting-slots-row {
  display: flex;
  gap: 12px;
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  min-height: 85px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.sorting-slot {
  width: 68px;
  height: 68px;
  border: 3px dashed #b2bec3;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  background: #f8f9fa;
  position: relative;
}

.sorting-slot.filled {
  border-style: solid;
  border-color: #00b894;
  background: #e8f8f5;
  box-shadow: 0 4px 0 #00b894;
}

.sorting-choices-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.sorting-choice-btn {
  padding: 12px 18px;
  min-width: 70px;
  min-height: 70px;
  background: #ffffff;
  border: 3px solid #ff7675;
  border-radius: var(--radius-md);
  font-size: 2rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 0 #d63031;
  transition: all 0.15s ease;
}

.sorting-choice-btn .choice-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #636e72;
}

.sorting-choice-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #d63031;
}

.sorting-choice-btn.selected {
  opacity: 0.3;
  pointer-events: none;
  transform: scale(0.9);
}

/* 8. DETECTIVUL DE OBIECTE (SPOT ITEM) */
.spot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.spot-target-banner {
  background: #ffffff;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.spot-field {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: #ffffff;
  padding: 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  max-width: 480px;
  width: 100%;
}

.spot-field.cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 480px) {
  .spot-field.cols-5 {
    gap: 6px;
    padding: 10px;
  }
  .spot-field.cols-5 .spot-item-cell {
    font-size: 1.6rem;
  }
}

.spot-item-cell {
  aspect-ratio: 1;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  transition: transform 0.15s;
}

.spot-item-cell:active {
  transform: scale(0.92);
}

.spot-item-cell.found {
  background: #a8e6cf;
  border-color: #1dd1a1;
  pointer-events: none;
  transform: scale(1.06);
  animation: rubberBand 0.4s;
}

/* 9. VÂNĂTORUL DE BALOANE / STELUȚE (TAP TARGETS) */
.tap-arena {
  width: 100%;
  max-width: 520px;
  height: 340px;
  background: linear-gradient(180deg, #c7ecee 0%, #dff9fb 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 4px solid #7ed6df;
  position: relative;
  overflow: hidden;
}

.tap-target-obj {
  position: absolute;
  width: 64px;
  height: 64px;
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  animation: floatPop 2.2s ease-in-out forwards;
  transition: transform 0.1s;
}

.tap-target-obj:active {
  transform: scale(1.3);
}

@keyframes floatPop {
  0% { transform: scale(0) translateY(20px); opacity: 0; }
  20% { transform: scale(1.1) translateY(0); opacity: 1; }
  85% { transform: scale(1) translateY(-10px); opacity: 1; }
  100% { transform: scale(0.4) translateY(-30px); opacity: 0; }
}

.tap-score-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255,255,255,0.9);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 5;
}

/* 10. GĂSEȘTE DIFERENȚELE (DIFFERENCES) */
.differences-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.diff-panels-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.diff-panel-box {
  background: #ffffff;
  padding: 14px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 3px solid #dfe4ea;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.diff-panel-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #747d8c;
}

.diff-grid {
  display: grid;
  gap: 8px;
}

.diff-cell {
  width: 62px;
  height: 62px;
  background: #f1f2f6;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

@media (max-width: 480px) {
  .diff-cell {
    width: 50px;
    height: 50px;
    font-size: 1.7rem;
  }
}

.diff-cell.interactive:active {
  transform: scale(0.92);
}

.diff-cell.found-diff {
  background: #ffeaa7;
  border: 3px solid #feca57;
  animation: pulse-soft 1s infinite;
}

/* 11. MATEMATICĂ DISTRACTIVĂ (MATH) */
.math-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.math-equation-card {
  background: #ffffff;
  padding: 20px 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 4px solid #74b9ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.math-visual-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.math-text-equation {
  font-size: 2.6rem;
  font-weight: 900;
  color: #2f3542;
  letter-spacing: 2px;
}

.math-choices-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.math-choice-btn {
  width: 80px;
  height: 80px;
  background: #ffffff;
  border: 3px solid #ff9f43;
  border-radius: var(--radius-lg);
  font-size: 2.2rem;
  font-weight: 900;
  color: #2f3542;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 0 #ee5253;
  transition: all 0.15s ease;
}

.math-choice-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 #ee5253;
}

.math-choice-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #ee5253;
}

/* ==========================================================================
   MODALURI (VICTORIE, FINAL, RESET)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  animation: fadeIn 0.25s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  position: relative;
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.victory-crown, .trophy-animation, .warn-icon {
  font-size: 4.5rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.victory-title, .grand-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ee5253;
  margin-bottom: 6px;
}

.victory-message, .grand-subtitle {
  font-size: 1.1rem;
  color: #576574;
  margin-bottom: 20px;
}

.victory-stars-box {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 3.4rem;
  margin-bottom: 20px;
}

.v-star {
  opacity: 0.2;
  transform: scale(0.5);
  display: inline-block;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.v-star.awarded {
  opacity: 1;
  transform: scale(1);
  animation: starPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes starPop {
  0% { transform: scale(0.2) rotate(-45deg); }
  60% { transform: scale(1.3) rotate(15deg); }
  100% { transform: scale(1) rotate(0); }
}

.victory-stats-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.stat-pill {
  background: #f1f2f6;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.95rem;
  color: #2f3542;
}

.victory-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.victory-secondary-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.grand-badge-box {
  background: #fff8e7;
  border: 3px dashed #feca57;
  padding: 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.grand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 900;
  color: #d35400;
  margin-bottom: 6px;
}

.grand-stars-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #2c3e50;
}

.modal-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

/* ==========================================================================
   ANIMAȚII DIVERSE
   ========================================================================== */
.bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-16px); }
  60% { transform: translateY(-8px); }
}

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

@keyframes pulse-glow {
  0% { box-shadow: 0 6px 0 #c23616, 0 0 0 rgba(238, 82, 83, 0.4); }
  50% { box-shadow: 0 6px 0 #c23616, 0 0 25px rgba(238, 82, 83, 0.7); }
  100% { box-shadow: 0 6px 0 #c23616, 0 0 0 rgba(238, 82, 83, 0.4); }
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@keyframes rubberBand {
  0% { transform: scale3d(1, 1, 1); }
  30% { transform: scale3d(1.25, 0.75, 1); }
  40% { transform: scale3d(0.75, 1.25, 1); }
  50% { transform: scale3d(1.15, 0.85, 1); }
  65% { transform: scale3d(0.95, 1.05, 1); }
  75% { transform: scale3d(1.05, 0.95, 1); }
  100% { transform: scale3d(1, 1, 1); }
}

@keyframes gentle-wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}
