/* ============================================
   gabs.games - Dopamine Maximalist Stylesheet
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --gummy-red: #FF4F6A;
    --mango-pop: #FF8C42;
    --lemon-fizz: #FFD166;
    --mint-bounce: #06D6A0;
    --bubble-blue: #4ECDC4;
    --grape-soda: #7B68EE;
    --berry-blast: #C77DFF;
    --cloud-white: #FAFBFF;
    --deep-plum: #2B1055;
    --soft-black: #1A1A2E;
    --warm-gray: #6B7280;
    --snow: #FFFFFF;
    --card-hover-bg: #F8F7FF;

    --rainbow-gradient: linear-gradient(135deg, #FF4F6A, #FF8C42, #FFD166, #06D6A0, #4ECDC4, #7B68EE, #C77DFF);

    --bounce-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --bounce-decorative: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw + 0.5rem, 1.25rem);
    line-height: 1.7;
    color: var(--soft-black);
    background: var(--cloud-white);
    overflow-x: hidden;
    position: relative;
}

/* --- Background Bubbles (Ambient) --- */
#bg-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-bubble {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--x);
    top: var(--y);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), transparent 60%);
    background-color: var(--hue);
    opacity: 0.1;
    animation: floatBubble var(--dur) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes floatBubble {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -40px) scale(1.05);
    }
    50% {
        transform: translate(-20px, -80px) scale(0.95);
    }
    75% {
        transform: translate(15px, -40px) scale(1.02);
    }
}

/* --- Confetti Container --- */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    opacity: 0.15;
    animation: confettiFall linear infinite;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
    }
}

/* --- Bubble Pop Container --- */
#bubble-pop-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.click-bubble {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: bubblePop 600ms ease-out forwards;
}

@keyframes bubblePop {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--bx), var(--by)) scale(0.2);
        opacity: 0;
    }
}

/* --- Floating Pill Nav --- */
#floating-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    animation: navSlideIn 800ms var(--bounce-spring) 300ms forwards;
}

@keyframes navSlideIn {
    to {
        transform: translateX(-50%) translateY(0);
    }
}

.nav-logo {
    font-family: 'Lilita One', cursive;
    font-size: 1.5rem;
    color: var(--grape-soda);
    letter-spacing: 0.01em;
    user-select: none;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-bubble {
    font-family: 'Baloo 2', cursive;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--soft-black);
    padding: 6px 16px;
    border-radius: 999px;
    background: transparent;
    transition: background 250ms ease, color 250ms ease, transform 250ms var(--bounce-spring);
}

.nav-bubble:hover {
    background: var(--grape-soda);
    color: var(--snow);
    transform: scale(1.08);
}

/* --- Hero Section --- */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px 60px;
    overflow: hidden;
    z-index: 1;
}

.hero-illustration {
    width: 100%;
    max-width: 500px;
    margin-bottom: 24px;
}

.hero-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 40px rgba(123, 104, 238, 0.25));
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hero-title {
    font-family: 'Lilita One', cursive;
    font-size: clamp(2.5rem, 7vw, 5rem);
    letter-spacing: 0.01em;
    color: var(--soft-black);
    text-shadow: 3px 3px 0 rgba(123, 104, 238, 0.2);
    display: flex;
    gap: 2px;
}

.bounce-letter {
    display: inline-block;
    animation: letterBounce 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.12s);
}

@keyframes letterBounce {
    0%, 100% {
        transform: translateY(0);
    }
    15% {
        transform: translateY(-12px);
    }
    30% {
        transform: translateY(0);
    }
}

.hero-tagline {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 600;
    color: var(--warm-gray);
}

.hero-cta {
    display: inline-block;
    font-family: 'Baloo 2', cursive;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--snow);
    background: var(--gummy-red);
    padding: 14px 40px;
    border-radius: 999px;
    box-shadow: 0 6px 24px rgba(255, 79, 106, 0.35);
    transition: transform 200ms var(--bounce-spring), box-shadow 200ms ease;
    cursor: pointer;
}

.hero-cta:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(255, 79, 106, 0.45);
}

.hero-cta:active {
    transform: scale(0.95);
}

/* Bubble clusters */
.bubble-cluster {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.cluster-left {
    left: 5%;
    bottom: 15%;
}

.cluster-right {
    right: 5%;
    top: 20%;
}

/* --- Wave Dividers --- */
.wave-divider {
    width: 100%;
    line-height: 0;
    margin-top: -1px;
    position: relative;
    z-index: 1;
}

.wave-divider svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Section Titles --- */
.section-title {
    font-family: 'Lilita One', cursive;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    letter-spacing: 0.02em;
    color: var(--soft-black);
    text-align: center;
    margin-bottom: 40px;
}

/* --- Game Cards Zone --- */
#games {
    position: relative;
    z-index: 1;
    padding: 60px 24px 80px;
    max-width: 1280px;
    margin: 0 auto;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.game-card {
    position: relative;
    background: var(--snow);
    border-radius: 24px;
    padding: 28px 24px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    border: 2px solid transparent;
    transition: transform 250ms var(--bounce-spring), box-shadow 250ms ease, border-color 250ms ease, background-color 250ms ease;
    overflow: visible;
    animation: cardFloat 8s ease-in-out infinite;
    animation-delay: var(--float-delay, 0s);
    cursor: pointer;
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(var(--float-offset, -4px));
    }
}

.game-card:hover {
    transform: scale(1.05) translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
    background-color: var(--card-hover-bg);
    border-color: var(--grape-soda);
}

.card-wide {
    grid-column: span 2;
}

.card-tall {
    grid-row: span 2;
}

