/* --- 全局样式配置 --- */
:root {
    --primary: #d400ff;
    /* 主题色：更改为霓虹紫 */
    --danger: #e74c3c;
    --bg: rgba(79, 226, 171, 0.8);
    --neon: #00f0ff;
}

/* 
   提示：如果你想修改背景颜色，可以在 #game-wrapper 中修改 background 属性
   提示：如果你想修改文字颜色，可以在 body 中修改 color 属性
*/
body {
    background: #000;
    color: #fff;
    margin: 0;
    overflow: hidden;
    font-family: 'Segoe UI', 'Orbitron', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* --- 游戏容器 --- */
#game-wrapper {
    position: relative;
    width: 800px;
    height: 600px;
    border: 1px solid #222;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    /* 修改：背景颜色，由黑色改为极光紫渐变 */
    background: linear-gradient(to bottom, #17cfd6, #b8d6df);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: none;
}

/* --- UI 层通用样式 --- */
.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
    z-index: 1000;
    /* 确保 UI 位于最上层 */
}

.ui-active {
    display: flex !important;
    /* 使用 flex 以支持居中，并强制显示 */
    pointer-events: auto;
}

.center-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    width: 100%;
}

/* --- 标题与文字 --- */
h1,
h2 {
    margin: 0 0 20px 0;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
}

h1 {
    background: linear-gradient(90deg, #bc13fe, #8b00ff, #00f0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 48px;
    text-shadow: 0 0 20px rgba(188, 19, 254, 0.5);
}

.stat {
    font-size: 16px;
    color: #aaa;
    margin: 5px;
    font-weight: 600;
}

/* --- 大 Boss 血条样式 --- */
#boss-ui {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 1001;
}

#boss-name {
    color: #ff3333;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px #000;
    margin-bottom: 5px;
}

#boss-hp-wrap {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ff0000;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

#boss-hp-fill {
    height: 100%;
    background: linear-gradient(to right, #990000, #ff0000);
    width: 100%;
    transition: width 0.1s ease;
}

#boss-hp-text {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 0 3px #000;
}

#boss-warning {
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 40px;
    color: #ff0000;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 20px #000;
    pointer-events: none;
    display: none;
    z-index: 2000;
    animation: warningPulse 1s infinite alternate;
}

@keyframes warningPulse {
    from { transform: scale(1); opacity: 0.7; }
    to { transform: scale(1.1); opacity: 1; }
}

.stat span {
    color: #fff;
    font-weight: bold;
    margin-left: 5px;
}

/* --- 按钮样式 --- */
.btn {
    background: linear-gradient(180deg, #222, #111);
    color: white;
    border: 1px solid #444;
    padding: 15px 40px;
    margin: 10px;
    font-size: 18px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 2px;
    transition: all 0.2s;
    width: 260px;
    text-align: center;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
}

.btn:hover {
    transform: scale(1.02);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px var(--primary);
}

.diff-wrapper {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.btn.diff {
    width: 100px;
    padding: 10px;
    opacity: 0.4;
    font-size: 14px;
}

.btn.diff.active {
    opacity: 1;
    border-color: var(--neon);
    color: var(--neon);
    box-shadow: 0 0 10px #00f0ff;
}

/* --- 升级卡片 --- */
#upgrade-cards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 750px;
    perspective: 1000px;
}

.card {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #333;
    width: 180px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transform-style: preserve-3d;
}

.card:hover {
    transform: translateY(-8px) scale(1.05);
    z-index: 10;
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(139, 0, 255, 0.5);
}

.card h3 {
    font-size: 16px;
    margin: 5px 0;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 5px currentColor;
}

.card p {
    font-size: 11px;
    color: #ccc;
    flex-grow: 1;
    line-height: 1.4;
    letter-spacing: 0.5px;
}

.card small {
    font-size: 10px;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #444;
    margin-top: 5px;
    color: #888;
}

.rarity-border {
    top: 0;
    left: 0;
    width: 100%;
    position: absolute;
    height: 3px;
}

.rare {
    background: linear-gradient(90deg, #0066ff, #00f0ff);
    box-shadow: 0 0 10px #0066ff;
}

.legend {
    background: linear-gradient(90deg, #ffcc00, #ff0000);
    box-shadow: 0 0 15px #ffcc00;
}

/* --- HUD (游戏内界面) --- */
#hud {
    display: none;
    width: 100%;
    height: 100%;
}

#hud-top {
    position: absolute;
    top: 10px;
    width: 100%;
    display: flex;
    gap: 20px;
    justify-content: center;
    font-family: 'Orbitron';
    text-shadow: 0 0 5px #000;
    z-index: 5;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    padding: 10px 0;
    align-items: center
}

#hud-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

/* --- HUD: 技能图标 --- */
.hud-skill {
    width: 55px;
    height: 55px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #444;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
    transition: 0.2s;
}

.hud-skill span {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    z-index: 2;
    font-family: 'Orbitron';
    color: rgba(255, 255, 255, 0.9);
}

.hud-skill .cd-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    transition: height 0.1s linear;
    border-top: 2px solid rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.hud-skill.active {
    border-color: #fff;
    box-shadow: 0 0 15px var(--primary);
}

.hud-skill.active span {
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary);
}

/* --- HUD: 进度条 --- */
.bar-wrap {
    display: flex;
    gap: 8px;
    align-items: center
}

.bar {
    width: 220px;
    height: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.bar .fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #e74c3c, #ff6b6b);
}

.bar.xp .fill {
    background: linear-gradient(90deg, #d400ff, #00f0ff);
}

/* 修改：经验条颜色 */
.bar-label {
    font-size: 12px;
    color: #ccc;
    margin-right: 6px;
}

/* --- 升级提示文字 --- */
#level-up-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    font-weight: 900;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    text-transform: uppercase;
    background: linear-gradient(45deg, #d400ff, #00f0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 20px rgba(212, 0, 255, 0.8));
    transition: 0.3s;
}

/* 确保 game-over 面板的遮罩层不会阻止点击 */
#game-over-screen.center-box {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 101;
    position: relative;
}

/* 确保按钮本身允许点击 (如果 .btn 的 pointer-events 被全局样式影响) */
#btn-menu {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* --- 移动端控件 (已移除) --- */
#mobile-controls {
    display: none !important;
}
