:root {
  --morado-borde: #9333ea;
  --morado-fondo: #d8b4fe;  /* lila */
  --morado-texto: #4b0082;  /* morado más fuerte */
}

body {
  font-family: 'Comic Neue', cursive, sans-serif;
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f3e8ff;
  overflow: hidden;
  position: relative;
  color: var(--morado-texto);
}

/* Fondo diagonal */
.background-text {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.background-text span {
  position: absolute;
  color: rgba(148, 51, 234, 0.08);
  font-size: 32px;
  transform: rotate(-30deg);
  white-space: nowrap;
  user-select: none;
}

/* Imagen decorativa */
#decorative-img {
  position: fixed;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 235px;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 5;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Botón pastel */
.cake-button {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 42px;
  cursor: pointer;
  animation: bounce 2s infinite;
  z-index: 2;
  user-select: none;
  outline: none;
}
.cake-button:focus { outline: none; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Burbuja animada (sale del pastel) */
.phrase-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-radius: 20px;
  padding: 14px 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  border: 2px solid var(--morado-borde);
  font-size: 18px;
  max-width: 400px;
  opacity: 1;
  pointer-events: none;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: transform 6s ease-out, opacity 6s ease-out;
  z-index: 3;
  user-select: none;
}
.phrase-bubble img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--morado-borde);
  flex-shrink: 0;
  -webkit-user-drag: none;
  user-select: none;
}
.phrase-text {
  background-color: var(--morado-fondo);
  border-radius: 15px;
  padding: 10px 16px;
  color: var(--morado-texto);
  font-size: 16px;
  position: relative;
  user-select: none;
}
.phrase-text::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 20px;
  width: 0;
  height: 0;
  border: 12px solid transparent;
  border-top-color: var(--morado-fondo);
}

/* Burbujas estáticas (PC) */
.fixed-bubble {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 20px;
  padding: 10px 14px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  border: 2px solid var(--morado-borde);
  font-size: 14px;
  z-index: 4;
  opacity: 0;
  transform: scale(.95);
  transition: opacity 0.5s ease, transform 0.5s ease;
  max-width: 260px;
}
.fixed-bubble.show {
  opacity: 1;
  transform: scale(1);
}
.fixed-bubble img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--morado-borde);
  -webkit-user-drag: none;
  user-select: none;
}

/* Contenedor de texto lilita dentro de burbujas estáticas */
.fixed-bubble .inner {
  background-color: var(--morado-fondo);
  color: var(--morado-texto);
  border-radius: 15px;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
  max-width: 180px;
  user-select: none;
}
.fixed-bubble .inner strong {
  font-weight: bold;
}

/* Efecto hover en las burbujas estáticas (PC) */
.fixed-bubble {
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.fixed-bubble:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 16px rgba(147, 51, 234, 0.4); /* sombra morada suave */
  z-index: 10; /* se eleva sobre otras burbujas */
}


/* Música */
#music-controls {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  opacity: 0.4;
  transition: opacity 0.3s;
}
#music-controls:hover { opacity: 1; }
#music-btn {
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
}

/* Móvil */
@media (max-width: 600px) {
  .cake-button { display: none; }
  .phrase-bubble,
  .fixed-bubble { display: none !important; }

  body {
    overflow-y: auto;
    display: block;
    padding-bottom: 80px;
  }

  #decorative-img {
    position: relative !important;
    top: 0 !important;
    transform: none !important;
    width: 120px !important;
    opacity: 1 !important;
    margin: 10px auto 0;
  }

  #mobile-phrase-list {
    display: block;
    max-width: 90vw;
    margin: 10px auto 0;
    color: var(--morado-texto);
  }
  #mobile-phrase-list .item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
  }
  #mobile-phrase-list .item img {
    width: 40px;
    height: 40px;
    border: 2px solid var(--morado-borde);
    border-radius: 50%;
    object-fit: cover;
  }
  #mobile-phrase-list .item .text {
    background-color: var(--morado-fondo);
    color: var(--morado-texto);
    border-radius: 15px;
    padding: 8px 14px;
    font-size: 14px;
    text-align: left;
    max-width: calc(90vw - 60px);
  }
  #mobile-phrase-list .item .text strong { font-weight: bold; }
}
