/* ========================================================
   JUEGOS DE ORDEN — Hoja de estilos (CREATICS)
   ========================================================
   Filosofía: pantalla completa, sin scroll, escalado dinámico.
   Variables CSS dinámicas (las setea game.js):
     --slot-size:         tamaño de cada slot/ficha (px)
     --item-content-size: tamaño del emoji dentro de la ficha
     --label-size:        tamaño de la etiqueta de la ficha
     --pattern-cell:      tamaño de cada celda en niveles de patrón
   ======================================================== */

:root {
  --slot-size: 96px;
  --item-content-size: 40px;
  --label-size: 13px;
  --pattern-cell: 60px;

  --c-pink:   #FF6B9D;
  --c-teal:   #4ECDC4;
  --c-yellow: #FFD93D;
  --c-purple: #A78BFA;
  --c-orange: #FF8C42;
  --c-cyan:   #06B6D4;
  --c-amber:  #F59E0B;
  --c-rose:   #EC4899;
  --c-blue:   #1E40AF;
}

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

html, body {
  height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  font-family: 'Comic Sans MS', 'Marker Felt', 'Patrick Hand', system-ui, sans-serif;
  overscroll-behavior: none;
}

body {
  background: linear-gradient(135deg, #FFE5F1 0%, #E5F1FF 50%, #FFFAE5 100%);
  color: #333;
}

#app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: hidden;
}

.screen.hidden { display: none; }

/* ========================================================
   MENÚ PRINCIPAL — siempre 3x3
   ======================================================== */
#menu {
  padding: 14px;
}

#menu h1 {
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  text-align: center;
  color: var(--c-pink);
  text-shadow: 3px 3px 0 #FFF, 6px 6px 0 rgba(0,0,0,0.08);
  margin-bottom: 2px;
  animation: bounce 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

#menu .subtitle {
  text-align: center;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: #666;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: clamp(8px, 1.4vw, 16px);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 6px;
}

@media (max-width: 380px) {
  /* En pantallas muy pequeñas, 2 columnas para que se vean los textos */
  .levels-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(5, 1fr); }
}

.level-card {
  background: white;
  border: 5px solid;
  border-radius: 22px;
  padding: clamp(8px, 1.5vw, 16px);
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 0 rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2px, 0.6vw, 6px);
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.level-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: currentColor;
  opacity: 0.85;
}

.level-card:hover { transform: translateY(-2px); }
.level-card:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}

