/* CSS 变量定义 */
:root {
    --bg-color: #000000;
    --container-bg: rgba(30, 30, 30, 0.9);
    --border-color: #333333;
    --control-bg: rgba(30, 30, 30, 0.9);
    --slider-bg: #333333;
    --slider-thumb: #ffffff;
    --slider-thumb-hover: #cccccc;
    --control-padding: 8px 16px;
    --border-radius: 20px;
    --transition-speed: 0.2s;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
html, body {
    background-color: var(--bg-color);
    color: #ffffff;
    font-family: Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* 容器样式 */
.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 游戏包装器 */
.game-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Ruffle 容器 */
#ruffle-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* 游戏播放器样式 */
#ruffle-container > * {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--transition-speed) ease;
}

/* 控制面板样式 */
.controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    align-items: center;
    z-index: 1000;
    transition: opacity var(--transition-speed) ease;
}

/* 音量控制样式 */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--control-bg);
    padding: var(--control-padding);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
    transition: all var(--transition-speed) ease;
}

/* 音量图标样式 */
.volume-icon {
    font-size: 18px;
    cursor: pointer;
    user-select: none;
    transition: transform var(--transition-speed) ease;
}

.volume-icon:hover {
    transform: scale(1.1);
}

/* 滑块样式 */
#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 4px;
    background: var(--slider-bg);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

/* WebKit 滑块拇指样式 */
#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--slider-thumb);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    background: var(--slider-thumb-hover);
    transform: scale(1.2);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Firefox 滑块拇指样式 */
#volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--slider-thumb);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all var(--transition-speed) ease;
}

#volume-slider::-moz-range-thumb:hover {
    background: var(--slider-thumb-hover);
    transform: scale(1.2);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* 全屏模式样式 */
body.fullscreen .controls {
    opacity: 0.8;
}

body.fullscreen .controls:hover {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .controls {
        bottom: 15px;
        gap: 15px;
    }
    
    .volume-control {
        padding: 6px 12px;
    }
    
    #volume-slider {
        width: 80px;
    }
    
    .volume-icon {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .controls {
        bottom: 10px;
        gap: 10px;
    }
    
    .volume-control {
        padding: 5px 10px;
    }
    
    #volume-slider {
        width: 60px;
    }
    
    .volume-icon {
        font-size: 14px;
    }
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.controls {
    animation: fadeIn 0.5s ease-out forwards;
}
