body {
  font-family: 'Open Sans', sans-serif;
  background-color: #f5f7fa;
  margin: 0;
  padding: 0; /* Cambiado a 0 para que la barra pegue arriba de todo */
  color: #2c3e50;
}

/* NUEVA BARRA DE ENCABEZADO A LO LARGO */
.hero-header-bar {
  background-color: #1e272e; /* Fondo oscuro elegante */
  background-image: linear-gradient(135deg, #2c3e50 0%, #0f171e 100%); /* Degradado sutil */
  width: 100%;
  padding: 30px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 25px;
  box-sizing: border-box;
}

.header-content {
  max-width: 1250px;
  margin: 0 auto;
  text-align: center;
}

.hero-header-bar h1 { 
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; 
  margin: 0 0 10px 0; 
  color: #ffffff; /* Letras blancas para contraste perfecto */
  letter-spacing: -0.5px;
  font-size: 2.3rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-header-bar .subtitle { 
  color: #ced6e0; /* Color gris claro/azul para la frase de Maslow */
  font-style: italic; 
  margin: 0; 
  font-size: 1.15rem; 
}

/* Contenedor principal de la simulación */
.container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 20px 40px 20px;
  text-align: center;
}

.instructions { 
  color: #e67e22; 
  font-weight: 600; 
  margin-top: 0;
  margin-bottom: 35px; 
  font-size: 1rem; 
}

/* Panel de Control de Dinero abajo */
.budget-panel {
  background: white;
  padding: 15px 30px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  display: inline-flex;
  align-items: center;
  gap: 30px;
  margin-top: 40px; 
  margin-bottom: 20px;
}

.budget-panel h2 { font-family: 'Montserrat', sans-serif; margin: 0; color: #27ae60; font-size: 1.5rem; }
.budget-panel p { margin: 0; font-weight: 600; color: #7f8c8d; }

#reset-btn {
  font-family: 'Montserrat', sans-serif;
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
#reset-btn:hover { background-color: #c0392b; }

/* Distribución de Pantalla */
.main-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 35px;
  align-items: start;
}

@media (max-width: 950px) {
  .main-layout { grid-template-columns: 1fr; }
}

/* CONTENEDOR DE LA PIRÁMIDE */
.pyramid-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.pyramid-level {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px;
  transition: all 0.3s ease;
  min-height: 85px;
  box-sizing: border-box;
}

.lvl-5 { 
  width: 38%; background-color: #ff7675; 
  border-top-left-radius: 120px; border-top-right-radius: 120px;
  padding-top: 25px;
}
.lvl-4 { width: 53%; background-color: #fab1a0; }
.lvl-3 { width: 68%; background-color: #ffeaa7; color: #2d3436; }
.lvl-2 { width: 84%; background-color: #74b9ff; }
.lvl-1 { width: 100%; background-color: #55efc4; color: #2d3436; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px;}

.level-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.level-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

/* BANCO DE TARJETAS EXTERNAS */
.cards-bank {
  background: white;
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  text-align: left;
}

.cards-bank h3 { font-family: 'Montserrat', sans-serif; margin-top: 0; border-bottom: 2px solid #f1f2f6; padding-bottom: 10px; }

.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
}

/* Tarjeta Interactiva */
.expense-card {
  position: relative;
  background: #f8f9fa;
  border: 2px solid #e2e8f0;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  transition: all 0.2s ease;
  user-select: none;
}

.expense-card:hover:not(.disabled) {
  transform: translateY(-3px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.1);
  border-color: #a5b1c2;
}

.card-name { font-size: 0.85rem; font-weight: 600; color: #2c3e50; padding-right: 3px; line-height: 1.3;}
.card-price { font-size: 0.95rem; font-weight: bold; color: #27ae60; margin-top: 5px; }

/* Estilos de la tarjeta cuando pasa adentro de la Pirámide */
.pyramid-level .expense-card {
  background: white;
  border: none;
  padding: 6px 22px 6px 10px; 
  font-size: 0.75rem;
  min-width: 115px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  cursor: default;
  transform: none !important;
  color: #2c3e50;
}
.pyramid-level .card-name { font-size: 0.75rem; text-align: left; }
.pyramid-level .card-price { font-size: 0.8rem; margin-top: 2px; text-align: left; }

/* Botón de la Crucecita */
.close-btn {
  position: absolute;
  top: 1px;
  right: 4px;
  background: none;
  border: none;
  color: #e74c3c;
  font-weight: bold;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.close-btn:hover {
  transform: scale(1.2);
}

.expense-card.disabled {
  opacity: 0.3;
  pointer-events: none;
  background: #dfe4ea;
}