        /* AAPKA ORIGINAL CSS START */
        @import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;700;800&display=swap");

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
        }

        :root {
            --primary-color: #112d4e;
            --accent-color: #3f72af;
            --bg-color: #dbe2ef;
            --card-bg: #f9f7f7;
            --white: #ffffff;
            --success-color: #4caf50;
            --error-color: #ff5252;
            --text-color: #112d4e;
            --border-color: rgba(63, 114, 175, 0.2);
            --custom-board-bg: rgba(249, 247, 247, 0.5);
            --custom-dot-bg: #fff;
            --custom-dot-text: transparent;
        }

        body {
            font-family: "Outfit", sans-serif;
            background: radial-gradient(circle at 50% 120%, var(--bg-color), var(--card-bg));
            background-size: 200% 200%;
            animation: gradientBG 15s ease infinite;
            color: var(--text-color);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            min-height: 100vh;
            padding: 0;
            overflow-x: hidden;
            text-rendering: optimizeLegibility;
            -webkit-font-smoothing: antialiased;
        }

        @keyframes gradientBG {
            0% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }

            100% {
                background-position: 0% 50%;
            }
        }

        .main-nav {
            width: 100%;
            padding: 15px 25px;
            background-color: var(--primary-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            z-index: 200;
            top: 0;
            animation: fadeInDown 0.8s ease-out forwards;
            position: relative;
            /* Ensure bubbles stay inside */
            overflow: hidden;
            /* Clip bubbles */
            /* Clip bubbles */
        }

        /* SCROLL TO TOP BUTTON (LEFT ALIGNED) */
        #scrollTopBtn {
            display: none;
            position: fixed;
            bottom: 25px;
            left: 25px;
            /* LEFT ALIGNED */
            z-index: 1000;
            font-size: 1.2rem;
            border: none;
            outline: none;
            background-color: var(--accent-color);
            color: white;
            cursor: pointer;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            transform: translateY(20px);
        }

        #scrollTopBtn.show {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        #scrollTopBtn:hover {
            background-color: var(--primary-color);
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        }

        /* HEADER BUBBLES */
        .header-bubbles {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            /* Behind content */
            pointer-events: none;
        }

        .header-bubble {
            position: absolute;
            bottom: -20px;
            background: rgba(255, 255, 255, 0.1);
            /* border-radius: 50%; REMOVED to allow squares */
            animation: bubbleRise linear infinite;
            will-change: transform;
            /* Performance Hint */
        }

        @keyframes bubbleRise {
            0% {
                transform: translateY(0) translateX(0);
                opacity: 0;
            }

            10% {
                opacity: 1;
            }

            90% {
                opacity: 1;
            }

            100% {
                transform: translateY(-120vh) translateX(20px) rotate(360deg);
                opacity: 0;
            }
        }

        /* Footer Shapes */
        .shape {
            position: absolute;
            bottom: -50px;
            background: rgba(255, 255, 255, 0.3);
            /* Increased opacity */
            animation: bubbleRise linear infinite;
            pointer-events: none;
            will-change: transform;
            z-index: 0;
        }

        .brand {
            font-size: 1.4rem;
            font-weight: 800;
            color: var(--card-bg);
            letter-spacing: -0.5px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .nav-items {
            display: flex;
            align-items: center;
            gap: 12px;
        }



        .nav-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 8px 14px;
            border-radius: 12px;
            color: #dbe2ef;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 8px;
            user-select: none;
            white-space: nowrap;
            text-decoration: none;
            /* Added for anchor links */
        }

        .nav-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            transform: translateY(-1px);
        }

        @media (max-width: 600px) {
            .main-nav {
                padding: 10px 15px;
            }

            .brand span {
                display: none;
            }

            .nav-btn span {
                display: none;
            }

            .nav-btn {
                padding: 8px;
                justify-content: center;
            }

            .nav-items {
                gap: 8px;
            }
        }

        /* --- BUILDER STYLES (Keep Original) --- */
        .custom-builder-content {
            max-width: 450px;
            width: 95%;
            max-height: 90vh;
            overflow-y: auto;
            margin: auto;
            padding: 20px;
        }

        .builder-layout {
            display: flex;
            flex-direction: column;
            gap: 20px;
            text-align: center;
            align-items: center;
            margin-bottom: 20px;
        }

        .builder-section {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .builder-preview {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.03);
            border-radius: 12px;
            padding: 20px;
            width: 100%;
        }

        .control-group {
            width: 100%;
            text-align: left;
        }

        .control-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 700;
            color: var(--primary-color);
            font-size: 0.9rem;
        }

        .control-group select,
        .control-group input[type="range"] {
            width: 100%;
            padding: 8px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
        }

        .preview-box {
            position: relative;
            width: 100%;
            max-width: 300px;
            aspect-ratio: 1;
            /* height: 240px; REMOVED FIXED HEIGHT */
            border: 3px solid var(--primary-color);
            background: rgba(255, 255, 255, 0.5);
            border-radius: 8px;
            backdrop-filter: blur(10px);
            box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
            margin: 20px auto;
            box-sizing: border-box;
            /* Crucial for alignment */
        }

        @media (max-width: 480px) {
            .b-dot {
                width: 20px;
                height: 20px;
                font-size: 0.7rem;
                border-width: 1.5px;
            }

            .b-dot.active-edit {
                transform: scale(1.15) !important;
            }
        }

        body.theme-neon .preview-box {
            background: rgba(0, 0, 0, 0.4);
            border-color: rgba(0, 255, 65, 0.3);
            box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
        }

        .b-dot {
            position: absolute;
            width: 28px;
            height: 28px;
            background: white;
            border: 2px solid var(--primary-color);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.9rem;
            color: var(--primary-color);
            z-index: 10;
        }

        .b-dot:hover {
            transform: scale(1.2);
            border-color: var(--accent-color);
            background: var(--card-bg);
        }

        .b-dot.active-edit {
            background: var(--accent-color);
            color: white;
            transform: scale(1.2) !important;
            box-shadow: 0 0 10px var(--accent-color);
            animation: pulse-edit 1s infinite;
        }

        @keyframes pulse-edit {
            0% {
                box-shadow: 0 0 0 0 rgba(63, 114, 175, 0.7);
            }

            70% {
                box-shadow: 0 0 0 6px rgba(63, 114, 175, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(63, 114, 175, 0);
            }
        }

        #hidden-input {
            position: absolute;
            opacity: 0;
            top: -1000px;
        }

        .color-picker-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .cp-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(255, 255, 255, 0.5);
            padding: 5px 10px;
            border-radius: 6px;
        }

        .cp-item input[type="color"] {
            border: none;
            width: 30px;
            height: 30px;
            cursor: pointer;
            background: none;
            padding: 0;
        }

        .theme-selector {
            display: flex;
            gap: 10px;
        }

        .theme-card {
            flex: 1;
            height: 80px;
            border: 2px solid rgba(0, 0, 0, 0.1);
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            font-size: 0.8rem;
            font-weight: 700;
        }

        .theme-card.active {
            border-width: 3px;
            transform: scale(1.05);
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
        }

        .theme-preview {
            font-size: 1.2rem;
            margin-bottom: 4px;
        }

        .builder-footer {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            width: 100%;
            padding-top: 10px;
            border-top: 1px solid var(--border-color);
        }

        .builder-footer .btn-game {
            grid-column: span 2;
        }

        input[type="range"] {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            background: transparent;
        }

        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            height: 20px;
            width: 20px;
            border-radius: 50%;
            background: var(--accent-color);
            cursor: pointer;
            margin-top: -8px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
            transition: transform 0.2s;
        }

        input[type="range"]::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }

        input[type="range"]::-webkit-slider-runnable-track {
            width: 100%;
            height: 4px;
            cursor: pointer;
            background: var(--border-color);
            border-radius: 2px;
        }

        .preview-hint {
            margin-top: 10px;
            font-size: 0.8rem;
            color: var(--accent-color);
            font-style: italic;
        }

        /* Theme Vars */
        #game-area.theme-classic {
            --primary-color: #112d4e;
            --accent-color: #3f72af;
            --card-bg: #f9f7f7;
        }

        #game-area.theme-neon {
            --primary-color: #ff00ff;
            --accent-color: #ffd700;
        }

        #game-area.theme-dark {
            --primary-color: #e2e8f0;
            --accent-color: #00ffff;
        }

        .nav-btn.active-mode {
            background: var(--accent-color);
            border-color: var(--accent-color);
            color: white;
        }

        .brand-logo-img {
            height: 40px;
            width: auto;
            border-radius: 8px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s;
        }

        .brand:hover .brand-logo-img {
            transform: rotate(-5deg) scale(1.05);
        }

        @media (max-width: 380px) {
            .brand-logo-img {
                height: 32px;
            }
        }

        /* Modal & Toast */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(17, 45, 78, 0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1100;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s;
        }

        .modal.show {
            opacity: 1;
            pointer-events: auto;
        }

        .modal-content {
            background: var(--card-bg);
            padding: 30px;
            border-radius: 16px;
            width: 90%;
            max-width: 350px;
            max-height: 85vh;
            overflow-y: auto;
            text-align: center;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            transform: translateY(20px);
            transition: transform 0.3s;
        }

        .modal.show .modal-content {
            transform: translateY(0);
        }

        .toast-container {
            position: fixed;
            top: 120px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            gap: 10px;
            z-index: 1200;
            pointer-events: none;
        }

        .toast {
            background: rgba(17, 45, 78, 0.95);
            color: #fff;
            padding: 10px 20px;
            border-radius: 50px;
            font-weight: 600;
            font-size: 0.95rem;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
            opacity: 0;
            transform: translateY(20px) scale(0.9);
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            display: flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap;
            max-width: 90vw;
            justify-content: center;
        }

        .popup-icon {
            width: 20px;
            height: 20px;
            fill: none;
            stroke: currentColor;
            stroke-width: 2.5;
            min-width: 20px;
        }

        .toast.show {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        .stat-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin: 20px 0;
        }

        .stat-item {
            background: #dbe2ef;
            padding: 15px;
            border-radius: 12px;
        }

        .stat-val {
            font-size: 1.5rem;
            font-weight: 800;
            color: var(--primary-color);
        }

        .stat-label {
            font-size: 0.8rem;
            color: var(--accent-color);
            font-weight: 600;
        }

        .close-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: none;
            border: none;
            font-size: 1.2rem;
            cursor: pointer;
            color: #718096;
        }

        /* Game Layout */
        .container {
            max-width: 500px;
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            margin: auto;
            padding: 40px 20px;
            flex-grow: 1;
        }

        @media (max-width: 400px) {
            .container {
                padding: 20px 10px;
            }
        }

        .header {
            text-align: center;
            margin-bottom: 25px;
            width: 100%;
            height: 60px;
        }

        .header h2 {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 8px;
            letter-spacing: -0.5px;
            transition: all 0.3s ease;
        }

        .status-text {
            color: var(--card-bg);
            font-weight: 600;
            font-size: 0.9rem;
            opacity: 0;
            transform: translateY(5px);
            transition: all 0.3s ease;
            background: var(--accent-color);
            padding: 4px 12px;
            border-radius: 12px;
            display: inline-block;
        }

        .status-text.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .game-area {
            position: relative;
            width: 320px;
            height: 320px;
            max-width: 90vw;
            max-height: 90vw;
            margin: 20px 0 70px 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .box-border {
            position: absolute;
            /* width/height/top/left set by JS renderBoard() */
            border: 4px solid var(--primary-color);
            border-radius: 4px;
            box-shadow: 0 10px 25px -5px rgba(17, 45, 78, 0.15);
            z-index: 1;
            border-color: var(--primary-color);
            background: var(--custom-board-bg, rgba(249, 247, 247, 0.5));
            box-sizing: border-box;
            /* IMPORTANT */
            pointer-events: none;
        }

        /* Mobile Optimization */
        @media (max-width: 380px) {
            .nav-btn span {
                display: none;
            }

            .nav-btn {
                padding: 6px;
            }

            .brand-logo-img {
                height: 28px;
            }

            .game-area {
                margin: 10px 0 50px 0;
            }
        }

        #canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 2;
            filter: drop-shadow(0 0 4px rgba(63, 114, 175, 0.5));
        }

        .letter-node {
            position: absolute;
            width: 16px;
            height: 16px;
            background: var(--custom-dot-bg, #fff);
            color: var(--custom-dot-text, transparent);
            border: 3px solid var(--primary-color);
            border-radius: 50%;
            z-index: 10;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .letter-node:after {
            content: "";
            position: absolute;
            top: -10px;
            left: -10px;
            right: -10px;
            bottom: -10px;
        }

        .letter-node:hover {
            transform: scale(1.4);
            border-color: var(--accent-color);
        }

        .letter-node.active {
            background-color: var(--accent-color);
            border-color: var(--primary-color);
            transform: scale(1.1);
            box-shadow: 0 0 15px rgba(63, 114, 175, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .letter-text {
            position: absolute;
            font-size: 1.7rem;
            font-weight: 800;
            color: var(--primary-color);
            pointer-events: none;
            user-select: none;
            transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            text-shadow: 0 2px 0 rgba(255, 255, 255, 0.2);
        }

        .letter-text.used {
            color: var(--accent-color);
            transform: scale(0.95);
            opacity: 0.8;
        }

        .letter-text.active {
            color: var(--accent-color);
            transform: scale(1.3);
            text-shadow: 0 0 15px rgba(63, 114, 175, 0.4);
            z-index: 20;
        }

        .current-word-section {
            text-align: center;
            margin-bottom: 25px;
            margin-top: 20px;
            min-height: 60px;
            height: auto;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 10px;
        }

        .current-word {
            font-size: 2.5rem;
            font-weight: 800;
            color: var(--primary-color);
            letter-spacing: 3px;
            text-transform: uppercase;
            text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.05);
            animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            white-space: nowrap;
            width: 90%;
            transition: font-size 0.2s ease, letter-spacing 0.2s ease;
            line-height: 1.1;
        }

        @keyframes popIn {
            from {
                transform: scale(0.9);
                opacity: 0;
            }

            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .particle {
            position: fixed;
            pointer-events: none;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--accent-color);
            z-index: 9999;
            animation: particleFade 1s forwards;
        }

        @keyframes particleFade {
            0% {
                transform: translate(0, 0) scale(1);
                opacity: 1;
            }

            100% {
                transform: translate(var(--tx), var(--ty)) scale(0);
                opacity: 0;
            }
        }

        .board-pulse {
            animation: pulse-board 0.4s ease-out;
        }

        @keyframes pulse-board {
            0% {
                transform: scale(1);
                box-shadow: 0 0 0 rgba(63, 114, 175, 0);
            }

            50% {
                transform: scale(1.02);
                box-shadow: 0 0 20px rgba(63, 114, 175, 0.4);
            }

            100% {
                transform: scale(1);
                box-shadow: 0 0 0 rgba(63, 114, 175, 0);
            }
        }

        .word-history-item {
            animation: fadeInUpItem 0.5s ease backwards;
        }

        @keyframes fadeInUpItem {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .floating-shapes {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
            overflow: hidden;
        }

        .shape {
            position: absolute;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            animation: floatShape 20s infinite linear;
        }

        @keyframes floatShape {
            0% {
                transform: translateY(100vh) rotate(0deg);
                opacity: 0;
            }

            20% {
                opacity: 1;
            }

            80% {
                opacity: 1;
            }

            100% {
                transform: translateY(-20vh) rotate(360deg);
                opacity: 0;
            }
        }

        .progress-section {
            text-align: center;
            margin-bottom: 35px;
        }

        .stats-info {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--accent-color);
            background: #dbe2ef;
            padding: 6px 16px;
            border-radius: 20px;
            display: inline-block;
        }

        .controls {
            display: flex;
            gap: 15px;
            margin-top: 10px;
            /* Add breathing room */
        }

        @media (max-width: 400px) {
            .controls {
                gap: 8px;
                /* Tighter gap for mobile */
                width: 100%;
                justify-content: center;
            }

            .btn {
                padding: 12px 20px !important;
                /* Reduce horizontal padding */
                border-radius: 12px;
                /* Slightly tighter radius */
            }

            .btn svg {
                width: 20px;
                height: 20px;
            }
        }

        .btn {
            padding: 14px 28px;
            border: none;
            border-radius: 16px;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            letter-spacing: 0.5px;
        }

        .btn:active {
            transform: scale(0.96);
        }

        .btn-game {
            background-color: var(--accent-color);
            color: var(--card-bg);
            box-shadow: 0 4px 12px rgba(63, 114, 175, 0.2);
        }

        .btn-game:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 16px rgba(63, 114, 175, 0.3);
            background-color: var(--primary-color);
        }

        .btn-reset {
            background-color: transparent;
            color: var(--accent-color);
            border: 2px solid #dbe2ef;
        }

        .btn-reset:hover {
            border-color: var(--accent-color);
            color: var(--primary-color);
            background-color: #dbe2ef;
        }

        .win-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(219, 226, 239, 0.98);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 50;
            opacity: 0;
            pointer-events: none;
            border-radius: 20px;
            transform: scale(0.95);
            transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
            backdrop-filter: blur(8px);
            will-change: transform, opacity;
            /* Performance Hint */
        }

        .win-overlay.show {
            opacity: 1;
            transform: scale(1);
            pointer-events: auto;
        }

        .win-overlay h2 {
            font-size: 2rem;
            color: var(--primary-color);
            margin-bottom: 10px;
        }

        .win-overlay p {
            font-size: 1.1rem;
            color: var(--accent-color);
            margin-bottom: 30px;
        }

        .word-history {
            margin-top: 15px;
            font-size: 0.9rem;
            color: var(--primary-color);
            font-weight: 500;
            opacity: 0.8;
            max-width: 90%;
            margin-left: auto;
            margin-right: auto;
            line-height: 1.4;
        }

        .content-section {
            max-width: 800px;
            margin: 0 auto 60px auto;
            padding: 40px;
            color: var(--text-color);
            background: var(--white);
            border-radius: 16px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            line-height: 1.6;
            font-size: 1.05rem;
            border: 1px solid var(--border-color);
            contain: content;
        }

        .content-section h1 {
            font-size: 2.2rem;
            color: var(--primary-color);
            margin-bottom: 25px;
            text-align: center;
            font-weight: 800;
        }

        .content-section h2 {
            font-size: 1.6rem;
            color: var(--accent-color);
            margin-top: 40px;
            margin-bottom: 15px;
            font-weight: 700;
            border-bottom: 2px solid rgba(63, 114, 175, 0.15);
            padding-bottom: 8px;
        }

        .content-section p {
            margin-bottom: 18px;
            color: var(--text-color);
            opacity: 0.9;
        }

        .content-section strong {
            color: var(--primary-color);
            font-weight: 700;
        }

        .content-section a {
            color: var(--accent-color);
            text-decoration: none;
            font-weight: 600;
        }

        .content-section a:hover {
            text-decoration: underline;
        }

        .content-section ul,
        .content-section ol {
            margin-bottom: 20px;
            padding-left: 30px;
        }

        .content-section ul {
            list-style-type: disc;
        }

        .content-section ol {
            list-style-type: decimal;
        }

        .content-section li {
            margin-bottom: 8px;
        }

        .cta-button-container {
            text-align: center;
            margin: 40px 0;
        }

        .btn-cta {
            display: inline-block;
            background: var(--accent-color);
            color: white;
            padding: 18px 40px;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 800;
            font-size: 1.2rem;
            box-shadow: 0 4px 15px rgba(63, 114, 175, 0.3);
            transition: all 0.3s ease;
        }

        .btn-cta:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(63, 114, 175, 0.4);
            background: var(--primary-color);
        }

        /* Jump Links */
        .jump-nav {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            justify-content: center;
            margin: 30px 0;
            opacity: 0;
            animation: fadeInUp 0.8s ease-out 0.3s forwards;
        }

        .jump-link {
            text-decoration: none;
            color: var(--accent-color);
            background: rgba(63, 114, 175, 0.1);
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.95rem;
            transition: all 0.2s;
            border: 1px solid transparent;
        }

        .jump-link:hover {
            background: var(--accent-color);
            color: white;
            transform: translateY(-2px);
        }

        /* HUD & Leaderboard */
        .user-identity-section {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 1px solid #f0f0f0;
            padding-bottom: 15px;
        }

        #username-input {
            flex: 1;
            padding: 8px 12px;
            border: 2px solid #eef0f2;
            border-radius: 8px;
            font-weight: 600;
            color: var(--primary-color);
            outline: none;
            transition: border 0.2s;
        }

        #username-input:focus {
            border-color: var(--accent-color);
        }

        .btn-save-name {
            background: var(--accent-color);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 8px 16px;
            font-weight: 700;
            cursor: pointer;
        }

        .leaderboard-card.is-me {
            border: 2px solid var(--accent-color);
            background: rgba(63, 114, 175, 0.05);
        }

        .game-hud {
            display: flex;
            justify-content: space-between;
            width: 100%;
            max-width: 350px;
            margin: 0 auto 10px auto;
            padding: 0 10px;
            position: relative;
            z-index: 20;
        }

        .hud-item {
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(8px);
            padding: 8px 16px;
            border-radius: 20px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 700;
            color: var(--primary-color);
            border: 1px solid rgba(255, 255, 255, 0.5);
            transition: transform 0.2s;
        }

        .hud-item:hover {
            transform: translateY(-2px);
        }

        .hud-label {
            font-size: 0.75rem;
            color: var(--accent-color);
            letter-spacing: 0.5px;
        }

        .hud-value {
            font-size: 1.1rem;
            font-variant-numeric: tabular-nums;
        }

        .score-float {
            position: absolute;
            color: var(--accent-color);
            font-weight: 800;
            font-size: 1.2rem;
            pointer-events: none;
            animation: floatUp 1s ease-out forwards;
            text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
            z-index: 100;
        }

        @keyframes floatUp {
            0% {
                transform: translateY(0) scale(1);
                opacity: 1;
            }

            100% {
                transform: translateY(-40px) scale(1.2);
                opacity: 0;
            }
        }

        .leaderboard-container {
            margin: 30px auto;
            max-width: 500px;
            background: white;
            border-radius: 16px;
            padding: 20px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
            contain: content;
            /* Layout Isolation */
        }

        .leaderboard-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 15px;
            margin-bottom: 10px;
            border-radius: 10px;
            background: #f8f9fa;
            border: 1px solid #eef0f2;
            transition: transform 0.3s ease;
            animation: slideInLeft 0.5s ease-out backwards;
        }

        .leaderboard-card.rank-1 {
            animation-delay: 0.1s;
            border-left: 4px solid #ffd700;
        }

        .leaderboard-card.rank-2 {
            animation-delay: 0.2s;
            border-left: 4px solid #c0c0c0;
        }

        .leaderboard-card.rank-3 {
            animation-delay: 0.3s;
            border-left: 4px solid #cd7f32;
        }

        .leaderboard-card:hover {
            transform: translateX(5px);
            background: #fff;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .lb-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .rank-badge {
            width: 30px;
            height: 30px;
            background: var(--primary-color);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.9rem;
        }

        .player-info {
            display: flex;
            flex-direction: column;
            text-align: left;
        }

        .player-name {
            font-weight: 700;
            color: var(--primary-color);
            font-size: 0.95rem;
        }

        .player-score {
            font-size: 0.8rem;
            color: #718096;
        }

        .medal {
            font-size: 1.5rem;
        }

        .leaderboard-placeholder {
            text-align: center;
            font-size: 0.9rem;
            color: #a0aec0;
            margin-top: 15px;
            font-style: italic;
        }

        /* FAQs */
        .faq-container {
            margin-top: 20px;
        }

        .faq-item {
            margin-bottom: 12px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        }

        .faq-question {
            width: 100%;
            text-align: left;
            padding: 15px;
            background: none;
            border: none;
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--primary-color);
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: color 0.2s;
        }

        .faq-question:hover {
            color: var(--accent-color);
        }

        .faq-icon {
            font-size: 1.5rem;
            transition: transform 0.3s ease;
            color: var(--accent-color);
        }

        .faq-question.active .faq-icon {
            transform: rotate(45deg);
        }

        .faq-answer {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
            padding: 0 15px;
        }

        .faq-answer p {
            padding-bottom: 20px;
            margin-bottom: 0;
            color: #4a5568;
            font-size: 1rem;
            line-height: 1.6;
            margin-top: -5px;
        }

        @keyframes slideInLeft {
            from {
                opacity: 0;
                transform: translateX(-20px);
            }

            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        /* Footer */
        .main-footer {
            background-color: var(--primary-color);
            color: #dbe2ef;
            padding: 40px 20px;
            text-align: center;
            border-top: 4px solid var(--accent-color);
            width: 100%;
            margin-top: 40px;
            position: relative;
            /* Ensure context */
            overflow: hidden;
            /* Clip bubbles */
            contain: content;
        }

        /* Footer Shapes Container (Fix) */
        #floating-shapes {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            /* overflow: hidden; Removed to prevent clipping start */
            z-index: 0;
            pointer-events: none;
        }

        .footer-grid {
            max-width: 1000px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 40px;
            text-align: left;
            position: relative;
            /* Layer above shapes */
            z-index: 1;
        }

        .footer-col h3 {
            color: white;
            margin-bottom: 20px;
            font-size: 1.2rem;
        }

        .footer-col p {
            font-size: 0.95rem;
            line-height: 1.6;
            opacity: 0.8;
        }

        .footer-bottom {
            margin-top: 60px;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            text-align: center;
            font-size: 0.85rem;
            color: rgba(255, 255, 255, 0.6);
            display: flex;
            flex-direction: column;
            gap: 10px;
            position: relative;
            /* Layer above shapes */
            z-index: 1;
        }

        .footer-col ul {
            list-style: none;
            padding: 0;
        }

        .footer-col li {
            margin-bottom: 10px;
        }

        .footer-col a {
            color: #dbe2ef;
            text-decoration: none;
            transition: color 0.2s;
        }

        .footer-col a:hover {
            color: white;
            text-decoration: underline;
        }

        .footer-bottom {
            max-width: 1000px;
            margin: 40px auto 0;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            text-align: center;
            font-size: 0.85rem;
            opacity: 0.6;
        }

        @media (max-width: 600px) {
            .content-section {
                padding: 20px !important;
                width: 100% !important;
                opacity: 1 !important;
                transform: none !important;
            }

            .content-section h1 {
                font-size: 1.8rem !important;
            }

            .footer-grid {
                text-align: center;
                grid-template-columns: 1fr;
            }

            .footer-col {
                margin-bottom: 30px;
            }
        }

        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* MOBILE OPTIMIZATIONS */
        @media (max-width: 480px) {
            .content-section {
                padding: 20px 15px !important;
                margin-bottom: 30px;
            }

            .leaderboard-container {
                padding: 15px !important;
                margin: 20px auto;
            }

            .user-identity-section {
                gap: 8px;
            }

            #username-input {
                min-width: 0;
                /* Critical for flex shrinking */
                font-size: 0.9rem;
            }

            .btn-save-name {
                padding: 8px 12px;
                font-size: 0.9rem;
                white-space: nowrap;
                /* Prevent text wrap */
            }

            .hud-item {
                padding: 6px 12px;
            }

            .hud-value {
                font-size: 1rem;
            }

            .btn-cta {
                padding: 12px 25px;
                /* Reduced from 18px 40px */
                font-size: 1rem;
                /* Reduced from 1.2rem */
                width: auto;
                max-width: 90%;
            }

            .content-section ul,
            .content-section ol {
                padding-left: 20px;
            }
        }


        /* Info Modal Styles */
        .info-content {
            max-width: 500px;
        }

        .info-content p {
            margin-bottom: 12px;
        }

        .info-content ul {
            margin-bottom: 15px;
            padding-left: 20px;
        }

        .info-content li {
            margin-bottom: 5px;
        }