 :root {
            --bg-color-light: white;
            --game-bg-light: #e39e9e;
            --text-color-light: black;
            --secondary-text-light: #8f7a66;
            --primary-color: #fdaaaa;
            --button-color: #fdaaaa;
            --border-color: #bbada0;
            --font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
            --shadow: rgba(0, 0, 0, 0.1);
        }

        body.dark-mode {
            --bg-color-light: #1a1a2e;
            --game-bg-light: #3a3a5a;
            --text-color-light: #eceff1;
            --secondary-text-light: #b0b0b0;
            --primary-color: #8b5cf6;
            --button-color: #546e7a;
            --border-color: #455a64;
            --shadow: rgba(0, 0, 0, 0.4);
        }

        body {
            font-family: var(--font-family);
            background-color: var(--bg-color-light);
            color: var(--text-color-light);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            flex-direction: column;
            padding: 20px;
            transition: background-color 0.3s, color 0.3s;
        }

        .game-container {
            width: 100%;
            max-width: 500px;
            text-align: center;
            position: relative;
            background-color: var(--bg-color-light);
            border-radius: 15px;
            box-shadow: 0 10px 30px var(--shadow);
            padding: 20px;
            box-sizing: border-box;
        }
        
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        h1 {
            color: var(--primary-color);
            margin: 0;
            font-size: clamp(2em, 8vw, 3em);
            font-weight: bold;
        }
        
        .score-container {
            background: var(--game-bg-light);
            padding: 10px 15px;
            border-radius: 6px;
            font-size: clamp(1.2em, 5vw, 1.5em);
            font-weight: bold;
            color: var(--text-color-light);
            min-width: 90px;
        }

        .score-title {
            font-size: 0.8em;
            color: var(--secondary-text-light);
            font-weight: normal;
        }
        
        .score-value {
            color: var(--text-color-light);
        }

        .game-board {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            grid-template-rows: repeat(4, 1fr);
            gap: 10px;
            background-color: var(--game-bg-light);
            border-radius: 6px;
            padding: 10px;
            position: relative;
        }

        .tile-cell {
            background-color: rgba(238, 228, 218, 0.35);
            border-radius: 3px;
            aspect-ratio: 1 / 1;
        }

        .tile {
            aspect-ratio: 1 / 1;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: clamp(1.5em, 5vw, 2.5em);
            font-weight: bold;
            color: #776e65;
            border-radius: 3px;
            transition: transform 0.2s ease-in-out;
            position: relative;
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
        }

        .tile-2 { background: #f3d6e3; }
        .tile-4 { background: #ede0c8; }
        .tile-8 { background: #f1cccc; color: #f9f6f2; }
        .tile-16 { background: #fed0d0; color: #f9f6f2; }
        .tile-32 { background: #f67c5f; color: #f9f6f2; }
        .tile-64 { background: #f65e3b; color: #f9f6f2; }
        .tile-128 { background: #edcf72; color: #f9f6f2; }
        .tile-256 { background: #edc850; color: #f9f6f2; }
        .tile-512 { background: #edc53f; color: #f9f6f2; }
        .tile-1024 { background: #edc22e; color: #f9f6f2; }
        .tile-2048 { background: #edc22e; color: #f9f6f2; }
        .tile-beyond { background: #3c3a32; color: #f9f6f2; }

        .game-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            text-align: center;
            border-radius: 6px;
            visibility: hidden;
            opacity: 0;
            transition: opacity 0.3s, visibility 0.3s;
        }
        
        body.dark-mode .game-overlay {
            background: rgba(26, 32, 46, 0.85);
        }
        
        .game-overlay.active {
            visibility: visible;
            opacity: 1;
        }

        .overlay-text {
            font-size: clamp(2em, 8vw, 3em);
            font-weight: bold;
            margin-bottom: 20px;
            color: var(--text-color-light);
        }

        .btn {
            padding: 10px 20px;
            background: var(--button-color);
            color: white;
            border-radius: 6px;
            text-decoration: none;
            font-size: 1.2em;
            font-weight: bold;
            cursor: pointer;
            border: none;
            transition: background-color 0.2s, transform 0.2s;
        }
        
        .btn:hover {
            transform: translateY(-2px);
            background: var(--primary-color);
        }
        
        .btn:active {
            transform: translateY(0);
        }

        .controls {
            margin-top: 20px;
            display: flex;
            justify-content: center;
            gap: 15px;
        }

        /* --- Theme Toggle Button --- */
        .theme-toggle {
            background: var(--bg-color-light);
            border: 1px solid var(--border-color);
            border-radius: 50%;
            width: 45px;
            height: 45px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color 0.3s, border-color 0.3s, transform 0.2s;
            z-index: 1010;
            box-shadow: 0 2px 4px var(--shadow);
        }
        .theme-toggle:hover {
            transform: scale(1.05);
        }
        .theme-toggle .material-icons {
            font-size: 24px;
            color: var(--text-color-light);
            transition: color 0.3s;
        }

        /* --- Explore More Section --- */
        .resources-section {
            width: 100%;
            max-width: 500px;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid var(--border-color);
            text-align: center;
        }
        .resources-section h3 {
            color: var(--primary-color);
            margin-bottom: 15px;
            font-size: clamp(1em, 4vw, 1.5em);
        }
        .resources-list {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 15px;
            list-style: none;
            padding: 0;
        }
        .resources-list a {
            padding: 10px 15px;
            border-radius: 8px;
            background-color: var(--bg-color-light);
            border: 1px solid var(--border-color);
            text-decoration: none;
            color: var(--text-color-light);
            transition: background-color 0.2s, transform 0.2s;
            display: flex;
            align-items: center;
            font-weight: bold;
        }
        .resources-list a:hover {
            transform: translateY(-2px);
            background-color: var(--hover-color);
            color: white;
        }
        .resources-list a:hover .material-icons {
             color: white;
        }
        .resources-list a .material-icons {
            margin-right: 8px;
            color: var(--primary-color);
            transition: color 0.2s;
        }
        
        /* Modal styling for game messages */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        .modal-content {
            background-color: var(--bg-color-light);
            padding: 30px;
            border-radius: 12px;
            text-align: center;
            box-shadow: 0 10px 20px var(--shadow);
            max-width: 400px;
            width: 80%;
        }
        .modal-content h3 {
            margin: 0 0 10px;
            font-size: 1.5rem;
            color: var(--primary-color);
        }
        .modal-content p {
            font-size: 1rem;
            margin-bottom: 20px;
        }