/* Card corner bubbles */
.card-corner-bubbles {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    pointer-events: none;
}

.corner-bubble {
    position: absolute;
    width: var(--cb-size);
    height: var(--cb-size);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), transparent 60%);
    background-color: var(--cb-color);
    opacity: 0.25;
    top: var(--cb-top, auto);
    right: var(--cb-right, auto);
    bottom: var(--cb-bottom, auto);
    left: var(--cb-left, auto);
}

/* Card icon */
.card-icon {
    margin-bottom: 16px;
    transition: transform 250ms var(--bounce-spring);
}

.game-card:hover .card-icon {
    transform: scale(1.15);
}

.card-icon-large {
    display: flex;
    justify-content: center;
}

/* Card tag */
.card-tag {
    display: inline-block;
    font-family: 'Baloo 2', cursive;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}

/* Card title */
.card-title {
    font-family: 'Lilita One', cursive;
    font-size: 1.25rem;
    color: var(--soft-black);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

/* Card description */
.card-desc {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--warm-gray);
}

/* --- Rainbow River --- */
#featured {
    position: relative;
    z-index: 1;
    padding: 60px 0 80px;
    overflow: hidden;
}

.rainbow-river {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 24px 0;
    background: var(--rainbow-gradient);
    background-size: 200% 100%;
    animation: rainbowShift 8s linear infinite;
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.river-track {
    display: flex;
    gap: 40px;
    padding: 16px 0;
    animation: riverScroll 30s linear infinite;
    width: max-content;
}

@keyframes riverScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.river-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    transition: transform 250ms var(--bounce-spring);
}

.river-item:hover {
    transform: scale(1.15);
}

.river-item svg {
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.river-label {
    font-family: 'Baloo 2', cursive;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--snow);
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* --- About Section --- */
#about {
    position: relative;
    z-index: 1;
    padding: 60px 24px 80px;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1rem, 1.2vw + 0.5rem, 1.2rem);
    line-height: 1.8;
    color: var(--warm-gray);
    margin-bottom: 16px;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* --- Footer Playground --- */
#footer {
    position: relative;
    z-index: 1;
    background: var(--deep-plum);
    padding: 80px 24px 40px;
    overflow: hidden;
}

.footer-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.footer-bubble {
    position: absolute;
    width: var(--fb-size);
    height: var(--fb-size);
    left: var(--fb-x);
    top: var(--fb-y);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent 60%);
    background-color: var(--fb-color);
    opacity: 0.12;
    animation: footerFloat var(--fb-dur) ease-in-out infinite;
    animation-delay: var(--fb-delay);
}

@keyframes footerFloat {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(20px, -30px);
    }
    66% {
        transform: translate(-15px, -15px);
    }
}

.footer-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto 48px;
}

.footer-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-heading {
    font-family: 'Lilita One', cursive;
    font-size: 1.1rem;
    color: var(--snow);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.footer-pill {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255,255,255,0.75);
    padding: 6px 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    transition: background 250ms ease, color 250ms ease, transform 250ms var(--bounce-spring);
}

.footer-pill:hover {
    background: rgba(255,255,255,0.18);
    color: var(--snow);
    transform: scale(1.06);
}

.footer-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-logo {
    font-family: 'Lilita One', cursive;
    font-size: 1.3rem;
    color: var(--berry-blast);
}

.footer-copy {
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* --- Bounce-Enter Animation System --- */
.animate-on-enter {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
}

.animate-on-enter.entered {
    animation: bounceEnter 500ms var(--bounce-spring) forwards;
}

@keyframes bounceEnter {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Section titles get a slightly slower enter */
.section-title.animate-on-enter.entered {
    animation-duration: 700ms;
}

/* Hero elements - custom stagger */
.hero-title.animate-on-enter.entered {
    animation-delay: 0ms;
}

.hero-tagline.animate-on-enter.entered {
    animation-delay: 150ms;
}

.hero-cta.animate-on-enter.entered {
    animation-delay: 300ms;
}

/* Bubble cluster enter */
.bubble-cluster {
    opacity: 0;
    transform: scale(0);
    animation: bubbleClusterEnter 800ms var(--bounce-decorative) 600ms forwards;
}

@keyframes bubbleClusterEnter {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .card-wide {
        grid-column: span 1;
    }

    .card-tall {
        grid-row: span 1;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-content {
        gap: 32px;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-bubble {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    #floating-nav {
        padding: 8px 16px;
        gap: 8px;
    }

    .nav-logo {
        font-size: 1.2rem;
    }

    .cluster-left,
    .cluster-right {
        display: none;
    }

    .hero-illustration {
        max-width: 320px;
    }
}

@media (max-width: 480px) {
    #hero {
        padding: 80px 16px 40px;
    }

    #games {
        padding: 40px 16px 60px;
    }

    #about {
        padding: 40px 16px 60px;
    }

    #footer {
        padding: 60px 16px 32px;
    }
}

/* --- Hover glow per card color --- */
.game-card[data-color="#FF4F6A"]:hover { border-color: #FF4F6A; }
.game-card[data-color="#FF8C42"]:hover { border-color: #FF8C42; }
.game-card[data-color="#FFD166"]:hover { border-color: #FFD166; }
.game-card[data-color="#06D6A0"]:hover { border-color: #06D6A0; }
.game-card[data-color="#4ECDC4"]:hover { border-color: #4ECDC4; }
.game-card[data-color="#7B68EE"]:hover { border-color: #7B68EE; }
.game-card[data-color="#C77DFF"]:hover { border-color: #C77DFF; }

/* --- Rainbow River pause on hover --- */
.rainbow-river:hover .river-track {
    animation-play-state: paused;
}
