        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

        :root {
            --bg-color-from: #0a0a0a;
            --bg-color-to: #1f1f1f;
            --container-bg: #111;
            --container-border: rgba(45, 212, 191, 0.5);
            --header-color-from: #2dd4bf;
            --header-color-to: #3b82f6;
            --text-color: #e5e7eb;
            --highlight-text-color: #94a3b8;
            --start-array-color: #fcd34d;
            --target-array-color: #34d399;
            --target-value-color: #f97316;
            --description-border: rgba(168, 85, 247, 0.3);
            --button-from: #8b5cf6;
            --button-to: #3b82f6;
            --button-hover-from: #7c3aed;
            --button-hover-to: #2563eb;
            --correct-color: #34d399;
            --incorrect-color: #ef4444;
            --code-bg: #0a0a0a;
            --code-text: #2dd4bf;
            --next-button-from: #3b82f6;
            --next-button-to: #8b5cf6;
            --next-button-hover-from: #2563eb;
            --next-button-hover-to: #7c3aed;
        }

        /* Base styles for responsiveness */
        body {
            margin: 0;
            font-family: 'Inter', sans-serif;
            background: linear-gradient(to bottom right, var(--bg-color-from), var(--bg-color-to));
            color: var(--text-color);
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            padding: 1rem;
            overflow-x: hidden;
            box-sizing: border-box; /* Ensure padding is included in width */
        }

        .game-container {
            width: 100%;
            max-width: 64rem;
            background: var(--container-bg);
            padding: 2.5rem;
            border-radius: 2rem;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            border: 2px solid var(--container-border);
            position: relative;
            overflow: hidden;
        }
        
        /* Responsive padding for smaller screens */
        @media (max-width: 640px) {
            body {
                padding: 0.5rem;
            }
            .game-container {
                padding: 1.5rem;
                border-radius: 1.5rem;
            }
        }

        .background-blobs {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0.1;
            pointer-events: none;
            z-index: 0;
        }

        .blob-1 {
            position: absolute;
            top: 25%;
            left: 25%;
            width: 75%;
            height: 75%;
            background-color: #3b82f6;
            border-radius: 50%;
            mix-blend-mode: screen;
            filter: blur(3rem);
            opacity: 0.5;
            animation: blob-animate 8s infinite ease-in-out;
        }

        .blob-2 {
            position: absolute;
            bottom: 25%;
            right: 25%;
            width: 50%;
            height: 50%;
            background-color: #a855f7;
            border-radius: 50%;
            mix-blend-mode: screen;
            filter: blur(3rem);
            opacity: 0.5;
            animation: blob-animate 8s infinite ease-in-out;
            animation-delay: 2s;
        }

        .blob-3 {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 33.333%;
            height: 33.333%;
            background-color: #2dd4bf;
            border-radius: 50%;
            mix-blend-mode: screen;
            filter: blur(3rem);
            opacity: 0.5;
            animation: blob-animate 8s infinite ease-in-out;
            animation-delay: 4s;
        }

        @keyframes blob-animate {
            0%, 100% { transform: translate(0, 0) scale(1); }
            33% { transform: translate(30px, -50px) scale(1.1); }
            66% { transform: translate(-20px, 20px) scale(0.9); }
        }

        .content {
            position: relative;
            z-index: 10;
        }

        .header-container {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap; /* Allow wrapping on small screens */
        }

        .header-icon {
            height: 2.5rem;
            width: 2.5rem;
            color: var(--header-color-from);
            margin-right: 1rem;
            filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07));
        }

        .header-title {
            font-size: clamp(2.5rem, 6vw, 3rem); /* Fluid font size */
            font-weight: 800;
            text-align: center;
            background: linear-gradient(to right, var(--header-color-from), var(--header-color-to));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin: 0;
            filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07));
        }

        .subtitle {
            text-align: center;
            color: var(--highlight-text-color);
            margin-bottom: 2rem;
            font-weight: 300;
            font-size: clamp(0.9rem, 2vw, 1.125rem); /* Fluid font size */
        }

        .game-state {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1.5rem;
            margin-bottom: 2rem;
            text-align: center;
            font-family: monospace;
        }

        @media (min-width: 768px) {
            .game-state {
                grid-template-columns: 1fr 1fr;
            }
        }

        .state-card {
            background: rgba(17, 24, 39, 0.6);
            backdrop-filter: blur(4px);
            padding: 1.5rem;
            border-radius: 1.5rem;
            border: 1px solid rgba(45, 212, 191, 0.3);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease-in-out;
        }
        
        .state-card:hover {
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(45, 212, 191, 0.5);
        }

        .card-title {
            font-size: clamp(1rem, 2vw, 1.25rem); /* Fluid font size */
            font-weight: 600;
            color: #94a3b8;
            margin-bottom: 0.5rem;
        }

        .card-value {
            font-size: clamp(1.25rem, 3vw, 1.875rem); /* Fluid font size */
            font-weight: 700;
            word-wrap: break-word; /* Prevents overflow */
        }

        #start-array-display { color: var(--start-array-color); }
        #target-display { }
        .target-array { color: var(--target-array-color); }
        .target-value { color: var(--target-value-color); }

        .challenge-description {
            background: rgba(17, 24, 39, 0.6);
            backdrop-filter: blur(4px);
            padding: 1.5rem;
            border-radius: 1.5rem;
            margin-bottom: 2rem;
            text-align: center;
            color: var(--highlight-text-color);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            border: 1px solid var(--description-border);
        }
        
        @media (max-width: 640px) {
            .challenge-description {
                padding: 1rem;
            }
        }

        .description-text {
            font-size: clamp(1rem, 2vw, 1.125rem); /* Fluid font size */
            font-style: italic;
            font-weight: 300;
        }

        .method-buttons {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Adjusted min-width for better mobile layout */
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .method-button {
            background: linear-gradient(to right, var(--button-from), var(--button-to));
            color: white;
            font-weight: 700;
            padding: 1rem 1.5rem;
            border-radius: 9999px;
            transition: all 0.3s ease-in-out;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            transform: translateZ(0);
            border: none;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            font-size: clamp(0.9rem, 2vw, 1rem); /* Fluid font size */
        }
        
        .method-button:hover {
            transform: scale(1.05);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            background: linear-gradient(to right, var(--button-hover-from), var(--button-hover-to));
        }

        .method-button:active {
            transform: scale(0.95);
            box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
        }

        .feedback-container {
            text-align: center;
            transition: opacity 0.5s ease-in-out;
        }

        .feedback-text {
            font-size: clamp(1.5rem, 4vw, 1.875rem); /* Fluid font size */
            font-weight: 700;
            margin-bottom: 1rem;
        }

        .correct { color: var(--correct-color); }
        .incorrect { color: var(--incorrect-color); }

        .explanation-card {
            background: rgba(17, 24, 39, 0.6);
            backdrop-filter: blur(4px);
            padding: 1.5rem;
            margin-top: 1rem;
            border-radius: 1.5rem;
            text-align: left;
            border: 1px solid var(--container-border);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

        .explanation-title {
            font-size: clamp(1rem, 2.5vw, 1.25rem); /* Fluid font size */
            font-weight: 700;
            color: white;
            margin-bottom: 0.5rem;
        }
        
        .explanation-text {
            color: var(--highlight-text-color);
            margin-bottom: 1rem;
            font-size: clamp(0.9rem, 2vw, 1rem); /* Fluid font size */
        }

        .code-snippet-container {
            background: var(--code-bg);
            padding: 1rem;
            border-radius: 0.5rem;
            font-family: monospace;
            font-size: clamp(0.9rem, 2vw, 1.125rem); /* Fluid font size */
            color: var(--code-text);
            overflow-x: auto;
            border: 1px solid var(--container-border);
        }
        
        .next-challenge-container {
            margin-top: 1.5rem;
        }

        .next-challenge-button {
            background: linear-gradient(to right, var(--next-button-from), var(--next-button-to));
            color: white;
            font-weight: 700;
            padding: 0.75rem 2rem;
            border-radius: 9999px;
            transition: all 0.2s ease-in-out;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            transform: translateZ(0);
            border: none;
            cursor: pointer;
            font-size: clamp(0.9rem, 2vw, 1rem); /* Fluid font size */
        }
        
        .next-challenge-button:hover {
            transform: scale(1.05);
            background: linear-gradient(to right, var(--next-button-hover-from), var(--next-button-hover-to));
        }

        .score-display {
            text-align: center;
            font-size: clamp(1.2rem, 3vw, 1.5rem); /* Fluid font size */
            font-weight: 600;
            color: var(--highlight-text-color);
            margin-top: 2rem;
        }

        .score-value {
            color: var(--header-color-from);
            font-size: clamp(1.5rem, 4vw, 1.875rem); /* Fluid font size */
            font-weight: 800;
        }

        /* Loading state styles */
        .loading {
            min-height: 100vh;
            background: var(--bg-color-from);
            color: var(--header-color-from);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            font-size: 1.875rem;
            font-weight: 700;
            animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
        }

        @keyframes pulse {
            0%, 100% {
                opacity: 1;
            }
            50% {
                opacity: .5;
            }
        }
