/* 游戏容器样式 */
.game-container {
    padding: 15px;
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 确保游戏模式容器正确显示 */
#game-mode {
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

#game-mode.hidden {
    display: none;
}

.game-content.hidden {
    display: none;
}

.game-selector {
    position: absolute;
    top: 100%;
    left: 0;
    width: 200px;
    background-color: #2c3e50;
    border-radius: 8px;
    padding: 8px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.game-selector.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.game-option {
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin: 4px 0;
    border: none;
    background-color: transparent;
    color: white;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.game-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 游戏内容区域样式 */
.game-content {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 游戏头部样式 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.score-display, .timer, .round-info {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
}

/* 城市显示区域样式 */
.city-display {
    text-align: center;
    margin: 12px 0;
    padding: 8px;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.city-display h2 {
    color: #495057;
    margin-bottom: 8px;
    font-size: 16px;
}

.city-display h3 {
    color: #1e88e5;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    padding: 12px;
    letter-spacing: 1px;
}

/* 坐标输入区域样式 */
.coordinates-input {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.slider-container {
    margin: 12px 0;
}

.slider-container label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.slider-container input[type="range"] {
    width: 100%;
    margin: 8px 0;
    height: 6px;
    -webkit-appearance: none;
    background: #dee2e6;
    border-radius: 3px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    color: #6c757d;
    font-size: 12px;
}

/* 游戏控制按钮样式 */
.game-controls {
    text-align: center;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.game-controls button {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#start-game-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

#submit-location-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

#start-game-btn:hover,
#submit-location-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#start-game-btn:disabled,
#submit-location-btn:disabled {
    background: #dee2e6;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 地球历史2048游戏样式 */
#earth-2048-game {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background: var(--background-color);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#earth-2048-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* 地球历史2048主题颜色变量 */
:root {
    --tile-color-2: #eee4da;
    --tile-color-4: #ede0c8;
    --tile-color-8: #f2b179;
    --tile-color-16: #f59563;
    --tile-color-32: #f67c5f;
    --tile-color-64: #f65e3b;
    --tile-color-128: #edcf72;
    --tile-color-256: #edcc61;
    --tile-color-512: #edc850;
    --tile-color-1024: #edc53f;
    --tile-color-2048: #edc22e;
    --text-dark: #776e65;
    --text-light: #f9f6f2;
    --background-color: #faf8ef;
    --board-color: #bbada0;
    --cell-color: rgba(238, 228, 218, 0.35);
    --button-color: #8f7a66;
}

/* 地球历史2048主题样式 */
.theme-default {
    /* 默认主题不需要修改，使用初始变量 */
    --button-color: #8f7a66;
}

.theme-blue {
    --tile-color-2: #d6eaf8;
    --tile-color-4: #aed6f1;
    --tile-color-8: #85c1e9;
    --tile-color-16: #5dade2;
    --tile-color-32: #3498db;
    --tile-color-64: #2980b9;
    --tile-color-128: #1f6aa1;
    --tile-color-256: #1a5c8a;
    --tile-color-512: #154c72;
    --tile-color-1024: #11405e;
    --tile-color-2048: #0e3450;
    --board-color: #7fb3d5;
    --cell-color: rgba(214, 234, 248, 0.35);
    --button-color: #2980b9;
}

.theme-green {
    --tile-color-2: #d5f5e3;
    --tile-color-4: #abebc6;
    --tile-color-8: #82e0aa;
    --tile-color-16: #58d68d;
    --tile-color-32: #2ecc71;
    --tile-color-64: #27ae60;
    --tile-color-128: #229954;
    --tile-color-256: #1e8449;
    --tile-color-512: #196f3d;
    --tile-color-1024: #145a32;
    --tile-color-2048: #0e3e21;
    --board-color: #7dcea0;
    --cell-color: rgba(213, 245, 227, 0.35);
    --button-color: #27ae60;
}

.theme-purple {
    --tile-color-2: #ebdef0;
    --tile-color-4: #d7bde2;
    --tile-color-8: #c39bd3;
    --tile-color-16: #af7ac5;
    --tile-color-32: #9b59b6;
    --tile-color-64: #8e44ad;
    --tile-color-128: #7d3c98;
    --tile-color-256: #6c3483;
    --tile-color-512: #5b2c6f;
    --tile-color-1024: #4a235a;
    --tile-color-2048: #391a45;
    --board-color: #bb8fce;
    --cell-color: rgba(235, 222, 240, 0.35);
    --button-color: #8e44ad;
}

/* 地球历史2048游戏网格样式 */
#earth-2048-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    background-color: var(--board-color);
    padding: 10px;
    border-radius: 6px;
    margin: 0 auto;
}

.cell {
    background-color: var(--cell-color);
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 3px;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    width: 100%;
    height: 100%;
}

.tile .level {
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    padding: 0 2px;
    box-sizing: border-box;
    font-family: "Yuanti SC", "幼圆", "思源圆体", "OPPO Sans", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
    letter-spacing: 1px;
}

.tile .value {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    font-family: "Yuanti SC", "幼圆", "思源圆体", "OPPO Sans", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
    letter-spacing: 1px;
}

/* 地球历史2048方块颜色 */
.tile[data-value="2"] { background-color: var(--tile-color-2); color: var(--text-dark); }
.tile[data-value="4"] { background-color: var(--tile-color-4); color: var(--text-dark); }
.tile[data-value="8"] { background-color: var(--tile-color-8); color: var(--text-light); }
.tile[data-value="16"] { background-color: var(--tile-color-16); color: var(--text-light); }
.tile[data-value="32"] { background-color: var(--tile-color-32); color: var(--text-light); }
.tile[data-value="64"] { background-color: var(--tile-color-64); color: var(--text-light); }
.tile[data-value="128"] { background-color: var(--tile-color-128); color: var(--text-light); }
.tile[data-value="256"] { background-color: var(--tile-color-256); color: var(--text-light); }
.tile[data-value="512"] { background-color: var(--tile-color-512); color: var(--text-light); }
.tile[data-value="1024"] { background-color: var(--tile-color-1024); color: var(--text-light); }
.tile[data-value="2048"] { background-color: var(--tile-color-2048); color: var(--text-light); }

/* 地球历史2048动画效果 */
@keyframes tile-appear {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

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

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

.tile-merged {
    animation: tile-merge 0.2s ease-out backwards;
}

/* 地球历史2048设置面板样式 */
.settings-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background-color: #faf8ef;
    border-left: 2px solid #bbada0;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    transition: right 0.3s ease-in-out;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.settings-panel.visible {
    right: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
    }

    .slider-container {
        margin: 15px 0;
    }

    .game-controls button {
        width: 100%;
        margin: 5px 0;
    }

    .tile .level {
        font-size: 17px;
    }

    .tile .value {
        font-size: 14px;
    }

    .settings-panel {
        width: 100%;
        right: -100%;
    }
}

/* 地球历史2048游戏界面优化 */
#earth-2048-game {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background: var(--background-color);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.earth-2048-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(238, 228, 218, 0.35);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.score-container {
    display: flex;
    gap: 15px;
}

.score-box {
    background: rgba(255, 255, 255, 0.5);
    padding: 8px 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.score-label {
    font-family: "Yuanti SC", "幼圆", "思源圆体", "OPPO Sans", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.score-box span:last-child {
    font-family: "Yuanti SC", "幼圆", "思源圆体", "OPPO Sans", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--button-color);
    letter-spacing: 1px;
}

.earth-2048-controls {
    display: flex;
    gap: 10px;
}

.game-button {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--button-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.game-button:active {
    transform: translateY(1px);
}

.game-button i {
    font-size: 18px;
}

.earth-2048-footer {
    width: 100%;
    text-align: center;
    margin-top: 15px;
}

.earth-2048-time {
    background: rgba(238, 228, 218, 0.35);
    border-radius: 8px;
    padding: 8px 15px;
    font-family: "Yuanti SC", "幼圆", "思源圆体", "OPPO Sans", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #776e65;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

/* 保存成功提示样式 */
.save-success-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.save-success-message.show {
    transform: translateX(-50%) translateY(0);
}

.save-success-message i {
    font-size: 20px;
}

/* 分值说明表格样式 */
.score-info {
    background: rgba(238, 228, 218, 0.35);
    border-radius: 8px;
    padding: 15px;
}

.score-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.score-row span {
    font-size: 14px;
    color: var(--text-dark);
    padding: 5px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    white-space: nowrap;
}

.score-row:last-child {
    grid-template-columns: repeat(2, 1fr);
}

.score-row:last-child span {
    font-weight: bold;
    color: var(--button-color);
}

/* 设置弹窗样式优化 */
.earth-2048-settings-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background-color);
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.settings-popup-header {
    background: var(--button-color);
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-popup-header h2 {
    color: white;
    margin: 0;
    font-size: 24px;
}

.settings-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.settings-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.settings-popup-content {
    padding: 20px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    color: var(--text-dark);
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(238, 228, 218, 0.5);
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(238, 228, 218, 0.35);
    border-radius: 10px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.settings-option:hover {
    background: rgba(238, 228, 218, 0.5);
}

.settings-option label {
    color: var(--text-dark);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 主题选项样式优化 */
.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.theme-option {
    background: rgba(238, 228, 218, 0.35);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.theme-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-option.active {
    border-color: var(--button-color);
    background: rgba(238, 228, 218, 0.5);
}

.theme-preview {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.theme-option:hover .theme-preview {
    transform: scale(1.05);
}

.theme-option span:last-child {
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
}

/* 游戏说明样式 */
.game-instructions {
    background: rgba(238, 228, 218, 0.35);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.game-instructions h4 {
    color: var(--text-dark);
    margin: 0 0 15px 0;
    font-size: 18px;
}

.game-instructions p {
    color: var(--text-dark);
    margin: 0 0 10px 0;
    line-height: 1.6;
    font-size: 14px;
}

.game-instructions ul {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
}

.game-instructions li {
    color: var(--text-dark);
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
    font-size: 14px;
}

.game-instructions li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--button-color);
}

/* 开关样式优化 */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: var(--button-color);
}

.switch input:checked + .slider:before {
    transform: translateX(26px);
}

/* 游戏信息区域优化 */
.earth-2048-info {
    margin-top: 30px;
    padding: 20px;
    background: rgba(238, 228, 218, 0.35);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.earth-2048-info h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.earth-2048-info p {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 14px;
    text-align: justify;
    margin: 0;
}

/* 遮罩层样式 */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    display: none;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    #earth-2048-game {
        padding: 10px;
    }

    .earth-2048-header {
        padding: 10px;
    }

    .score-box {
        min-width: 80px;
        padding: 5px 10px;
    }

    .score-label {
        font-size: 12px;
    }

    .score-box span:last-child {
        font-size: 16px;
    }

    .game-button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .score-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .score-row:last-child {
        grid-template-columns: 1fr;
    }

    .score-row span {
        font-size: 12px;
    }
}

/* 添加保存按钮样式 */
#save-progress-btn {
    background: var(--button-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#save-progress-btn:hover {
    opacity: 0.8;
}

#save-progress-btn i {
    font-size: 18px;
} 