/* ✨ Iris's Magical Unicorn World - Styles ✨ */

/* CSS Custom Properties */
:root {
    --pink-light: #FFD6E8;
    --pink: #FF9DC4;
    --pink-deep: #FF6BA9;
    --purple-light: #E8D6FF;
    --purple: #C49DFF;
    --purple-deep: #9B6BFF;
    --mint: #B8F4D8;
    --mint-deep: #6BE3A7;
    --peach: #FFE0CC;
    --peach-deep: #FFB088;
    --yellow: #FFF5B8;
    --yellow-deep: #FFE566;
    --blue-light: #D6EEFF;
    --blue: #88CCFF;
    --white: #FFFFFF;
    --rainbow-gradient: linear-gradient(
        90deg,
        #FF9DC4 0%,
        #FFB088 16%,
        #FFE566 33%,
        #6BE3A7 50%,
        #88CCFF 66%,
        #C49DFF 83%,
        #FF9DC4 100%
    );
    --magic-shadow: 0 8px 32px rgba(255, 107, 169, 0.3);
    --font-display: 'Baloo 2', cursive;
    --font-body: 'Fredoka', sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(180deg, 
        #FFF5F8 0%, 
        #F5F0FF 25%, 
        #E8F8FF 50%, 
        #FFF5E6 75%, 
        #FFF0F5 100%
    );
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    color: #6B4C7A;
}

/* ==================== */
/* SPARKLES BACKGROUND  */
/* ==================== */
.sparkles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #FFE566 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkle-float 8s ease-in-out infinite;
}

.sparkle::before {
    content: '✨';
    position: absolute;
    font-size: 14px;
    top: -2px;
    left: -2px;
}

.sparkle:nth-child(1) { left: 5%; top: 10%; animation-delay: 0s; animation-duration: 7s; }
.sparkle:nth-child(2) { left: 15%; top: 80%; animation-delay: 1s; animation-duration: 9s; }
.sparkle:nth-child(3) { left: 25%; top: 30%; animation-delay: 2s; animation-duration: 6s; }
.sparkle:nth-child(4) { left: 40%; top: 60%; animation-delay: 0.5s; animation-duration: 8s; }
.sparkle:nth-child(5) { left: 55%; top: 20%; animation-delay: 1.5s; animation-duration: 7s; }
.sparkle:nth-child(6) { left: 65%; top: 70%; animation-delay: 2.5s; animation-duration: 10s; }
.sparkle:nth-child(7) { left: 75%; top: 40%; animation-delay: 0.8s; animation-duration: 6s; }
.sparkle:nth-child(8) { left: 85%; top: 85%; animation-delay: 1.8s; animation-duration: 8s; }
.sparkle:nth-child(9) { left: 92%; top: 15%; animation-delay: 2.2s; animation-duration: 9s; }
.sparkle:nth-child(10) { left: 35%; top: 45%; animation-delay: 3s; animation-duration: 7s; }
.sparkle:nth-child(11) { left: 50%; top: 90%; animation-delay: 0.3s; animation-duration: 11s; }
.sparkle:nth-child(12) { left: 80%; top: 55%; animation-delay: 1.2s; animation-duration: 8s; }

@keyframes sparkle-float {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-20px) scale(1.2) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-10px) scale(0.8) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-25px) scale(1.1) rotate(270deg);
        opacity: 1;
    }
}

/* ==================== */
/* FLOATING CLOUDS      */
/* ==================== */
.clouds {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.cloud {
    position: absolute;
    font-size: 4rem;
    opacity: 0.4;
    filter: blur(1px);
    animation: cloud-drift 30s linear infinite;
}

.cloud-1 { top: 8%; animation-duration: 35s; font-size: 5rem; }
.cloud-2 { top: 25%; animation-duration: 45s; animation-delay: -15s; }
.cloud-3 { top: 50%; animation-duration: 40s; animation-delay: -25s; font-size: 3.5rem; }

@keyframes cloud-drift {
    0% { left: -15%; }
    100% { left: 110%; }
}

/* ==================== */
/* RAINBOW ARC          */
/* ==================== */
.rainbow {
    position: fixed;
    top: -200px;
    right: -100px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: conic-gradient(
        from 180deg,
        transparent 0deg,
        transparent 180deg,
        #FF6B6B 180deg,
        #FF8C42 195deg,
        #FFD93D 210deg,
        #6BCB77 225deg,
        #4D96FF 240deg,
        #9B59B6 255deg,
        transparent 270deg
    );
    opacity: 0.3;
    z-index: 0;
    animation: rainbow-pulse 5s ease-in-out infinite;
}

@keyframes rainbow-pulse {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.02); }
}

