﻿#display-mode { padding: 0 !important; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #0b0e1f 0%, #1b1e3f 100%);
    user-select: none;
    -webkit-user-select: none;
    position: fixed;
    width: 100%;
    height: 100%;
}

#gameCanvas {
    display: block;
    cursor: grabbing;
}

#gameCanvas:active {
    cursor: grab;
}

/* 主HUD面板 */
#mainHUD {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 15px 12px 0 13px;
    background: linear-gradient(135deg, rgba(15, 20, 40, 0.95), rgba(25, 35, 60, 0.9));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    color: #fff;
    min-width: 280px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 150, 255, 0.2);
    z-index: 1000;
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#mainHUD h1 {
    font-size: 24px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #6ee7ff, #9f7eff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(110, 231, 255, 0.3);
    font-weight: bold;
}

.hudSection {
    margin: 12px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid #6ee7ff;
}

.hudRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
    font-size: 14px;
}

.hudLabel {
    color: #a8c7ff;
    font-weight: 500;
}

.hudValue {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(110, 231, 255, 0.5);
}

.hudValue.highlight {
    color: #ffd700;
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 进度条样式 */
.progressBar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.progressFill {
    height: 100%;
    background: linear-gradient(90deg, #6ee7ff, #9f7eff);
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
    box-shadow: 0 0 10px rgba(110, 231, 255, 0.5);
}

.progressFill.danger {
    background: linear-gradient(90deg, #ff6b6b, #ff9f40);
}

.progressFill.charged {
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    animation: shimmer 1s linear infinite;
}

@keyframes shimmer {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
    100% { filter: brightness(1); }
}

/* 控制说明面板 */
#controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(15, 20, 40, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    color: #a8c7ff;
    font-size: 12px;
    line-height: 1.6;
    max-width: 320px;
    border: 1px solid rgba(100, 150, 255, 0.2);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    animation: slideInUp 0.5s ease-out 0.3s both;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#controls h3 {
    color: #6ee7ff;
    margin-bottom: 10px;
    font-size: 14px;
}

.controlItem {
    margin: 5px 0;
    display: flex;
    align-items: center;
}

.controlKey {
    display: inline-block;
    background: linear-gradient(135deg, #2a3f5f, #3a4f7f);
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 8px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    min-width: 60px;
    text-align: center;
}

/* 小地图 */
#minimap {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 200px;
    height: 200px;
    background: rgba(15, 20, 40, 0.95);
    border: 2px solid rgba(110, 231, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: slideInRight 0.5s ease-out 0.2s both;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#minimapCanvas {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* 消息提示 */
#messageCenter {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2000;
}

.gameMessage {
    background: linear-gradient(135deg, rgba(15, 20, 40, 0.95), rgba(110, 231, 255, 0.2));
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    box-shadow: 
        0 10px 40px rgba(110, 231, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(110, 231, 255, 0.5);
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    animation: messagePopup 0.5s ease-out forwards;
}

@keyframes messagePopup {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.gameMessage.fadeOut {
    animation: messageFadeOut 0.3s ease-out forwards;
}

@keyframes messageFadeOut {
    to {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
}

/* 成就通知 */
/*
#achievementPopup {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1b1e3f;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.5);
    display: none;
    z-index: 1500;
    animation: achievementSlide 0.5s ease-out;
}
*/

@keyframes achievementSlide {
    from {
        transform: translateX(400px);
    }
    to {
        transform: translateX(0);
    }
}

/*
#achievementPopup h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

#achievementPopup p {
    margin: 0;
    font-size: 14px;
}
*/

/* 暂停菜单 */
#pauseMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

#pauseMenu.active {
    display: flex;
}

.pauseContent {
    background: linear-gradient(135deg, rgba(25, 35, 60, 0.98), rgba(15, 20, 40, 0.98));
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(110, 231, 255, 0.3);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.pauseContent h2 {
    color: #6ee7ff;
    margin-bottom: 30px;
    font-size: 32px;
    text-shadow: 0 4px 20px rgba(110, 231, 255, 0.5);
}

.menuButton {
    display: block;
    width: 200px;
    margin: 15px auto;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6ee7ff, #9f7eff);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(110, 231, 255, 0.3);
}

.menuButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(110, 231, 255, 0.5);
}

.menuButton:active {
    transform: translateY(0);
}

/* 设置面板 */
#settingsPanel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: rgba(15, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    color: #fff;
    display: none;
    z-index: 3100;
    border: 1px solid rgba(100, 150, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#settingsPanel.active {
    display: block;
    animation: settingsPanelPop 0.25s ease-out;
}

@keyframes settingsPanelPop {
    from {
        transform: translate(-50%, -50%) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.settingRow {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settingLabel {
    color: #a8c7ff;
    margin-right: 20px;
}

.settingSlider {
    width: 150px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(110, 231, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

.settingSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #6ee7ff, #9f7eff);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(110, 231, 255, 0.5);
}

.settingSlider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #6ee7ff, #9f7eff);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(110, 231, 255, 0.5);
}

/* 选关面板 */
#levelSelectPanel {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
    z-index: 3200;
}

#levelSelectPanel.active {
    display: flex;
}

.levelSelectContent {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(25, 35, 60, 0.98), rgba(15, 20, 40, 0.98));
    border: 1px solid rgba(110, 231, 255, 0.35);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.levelSelectTitle {
    color: #6ee7ff;
    font-size: 26px;
    text-align: center;
    margin-bottom: 18px;
}

.levelSelectList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.levelSelectItem {
    border: 1px solid rgba(110, 231, 255, 0.25);
    background: rgba(25, 35, 60, 0.7);
    border-radius: 12px;
    color: #dce8ff;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.levelSelectItem:hover {
    transform: translateY(-1px);
    border-color: rgba(110, 231, 255, 0.55);
    box-shadow: 0 8px 26px rgba(110, 231, 255, 0.2);
}

.levelSelectItem.current {
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.3) inset;
}

.levelSelectName {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #ffffff;
}

.levelSelectMeta {
    display: block;
    font-size: 12px;
    color: #a8c7ff;
}

.levelSelectState {
    text-align: center;
    color: #a8c7ff;
    padding: 12px;
    grid-column: 1 / -1;
}

/* 关卡完成界面 */
#levelComplete {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 4000;
}

#levelComplete.active {
    display: flex;
}

.completeContent {
    background: linear-gradient(135deg, rgba(25, 35, 60, 0.98), rgba(15, 20, 40, 0.98));
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.5);
    animation: victoryAnimation 0.5s ease-out;
}

@keyframes victoryAnimation {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.completeContent h1 {
    color: #ffd700;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 5px 30px rgba(255, 215, 0, 0.5);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 5px 30px rgba(255, 215, 0, 0.5);
    }
    50% {
        text-shadow: 0 5px 50px rgba(255, 215, 0, 0.8);
    }
}

.stars {
    font-size: 60px;
    margin: 20px 0;
}

.star {
    display: inline-block;
    color: #ccc;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.star.earned {
    color: #ffd700;
    animation: starPop 0.5s ease-out;
}

@keyframes starPop {
    0% {
        transform: scale(0) rotate(180deg);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.statsGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.statCard {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    border-left: 3px solid #6ee7ff;
}

.statCard h3 {
    color: #a8c7ff;
    font-size: 14px;
    margin-bottom: 5px;
}

.statCard p {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
}

/* 粒子效果容器 */
#particleContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #6ee7ff;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* 音效按钮 */
#soundToggle {
    position: fixed;
    top: 20px;
    right: 240px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(15, 20, 40, 0.95), rgba(25, 35, 60, 0.9));
    border: 1px solid rgba(110, 231, 255, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

#soundToggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(110, 231, 255, 0.5);
}

#soundToggle.muted {
    opacity: 0.5;
}

/* 加载画面 */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0b0e1f, #1b1e3f);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loadingContent {
    text-align: center;
}

.loadingLogo {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #6ee7ff, #9f7eff);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(110, 231, 255, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 60px rgba(110, 231, 255, 0.8);
    }
}

