body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#dynamic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #ff00ff, #00ff00, #0000ff, #ff0000, #ffff00);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

#game-container {
    background-color: rgba(224, 224, 224, 0.8);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 
        20px 20px 60px rgba(0, 0, 0, 0.3),
        -20px -20px 60px rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    width: 400px;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

h1 {
    color: #333;
    font-size: 48px;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

#game-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 15px;
}

.info-label {
    font-size: 14px;
    font-weight: bold;
    color: #776e65;
    margin-bottom: 5px;
}

#score-container, #moves-container {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding: 5px 10px;
    border-radius: 15px;
    background-color: #e0e0e0;
    box-shadow: 
        inset 4px 4px 8px #bebebe,
        inset -4px -4px 8px #ffffff;
    min-width: 60px;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    background-color: rgba(187, 173, 160, 0.8);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 
        inset 6px 6px 12px rgba(0, 0, 0, 0.2),
        inset -6px -6px 12px rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

#controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

button {
    background-color: #e0e0e0;
    color: #333;
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50px;
    box-shadow: 
        6px 6px 12px #bebebe,
        -6px -6px 12px #ffffff;
    transition: all 0.3s ease;
}

button:hover {
    box-shadow: 
        4px 4px 8px #bebebe,
        -4px -4px 8px #ffffff;
}

button:active {
    box-shadow: inset 4px 4px 8px #bebebe,
                inset -4px -4px 8px #ffffff;
}

#new-game {
    flex-grow: 1;
    margin-right: 15px;
}

#undo {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    padding: 0;
}

.tile {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 
        4px 4px 8px rgba(0, 0, 0, 0.1),
        -4px -4px 8px rgba(255, 255, 255, 0.1);
}

.tile-2 { 
    background-color: #E6F3FF; 
    color: #1E90FF;
}
.tile-4 { 
    background-color: #FFE6E6; 
    color: #FF4500;
}
.tile-8 { 
    background-color: #E6FFE6; 
    color: #228B22;
}
.tile-16 { 
    background-color: #FFE6F3; 
    color: #FF1493;
}
.tile-32 { 
    background-color: #E6E6FF; 
    color: #4B0082;
}
.tile-64 { 
    background-color: #FFF3E6; 
    color: #FF8C00;
}
.tile-128 { 
    background-color: #F3E6FF; 
    color: #8A2BE2;
    font-size: 24px;
}
.tile-256 { 
    background-color: #E6FFF3; 
    color: #008B8B;
    font-size: 24px;
}
.tile-512 { 
    background-color: #FFE6FF; 
    color: #8B008B;
    font-size: 24px;
}
.tile-1024 { 
    background-color: #F3FFE6; 
    color: #6B8E23;
    font-size: 20px;
}
.tile-2048 { 
    background-color: #FFE6E6; 
    color: #B22222;
    font-size: 20px;
}

.tile {
    box-shadow: 
        4px 4px 8px rgba(0, 0, 0, 0.1),
        -4px -4px 8px rgba(255, 255, 255, 0.3),
        inset 2px 2px 4px rgba(0, 0, 0, 0.05),
        inset -2px -2px 4px rgba(255, 255, 255, 0.2);
}

.star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

#galaxy-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #000;
    overflow: hidden;
}

.galaxy-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: rotate 100s linear infinite, twinkle 3s ease-in-out infinite alternate;
}

@keyframes rotate {
    from {
        transform: rotate(0deg) translateX(100vw) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(100vw) rotate(-360deg);
    }
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.tile {
    backdrop-filter: blur(5px);
    background-color: rgba(224, 224, 224, 0.7);
}

/* 在文件末尾添加以下样式 */
#sound-toggle {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    padding: 0;
    margin-left: 15px;
}

#sound-icon {
    color: #776e65;
}