/* ==================== */
/* MAIN CONTAINER       */
/* ==================== */
.container {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== */
/* HERO SECTION         */
/* ==================== */
.hero {
    text-align: center;
    padding: 40px 20px 60px;
    position: relative;
}

.unicorn-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.unicorn-hero {
    width: 200px;
    height: auto;
    animation: unicorn-bounce 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(255, 107, 169, 0.4));
    position: relative;
    z-index: 2;
}

.unicorn-glow {
    position: absolute;
    inset: -30px;
    background: radial-gradient(circle, rgba(255, 157, 196, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes unicorn-bounce {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes glow-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 800;
    background: var(--rainbow-gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease-in-out infinite;
    margin-bottom: 10px;
    line-height: 1.2;
}

.title-sparkle {
    display: inline-block;
    animation: sparkle-spin 2s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

@keyframes sparkle-spin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

.subtitle {
    font-size: 1.3rem;
    color: var(--purple);
    font-weight: 500;
}

/* ==================== */
/* NAME BANNER          */
/* ==================== */
.name-banner {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 40px 0 60px;
    flex-wrap: wrap;
}

.letter {
    font-family: var(--font-display);
    font-size: clamp(3rem, 15vw, 6rem);
    font-weight: 800;
    color: hsl(var(--hue), 80%, 65%);
    text-shadow: 
        3px 3px 0 hsl(var(--hue), 80%, 85%),
        6px 6px 0 hsl(var(--hue), 60%, 90%);
    animation: letter-bounce 1s ease-in-out infinite;
    animation-delay: calc(var(--hue) * 2ms);
    cursor: default;
    transition: transform 0.3s ease;
}

.letter:hover {
    transform: scale(1.2) rotate(10deg);
}

@keyframes letter-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==================== */
/* SECTION TITLES       */
/* ==================== */
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 5vw, 2rem);
    text-align: center;
    color: var(--purple-deep);
    margin-bottom: 30px;
}

/* ==================== */
/* CARDS SECTION        */
/* ==================== */
.cards-section {
    margin-bottom: 60px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.card {
    background: var(--white);
    border-radius: 24px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--magic-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.15;
    border-radius: 24px;
}

.card-pink::before { background: var(--pink); }
.card-purple::before { background: var(--purple); }
.card-mint::before { background: var(--mint); }
.card-peach::before { background: var(--peach); }

.card:hover {
    transform: translateY(-8px) rotate(2deg);
    box-shadow: 0 16px 48px rgba(255, 107, 169, 0.4);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: icon-wobble 2s ease-in-out infinite;
}

@keyframes icon-wobble {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--purple-deep);
    margin-bottom: 5px;
}

.card p {
    color: var(--purple);
    font-weight: 500;
}

.card .big-text {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    color: var(--pink-deep);
}

/* ==================== */
/* UNICORN FRIENDS      */
/* ==================== */
.unicorn-friends {
    margin-bottom: 60px;
    text-align: center;
}

.unicorn-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.unicorn-friend {
    background: var(--white);
    border: 4px solid var(--pink);
    border-radius: 50%;
    width: 140px;
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 157, 196, 0.3);
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--purple);
}

.unicorn-friend img {
    width: 80px;
    height: auto;
    transition: transform 0.3s ease;
}

.unicorn-friend:hover {
    transform: scale(1.1);
    border-color: var(--purple);
    box-shadow: 0 12px 40px rgba(196, 157, 255, 0.5);
}

.unicorn-friend:hover img {
    transform: scale(1.1);
}

.unicorn-friend:active {
    transform: scale(0.95);
}

.friend-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--purple-deep);
    margin-top: 5px;
}

.speech-bubble {
    background: var(--white);
    border-radius: 30px;
    padding: 20px 30px;
    font-size: 1.2rem;
    color: var(--purple-deep);
    box-shadow: var(--magic-shadow);
    display: inline-block;
    position: relative;
    animation: bubble-float 3s ease-in-out infinite;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: var(--white);
}

