
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #000;
    overflow: hidden;
}
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}
#game-container {
    width: 460px;
    background-color: rgba(250, 248, 239, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 20px 20px 60px rgba(0, 0, 0, 0.5), -20px -20px 60px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}
.title {
    text-align: center;
    font-size: 48px;
    font-weight: bold;
    color: #776e65;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}
.info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.score-container, .best-score-container {
    background-color: #bbada0;
    padding: 10px 20px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.score-container:hover, .best-score-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider {
    background-color: #2196F3;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
#sound-toggle-container {
    display: flex;
    align-items: center;
}
#sound-toggle-label {
    margin-right: 10px;
    font-weight: bold;
    color: #776e65;
}
.row {
    display: flex;
}
.cell {
    width: 100px;
    height: 100px;
    margin: 5px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    font-weight: bold;
    color: #776e65;
    transition: all 0.1s ease-in-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.cell-0 { background-color: #cdc1b4; }
.cell-2 { background-color: #eee4da; }
.cell-4 { background-color: #ede0c8; }
.cell-8 { background-color: #f2b179; color: #f9f6f2; }
.cell-16 { background-color: #f59563; color: #f9f6f2; }
.cell-32 { background-color: #f67c5f; color: #f9f6f2; }
.cell-64 { background-color: #f65e3b; color: #f9f6f2; }
.cell-128 { background-color: #edcf72; color: #f9f6f2; }
.cell-256 { background-color: #edcc61; color: #f9f6f2; }
.cell-512 { background-color: #edc850; color: #f9f6f2; }
.cell-1024 { background-color: #edc53f; color: #f9f6f2; }
.cell-2048 { background-color: #edc22e; color: #f9f6f2; }
#restart-button {
    display: block;
    margin: 20px auto 0;
    padding: 15px 30px;
    font-size: 18px;
    background-color: #8f7a66;
    color: #f9f6f2;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#restart-button:hover {
    background-color: #9f8b77;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}
#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background-color: #faf8ef;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.game-over-content h2 {
    font-size: 48px;
    color: #776e65;
    margin-bottom: 20px;
}

.game-over-content p {
    font-size: 24px;
    color: #776e65;
    margin-bottom: 30px;
}

.game-over-content button {
    padding: 15px 30px;
    font-size: 18px;
    background-color: #8f7a66;
    color: #f9f6f2;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-over-content button:hover {
    background-color: #9f8b77;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#drag-indicator {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 25px;
    background-color: rgba(238, 228, 218, 0.5);
    pointer-events: none;
    display: none;
    transition: all 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
@keyframes appear {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
