:root {
  --primary-gold: #ffd700;
  --secondary-gold: #ffaa00;
  --light-gold: #fff4a3;
  --glow-color: rgba(255, 215, 0, 0.45);
  --glass-bg: rgba(18, 20, 32, 0.65);
  --glass-border: rgba(255, 215, 0, 0.28);
  --text-main: #fdfdfd;
  --text-muted: #d0d2db;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #05060b;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-main);
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Transición Warp Flash */
#warp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 235, 150, 0.95) 0%, rgba(255, 170, 0, 0.7) 40%, rgba(5, 6, 11, 0.9) 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#warp-overlay.active {
  opacity: 1;
}

/* =========================================
   PANTALLA DE DEDICATORIA (INICIAL)
========================================= */
#dedication-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  background: radial-gradient(ellipse at center, rgba(20, 16, 35, 0.75) 0%, rgba(5, 6, 11, 0.95) 100%);
  backdrop-filter: blur(8px);
  padding: 20px;
  transition: opacity 1.2s ease, transform 1.2s ease;
}

#dedication-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.08);
}

.dedication-card {
  position: relative;
  max-width: 580px;
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 42px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px var(--glow-color);
  backdrop-filter: blur(20px);
  text-align: center;
  animation: floatCard 6s ease-in-out infinite;
}

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

.sunflower-emblem {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sunflower-emblem .flower-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 15px #ffcc00);
  animation: pulseRotate 12s linear infinite;
}

@keyframes pulseRotate {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}

.badge-date {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary-gold);
  background: rgba(255, 215, 0, 0.12);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  margin-bottom: 18px;
}

.title-dedication {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 8px;
}

.recipient-wrapper {
  margin: 12px 0 20px;
}

.recipient-name {
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff8d6;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.75), 0 0 35px rgba(255, 170, 0, 0.5);
  display: inline-block;
  padding: 6px 20px;
  border-radius: 14px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 0 12px rgba(255, 215, 0, 0.1);
}

.dedication-message {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-weight: 300;
  padding: 0 10px;
}

.dedication-message strong {
  color: var(--primary-gold);
  font-weight: 500;
}

.btn-enter-galaxy {
  position: relative;
  background: linear-gradient(135deg, #ffd700, #ff9500);
  color: #120e03;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 16px 36px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(255, 170, 0, 0.55), 0 0 20px rgba(255, 215, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-enter-galaxy:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 40px rgba(255, 170, 0, 0.8), 0 0 35px rgba(255, 235, 120, 0.7);
  filter: brightness(1.08);
}

.btn-enter-galaxy:active {
  transform: translateY(0) scale(0.98);
}

/* =========================================
   INTERFAZ DE LA GALAXIA (HUD)
========================================= */
#galaxy-hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  opacity: 0;
  transition: opacity 1.5s ease;
}

#galaxy-hud.visible {
  opacity: 1;
}

.hud-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 8px 18px;
  border-radius: 40px;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.hud-brand span.icon {
  font-size: 1.25rem;
  filter: drop-shadow(0 0 8px var(--primary-gold));
}

.hud-brand span.text {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--light-gold);
}

.hud-controls {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.btn-icon {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
  outline: none;
}

.btn-icon:hover {
  background: rgba(255, 215, 0, 0.25);
  border-color: var(--primary-gold);
  transform: scale(1.08);
  box-shadow: 0 0 15px var(--glow-color);
}

/* Tarjeta de Frase Flotante */
.phrase-container {
  display: flex;
  justify-content: center;
  width: 100%;
  pointer-events: auto;
  margin-bottom: 15px;
}

.phrase-card {
  max-width: 620px;
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  border-radius: 22px;
  padding: 24px 30px 20px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 200, 50, 0.2);
  transition: transform 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.phrase-card:hover {
  border-color: rgba(255, 215, 0, 0.6);
}

.quote-symbol {
  font-size: 2rem;
  line-height: 1;
  color: var(--primary-gold);
  opacity: 0.8;
  margin-bottom: -5px;
}

.phrase-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
  color: #fff;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.phrase-text.changing {
  opacity: 0;
  transform: translateY(6px);
}

.phrase-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.btn-pill {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: var(--light-gold);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-pill:hover {
  background: rgba(255, 215, 0, 0.35);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
  transform: translateY(-1px);
}

/* Indicador de ayuda táctil/mouse */
.interaction-hint {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
}

/* Notificación emergente al hacer clic en un girasol */
#sunflower-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: rgba(18, 16, 26, 0.92);
  border: 1px solid var(--primary-gold);
  border-radius: 20px;
  padding: 24px 30px;
  color: #fff;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 15px 50px rgba(0,0,0,0.8), 0 0 35px rgba(255, 215, 0, 0.5);
  backdrop-filter: blur(15px);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#sunflower-popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

#sunflower-popup h3 {
  color: var(--primary-gold);
  font-size: 1.2rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#sunflower-popup p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e5e5e5;
  margin-bottom: 16px;
}



/* Responsive */
@media (max-width: 600px) {
  .dedication-card {
    padding: 30px 20px;
  }
  .title-dedication {
    font-size: 1.35rem;
  }
  .recipient-name {
    font-size: 1.6rem;
    letter-spacing: 1px;
    padding: 4px 14px;
  }
  .dedication-message {
    font-size: 0.9rem;
  }
  .btn-enter-galaxy {
    padding: 14px 28px;
    font-size: 0.95rem;
  }
  .phrase-card {
    padding: 18px 20px 16px;
  }
  .phrase-text {
    font-size: 0.98rem;
  }
  .hud-brand span.text {
    display: none;
  }
}
