/* style.css */
/* ----- 全局重置 & 字体 ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* 防止选中文本，更像游戏 */
}

body {
    overflow: hidden;
    font-family: 'Segoe UI', 'Poppins', 'Microsoft YaHei', sans-serif;
    background-color: #0a0c0f; /* 仅作为后备 */
}

/* ----- 遮罩层 (进入界面) 添加背景插画 ----- */
#blocker {
    position: fixed;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a2a1f 0%, #0b140f 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    color: #f5e7c8;
    text-shadow: 0 0 10px #ffb347, 0 0 20px #7c5e3a;
    backdrop-filter: blur(4px);
}

/* 插画伪元素 – 若隐若现 */
#blocker::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://wordhyf.oss-cn-beijing.aliyuncs.com/background-illustration.jpg'); /* 替换为你的插画路径 */
    background-size: cover;
    background-position: center;
    opacity: 0.15;                /* 透明度极低，达到“不那么明显”的效果 */
    pointer-events: none;         /* 让鼠标点击穿透到按钮 */
    z-index: 0;
}

/* 确保所有文字和按钮显示在插画上层 */
#blocker > * {
    position: relative;
    z-index: 1;
}

#blocker h1 {
    font-size: 4rem;
    letter-spacing: 6px;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 2px solid #ffaa33;
    padding-bottom: 0.3rem;
    text-transform: uppercase;
    animation: glowPulse 2s infinite;
}

#blocker p {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    font-style: italic;
}

#blocker button {
    padding: 16px 48px;
    font-size: 1.8rem;
    background: #f68adb;
    color: #1e2b1a;
    border: 3px solid #f5e7c8;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 0 30px #ffaa33, 0 4px 0 #8b5a2b;
    transition: 0.1s ease;
    border-radius: 60px;
}

#blocker button:hover {
    background: #ffb347;
    transform: translateY(-2px);
    box-shadow: 0 0 40px #ffc107, 0 6px 0 #8b5a2b;
}

#blocker button:active {
    transform: translateY(4px);
    box-shadow: 0 0 20px #ffaa33, 0 2px 0 #8b5a2b;
}

@keyframes glowPulse {
    0% { text-shadow: 0 0 10px #ffb347, 0 0 20px #7c5e3a; }
    50% { text-shadow: 0 0 20px #ffaa33, 0 0 40px #ff8800; }
    100% { text-shadow: 0 0 10px #ffb347, 0 0 20px #7c5e3a; }
}

/* ----- 顶层UI层 (指针穿透区域控制) ----- */
#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 让点击穿透到canvas，除了需要交互的元素 */
    z-index: 10;
}

/* 所有需要交互的子元素恢复指针事件 */
#ui-layer > * {
    pointer-events: auto;
}

/* ----- 准星 (更精致的游戏风格) ----- */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 10px #ff9800, inset 0 0 6px #ff9800;
    pointer-events: none;
    z-index: 20;
}

#crosshair::before,
#crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 6px #ff9800;
}

#crosshair::before {
    width: 12px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#crosshair::after {
    width: 2px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ----- HUD 左上信息面板 (半透明磨砂) ----- */
#hud {
    display: none;  /* 隐藏整个面板 */
}
#hud {
    position: absolute;
    top: 24px;
    left: 24px;
    background: rgba(10, 20, 10, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid #ffaa33;
    border-radius: 12px;
    padding: 12px 28px;
    color: #f5e7c8;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 15px #7c5e3a;
    letter-spacing: 1px;
    min-width: 180px;
}

#hud .label {
    font-size: 0.9rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 4px;
}

#mode-name {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 0 8px #ff9800;
    color: #fff3d1;
}

/* ----- 底部工具栏 (类似Minecraft风格但更现代) ----- */
#toolbar {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 18px;
    background: rgba(20, 20, 15, 0.6);
    backdrop-filter: blur(16px);
    padding: 12px 28px;
    border-radius: 60px;
    border: 1px solid #ffaa33;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7), 0 0 30px #3a2e1e;
}

.tool {
    background: transparent;
    border: 2px solid rgba(255, 200, 120, 0.5);
    color: #eedbba;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 40px;
    text-shadow: 0 2px 4px black;
    box-shadow: 0 4px 0 #3a2e1e;
    letter-spacing: 1px;
}

.tool.active {
    background: #ff9800;
    border-color: #fff3c9;
    color: #1e2b1a;
    transform: translateY(-6px);
    box-shadow: 0 8px 0 #8b5a2b, 0 0 25px #ffaa33;
    font-weight: 800;
}

.tool:not(.active):hover {
    border-color: #ffaa33;
    background: rgba(255, 170, 50, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #3a2e1e;
}

/* ----- 对话框 (RPG风格) ----- */
#dialogue-box {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    width: 550px;
    max-width: 80vw;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    border: 2px solid #c79a4b;
    border-radius: 24px;
    padding: 24px 32px;
    color: #f5e7c8;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 50px #7c5e3a;
    display: none;
    pointer-events: auto;
    font-size: 1.3rem;
}

#dialogue-box b {
    color: #ffc174;
    font-size: 1.6rem;
    margin-right: 10px;
    text-shadow: 0 0 10px #ff9800;
}

#dialogue-box span {
    line-height: 1.6;
}

#dialogue-box .hint {
    font-size: 1rem;
    margin-top: 16px;
    color: #ffaa33;
    text-align: right;
    opacity: 0.8;
    border-top: 1px dashed #5e4a2b;
    padding-top: 12px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #blocker h1 {
        font-size: 2.5rem;
    }
    #blocker button {
        font-size: 1.4rem;
        padding: 12px 32px;
    }
    #toolbar {
        gap: 8px;
        padding: 8px 16px;
    }
    .tool {
        padding: 8px 16px;
        font-size: 1rem;
    }
    #dialogue-box {
        bottom: 120px;
        padding: 16px 24px;
        font-size: 1rem;
    }
    #dialogue-box b {
        font-size: 1.3rem;
    }
}