@keyframes bubble-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ==================== */
/* RAINBOW SECTION      */
/* ==================== */
.rainbow-section {
    margin-bottom: 60px;
    text-align: center;
}

.rainbow-bands {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto 20px;
}

.band {
    height: 40px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.band::after {
    content: attr(data-color);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.band:hover::after {
    opacity: 1;
}

.band:hover {
    transform: scaleX(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.band:active {
    transform: scaleX(0.98);
}

.band-red { background: linear-gradient(90deg, #FF6B6B, #FF8585); }
.band-orange { background: linear-gradient(90deg, #FF8C42, #FFA566); }
.band-yellow { background: linear-gradient(90deg, #FFD93D, #FFE566); }
.band-green { background: linear-gradient(90deg, #6BCB77, #88E394); }
.band-blue { background: linear-gradient(90deg, #4D96FF, #77B0FF); }
.band-purple { background: linear-gradient(90deg, #9B59B6, #B577CF); }

.rainbow-hint {
    color: var(--purple);
    font-size: 1rem;
}

/* ==================== */
/* STAR GAME            */
/* ==================== */
.star-game {
    margin-bottom: 60px;
    text-align: center;
}

.star-counter {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    border-radius: 20px;
    padding: 20px 40px;
    box-shadow: var(--magic-shadow);
    margin-bottom: 30px;
}

.star-count {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.star-label {
    font-size: 1.2rem;
    color: var(--purple);
    font-weight: 600;
}

.star-field {
    min-height: 200px;
    background: linear-gradient(135deg, var(--purple-light) 0%, var(--blue-light) 100%);
    border-radius: 30px;
    position: relative;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 4px 20px rgba(155, 107, 255, 0.2);
}

.star-catch {
    position: absolute;
    font-size: 2rem;
    cursor: pointer;
    animation: star-twinkle 1s ease-in-out infinite;
    transition: transform 0.2s ease;
    user-select: none;
}

.star-catch:hover {
    transform: scale(1.3);
}

.star-catch:active {
    transform: scale(0.8);
}

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

.star-catch.caught {
    animation: star-caught 0.5s ease-out forwards;
}

@keyframes star-caught {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 0.5; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

.magic-button {
    font-family: var(--font-display);
    font-size: 1.3rem;
    padding: 15px 40px;
    background: var(--rainbow-gradient);
    background-size: 200% auto;
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 107, 169, 0.4);
    transition: all 0.3s ease;
    animation: gradient-shift 3s ease-in-out infinite;
}

.magic-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 107, 169, 0.5);
}

.magic-button:active {
    transform: translateY(0) scale(0.98);
}

/* ==================== */
/* FOOTER               */
/* ==================== */
.magical-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
}

.footer-unicorn {
    font-size: 4rem;
    animation: unicorn-bounce 2s ease-in-out infinite;
    margin-bottom: 15px;
}

.magical-footer p {
    font-size: 1.2rem;
    color: var(--purple);
    margin-bottom: 10px;
}

.footer-stars {
    font-size: 1.5rem;
    animation: footer-stars-glow 2s ease-in-out infinite;
}

@keyframes footer-stars-glow {
    0%, 100% { opacity: 0.6; filter: blur(0px); }
    50% { opacity: 1; filter: blur(1px); }
}

/* ==================== */
/* RESPONSIVE           */
/* ==================== */
@media (max-width: 600px) {
    .unicorn-hero {
        width: 150px;
    }
    
    .letter {
        font-size: 3rem;
    }
    
    .name-banner {
        gap: 10px;
    }
    
    .unicorn-friend {
        width: 110px;
        height: 110px;
    }
    
    .unicorn-friend img {
        width: 60px;
    }
    
    .band {
        height: 35px;
    }
    
    .magic-button {
        font-size: 1.1rem;
        padding: 12px 30px;
    }
}

/* ==================== */
/* ACCESSIBILITY        */
/* ==================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
button:focus-visible,
.unicorn-friend:focus-visible,
.band:focus-visible {
    outline: 3px solid var(--purple-deep);
    outline-offset: 3px;
}
