/* ===== 首页样式 ===== */
#home-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 30%, #1a3a2a 60%, #2d1b3d 100%);
    overflow: hidden;
}

.home-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(255, 215, 0, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(200, 50, 50, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(50, 100, 200, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.home-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    width: 90%;
    padding: 40px 20px;
}

/* 标题区域 */
.home-title-area {
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease;
}

.home-title {
    font-size: 72px;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.4), 2px 2px 8px rgba(0, 0, 0, 0.8);
    letter-spacing: 20px;
    font-weight: bold;
    margin-bottom: 12px;
}

.home-subtitle {
    color: #ccc;
    font-size: 22px;
    letter-spacing: 8px;
}

/* 模式卡片 */
.mode-cards {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 340px;
    padding: 40px 30px;
    border-radius: 16px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    transition: all 0.3s;
}

.mode-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mode-card:hover::before {
    background: rgba(255, 255, 255, 0.06);
}

/* 1v1 模式 */
.mode-1v1 {
    background: linear-gradient(160deg, rgba(30, 60, 40, 0.9) 0%, rgba(15, 30, 20, 0.95) 100%);
}
.mode-1v1:hover {
    border-color: #22aa22;
    box-shadow: 0 20px 60px rgba(34, 170, 34, 0.2);
}

/* 多人模式 */
.mode-multi {
    background: linear-gradient(160deg, rgba(50, 30, 60, 0.9) 0%, rgba(25, 15, 35, 0.95) 100%);
}
.mode-multi:hover {
    border-color: #aa44aa;
    box-shadow: 0 20px 60px rgba(170, 68, 170, 0.2);
}

.mode-icon {
    font-size: 64px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.mode-name {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    letter-spacing: 4px;
}

.mode-1v1 .mode-name {
    color: #66dd66;
}

.mode-multi .mode-name {
    color: #cc66cc;
}

.mode-desc {
    font-size: 15px;
    color: #aaa;
    line-height: 1.8;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    max-width: 280px;
}

.mode-players {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.mode-1v1 .mode-players {
    background: rgba(34, 170, 34, 0.2);
    color: #66dd66;
    border: 1px solid rgba(34, 170, 34, 0.4);
}

.mode-multi .mode-players {
    background: rgba(170, 68, 170, 0.2);
    color: #cc66cc;
    border: 1px solid rgba(170, 68, 170, 0.4);
}

.mode-enter {
    font-size: 18px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s, letter-spacing 0.3s;
}

.mode-card:hover .mode-enter {
    transform: translateX(8px);
    letter-spacing: 2px;
}

.mode-1v1 .mode-enter {
    color: #66dd66;
}

.mode-multi .mode-enter {
    color: #cc66cc;
}

/* 底部 */
.home-footer {
    color: #666;
    font-size: 14px;
    animation: fadeIn 1s ease 0.6s both;
}

/* 动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .home-title {
        font-size: 48px;
        letter-spacing: 12px;
    }

    .home-subtitle {
        font-size: 18px;
        letter-spacing: 4px;
    }

    .mode-cards {
        flex-direction: column;
        gap: 24px;
    }

    .mode-card {
        width: 100%;
        max-width: 360px;
        padding: 30px 20px;
    }

    .mode-icon {
        font-size: 48px;
    }

    .mode-name {
        font-size: 26px;
    }
}

/* ===== 设置面板（1v1 & 多人共用） ===== */

.settings-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
}

.settings-panel {
    position: fixed;
    top: 60px;
    right: 15px;
    z-index: 200;
    width: 260px;
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.settings-panel.hidden {
    display: none;
}

.settings-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 16px;
    font-weight: bold;
}

.settings-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.settings-close:hover {
    color: #fff;
}

.settings-panel-body {
    padding: 12px 16px;
}

.settings-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.settings-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.settings-item-label .audio-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.settings-item-label .audio-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.settings-item .volume-slider-container {
    margin-left: 40px;
}

.settings-item .volume-slider {
    width: 100%;
}

.settings-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}
