@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #3e2723 0%, #5d4037 30%, #4e342e 60%, #3e2723 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 183, 77, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 138, 101, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(210, 180, 140, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Main container */
.container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px;
    width: 100%;
    max-width: 520px;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.4rem;
    background: linear-gradient(180deg, #ffcc80 0%, #ff8a65 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: 1px;
}

.header .subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    font-weight: 400;
}

/* Cookie button */
.cookie-wrapper {
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.05s ease;
}

.cookie-wrapper:active {
    transform: scale(0.92);
}

.cookie-wrapper .ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 183, 77, 0.7) 0%, rgba(255, 138, 101, 0) 70%);
    animation: ripple-out 0.6s ease-out forwards;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

@keyframes ripple-out {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* CSS Cookie */
.cookie {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle at 45% 35%, #fdd8a8 0%, #e8a850 30%, #c6782a 60%, #9b4a1a 100%);
    border-radius: 50%;
    position: relative;
    box-shadow:
        0 0 40px rgba(255, 170, 60, 0.5),
        0 8px 30px rgba(0, 0, 0, 0.4),
        inset 0 -4px 8px rgba(0, 0, 0, 0.3),
        inset 0 4px 12px rgba(255, 255, 255, 0.15);
    animation: float 3s ease-in-out infinite;
    transition: transform 0.05s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie::after {
    content: 'Click Me!';
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 2;
}

.cookie:hover {
    box-shadow:
        0 0 60px rgba(255, 170, 60, 0.7),
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 -4px 8px rgba(0, 0, 0, 0.3),
        inset 0 4px 12px rgba(255, 255, 255, 0.15);
}

/* Chocolate chips */
.chip {
    position: absolute;
    background: #2a1005;
    border-radius: 50%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.chip-1 { width: 18px; height: 14px; top: 22%; left: 28%; transform: rotate(-20deg); }
.chip-2 { width: 22px; height: 16px; top: 15%; left: 58%; transform: rotate(15deg); }
.chip-3 { width: 16px; height: 13px; top: 42%; left: 72%; transform: rotate(40deg); }
.chip-4 { width: 20px; height: 15px; top: 62%; left: 22%; transform: rotate(-10deg); }
.chip-5 { width: 15px; height: 12px; top: 38%; left: 12%; transform: rotate(25deg); }
.chip-6 { width: 17px; height: 14px; top: 55%; left: 58%; transform: rotate(-35deg); }
.chip-7 { width: 14px; height: 11px; top: 68%; left: 75%; transform: rotate(10deg); }
.chip-8 { width: 19px; height: 14px; top: 78%; left: 18%; transform: rotate(50deg); }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Floating +1 text */
.floating-text {
    position: absolute;
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: #ffcc80;
    pointer-events: none;
    animation: float-up 1s ease-out forwards;
    text-shadow: 0 2px 8px rgba(255, 140, 60, 0.6);
    z-index: 10;
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1.5);
    }
}

/* Stats card */
.stats-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
}

.stats-card .label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

.stats-card .count {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    background: linear-gradient(180deg, #ffcc80 0%, #ffab91 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    transition: all 0.1s ease;
}

.stats-card .count.pop {
    animation: pop 0.2s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Progress bar section */
.progress-section {
    width: 100%;
    text-align: center;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff8a65, #ffcc80, #ff8a65);
    background-size: 200% 100%;
    border-radius: 20px;
    transition: width 0.15s ease;
    animation: shimmer 3s ease-in-out infinite;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer-move 2s linear infinite;
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}

@keyframes shimmer-move {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Achievement hint */
.achievement-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 6px;
}

/* Particles */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    background: #d2a679;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-fall 0.8s ease-out forwards;
}

@keyframes particle-fall {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0) rotate(var(--rot));
    }
}

/* Flag message */
.flag-message {
    background: linear-gradient(135deg, rgba(255, 138, 101, 0.2), rgba(255, 204, 128, 0.2));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 2px solid rgba(255, 183, 77, 0.5);
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(255, 140, 60, 0.2);
    animation: glow-pulse 2s ease-in-out infinite;
    width: 100%;
}

.flag-message h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    color: #ffcc80;
    word-break: break-all;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(255, 140, 60, 0.2); }
    50% { box-shadow: 0 12px 48px rgba(255, 140, 60, 0.45); }
}

/* Responsive */
@media (max-width: 540px) {
    .container {
        padding: 20px;
        gap: 16px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .cookie {
        width: 140px;
        height: 140px;
    }

    .stats-card .count {
        font-size: 2.4rem;
    }

    .flag-message h1 {
        font-size: 1.3rem;
    }
}