* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #776e65;
    overflow: hidden;
}

/* Home Menu Styles */
.home-menu {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
}

.home-title {
    font-size: 4rem;
    font-weight: bold;
    color: #776e65;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #f67c5f, #f59563, #edcf72);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-subtitle {
    font-size: 1.2rem;
    color: #8f7a66;
    margin-bottom: 40px;
}

.board-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.board-option {
    background: linear-gradient(45deg, #8f7a66, #9f8a76);
    color: white;
    border: none;
    padding: 20px 30px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.board-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.board-option:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.board-option:hover::before {
    left: 100%;
}

.board-option:active {
    transform: translateY(-1px) scale(1.01);
}

.option-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.option-desc {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Game Container Styles */
.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
    display: none;
    animation: slideIn 0.5s ease-out;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #776e65;
}

.home-btn {
    background: #f67c5f;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.home-btn:hover {
    background: #f59563;
    transform: scale(1.05);
}

.scores {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.score-box {
    background: #bbada0;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    text-align: center;
    min-width: 80px;
}

.score-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.score-value {
    font-size: 1.2rem;
    font-weight: bold;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    background: #8f7a66;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #9f8a76;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.grid-container {
    position: relative;
    background: #bbada0;
    border-radius: 10px;
    padding: 10px;
    margin: 0 auto;
}

.grid-container.size-3 {
    width: 280px;
    height: 280px;
}

.grid-container.size-4 {
    width: 360px;
    height: 360px;
}

.grid-row {
    display: flex;
    margin-bottom: 10px;
}

.grid-row:last-child {
    margin-bottom: 0;
}

.grid-cell {
    position: relative; /* If needed */
    background: rgba(238, 228, 218, 0.35);
    border-radius: 6px;
    margin-right: 10px;
}

.grid-cell:last-child {
    margin-right: 0;
}

.size-3 .grid-cell {
    width: 80px;
    height: 80px;
}

.size-4 .grid-cell {
    width: 80px;
    height: 80px;
}

.tile {
    position: absolute;
    background: #eee4da;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    z-index: 2;
}

.size-3 .tile {
    width: 80px;
    height: 80px;
}

.size-4 .tile {
    width: 80px;
    height: 80px;
}

.tile-2 { background: #eee4da; color: #776e65; }
.tile-4 { background: #ede0c8; color: #776e65; }
.tile-8 { background: #f2b179; color: #f9f6f2; }
.tile-16 { background: #f59563; color: #f9f6f2; }
.tile-32 { background: #f67c5f; color: #f9f6f2; }
.tile-64 { background: #f65e3b; color: #f9f6f2; }
.tile-128 { background: #edcf72; color: #f9f6f2; font-size: 28px; }
.tile-256 { background: #edcc61; color: #f9f6f2; font-size: 28px; }
.tile-512 { background: #edc850; color: #f9f6f2; font-size: 28px; }
.tile-1024 { background: #edc53f; color: #f9f6f2; font-size: 24px; }
.tile-2048 { background: #edc22e; color: #f9f6f2; font-size: 24px; }
.tile-4096 { background: #3c3a32; color: #f9f9f2; font-size: 20px; }

.tile-new {
    animation: appear 0.2s ease-in-out;
}

.tile-merged {
    animation: pop 0.2s ease-in-out;
}

.tile-move {
    transition: all 0.15s ease-in-out;
}

@keyframes appear {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-over, .game-won {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    z-index: 100;
    animation: fadeIn 0.3s ease-out;
}

.game-over h2, .game-won h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #776e65;
}

.instructions {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #8f7a66;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .home-menu, .game-container {
        margin: 10px;
        padding: 20px;
    }
    
    .home-title {
        font-size: 3rem;
    }
    
    .grid-container.size-3 {
        width: 240px;
        height: 240px;
    }
    
    .grid-container.size-4 {
        width: 300px;
        height: 300px;
    }
    
    .size-3 .grid-cell, .size-3 .tile {
        width: 65px;
        height: 65px;
    }
    
    .size-4 .grid-cell, .size-4 .tile {
        width: 65px;
        height: 65px;
    }
    
    .tile {
        font-size: 24px;
    }
    
    .tile-128, .tile-256, .tile-512 {
        font-size: 20px;
    }
    
    .tile-1024, .tile-2048 {
        font-size: 16px;
    }
}
/* Loader Styles */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10; /* Above tiles, below game over/won */
    border-radius: 10px;
    transition: opacity 0.3s ease-out;
}

.loader {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #f67c5f; /* Orange */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
<environment_details>
# VSCode Visible Files
style.css

# VSCode Open Tabs
style.css
script.js
enhanced_2048_game.html

# Current Time
5/27/2025, 4:11:00 PM (Asia/Dhaka, UTC+6:00)

# Context Window Usage
154,184 / 1,048.576K tokens used (15%)

# Current Mode
ACT MODE
</environment_details>