.loadingLogo::before {
    /* content: '🏀';
    font-size: 60px; */
}

.loadingText {
    color: #6ee7ff;
    font-size: 24px;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(110, 231, 255, 0.5);
}

.loadingBar {
    width: 300px;
    height: 6px;
    background: rgba(110, 231, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.loadingBarFill {
    height: 100%;
    background: linear-gradient(90deg, #6ee7ff, #9f7eff);
    border-radius: 3px;
    animation: loadingProgress 2s ease-out forwards;
}

@keyframes loadingProgress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    #mainHUD {
        top: 10px;
        left: 10px;
        min-width: 240px;
        padding: 15px;
    }
    
    #mainHUD h1 {
        font-size: 20px;
    }
    
    #controls {
        bottom: 10px;
        left: 10px;
        max-width: 280px;
    }
    
    #minimap {
        width: 150px;
        height: 150px;
    }
    
    .completeContent {
        padding: 30px;
    }
    
    .completeContent h1 {
        font-size: 36px;
    }
}

/* 性能优化：GPU加速 */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* 辅助功能：高对比度模式 */
@media (prefers-contrast: high) {
    #mainHUD,
    #controls,
    #minimap {
        border: 2px solid #fff;
    }
    
    .hudValue {
        font-weight: 900;
    }
}

