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

body {
    font-family: 'Roboto', sans-serif;
    background: #228B22;
}

/* Game Container */
.game-container {
    background: url('https://www.transparenttextures.com/patterns/asfalt-light.png') repeat, #228B22;
    background-size: 100px 100px;
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Game Grid */
.grid-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    position: relative;
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
}

/* Grid Cells */
.grid-cell {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    font-weight: bold;
    color: white;
    transition: all 0.15s ease;
    position: relative;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Tile Colors based on values */
.tile-2 { background-color: #eee4da; color: #776e65; }
.tile-4 { background-color: #ede0c8; color: #776e65; }
.tile-8 { background-color: #f2b179; }
.tile-16 { background-color: #f59563; }
.tile-32 { background-color: #f67c5f; }
.tile-64 { background-color: #f65e3b; }
.tile-128 { 
    background-color: #edcf72;
    font-size: 32px;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.2381);
}
.tile-256 { 
    background-color: #edcc61;
    font-size: 32px;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.31746);
}
.tile-512 { 
    background-color: #edc850;
    font-size: 32px;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.39683);
}
.tile-1024 { 
    background-color: #edc53f;
    font-size: 28px;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.47619);
}
.tile-2048 { 
    background-color: #edc22e;
    font-size: 28px;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.55556);
}

/* Game Stats */
.game-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 18px;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.control-button {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    transition: background 0.3s ease;
}

.control-button:hover {
    background: #45a049;
}

/* Animations */
@keyframes appear {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

.tile-new {
    animation: appear 0.2s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.tile-merged {
    animation: pop 0.2s ease;
}

/* Responsive Design */
@media (max-width: 520px) {
    .grid-container {
        grid-gap: 10px;
        padding: 10px;
    }

    .grid-cell {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }

    .tile-128, .tile-256, .tile-512 {
        font-size: 22px;
    }

    .tile-1024, .tile-2048 {
        font-size: 18px;
    }
}

/* Override popup styles */
.popup {
    display: none;
}

.popup.show {
    display: flex;
}

/* Header specific */
.game-header {
    font-family: 'Press Start 2P', cursive;
    color: white;
    text-align: center;
    margin: 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Content Section */
.game-content {
    background: linear-gradient(135deg, #1a472a, #2a623d);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.game-content h2 {
    font-family: 'Press Start 2P', cursive;
    color: #FFD700;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.game-content p, .game-content li {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.game-content ul {
    margin-left: 1rem;
    margin-bottom: 2rem;
}

/* Update font class to ensure it works */
.font-press-start {
    font-family: 'Press Start 2P', cursive !important;
}

/* Override Tailwind font class */
h1.font-press-start {
    font-family: 'Press Start 2P', cursive !important;
}

/* Ensure proper spacing */
main {
    min-height: calc(100vh - 64px - 320px); /* header height and footer height */
    padding: 20px 0;
}
