@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

        :root {
            --bg-primary: #faf8f5;
            --bg-secondary: #f5f1eb;
            --text-primary: #2d2d2d;
            --text-muted: #8b8b8b;
            --accent-pink: #ff9a9e;
            --accent-purple: #c4a1ff;
            --accent-blue: #a8daff;
            --shadow: rgba(0, 0, 0, 0.08);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html, body {
            height: 100%;
            font-family: 'Outfit', -apple-system, system-ui, sans-serif;
            overflow-x: hidden;
        }

        body {
            background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 20%, #ffecd2 40%, #a1c4fd 60%, #c2e9fb 80%, #ffecd2 100%);
            background-size: 400% 400%;
            animation: gradientShift 15s ease infinite;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

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

        /* Floating elements background */
        .bg-decoration {
            position: fixed;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
        }

        .float-shape {
            position: absolute;
            border-radius: 50%;
            opacity: 0.15;
            animation: float-around 20s ease-in-out infinite;
        }

        .float-shape:nth-child(1) {
            width: 300px;
            height: 300px;
            background: radial-gradient(circle, var(--accent-pink), transparent);
            top: 10%;
            left: -10%;
            animation-duration: 25s;
        }

        .float-shape:nth-child(2) {
            width: 250px;
            height: 250px;
            background: radial-gradient(circle, var(--accent-purple), transparent);
            bottom: 15%;
            right: -5%;
            animation-duration: 20s;
            animation-delay: -5s;
        }

        .float-shape:nth-child(3) {
            width: 200px;
            height: 200px;
            background: radial-gradient(circle, var(--accent-blue), transparent);
            top: 50%;
            right: 10%;
            animation-duration: 30s;
            animation-delay: -10s;
        }

        @keyframes float-around {
            0%, 100% { transform: translate(0, 0) rotate(0deg); }
            25% { transform: translate(30px, -30px) rotate(90deg); }
            50% { transform: translate(-20px, 20px) rotate(180deg); }
            75% { transform: translate(40px, 30px) rotate(270deg); }
        }

        /* Start Screen */
        .start-overlay {
        position: fixed;
        inset: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(
            180deg,
            rgba(0,0,0,0.35),
            rgba(0,0,0,0.5)
        );
        }

        .start-card {
        background: rgba(255,255,255,0.95);
        padding: 36px 32px;
        border-radius: 24px;
        text-align: center;
        max-width: 420px;
        width: 90%;
        box-shadow: 0 20px 50px rgba(0,0,0,0.25);
        animation: popIn 0.6s cubic-bezier(0.34,1.56,0.64,1);
        }

        .start-title {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 2rem;
        font-weight: 800;
        margin-bottom: 12px;
        background: linear-gradient(135deg, #ff6b9d, #c44569);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        }

        .start-desc {
        color: var(--text-muted);
        margin-bottom: 24px;
        font-size: 1.05rem;
        }

        .start-btn {
        font-size: 1.1rem;
        padding: 14px 36px;
        }

        /* Game Screen */
        #game-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 10;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            opacity: 1;
            transition: opacity 0.5s ease;
        }

        #game-screen.hidden {
            opacity: 0;
            pointer-events: none;
        }

        .game-header {
            position: absolute;
            top: 30px;
            text-align: center;
            width: 100%;
            z-index: 11;
        }

        .game-title {
            font-size: 2rem;
            font-weight: 700;
            font-family: 'Space Grotesk', sans-serif;
            background: linear-gradient(135deg, #ff6b9d, #c44569);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 15px;
        }

        .game-stats {
            display: inline-block;
            background: rgba(255, 255, 255, 0.85);
            -webkit-backdrop-filter: blur(15px);
            backdrop-filter: blur(15px);
            padding: 15px 35px;
            border-radius: 100px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            border: 2px solid rgba(255, 255, 255, 0.5);
        }

        .stat {
            display: inline-block;
            margin: 0 12px;
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .stat-label {
            color: var(--text-muted);
            font-size: 0.85rem;
            display: block;
            margin-bottom: 2px;
        }

        .game-area {
            position: relative;
            width: 100%;
            height: 100%;
            padding: 12px 18px; /* prevent icons from hugging screen edges on small devices */
            box-sizing: border-box;
        }

        .falling-icon {
            position: absolute;
            width: 60px;
            height: 60px;
            cursor: pointer;
            animation: fall linear;
            border-radius: 50%;
            transition: transform 0.2s ease;
            filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
            will-change: transform;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
        }

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

        .falling-icon.caught {
            animation: catch 0.5s ease forwards;
        }

        .falling-icon img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
            pointer-events: none;
        }

        @keyframes fall {
            to {
                transform: translateY(120vh);
            }
        }

        @keyframes catch {
            0% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.4) rotate(20deg); }
            100% { transform: scale(0); opacity: 0; }
        }

        /* Main Container */
        .container {
            position: relative;
            z-index: 1;
            width: 90%;
            max-width: 480px;
            padding: 40px 30px;
            border-radius: 32px;
            background: rgba(255, 255, 255, 0.7);
            -webkit-backdrop-filter: blur(20px);
            backdrop-filter: blur(20px);
            text-align: center;
            box-shadow: 
                0 20px 60px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .container.show {
            animation: containerEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        @keyframes containerEntrance {
            0% {
                opacity: 0;
                transform: scale(0.9) translateY(20px);
            }
            100% {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .message {
            min-height: 90px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            font-weight: 500;
            line-height: 1.4;
            padding: 12px;
            transition: opacity 0.5s ease, transform 0.5s ease;
            opacity: 0;
            transform: translateY(12px);
            color: var(--text-primary);
        }

        .message.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .hidden {
            display: none !important;
        }

        .art {
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 20px 0;
        }

        .art img {
            max-width: 280px;
            width: 75%;
            height: auto;
            border-radius: 24px;
            box-shadow: 
                0 15px 40px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.3);
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .pop {
            animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

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

        .question {
            margin: 24px 0 18px;
            font-size: 1.75rem;
            font-weight: 700;
            font-family: 'Space Grotesk', sans-serif;
            background: linear-gradient(135deg, #ff6b9d, #c44569, #a8daff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: shimmer 3s ease-in-out infinite;
        }

        @keyframes shimmer {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.8; }
        }

        .buttons {
            margin-top: 24px;
            display: flex;
            gap: 14px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .btn {
            padding: 14px 32px;
            border-radius: 100px;
            border: none;
            cursor: pointer;
            font-weight: 600;
            font-size: 1rem;
            font-family: 'Outfit', sans-serif;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 8px 20px var(--shadow);
            position: relative;
            overflow: hidden;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s;
        }

        .btn:hover::before {
            left: 100%;
        }

        .btn:active {
            transform: scale(0.95);
        }

        .btn.yes {
            background: linear-gradient(135deg, #a8e6cf, #56cc9d);
            color: #1a4d3a;
            box-shadow: 0 8px 25px rgba(86, 204, 157, 0.3);
        }

        .btn.yes:hover {
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 12px 35px rgba(86, 204, 157, 0.4);
        }

        .btn.no {
            background: linear-gradient(135deg, #ff9a9e, #fecfef);
            color: #7d2952;
            box-shadow: 0 8px 25px rgba(255, 154, 158, 0.3);
        }

        .btn.no:hover {
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 12px 35px rgba(255, 154, 158, 0.4);
        }

        .btn.back {
            background: rgba(255, 255, 255, 0.4);
            border: 2px solid rgba(139, 139, 139, 0.2);
            color: var(--text-muted);
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
        }

        .btn.back:hover {
            background: rgba(255, 255, 255, 0.6);
            transform: translateY(-2px);
        }

        .btn.disabled,
        .btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            pointer-events: none;
        }

        @keyframes shiverKey {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-4px) rotate(-2deg); }
            50% { transform: translateX(0); }
            75% { transform: translateX(4px) rotate(2deg); }
        }

        .shiver {
            animation: shiverKey 0.2s ease-in-out infinite;
        }

        .confirm {
            margin-top: 20px;
            animation: fadeIn 0.5s ease;
        }

        .confirm p {
            font-size: 1.15rem;
            margin: 0 0 18px;
            color: var(--text-muted);
            font-weight: 500;
        }

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

        .result {
            margin-top: 20px;
            font-size: 1.3rem;
            animation: fadeIn 0.6s ease;
        }

        /* Win overlay shown after game ends */
        .win-overlay{
            position: fixed;
            inset: 0;
            display:flex;
            align-items:center;
            justify-content:center;
            background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.45));
            z-index: 50;
            padding: 20px; /* ensure some breathing room on very small screens */
            pointer-events: auto;
        }
        .win-card{
            background: rgba(255,255,255,0.95);
            padding: 28px 28px;
            border-radius: 16px;
            text-align:center;
            box-shadow: 0 12px 40px rgba(0,0,0,0.25);
            box-sizing: border-box;
            max-width: 92vw;
            width: min(480px, 92vw);
            pointer-events: auto;
        }
        .win-title{font-size:1.6rem;font-weight:800;margin-bottom:6px}
        .win-sub{color:var(--text-muted);margin-bottom:14px}
        .win-card .btn{padding:10px 20px;border-radius:12px}

        .celebrate {
            background: linear-gradient(135deg, #ffd89b, #19547b);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-weight: 700;
            font-size: 1.5rem;
            font-family: 'Space Grotesk', sans-serif;
            margin-bottom: 16px;
        }

        .restart {
            margin-top: 16px;
            display: inline-block;
        }

        /* Confetti */
        .confetti {
            position: fixed;
            top: -10vh;
            z-index: 9999;
            pointer-events: none;
            transform: translateY(0);
            opacity: 1;
            font-size: 24px;
        }

        @keyframes confettiFall {
            to {
                transform: translateY(120vh) rotate(720deg);
                opacity: 0;
            }
        }

        .confetti {
            animation-name: confettiFall;
            animation-timing-function: ease-in;
        }

        /* Mobile responsive */
        @media (max-width: 768px) {
            .falling-icon {
                filter: none;
            }
            .container,
            .game-stats {
              -webkit-backdrop-filter: none;
              backdrop-filter: none;
              background: rgba(255,255,255,0.9);
          }
        }

        @media (max-width: 480px) {
            .container {
                padding: 32px 24px;
                overflow-x: hidden;
            }

            /* increase game-area padding on small screens to give breathing room */
            .game-area { padding-left: 20px; padding-right: 20px; }

            .message {
                font-size: 1.25rem;
                min-height: 75px;
            }

            .question {
                font-size: 1.5rem;
            }

            .btn {
                padding: 12px 28px;
                font-size: 0.95rem;
            }

            .art img {
                max-width: 240px;
            }

            .game-title {
                font-size: 1.5rem;
            }

            .falling-icon {
                width: 50px;
                height: 50px;
            }

            /* tighten win-card on small screens to avoid any overflow */
            .win-card {
                padding: 18px 16px;
                width: 92vw;
            }

            .win-title { font-size: 1.3rem; }
        }