.level-card[data-level="1"] { border-color: var(--c-teal);   color: #2BB5AB; }
.level-card[data-level="2"] { border-color: var(--c-yellow); color: #D9A800; }
.level-card[data-level="3"] { border-color: var(--c-pink);   color: var(--c-pink); }
.level-card[data-level="4"] { border-color: var(--c-purple); color: #7E63D6; }
.level-card[data-level="5"] { border-color: var(--c-orange); color: #E66A1F; }
.level-card[data-level="6"] { border-color: var(--c-rose);   color: #DB2777; }
.level-card[data-level="7"] { border-color: var(--c-cyan);   color: #0891B2; }
.level-card[data-level="8"] { border-color: var(--c-amber);  color: #D97706; }
.level-card[data-level="9"] { border-color: var(--c-blue);   color: var(--c-blue); }

.level-num {
  font-size: clamp(0.95rem, 2vw, 1.5rem);
  font-weight: bold;
  margin-top: 2px;
}

.level-icons {
  font-size: clamp(1.3rem, 3.2vw, 2.4rem);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-name {
  font-size: clamp(0.75rem, 1.6vw, 1.15rem);
  font-weight: bold;
  color: #555;
  line-height: 1.2;
}

.difficulty {
  font-size: clamp(0.55rem, 1.2vw, 0.85rem);
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================================
   PANTALLA DE JUEGO
   ======================================================== */
#game {
  padding: 8px 10px;
  gap: 4px;
}

#game .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

#game .title {
  font-size: clamp(0.85rem, 2.2vw, 1.4rem);
  color: #444;
  font-weight: bold;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.progress-badge {
  background: var(--c-purple);
  color: white;
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
  padding: 2px 12px;
  border-radius: 50px;
  font-weight: bold;
  box-shadow: 0 2px 0 #7e63d6;
  letter-spacing: 0.5px;
}

.back-btn, .help-btn {
  border: none;
  border-radius: 50px;
  padding: 8px 14px;
  font-size: clamp(0.8rem, 1.8vw, 1.1rem);
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.back-btn {
  background: var(--c-pink);
  color: white;
  box-shadow: 0 4px 0 #d44a7c;
}
.back-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #d44a7c; }

.help-btn {
  background: var(--c-yellow);
  color: #333;
  box-shadow: 0 4px 0 #d9a800;
}
.help-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #d9a800; }

.instruction {
  text-align: center;
  font-size: clamp(0.9rem, 2.2vw, 1.3rem);
  background: white;
  padding: 8px 16px;
  border-radius: 18px;
  margin: 2px auto;
  max-width: 760px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
  color: #333;
  font-weight: bold;
  flex-shrink: 0;
}

.arrow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(0.8rem, 1.8vw, 1.1rem);
  font-weight: bold;
  flex-shrink: 0;
  margin: 1px 0;
}

.arrow-row .from-label { color: #2BB5AB; }
.arrow-row .to-label   { color: var(--c-pink); }
.arrow-row .arrow      { font-size: clamp(1.1rem, 2.6vw, 1.6rem); color: #888; }

/* ========================================================
   ÁREA DE JUEGO
   ======================================================== */
.play-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* ===== Slots clásicos (linear) ===== */
.slots {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 16px);
  flex-wrap: wrap;
  padding: 18px 4px 4px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.slot {
  width: var(--slot-size);
  height: var(--slot-size);
  border: 4px dashed #b8b8b8;
  border-radius: 20px;
  background: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.slot.hover {
  border-color: var(--c-teal) !important;
  background: rgba(78, 205, 196, 0.28) !important;
  transform: scale(1.06);
}
.slot.hover-bad {
  border-color: var(--c-pink) !important;
  background: rgba(255, 107, 157, 0.22) !important;
  transform: scale(1.04);
}
.slot.correct {
  border-style: solid;
  border-color: var(--c-teal);
  background: rgba(78, 205, 196, 0.18);
  animation: pop 0.4s;
}

.slot-number {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-pink);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 2px 0 rgba(0,0,0,0.2);
  z-index: 5;
  transition: background 0.25s;
}

.slot-number.done {
  background: var(--c-teal);
  box-shadow: 0 2px 0 #38a89f;
}

/* ===== Pool (banco de fichas) ===== */
.pool {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 16px);
  padding: 12px;
  background: rgba(255,255,255,0.45);
  border-radius: 25px;
  margin: 6px;
  min-height: 90px;
  border: 3px dashed rgba(0,0,0,0.1);
  width: calc(100% - 12px);
  box-sizing: border-box;
}

/* Placeholder invisible que mantiene el hueco mientras arrastramos */
.item-placeholder {
  background: transparent;
  border: 3px dashed rgba(0,0,0,0.1);
  border-radius: 20px;
  flex-shrink: 0;
  pointer-events: none;
}

.item {
  width: var(--slot-size);
  height: var(--slot-size);
  background: white;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 rgba(0,0,0,0.15);
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 3px solid #fff;
  text-align: center;
  line-height: 1;
  flex-shrink: 0;
  padding: 4px;
}

.item .item-content {
  font-size: var(--item-content-size);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
}

.item .item-label {
  font-size: var(--label-size);
  margin-top: 3px;
  color: #555;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(var(--slot-size) - 8px);
}

.item.dragging {
  cursor: grabbing;
  transform: scale(1.15) rotate(3deg) !important;
  box-shadow: 0 14px 28px rgba(0,0,0,0.3);
  z-index: 1000;
  position: fixed !important;
  pointer-events: none;
  transition: none;
}

/* Item COLOCADO dentro de un slot lineal: rellena el slot */
.slot .item.placed {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  box-shadow: none;
  cursor: default;
  border: 3px solid var(--c-teal);
  background: white;
  border-radius: 18px;
}

.item.shake { animation: shake 0.5s; }

/* Tamaños distintos para nivel 1 (size) */
.item.size-small  .item-content { font-size: calc(var(--item-content-size) * 0.6); }
.item.size-medium .item-content { font-size: calc(var(--item-content-size) * 0.85); }
.item.size-large  .item-content { font-size: calc(var(--item-content-size) * 1.15); }

/* Multi (varias frutas) para nivel 2 */
.item.multi .item-content {
  font-size: calc(var(--item-content-size) * 0.55);
  gap: 2px;
  padding: 2px;
}

/* ========================================================
   NIVELES DE PATRONES (collares + paleta)
   ======================================================== */
.necklaces {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vw, 14px);
  padding: 10px 6px 4px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.necklace {
  display: flex;
  gap: clamp(2px, 0.5vw, 5px);
  align-items: center;
  background: rgba(255,255,255,0.7);
  padding: 5px clamp(6px, 1.2vw, 14px);
  border-radius: 60px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
  max-width: 100%;
  box-sizing: border-box;
}

/* TODAS las celdas del collar — incluye .cell, .blank y la celda
   colocada (.correct.full sin .cell ni .blank). Esto evita que la
   celda se colapse al pasar de .blank a .correct. */
.necklace > div:not(.separator) {
  width: var(--pattern-cell);
  height: var(--pattern-cell);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--pattern-cell) * 0.6);
  flex-shrink: 0;
  /* No incluir transform en la transición: pelearía con la animación
     de entrada de .correct y dejaría la celda atascada en scale(0.7) */
  transition: background 0.25s, border-color 0.25s;
  position: relative;
  box-sizing: border-box;
}

.necklace .cell {
  background: white;
  box-shadow: 0 2px 0 rgba(0,0,0,0.1);
}

.necklace .cell.group-a { background: #FFFCF0; }
.necklace .cell.group-b { background: #F4F0FF; }

.necklace .blank {
  border: 3px dashed var(--c-pink);
  background: rgba(255, 107, 157, 0.12);
  color: var(--c-pink);
  font-weight: bold;
  animation: pulseSlot 1.5s ease-in-out infinite;
}

.necklace .blank.hover {
  border-color: var(--c-teal) !important;
  background: rgba(78, 205, 196, 0.28) !important;
  transform: scale(1.1);
  animation: none;
}
.necklace .blank.hover-bad {
  border-color: var(--c-pink) !important;
  background: rgba(255, 107, 157, 0.3) !important;
  transform: scale(1.04);
}

.necklace .correct {
  border: 3px solid var(--c-teal);
  background: rgba(78, 205, 196, 0.22);
  animation: pop 0.5s;
}

/* Item colocado dentro de la celda correcta del collar */
.necklace .correct .item.placed {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 12px;
}

.necklace .correct .item.placed .item-content {
  font-size: calc(var(--pattern-cell) * 0.6);
}

.necklace .separator {
  width: 3px;
  height: calc(var(--pattern-cell) * 0.6);
  background: rgba(167, 139, 250, 0.5);
  border-radius: 2px;
  flex-shrink: 0;
  margin: 0 1px;
}

.palette {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 18px);
  flex-wrap: wrap;
  padding: 22px 12px 12px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(78, 205, 196, 0.18));
  border-radius: 25px;
  margin: 14px 8px 6px;
  border: 3px dashed rgba(167, 139, 250, 0.5);
  position: relative;
  flex: 1;
  align-content: center;
  min-height: 80px;
  max-width: calc(100% - 16px);
  box-sizing: border-box;
}

.palette::before {
  content: '🎨 Cógelas tantas veces como quieras';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-purple);
  color: white;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.palette-item {
  width: clamp(56px, 9vw, 88px);
  height: clamp(56px, 9vw, 88px);
  background: white;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
  cursor: grab;
  border: 3px solid #fff;
  position: relative;
  transition: transform 0.15s;
  flex-shrink: 0;
  padding: 4px;
}

.palette-item .item-content {
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1;
}

.palette-item::after {
  content: '∞';
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--c-yellow);
  color: #333;
  font-size: 0.95rem;
  font-weight: bold;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
  line-height: 1;
}

.palette-item:active { transform: scale(0.94); }

/* ========================================================
   NIVEL DE CLASIFICACIÓN (zonas)
   ======================================================== */
.zones {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px;
  width: 100%;
  flex-shrink: 0;
}

.zone {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 320px;
  border: 4px dashed;
  border-radius: 25px;
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.25s;
  min-height: 130px;
  position: relative;
}

.zone-header {
  text-align: center;
  font-size: clamp(0.95rem, 2.2vw, 1.3rem);
  font-weight: bold;
  padding: 4px;
}

.zone-content {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 6px;
  min-height: 60px;
}

.zone-content .item.placed {
  position: relative;
  inset: auto;
  width: clamp(48px, 8vw, 70px);
  height: clamp(48px, 8vw, 70px);
  box-shadow: 0 3px 0 rgba(0,0,0,0.12);
  border-color: rgba(255,255,255,0.95);
  background: white;
  padding: 2px;
}

.zone-content .item.placed .item-content {
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
}

.zone.full {
  border-style: solid !important;
  animation: pop 0.5s;
}
.zone.full .zone-header::after { content: ' ✅'; }

.classify-pool { min-height: 110px; background: rgba(255,255,255,0.5); }

/* ========================================================
   PISTA / ERROR
   ======================================================== */
.hint-pulse {
  animation: hintPulse 0.7s ease-in-out infinite alternate !important;
  z-index: 5;
  position: relative;
}

@keyframes hintPulse {
  from { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 217, 61, 0.85), 0 5px 0 rgba(0,0,0,0.15); }
  to   { transform: scale(1.15); box-shadow: 0 0 0 18px rgba(255, 217, 61, 0), 0 5px 0 rgba(0,0,0,0.15); }
}

.error-flash { animation: errorFlash 0.5s !important; }

@keyframes errorFlash {
  0%, 100% { filter: none; }
  25%, 75% { filter: hue-rotate(-30deg) brightness(1.1); }
  50%      { filter: hue-rotate(-50deg) brightness(1.2); }
}

/* ========================================================
   PARTÍCULAS DE ÉXITO
   ======================================================== */
.sparkle {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  animation: sparkleFly 0.7s ease-out forwards;
}

@keyframes sparkleFly {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to   { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* ========================================================
   MODALES
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.3s;
  padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: linear-gradient(135deg, #FFF6FA, #fff);
  border-radius: 30px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
  max-width: 90%;
  animation: pop 0.5s;
  border: 6px solid var(--c-yellow);
}

.modal h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--c-pink);
  margin-bottom: 6px;
}

.modal .stars {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  margin: 8px 0;
  animation: bounce 1s ease-in-out infinite;
}

.modal .msg {
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  color: #555;
  margin-bottom: 6px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.modal-btn {
  background: var(--c-teal);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 22px;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 #38a89f;
  font-family: inherit;
}

.modal-btn.next {
  background: var(--c-purple);
  box-shadow: 0 4px 0 #7e63d6;
}

.modal-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}

/* ===== Modal intro de nivel ===== */
.intro-modal {
  background: linear-gradient(135deg, #FFE5F1 0%, #E5F1FF 50%, #FFFAE5 100%) !important;
  border-color: var(--c-purple) !important;
  max-width: 95%;
  min-width: 280px;
}

.intro-header {
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: #7E63D6;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.intro-name {
  font-size: clamp(1.4rem, 3.6vw, 2.2rem);
  color: var(--c-pink);
  font-weight: bold;
  margin: 6px 0 10px;
  text-shadow: 2px 2px 0 #FFF;
}

.intro-icons {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin: 10px 0 14px;
  line-height: 1.2;
  animation: bounce 1.6s ease-in-out infinite;
}

.intro-instruction {
  font-size: clamp(0.95rem, 2.4vw, 1.3rem);
  color: #333;
  background: rgba(255,255,255,0.7);
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 14px;
  font-weight: bold;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}

.intro-progress {
  width: 100%;
  height: 7px;
  background: rgba(0,0,0,0.1);
  border-radius: 7px;
  margin-top: 14px;
  overflow: hidden;
}

.intro-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--c-purple), var(--c-pink));
  border-radius: 7px;
}

.intro-progress-bar.running { animation: introProgress 3.6s linear forwards; }

@keyframes introProgress { from { width: 0%; } to { width: 100%; } }

/* ========================================================
   CONFETTI
   ======================================================== */
.confetti {
  position: fixed;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 200;
  top: -20px;
}

@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ========================================================
   ANIMACIONES BASE
   ======================================================== */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-12px) rotate(-3deg); }
  40%      { transform: translateX(12px) rotate(3deg); }
  60%      { transform: translateX(-10px) rotate(-2deg); }
  80%      { transform: translateX(10px) rotate(2deg); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ========================================================
   RESPONSIVE — paisaje muy bajo
   ======================================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .level-card  { padding: 6px; }
  .instruction { padding: 5px 10px; font-size: 0.9rem; }
  .pool        { min-height: 60px; padding: 8px; }
  .palette     { padding: 18px 10px 8px; min-height: 60px; }
  #menu h1     { font-size: 1.3rem; margin-bottom: 0; }
  #menu .subtitle { display: none; }
}
