:root {
    --bg-gradient: linear-gradient(135deg, #0f172a, #1e293b);
    --panel-bg: rgba(30, 41, 59, 0.7);
    --border-color: #38bdf8;
    --text-main: #f8fafc;
    --accent-neon: #38bdf8;
    --neon-glow: 0 0 10px #38bdf8, 0 0 20px #38bdf8;
}

/* 5大确定性环境切换样式 */
body.biome-normal {
    --bg-gradient: linear-gradient(135deg, #020617, #0f172a);
    --panel-bg: rgba(15, 23, 42, 0.75);
    --border-color: #38bdf8;
    --accent-neon: #38bdf8;
    --neon-glow: 0 0 8px #38bdf8;
}
body.biome-hell {
    --bg-gradient: linear-gradient(135deg, #450a0a, #180000);
    --panel-bg: rgba(28, 0, 0, 0.8);
    --border-color: #ef4444;
    --accent-neon: #f97316;
    --neon-glow: 0 0 12px #ef4444, 0 0 25px #f97316;
}
body.biome-starfall {
    --bg-gradient: linear-gradient(135deg, #1e1b4b, #2e1065);
    --panel-bg: rgba(23, 13, 46, 0.8);
    --border-color: #a855f7;
    --accent-neon: #f472b6;
    --neon-glow: 0 0 15px #a855f7, 0 0 30px #f472b6;
}
body.biome-glitched {
    --bg-gradient: linear-gradient(135deg, #064e3b, #022c22);
    --panel-bg: rgba(2, 40, 30, 0.85);
    --border-color: #10b981;
    --accent-neon: #34d399;
    --neon-glow: 0 0 10px #10b981;
    font-family: 'Courier New', Courier, monospace !important;
}
body.biome-singularity {
    --bg-gradient: linear-gradient(135deg, #000000, #171717);
    --panel-bg: rgba(10, 10, 10, 0.9);
    --border-color: #fbbf24;
    --accent-neon: #f59e0b;
    --neon-glow: 0 0 20px #fbbf24, 0 0 40px #d97706;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    transition: background 1s ease;
}

/* 登录层 */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease;
}
.overlay.hidden {
    opacity: 0; pointer-events: none;
}
.auth-box {
    background: #1e293b;
    padding: 40px; border-radius: 12px;
    border: 2px solid var(--border-color);
    box-shadow: var(--neon-glow);
    text-align: center; max-width: 400px; width: 90%;
}
.auth-box h2 { margin-bottom: 10px; color: var(--accent-neon); }
.auth-box p { font-size: 14px; color: #94a3b8; margin-bottom: 25px; }
.auth-box input {
    width: 100%; padding: 12px; border-radius: 6px; border: 1px solid #475569;
    background: #0f172a; color: #fff; text-align: center; font-size: 16px; margin-bottom: 20px;
}
.auth-box button {
    background: var(--accent-neon); color: #000; padding: 12px 30px; border: none;
    border-radius: 6px; font-weight: bold; cursor: pointer; text-transform: uppercase;
}

/* 核心容器 */
.game-container {
    display: flex; flex-direction: column; height: 100vh;
}

/* 头部及公告栏 */
.game-header {
    height: 60px; background: rgba(0,0,0,0.5); border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center; padding: 0 20px;
}
.ticker-wrapper { display: flex; align-items: center; flex: 1; overflow: hidden; margin-right: 20px; }
.ticker-label { color: var(--accent-neon); font-weight: bold; white-space: nowrap; font-size: 14px; }
.ticker-content { overflow: hidden; white-space: nowrap; width: 100%; }
.user-bar { display: flex; align-items: center; gap: 15px; }
.user-info { font-size: 14px; background: #0f172a; padding: 6px 12px; border-radius: 4px; border: 1px solid #334155; white-space: nowrap;}
.btn-lang { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); padding: 5px 10px; border-radius: 4px; cursor: pointer; }

/* 布局分布 */
.game-main { display: flex; flex: 1; padding: 15px; gap: 15px; overflow: hidden; }
.panel {
    background: var(--panel-bg); border-radius: 8px; border: 1px solid var(--border-color);
    display: flex; flex-direction: column; padding: 15px; transition: all 0.5s ease;
}
.panel-left { width: 25%; gap: 15px; overflow-y: auto; }
.panel-center { width: 45%; justify-content: center; align-items: center; position: relative; }
.panel-right { width: 30%; }

/* 左面板模块 */
.biome-display { text-align: center; background: rgba(0,0,0,0.3); padding: 12px; border-radius: 6px; }
.biome-highlight { font-size: 20px; font-weight: bold; color: var(--accent-neon); text-shadow: var(--neon-glow); margin: 5px 0; }
.timer-sub { font-size: 12px; color: #64748b; }
.luck-stats { background: rgba(0,0,0,0.2); padding: 12px; border-radius: 6px; display: flex; flex-direction: column; gap: 6px; }
.stat-row { display: flex; justify-content: space-between; font-size: 13px; }
.controls { display: flex; flex-direction: column; gap: 10px; }
.btn-roll {
    width: 100%; padding: 15px; font-size: 22px; font-weight: bold; border-radius: 8px;
    background: linear-gradient(180deg, var(--accent-neon), #0284c7); color: #000; border: none;
    cursor: pointer; box-shadow: var(--neon-glow); text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}
.btn-roll:active { transform: scale(0.98); }

.switch-group { display: flex; flex-direction: column; gap: 8px; }
.switch-container { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.filter-menu h4 { font-size: 14px; color: var(--accent-neon); margin-bottom: 4px; }
.filter-desc { font-size: 11px; color: #94a3b8; margin-bottom: 8px; }
.cloud-status { font-size: 11px; text-align: center; color: #10b981; margin-top: 5px; opacity: 0.7; }

/* 中间舞台效果 */
.stage-card { width: 85%; height: 60%; perspective: 1000px; }
.card-inner { width: 100%; height: 100%; text-align: center; border-radius: 16px; }
.card-front {
    width: 100%; height: 100%; background: rgba(15, 23, 42, 0.8);
    border: 3px solid var(--border-color); border-radius: 16px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 20px; box-shadow: inset 0 0 20px rgba(255,255,255,0.05);
}
.aura-title-prefix { font-size: 14px; color: #64748b; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; }
#stage-aura-name { font-size: 38px; font-weight: 900; margin-bottom: 15px; text-align: center; }
#stage-aura-rarity { font-size: 18px; color: #94a3b8; font-weight: bold; }

/* 背包与各梯度视觉特效 */
.aura-glow-mid { animation: neonPulse 2s infinite alternate; text-shadow: 0 0 10px currentColor, 0 0 20px currentColor; }
.aura-glow-high { animation: superGlow 1.5s infinite alternate; text-shadow: 0 0 15px currentColor, 0 0 30px currentColor, 0 0 45px currentColor; }
@keyframes neonPulse { from { text-shadow: 0 0 5px currentColor, 0 0 10px currentColor; } to { text-shadow: 0 0 12px currentColor, 0 0 25px currentColor; } }
@keyframes superGlow { from { text-shadow: 0 0 8px #{currentColor}; } to { text-shadow: 0 0 20px currentColor, 0 0 40px currentColor; } }

.inventory-grid, .index-grid { display: flex; flex-direction: column; gap: 8px; }
.inv-item {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0,0,0,0.2); padding: 8px 12px; border-radius: 6px;
    border-left: 4px solid #475569; font-size: 13px;
}
.inv-item.active-gear { border: 1px solid #fbbf24; background: rgba(251,191,36,0.05); }
.inv-actions { display: flex; gap: 6px; }
.btn-lock { background: #334155; color: #fff; border: none; padding: 4px 8px; font-size: 11px; border-radius: 4px; cursor: pointer; }
.btn-lock.locked { background: #ef4444; }
.btn-equip { background: var(--accent-neon); color: #000; border: none; padding: 4px 8px; font-size: 11px; border-radius: 4px; cursor: pointer; font-weight: bold; }

.crafting-list { display: flex; flex-direction: column; gap: 10px; }
.craft-card { background: rgba(0,0,0,0.2); padding: 10px; border-radius: 6px; border: 1px solid #334155; }
.craft-title { font-weight: bold; color: #fff; margin-bottom: 4px; display: flex; justify-content: space-between; font-size: 13px;}
.craft-desc { font-size: 11px; color: #94a3b8; margin-bottom: 6px; }
.craft-mats { font-size: 11px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mat-status.ok { color: #22c55e; }
.mat-status.no { color: #ef4444; }
.btn-craft { background: #475569; color: #94a3b8; border: none; padding: 6px 12px; border-radius: 4px; cursor: not-allowed; font-size: 12px; font-weight: bold; }
.btn-craft.ready { background: #22c55e; color: white; cursor: pointer; }

/* 稀有全屏震憾特效 */
.cutscene-fullscreen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle, rgba(0,0,0,0.95) 40%, rgba(10,10,10,1) 100%);
    z-index: 10000; display: flex; justify-content: center; align-items: center;
    overflow: hidden; transition: opacity 0.4s ease;
}
.cutscene-fullscreen.hidden { display: none; pointer-events: none; }
.cutscene-flash { position: absolute; width: 100%; height: 100%; background: #fff; opacity: 0; pointer-events: none; z-index: 10002; }
.flash-bang { animation: flashActive 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards; }
@keyframes flashActive { 0% { opacity: 1; } 100% { opacity: 0; } }

.cutscene-light-beam {
    position: absolute; width: 150px; height: 200%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
    box-shadow: 0 0 100px currentColor; opacity: 0; transform: scaleY(0); transform-origin: bottom; z-index: 10001;
}
.beam-active { animation: beamShoot 2.5s cubic-bezier(0.15, 0.85, 0.35, 1) forwards; }
@keyframes beamShoot {
    0% { opacity: 0; transform: scaleY(0) rotate(0deg); filter: blur(4px); }
    15% { opacity: 1; transform: scaleY(1.2) rotate(0deg); filter: blur(0px); }
    85% { opacity: 1; transform: scaleY(1) rotate(3deg); }
    100% { opacity: 0; transform: scaleY(0) rotate(5deg); }
}

.cutscene-body { text-align: center; z-index: 10003; }
.cutscene-announce { font-size: 18px; color: #64748b; letter-spacing: 6px; margin-bottom: 20px; animation: textSlideIn 0.5s ease-out forwards; }
.cutscene-title { font-size: 64px; font-weight: 900; letter-spacing: 4px; text-transform: uppercase; }
.title-pop { animation: titleZoomPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.cutscene-chance { font-size: 22px; color: #cbd5e1; font-weight: bold; margin-top: 20px; animation: textSlideIn 0.5s 0.5s ease-out forwards; opacity: 0; }

@keyframes textSlideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes titleZoomPop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; text-shadow: 0 0 30px currentColor, 0 0 60px currentColor; } }

.hyper-shake { animation: ultraEarthquake 2s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes ultraEarthquake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate3d(-8px, -6px, 0) rotate(-1deg); }
    20%, 40%, 60%, 80% { transform: translate3d(8px, 6px, 0) rotate(1deg); }
}

.equipped-aura-bg-glow {
    position: absolute; top:0; left:0; width:100%; height:100%; pointer-events: none;
    z-index: -1; opacity: 0.15; transition: all 1s ease; border-radius: 16px;
}

/* ========================================== */
/* 新增：首屏欢迎大厅动画层与密码控件样式 */
/* ========================================== */
.welcome-theme {
    background: radial-gradient(circle, #0f172a 0%, #020617 100%) !important;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 80px 20px;
    z-index: 10005; /* 确保置于任何普通遮罩层之上 */
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
}
.welcome-animation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    width: 100%;
}
.glitch-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: #38bdf8;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.7);
    letter-spacing: 6px;
    animation: cyberPulse 2.5s infinite ease-in-out;
    text-align: center;
}
.welcome-subtitle {
    margin-top: 24px;
    font-size: 1.1rem;
    color: #94a3b8;
    letter-spacing: 8px;
    animation: textNeon 3s infinite ease-in-out;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}
.cyber-grid-anim {
    position: absolute;
    width: 320px;
    height: 320px;
    border: 2px dashed rgba(56, 189, 248, 0.15);
    border-radius: 50%;
    animation: rotateMatrix 15s linear infinite;
    z-index: -1;
}
.btn-enter-game {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid #38bdf8;
    color: #38bdf8;
    padding: 14px 60px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 40px;
}
.btn-enter-game:hover {
    background: #38bdf8;
    color: #020617;
    box-shadow: 0 0 30px #38bdf8;
    transform: translateY(-3px);
}

/* 密码框样式适配扩展 */
#password-input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #fff;
    text-align: center;
    font-size: 16px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s;
}
#password-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

@keyframes cyberPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5)); }
    50% { transform: scale(1.02); filter: drop-shadow(0 0 25px rgba(168, 85, 247, 0.7)); }
}
@keyframes textNeon {
    0%, 100% { opacity: 0.7; color: #94a3b8; }
    50% { opacity: 1; color: #c084fc; }
}
@keyframes rotateMatrix {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}