/* 动画偏好：减少动画 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 金身进度条 */
.progressFill.golden {
    background: linear-gradient(90deg, #ffd700, #ffaa00);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: goldenShimmer 1s linear infinite;
}

@keyframes goldenShimmer {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
    100% { filter: brightness(1); }
}

/* 金身粒子 */
.golden-particle {
    background: radial-gradient(circle, #fff, #ffd700);
    width: 8px;
    height: 8px;
    box-shadow: 0 0 10px #ffd700;
}

/* 金身光环 */
.golden-ring {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 3px solid #ffd700;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ringExpand 1s ease-out forwards;
}

@keyframes ringExpand {
    0% {
        width: 100px;
        height: 100px;
        opacity: 1;
        border-width: 3px;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
        border-width: 1px;
    }
}

/* 金身模式下的球体光晕 */
.goldenGlow {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6), transparent);
    border-radius: 50%;
    pointer-events: none;
    animation: goldenPulse 2s ease-in-out infinite;
}

@keyframes goldenPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }
}

/* 在文件末尾添加金身模式控制提示样式 */

.controlItem.golden-only {
    opacity: 0.5;
    transition: opacity 0.3s;
}

body.golden-mode .controlItem.golden-only {
    opacity: 1;
    color: #ffeaa7;
}

/* 更新金身粒子颜色 */
.golden-particle {
    background: radial-gradient(circle, #ffffff, #ffeaa7);
    box-shadow: 0 0 15px #fff8dc;
}

/* 金身模式下的UI效果 */
body.golden-mode #mainHUD {
    border-color: rgba(255, 234, 167, 0.5);
    box-shadow: 
        0 10px 40px rgba(255, 234, 167, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

body.golden-mode .hudSection {
    border-left-color: #ffeaa7;
}

/* 金身模式下的画布发光效果 */
body.golden-mode #gameCanvas {
    box-shadow: 0 0 50px rgba(255, 234, 167, 0.3);
}

.golden-particle {
    background: radial-gradient(circle, #fff8dc, #ffd700) !important;
    box-shadow: 0 0 10px #ffd700;
}

/* 屏蔽各面板鼠标交互 */
#mainHUD,
#controls,
#minimap,
#messageCenter,
#particleContainer,
#soundToggle,
#loadingScreen {
    pointer-events: none;
}
