body {
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, #fff5d6 0%, #ffe4ec 45%, #f8d8ff 100%);
    animation: backgroundGlow 10s ease-in-out infinite alternate;
}

#login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 3rem;
    border-radius: var(--border-radius-large);
    box-shadow: 0 25px 55px rgba(148, 102, 255, 0.25);
    animation: fadeIn 1s ease-in-out;
    position: relative;
    overflow: hidden;
}

#login-container .login-steps {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--muted);
    text-align: center;
    margin: -0.5rem 0 0.5rem;
    letter-spacing: 0.02em;
}

#login-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.4), transparent 55%),
                radial-gradient(circle at bottom left, rgba(255,255,255,0.35), transparent 50%);
    pointer-events: none;
}

#avatar-selection {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.avatar-option {
    font-size: 4rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 1rem;
    border-radius: 50%;
    border: 5px solid transparent;
    position: relative;
    box-shadow: 0 10px 25px rgba(148, 102, 255, 0.1);
    animation: floaty 4s ease-in-out infinite;
    background: rgba(255, 255, 255, 0.85);
}

.avatar-option.pulse {
    animation: pulseSelect 0.5s ease;
}

.avatar-option:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 14px 32px rgba(148, 102, 255, 0.35);
}

.avatar-option.selected {
    border-color: var(--primary-light);
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.7), 0 18px 35px rgba(148,102,255,0.4);
    animation: none;
}

.avatar-option.selected::before {
    content: '✨';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    animation: twinkle 1.2s ease-in-out infinite;
}

.avatar-option.selected::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(255,255,255,0.35), rgba(255,255,255,0));
    animation: starglow 2s linear infinite;
    pointer-events: none;
}

.avatar-option[data-avatar="🦄"].selected { animation: unicornBlink 1.6s steps(2) infinite; }
.avatar-option[data-avatar="🐼"].selected { animation: pandaNod 1.4s ease-in-out infinite; }
.avatar-option[data-avatar="🐸"].selected { animation: frogHop 1s ease-in-out infinite; }

.name-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-medium);
    padding: 0.5rem 1rem;
    border: 2px solid rgba(148, 102, 255, 0.2);
    box-shadow: 0 8px 20px rgba(148, 102, 255, 0.15);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.name-input-wrapper.typing {
    animation: bounceGlow 0.45s ease;
}

.name-input-wrapper:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 12px 28px rgba(148, 102, 255, 0.3);
}

.name-icon {
    font-size: 1.75rem;
}

#name-input {
    font-family: var(--font-body);
    font-size: 1.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-medium);
    border: none;
    text-align: left;
    width: 100%;
    max-width: 340px;
    background: transparent;
    outline: none;
}

#color-selection {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.color-option {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 5px solid transparent;
    position: relative;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.75), transparent 60%),
                var(--color-base);
    box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.color-option:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 16px 28px rgba(0,0,0,0.2);
}

.color-option.selected {
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 6px rgba(255,255,255,0.65), 0 18px 35px rgba(0,0,0,0.25);
}

.color-option-white {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.color-option::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -2.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

.color-option:hover::after {
    opacity: 1;
    transform: translate(-50%, -4px);
}

.color-option.selected::before {
    content: '';
    position: absolute;
    top: -12px;
    right: -12px;
    background: white;
    color: var(--success);
    border-radius: 50%;
    padding: 0.1rem 0.4rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#login-btn {
  margin-top: 1rem;
  background-image: linear-gradient(135deg, hsl(0, 0%, 61%), #9dff9f);
  background-size: 200% 200%;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 2.5rem;
  font-size: 1.5rem;
  font-weight: bold;
  border: none;
  border-radius: 999px;
  box-shadow: 0 12px 25px rgba(77, 216, 141, 0.35);
  position: relative;
  overflow: hidden;
  cursor: pointer;

  /* ✨ Animaciones */
  animation: pulse 2.5s infinite, gradientShift 6s ease infinite;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-label {
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
}

#login-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 18px 35px rgba(77, 216, 141, 0.45);
}

#login-btn:hover .rocket-icon {
    animation: rocketHover 0.6s ease-in-out infinite;
}

#login-btn:active {
    transform: scale(0.97);
}

