body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding-bottom: 50px;
}

.game-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    flex: 1;
    padding: 20px;
    box-sizing: border-box;
}

.left-panel,
.right-panel {
    color: #00ffcc;
    width: 20%;
    max-height: 100vh;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

.game-board-wrapper {
    width: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 100vh;
    overflow-y: auto;
}

.title-2048 {
    font-size: 6vw;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(45deg, #00ffcc, #0077ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
    -webkit-text-stroke: 2px rgba(0, 0, 0, 0.2);
    animation: neonGlow 1.5s ease-in-out infinite alternate;
    margin-bottom: 10px;
}

@keyframes neonGlow {
    from {
        text-shadow: 0 0 10px rgba(0, 255, 204, 0.5), 0 0 20px rgba(0, 255, 204, 0.5), 0 0 30px rgba(0, 255, 204, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(0, 255, 204, 0.8), 0 0 30px rgba(0, 255, 204, 0.8), 0 0 40px rgba(0, 255, 204, 0.8);
    }
}

#game-board {
    display: grid;
    gap: 10px;
    background-color: #222;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
    perspective: 1000px;
    max-width: 100%;
    max-height: 70vh;
    overflow: auto;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    /* 添加悬浮 3D 动画效果 */
    transform: translateZ(0);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateZ(0) translateY(0);
        box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
    }
    50% {
        transform: translateZ(10px) translateY(-10px);
        box-shadow: 0 10px 30px rgba(0, 255, 204, 0.5);
    }
    100% {
        transform: translateZ(0) translateY(0);
        box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
    }
}

.tile {
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2vw;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    transform-style: preserve-3d;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateZ(0);
    aspect-ratio: 1/1;
}

.tile.new {
    animation: pop 0.2s ease-in-out;
}

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

.tile.merge {
    animation: merge 0.4s ease-in-out;
}

@keyframes merge {
    0% {
        transform: scale(1) rotateX(0deg);
    }
    50% {
        transform: scale(1.5) rotateX(180deg);
    }
    100% {
        transform: scale(1) rotateX(360deg);
    }
}

.tile.move {
    transition: transform 0.2s ease-in-out;
}

#score-board {
    margin-top: 20px;
    font-size: 24px;
    color: #00ffcc;
}

button {
    margin-top: 10px;
    padding: 8px 16px;
    font-size: 16px;
    background-color: #0077ff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 119, 255, 0.5);
}

button:hover {
    background-color: #0099ff;
}

#game-over,
#game-win {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
    text-align: center;
    color: #00ffcc;
}

.version-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    color: #777;
    font-size: 14px;
    text-align: center;
    padding: 10px 0;
}

.tile[data-value="2"] {
    background-color: #FFEB3B;
    color: #333;
}

.tile[data-value="4"] {
    background-color: #FFC107;
    color: #333;
}

.tile[data-value="8"] {
    background-color: #FF9800;
    color: white;
}

.tile[data-value="16"] {
    background-color: #FF5722;
    color: white;
}

.tile[data-value="32"] {
    background-color: #F44336;
    color: white;
}

.tile[data-value="64"] {
    background-color: #E91E63;
    color: white;
}

.tile[data-value="128"] {
    background-color: #9C27B0;
    color: white;
}

.tile[data-value="256"] {
    background-color: #673AB7;
    color: white;
}

.tile[data-value="512"] {
    background-color: #3F51B5;
    color: white;
}

.tile[data-value="1024"] {
    background-color: #2196F3;
    color: white;
}

.tile[data-value="2048"] {
    background-color: #03A9F4;
    color: white;
}

.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation: firework 1s ease-out forwards;
}

@keyframes firework {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(10);
        opacity: 0;
    }
}

#motivation-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
    text-align: center;
    color: #00ffcc;
    font-size: 24px;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.difficulty-button {
    position: relative;
    background-color: #333;
    border: none;
    box-shadow: 0 4px 0 #1a1a1a;
    transform: translateY(0);
    transition: all 0.2s ease;
}

.difficulty-button:hover {
    background-color: #444;
}

.difficulty-button:active {
    box-shadow: 0 2px 0 #1a1a1a;
    transform: translateY(2px);
}

.difficulty-button.active {
    background-color: #00ffcc;
    color: #121212;
    box-shadow: 0 4px 0 #00b38f;
    animation: buttonFlash 1s infinite alternate;
}

@keyframes buttonFlash {
    from {
        border-color: transparent;
        box-shadow: 0 4px 0 #00b38f;
    }
    to {
        border-color: #0077ff;
        box-shadow: 0 4px 10px #0077ff;
    }
}