/* ==========================================================================
   disenos/estados.css — Estados compartidos de las 24 casillas y canvas confeti
   Depende de: temas.css.
   ========================================================================== */

.cal-tile {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.16s ease, filter 0.16s ease;
}

.cal-tile:focus-visible {
  outline: 3px solid #FACC15;
  outline-offset: 2px;
}

.cal-tile:hover {
  transform: translateY(-3px) scale(1.022);
  z-index: 8;
}

.cal-tile.state-today {
  animation: todayPulseGlow 1.9s infinite ease-in-out;
  z-index: 6;
}

@keyframes todayPulseGlow {
  0%, 100% {
    filter: drop-shadow(0 0 0px rgba(250, 204, 21, 0));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.95));
  }
}

.cal-tile.is-shaking {
  animation: retroWobble 0.44s ease-in-out !important;
}

@keyframes retroWobble {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  18% { transform: translateX(-6px) rotate(-2.5deg); }
  38% { transform: translateX(6px) rotate(2.5deg); }
  58% { transform: translateX(-4px) rotate(-1.4deg); }
  78% { transform: translateX(4px) rotate(1.4deg); }
}

.cal-tile.is-unwrapping {
  animation: unwrapPop 0.56s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}

@keyframes unwrapPop {
  0% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.1) rotate(-4deg); }
  65% { transform: scale(1.15) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.tile-badge-today {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 12;
  background: #FACC15;
  color: #1A1A2E;
  border: 2px solid #1A1A2E;
  border-radius: 999px;
  padding: 1px 7px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 1.5px 1.5px 0 #1A1A2E;
  line-height: 1.3;
  animation: tinyFloat 1.5s infinite;
}

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

.tile-badge-opened {
  position: absolute;
  bottom: 5px;
  right: 5px;
  z-index: 12;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #10B981;
  color: #FFFFFF;
  border: 2px solid #1A1A2E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 1.5px 1.5px 0 #1A1A2E;
}

.tile-badge-locked {
  position: absolute;
  bottom: 5px;
  left: 5px;
  z-index: 12;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1A1A2E;
  border: 1.5px solid #1A1A2E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  opacity: 0.9;
}

/* Estados visuales cuando el tablero se usa dentro de /editor */
.cal-tile.esta-seleccionada-editor {
  outline: 4px solid #FACC15;
  outline-offset: 2px;
  transform: translateY(-3px) scale(1.03);
  z-index: 14;
  box-shadow: 0 0 0 2px #1A1A2E, 0 8px 16px rgba(26, 26, 46, 0.35);
}

.tile-badge-editor-media {
  position: absolute;
  bottom: 5px;
  left: 5px;
  z-index: 12;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #FFFFFF;
  color: #1A1A2E;
  border: 1.5px solid #1A1A2E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  box-shadow: 1.5px 1.5px 0 #1A1A2E;
}

.tile-badge-editor-editando {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 12;
  background: #FACC15;
  color: #1A1A2E;
  border: 2px solid #1A1A2E;
  border-radius: 999px;
  padding: 1px 7px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 1.5px 1.5px 0 #1A1A2E;
}

/* Contenido multimedia mostrado dentro de casillas desbloqueadas en /editor */
.casilla-media-imagen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 4;
  pointer-events: none;
}

.casilla-media-miniatura {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px;
  pointer-events: none;
  text-align: center;
}

.casilla-media-miniatura--audio {
  background-color: rgba(232, 243, 244, 0.94);
  color: #1A1A2E;
}

.casilla-media-miniatura--gif {
  background-color: rgba(16, 37, 66, 0.9);
  color: #FFFFFF;
}

.casilla-media-miniatura--video {
  background-color: rgba(16, 37, 66, 0.92);
  color: #FFFFFF;
}

.tile-badge-media-tipo {
  position: absolute;
  bottom: 5px;
  left: 5px;
  z-index: 12;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #1A1A2E;
  border: 1.5px solid #1A1A2E;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 1.5px 1.5px 0 #1A1A2E;
}

.casilla-media-miniatura-icono {
  font-size: 1.55rem;
  line-height: 1;
}

.casilla-media-miniatura-texto {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cal-tile.casilla-con-media-preview .ilustracion-svg,
.cal-tile.casilla-con-media-preview .washi-arte,
.cal-tile.casilla-con-media-preview .adornos-fondo,
.cal-tile.casilla-con-media-preview .gift-ribbon-v,
.cal-tile.casilla-con-media-preview .gift-ribbon-h,
.cal-tile.casilla-con-media-preview .santa-fur-trim,
.cal-tile.casilla-con-media-preview .santa-belt {
  opacity: 0;
}

.cal-tile.casilla-con-media-preview .postal-corner-num,
.cal-tile.casilla-con-media-preview .art-corner-num,
.cal-tile.casilla-con-media-preview .washi-sticker-num,
.cal-tile.casilla-con-media-preview .gift-num-plain {
  color: #1A1A2E;
  background-color: rgba(255, 255, 255, 0.92);
  border: 1.5px solid #1A1A2E;
  border-radius: 9999px;
  padding: 2px 7px;
  font-size: 0.85rem;
  line-height: 1.1;
  text-shadow: none;
  box-shadow: 1.5px 1.5px 0 #1A1A2E;
  z-index: 9;
}

.cal-tile.casilla-con-media-preview .gift-num-plain {
  position: absolute;
  top: 6px;
  right: 6px;
  margin-bottom: 0;
}

.cal-tile.casilla-con-media-preview .gift-num-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  font-size: 0.92rem;
  z-index: 9;
}

/* Clases SVG compartidas (evitan atributos style="" en línea) */
.svg-defs-oculto {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.adornos-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.ilustracion-svg {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: 84%;
  max-height: 84%;
}

.ilustracion-svg--hero {
  max-width: 94%;
  max-height: 94%;
}

.ilustracion-svg--artesanal {
  z-index: 5;
}

/* Canvas a pantalla completa para lluvia de confeti */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 80;
}
