:root {
    /* 简化的设计变量 */
    --primary-color: #776e65;
    --secondary-color: #bbada0;
    --bg-color: #faf8ef;
    --cell-bg: #cdc1b4;
    --text-light: #f9f6f2;
    --text-dark: #776e65;
    --button-bg: #8f7a66;
    --button-hover: #9f8a76;
    --grid-size: 400px;
    --cell-gap: 10px;
    --border-radius: 10px;
    --danger-color: #f65e3b;
    --success-color: #edc22e;
}

/* 深色模式变量（简化） */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #f0e6d6;
        --secondary-color: #3a3630;
        --bg-color: #1e1b18;
        --cell-bg: #4a4540;
        --button-bg: #9c8a7a;
        --button-hover: #b09e8e;
        --danger-color: #ff7b5a;
        --success-color: #ffd700;
    }
}

/* 基础样式（性能优化） */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    text-align: center;
    background: var(--bg-color);
    margin: 0;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
}

/* 容器简化 */
.container {
    max-width: min(95vw, 500px);
    margin: 0 auto;
    padding: 15px;
}

/* 标题简化 */
h1 {
    color: var(--primary-color);
    font-size: 32px;
    margin: 10px 0 15px;
    font-weight: 800;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--button-bg);
    border-radius: 2px;
}

/* AI徽章简化 */
h1::before {
    content: 'AI';
    position: absolute;
    top: -8px;
    right: -25px;
    background: var(--success-color);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

/* 分数显示简化 */
.score {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

#score,
#maxTile {
    font-weight: 700;
    color: var(--button-bg);
    background: rgba(143, 122, 102, 0.1);
    padding: 4px 12px;
    border-radius: 6px;
    min-width: 60px;
    display: inline-block;
}

/* 控制区域简化 */
.controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    background: var(--button-bg);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-width: 90px;
}

.btn:hover {
    background: var(--button-hover);
}

/* 速度按钮简化样式 */
.btn:nth-child(4) {
    background: #4CAF50;
}

.btn:nth-child(5) {
    background: #2196F3;
}

.btn:nth-child(6) {
    background: #FF9800;
}

/* 游戏棋盘简化 */
.game-board {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: var(--cell-gap);
    width: min(90vw, var(--grid-size));
    height: min(90vw, var(--grid-size));
    margin: 0 auto 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: var(--cell-gap);
    width: 100%;
    height: 100%;
}

/* 单元格大幅简化 */
.cell {
    background: var(--cell-bg);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

/* 数字块基础样式（移除渐变和阴影） */
.cell[data-value="1"] {
    background: #eee4da;
}

.cell[data-value="2"] {
    background: #ede0c8;
}

.cell[data-value="4"] {
    background: #f2b179;
    color: var(--text-light);
}

.cell[data-value="8"] {
    background: #f59563;
    color: var(--text-light);
}

.cell[data-value="16"] {
    background: #f67c5f;
    color: var(--text-light);
    font-size: 20px;
}

.cell[data-value="32"] {
    background: #f65e3b;
    color: var(--text-light);
    font-size: 20px;
}

.cell[data-value="64"] {
    background: #edcf72;
    color: var(--text-light);
    font-size: 20px;
}

.cell[data-value="128"] {
    background: #edcc61;
    color: var(--text-light);
    font-size: 18px;
}

.cell[data-value="256"] {
    background: #edc850;
    color: var(--text-light);
    font-size: 18px;
}

.cell[data-value="512"] {
    background: #edc53f;
    color: var(--text-light);
    font-size: 18px;
}

.cell[data-value="1024"] {
    background: #edc22e;
    color: var(--text-light);
    font-size: 16px;
}

.cell[data-value="2048"] {
    background: #edc22e;
    color: var(--text-light);
    font-size: 16px;
}

.cell[data-value="4096"] {
    background: #3c3a32;
    color: #fff;
    font-size: 16px;
}

/* 深色模式基础适配 */
@media (prefers-color-scheme: dark) {
    .cell[data-value="1"] {
        background: #4d4840;
    }

    .cell[data-value="2"] {
        background: #5d584f;
    }

    .cell[data-value="4"] {
        background: #d6935a;
    }

    .cell[data-value="8"] {
        background: #d87a44;
    }

    .cell[data-value="16"] {
        background: #d85936;
    }

    .cell[data-value="32"] {
        background: #d83e1c;
    }

    .cell[data-value="64"] {
        background: #d8b947;
    }

    .cell[data-value="128"] {
        background: #d8b031;
    }

    .cell[data-value="256"] {
        background: #d8a81b;
    }

    .cell[data-value="512"] {
        background: #d89f05;
    }

    .cell[data-value="1024"] {
        background: #d89600;
    }

    .cell[data-value="2048"] {
        background: #ffd700;
    }

    .cell[data-value="4096"] {
        background: #4a3f31;
    }
}

/* 游戏结束界面简化 */
.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(238, 228, 218, 0.95);
    border-radius: var(--border-radius);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    padding: 20px;
}

.game-over-text {
    font-size: 36px;
    color: var(--danger-color);
    font-weight: 800;
    margin-bottom: 20px;
}

.game-over div {
    font-size: 16px;
    margin: 8px 0;
    font-weight: 600;
}

#finalScore,
#finalMaxTile {
    font-weight: 700;
    color: var(--success-color);
    padding: 4px 12px;
    border-radius: 6px;
}

.restart-btn {
    background: var(--danger-color);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    min-width: 150px;
}

.restart-btn:hover {
    background: #ff7b5a;
}

/* AI状态简化 */
.ai-status {
    margin: 10px auto;
    color: var(--button-bg);
    font-size: 14px;
    font-weight: 600;
    background: rgba(143, 122, 102, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

/* 响应式基础适配（简化） */
@media (max-width: 480px) {
    .game-board {
        padding: 8px;
    }

    .grid {
        gap: 8px;
    }

    .cell {
        font-size: 18px;
    }

    .btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .controls {
        gap: 8px;
    }

    .btn {
        min-width: 70px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* 移除所有动画和过渡 */
* {
    animation: none !important;
    transition: none !important;
}