* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#group-number-banner {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    padding: 6px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    pointer-events: none;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 100;
}

#world-indicator {
    font-size: 24px;
    font-weight: bold;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.8), rgba(0, 100, 200, 0.6));
    border-radius: 10px;
    margin-bottom: 10px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#world-indicator.underworld {
    background: linear-gradient(135deg, rgba(150, 50, 200, 0.8), rgba(100, 30, 150, 0.6));
}

#dizzy-timer {
    font-size: 20px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.8), rgba(200, 50, 50, 0.6));
    border-radius: 10px;
    margin-bottom: 10px;
    backdrop-filter: blur(5px);
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

#dizzy-time-display {
    font-weight: bold;
    font-size: 20px;
}

#portal-hint {
    font-size: 18px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(150, 50, 200, 0.8), rgba(100, 30, 150, 0.6));
    border-radius: 8px;
    animation: glow 1.5s infinite;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(150, 50, 200, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(150, 50, 200, 0.8);
    }
}

/* 小地图 */
#minimap {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px;
    height: 200px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    z-index: 100;
}

/* 控制按钮 */
#controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

#controls button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, rgba(60, 60, 80, 0.9), rgba(40, 40, 60, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#controls button:hover {
    background: linear-gradient(135deg, rgba(80, 80, 100, 0.9), rgba(60, 60, 80, 0.8));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 游戏结束界面 */
#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

#game-over-content {
    text-align: center;
    color: #fff;
    padding: 40px 60px;
    background: linear-gradient(135deg, rgba(40, 40, 60, 0.95), rgba(20, 20, 40, 0.9));
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

#game-over-title {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

#game-over-title.victory {
    color: #4ade80;
}

#game-over-title.defeat {
    color: #f87171;
}

#game-over-message {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.8;
}

#restart-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* 游戏结束按钮容器 */
.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

/* 主菜单按钮 */
#menu-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, rgba(60, 60, 80, 0.9), rgba(40, 40, 60, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(60, 60, 80, 0.4);
}


/* 开始界面 */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
}

#start-content {
    text-align: center;
    color: #fff;
    padding: 50px 70px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

#start-content h1 {
    font-size: 56px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

#start-content>p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.7;
}

.controls-info {
    text-align: left;
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.controls-info p {
    font-size: 16px;
    margin: 10px 0;
    opacity: 0.8;
}

.controls-info strong {
    color: #a78bfa;
    min-width: 150px;
    display: inline-block;
}

#start-btn {
    padding: 18px 60px;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

#start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 设置界面 */
#settings-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
}

#settings-content {
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    color: #fff;
    padding: 40px 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

#settings-content h1 {
    font-size: 42px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

/* 标签页导航 */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.settings-tab-btn {
    flex: 1;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.settings-tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 标签页内容 */
.settings-tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.settings-tab-content.active {
    display: flex;
}


.settings-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

.settings-scroll::-webkit-scrollbar {
    width: 8px;
}

.settings-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.settings-scroll::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.settings-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

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

.settings-section h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #a78bfa;
    border-bottom: 1px solid rgba(167, 139, 250, 0.3);
    padding-bottom: 10px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.setting-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.setting-item label {
    font-size: 16px;
    opacity: 0.9;
    flex: 1;
    margin-right: 20px;
}

.setting-item input {
    width: 150px;
    padding: 8px 12px;
    font-size: 16px;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.setting-item input {
    font-size: 14px;
}

.setting-item input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.setting-item input::-webkit-inner-spin-button,
.setting-item input::-webkit-outer-spin-button {
    opacity: 1;
}

.settings-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-buttons button {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#save-settings-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

#save-settings-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

#reset-defaults-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

#reset-defaults-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
}

#close-settings-btn {
    background: linear-gradient(135deg, rgba(60, 60, 80, 0.9), rgba(40, 40, 60, 0.8));
}

#close-settings-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(60, 60, 80, 0.4);
}

#settings-btn {
    padding: 15px 50px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, rgba(60, 60, 80, 0.9), rgba(40, 40, 60, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

#settings-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(60, 60, 80, 0.4);
}

/* 音量滑块 */
.volume-slider {
    width: 120px !important;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(167, 139, 250, 0.3);
    border-radius: 5px;
    outline: none;
    margin-right: 10px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.volume-value {
    min-width: 45px;
    text-align: right;
    font-weight: bold;
    color: #a78bfa;
}

/* 复选框样式 */
.setting-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #667eea;
}

/* 下拉选择框样式 */
.mode-select {
    width: 150px;
    padding: 8px 12px;
    font-size: 16px;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.mode-select option {
    background: #2d1b4e;
    color: #fff;
}

/* 难度预设选择器 */
.difficulty-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.difficulty-select {
    width: 100% !important;
    max-width: 350px;
    padding: 12px 16px !important;
    font-size: 16px !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2)) !important;
    border: 2px solid rgba(167, 139, 250, 0.4) !important;
}

.difficulty-select:hover {
    border-color: rgba(167, 139, 250, 0.6) !important;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

.preset-description {
    margin-top: 10px;
    padding: 10px 15px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #a78bfa;
    font-style: italic;
    transition: all 0.3s ease;
}

/* 预设锁定状态的输入框样式 */
.preset-locked {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background: rgba(0, 0, 0, 0.4) !important;
}

.preset-locked:hover {
    border-color: rgba(167, 139, 250, 0.3) !important;
    box-shadow: none !important;
}

#custom-game-settings .settings-section {
    position: relative;
}

/* 自定义模式的描述文字 */
.preset-description.custom-mode {
    border-left-color: #4ade80;
    color: rgba(74, 222, 128, 0.9);
}