.rocket-icon {
    display: inline-block;
}

.btn-sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, rgba(255,255,255,0.9), transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkleFade 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes starglow {
    from { transform: rotate(0deg); opacity: 0.8; }
    to { transform: rotate(360deg); opacity: 0.4; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(0.9); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

@keyframes unicornBlink {
    0%, 40%, 100% { transform: translateY(-6px) scale(1.05); }
    45%, 55% { transform: translateY(-8px) scale(1.03); }
}

@keyframes pandaNod {
    0%, 100% { transform: translateY(-4px) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(-8deg); }
}

@keyframes frogHop {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-12px); }
    60% { transform: translateY(-6px); }
}

@keyframes bounceGlow {
    0% { transform: scale(1); box-shadow: 0 8px 20px rgba(148,102,255,0.15); }
    40% { transform: scale(1.02); box-shadow: 0 12px 28px rgba(148,102,255,0.3); }
    100% { transform: scale(1); box-shadow: 0 8px 20px rgba(148,102,255,0.15); }
}

@keyframes pulseSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

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

@keyframes sparkleFade {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.2); }
}

@keyframes backgroundGlow {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(12deg); }
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

@media (max-width: 480px) {
    #login-container {
        padding: 1.5rem 1rem; /* Make container more compact */
        gap: 1rem;
    }

    #login-container .login-steps {
        font-size: 0.9rem;
        margin: -0.2rem 0 0.8rem;
    }

    #avatar-selection {
        gap: 0.9rem;
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    }

    .avatar-option {
        width: clamp(92px, 30vw, 120px);
        min-height: clamp(120px, 32vw, 150px);
        padding: 0.75rem 0.5rem;
        box-shadow: 0 8px 20px rgba(148, 102, 255, 0.18);
    }

    .avatar-option img {
        width: clamp(64px, 22vw, 84px);
        height: clamp(64px, 22vw, 84px);
    }

    .avatar-option.selected {
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7), 0 16px 30px rgba(148,102,255,0.38);
    }

    .avatar-option.selected::before {
        font-size: 1.1rem;
        top: -14px;
    }

    .avatar-label {
        font-size: clamp(0.85rem, 3.4vw, 1rem);
    }

    .name-input-wrapper {
        padding: 0.4rem 0.8rem;
        gap: 0.5rem;
    }

    .name-icon {
        font-size: 1.4rem; /* Smaller icon */
    }

    #name-input {
        font-size: 1.2rem; /* Smaller font for input */
        width: 80%;
        max-width: none;
    }

    #color-selection {
        gap: 0.8rem; /* Reduce gap between color options */
    }

    .color-option {
        width: 40px; /* Smaller color options */
        height: 40px;
        border: 3px solid transparent; /* Smaller border */
        box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    }

    .color-option:hover {
        transform: translateY(-2px) scale(1.05); /* Less pronounced hover effect */
        box-shadow: 0 10px 18px rgba(0,0,0,0.15);
    }

    .color-option.selected {
        border-color: rgba(255, 255, 255, 0.95);
        box-shadow: 0 0 0 4px rgba(255,255,255,0.65), 0 12px 25px rgba(0,0,0,0.2);
    }

    .color-option.selected::before {
        top: -8px;
        right: -8px;
        font-size: 0.9rem;
        padding: 0.05rem 0.3rem;
    }

    #login-btn {
        margin-top: 0.8rem;
        padding: 0.6rem 1.6rem; /* Smaller button padding */
        font-size: 1.15rem; /* Smaller button font */
        gap: 0.45rem;
        box-shadow: 0 8px 18px rgba(77, 216, 141, 0.3);
    }

    #login-btn:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 12px 25px rgba(77, 216, 141, 0.4);
    }

    .btn-label {
        letter-spacing: 0.01em;
    }

    .question-prompt {
        font-size: 1.8rem; /* Adjust question prompt size */
    }
}
