/* =========================================
   0. VARIABLES Y ESTILOS GENERALES
   ========================================= */
:root {
  --pink-soft: #f8b6cb;
  --pink-dark: #e55c8a;
  --white: #ffffff;
  --text: #4a3e3d;
  --ease-kawaii: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Nuevas variables de contraste para el reverso */
  --card-bg-back: #fdfbf7;      
  --text-back-dark: #2d1b2e;   
  --text-back-note: #382133;  
  --pink-note-bg: #f4e8ee;     
}

.album-wall-section {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  padding: 10px;
  box-sizing: border-box;
}

/* Encabezado */
.wall-header {
  text-align: center;
  margin-bottom: 15px;
}

.wall-title {
  font-family: 'Silkscreen', cursive, sans-serif;
  font-size: 30px;
  color: var(--pink-dark);
  margin: 0 0 5px 0;
  text-shadow: 1.5px 1.5px 0 var(--text);
}

.wall-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text);
  margin: 0;
  opacity: 0.85;
}

.hint {
  text-align: center;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--text);
  margin-top: 10px;
  opacity: 0.75;
}

/* =========================================
   1. TOOLBAR, BOTONERA Y FILTROS
   ========================================= */
#toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.toolbar-actions button {
  font-family: 'Silkscreen', cursive;
  font-size: 16px;
  background: var(--white);
  color: var(--pink-dark);
  border: 2px solid var(--pink-dark);
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--text);
  transition: transform 0.15s ease, background 0.15s ease;
}

.toolbar-actions button:hover {
  transform: translateY(-2px);
  background: var(--pink-soft);
}

.filter-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--white);
  border: 2px solid var(--pink-dark);
  border-radius: 20px;
  padding: 8px 16px;
  box-shadow: 3px 3px 0 var(--text);
}

.filter-group label {
  font-family: 'Silkscreen', cursive;
  font-size: 12px;
  color: var(--pink-dark);
}

.filter-group select {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  background: var(--pink-soft);
  border: 1.5px solid var(--pink-dark);
  border-radius: 12px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease;
}

.filter-group select:hover {
  transform: scale(1.03);
}

.no-results {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: 'Silkscreen', cursive;
  color: var(--white);
  font-size: 14px;
  line-height: 1.6;
  text-shadow: 2px 2px 0 var(--pink-dark);
}

/* =========================================
   2. EL MURO DE CORCHO
   ========================================= */
#wall {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 640px;
  height: auto;
  
  /* Textura de corcho */
  background-color: #d19a5b;
  background-image: 
    radial-gradient(#b87d3b 15%, transparent 16%),
    radial-gradient(#e5ad6f 15%, transparent 16%),
    radial-gradient(rgba(100, 50, 10, 0.15) 15%, transparent 20%);
  background-size: 12px 12px, 12px 12px, 24px 24px;
  background-position: 0 0, 6px 6px, 3px 3px;
  
  /* Marco de madera */
  border: 12px solid #a36f38;
  border-radius: 18px;
  box-shadow: 
    inset 0 0 25px rgba(50, 20, 0, 0.4),
    8px 8px 0 rgba(109, 47, 68, 0.15);
  
  overflow: visible; 
  perspective: 1000px;
  transition: min-height 0.3s ease;
}

/* =========================================
   3. ESTRUCTURA DE LA TARJETA Y ANIMACIÓN 3D
   ========================================= */
.card {
  position: absolute;
  width: 190px;
  min-height: 230px;
  cursor: grab;
  user-select: none;
  touch-action: none;

  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-kawaii), box-shadow 0.2s ease;
}

.card.flipped {
  transform: rotate(var(--card-r, 0deg)) rotateY(180deg) !important;
}

.pin {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--pink-dark) 50%, #902040 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.4);
  z-index: 20;
}

.front {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: var(--white);
  border: 2.5px solid var(--pink-dark);
  border-radius: 12px;
  padding: 12px 10px 14px;
  box-sizing: border-box;
  box-shadow: 3px 6px 12px rgba(60, 30, 10, 0.35);

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* REVERSO REDISEÑADO: Fondo limpio, sin bordes toscos */
.back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--card-bg-back);
  border: 2.5px solid var(--pink-dark);
  border-radius: 12px;
  padding: 14px 12px;
  box-sizing: border-box;
  box-shadow: 3px 6px 12px rgba(60, 30, 10, 0.35);
  transform: rotateY(180deg);
  overflow-y: auto;
  max-height: 420px;
  color: var(--text-back-dark);

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.back::-webkit-scrollbar {
  width: 5px;
}
.back::-webkit-scrollbar-thumb {
  background: rgba(229, 92, 138, 0.4);
  border-radius: 10px;
}

/* =========================================
   4. ELEMENTOS DE CONTENIDO INTERNO
   ========================================= */
.cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  background: var(--pink-soft);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.label {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  line-height: 1.25;
  color: var(--text);
}

.label b {
  display: block;
  font-family: 'Silkscreen', cursive;
  font-size: 11px;
  color: var(--pink-dark);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ESTRELLAS: Grandes, legibles y nítidas */
.stars {
  text-align: center;
  font-size: 16px;
  letter-spacing: 2px;
  color: #f59e0b;
  margin: 2px 0 8px 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* DESCRIPCIÓN Y NOTA: Alto contraste y fondo fluido */
.album-note {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-back-note);
  margin: 8px 0;
  text-align: left;
  background: var(--pink-note-bg);
  padding: 10px;
  border-radius: 10px;
  border: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* =========================================
   5. BOTONES Y DESPLEGABLE DE CANCIONES
   ========================================= */
/* Botones exteriores (Spotify / YouTube) */
.links-container, .external-links {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.card-btn, .btn-stream {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 4px;
  border-radius: 8px;
  border: none;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.card-btn.spotify, .btn-spotify { background: #1db954; }
.card-btn.youtube, .btn-youtube { background: #ff0000; }

.card-btn:hover, .btn-stream:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.08);
}

/* Botón desplegable de canciones fluido (estilo cápsula) */
.toggle-tracks-btn {
  width: 100%;
  background: #ffffff;
  color: var(--pink-dark);
  border: 1.5px solid #f0cad8;
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 10px;
  margin: 8px 0 6px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.toggle-tracks-btn:hover {
  background: var(--pink-dark);
  color: #ffffff;
  border-color: var(--pink-dark);
}

/* Lista y secciones de canciones */
.tracklist {
  list-style: none;
  padding: 6px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.tracklist.hidden, .tracklist[style*="display: none"] {
  display: none;
}

.track-item {
  background: transparent;
  border-bottom: 1px solid #f5eaf0;
  border-radius: 0;
  padding: 5px 4px;
  text-align: left;
}

.track-item:last-child {
  border-bottom: none;
}

.track-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; 
  gap: 6px;                
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-back-dark);
}

.track-title {
  flex: 1;                 
  white-space: normal;     
  overflow: visible;
  word-break: break-word; 
  line-height: 1.25;       
}

.track-time {
  font-size: 10px;
  color: var(--text-back-dark);
  opacity: 0.7;
  font-weight: normal;
  white-space: nowrap;    
}

.track-detail {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  color: var(--text-back-note);
  line-height: 1.3;
  margin: 3px 0 0 0;
  font-style: italic;
}

/* =========================================
   6. FOOTER Y CRÉDITOS RETRO
   ========================================= */
footer {
  text-align: center;
  margin-top: 30px;
  padding: 20px 10px;
  font-family: 'Silkscreen', cursive;
  color: var(--text);
}

.footer-divider {
  color: var(--pink-soft);
  font-size: 10px;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.footer-credits {
  font-size: 10px;
}

.footer-credits span {
  color: var(--pink-dark);
}

.footer-nav {
  margin-top: 8px;
}

.sitemap-link {
  font-size: 9px;
  color: var(--pink-dark);
  text-decoration: none;
  border-bottom: 1px dashed var(--pink-dark);
  padding-bottom: 2px;
}

.sitemap-link:hover {
  color: var(--text);
  border-color: var(--text);
}

.footer-barcode {
  font-size: 14px;
  letter-spacing: 2px;
  margin-top: 10px;
  opacity: 0.4;
}

/* =========================================
   7. OPTIMIZACIÓN RESPONSIVE / MÓVILES
   ========================================= */
@media (max-width: 600px) {
  #wall {
    min-height: 520px;
    border-width: 8px;
    border-radius: 12px;
  }

  .card {
    width: 140px;
    min-height: 185px;
  }

  .back {
    max-height: 280px;
    padding: 10px 8px;
  }

  .label { font-size: 10px; }
  .label b { font-size: 9px; }
  .stars { font-size: 13px; }
  .album-note { font-size: 10.5px; padding: 6px; }

  .card-btn, .btn-stream {
    font-size: 9px;
    padding: 5px 2px;
  }

  .toggle-tracks-btn {
    font-size: 9.5px;
    padding: 5px 4px;
  }

  .track-header { font-size: 9.5px; }
  .track-title { max-width: 80px; }
  .track-detail { font-size: 8.5px; }

  .toolbar-actions {
    width: 100%;
    justify-content: center;
  }
}