/* --- 通用样式 --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- 入口页样式 --- */
#entrance-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/zoos.jpeg') no-repeat center center;
    background-size: cover;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s ease-out;
}

.enter-btn {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 70px;
    background: linear-gradient(145deg, #FFD700, #FF8C00);
    border: 2px solid #FFF8DC;
    border-radius: 15px;
    color: #fff9aa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
    50% { transform: translateX(-50%) scale(1.05); box-shadow: 0 0 25px rgba(255, 215, 0, 1); }
    100% { transform: translateX(-50%) scale(1); box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
}

/* --- 游戏页容器 --- */
#game-container {
    opacity: 0;
    transition: opacity 2s ease-in;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;

}

/* 核心容器：改为横屏全图 */
.game-card {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #222;
    overflow: hidden;
    cursor: url('../images/wand.png') 5 15, auto;
}

/* 巫师背景图 */
.wizard-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
}

/* UI层 */
.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    box-sizing: border-box;
    pointer-events: none;
}

/* --- 魔法气泡对话框 --- */
.dialog-container {
    position: absolute;
    top: 10%; 
    left: 35%;
    transform: translateX(-50%);
    z-index: 20;
    pointer-events: auto;
    /* 弹跳入场动画 */
    animation: magicBounceIn 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* 弹跳入场动画关键帧 */
@keyframes magicBounceIn {
    0% { opacity: 0; transform: translateX(-50%) scale(0.3); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
    70% { transform: translateX(-50%) scale(0.95); }
    100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

.dialog-bubble {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f3e7ff 100%); /* 梦幻的淡紫色渐变背景 */
    color: #4a2c6d; /* 深邃的魔法紫字体 */
    padding: 20px 35px;
    border-radius: 25px;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    max-width: 80vw;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #d1c4e9; /* 浅紫色边框 */
    box-shadow: 0 0 20px rgba(179, 157, 219, 0.5); /* 初始魔法光晕 */
    /* 持续的呼吸感动画 */
    animation: magicPulse 3s infinite ease-in-out;
}

/* 魔法呼吸感动画 */
@keyframes magicPulse {
    0% { box-shadow: 0 0 20px rgba(179, 157, 219, 0.5); transform: scale(1); }
    50% { box-shadow: 0 0 35px rgba(209, 196, 233, 0.9); transform: scale(1.02); }
    100% { box-shadow: 0 0 20px rgba(179, 157, 219, 0.5); transform: scale(1); }
}

/* 气泡的小三角（带高级描边效果） */
.dialog-bubble::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -14px;
    border-width: 14px;
    border-style: solid;
    /* 外层模拟边框色（浅紫色） */
    border-color: #d1c4e9 transparent transparent transparent; 
}

.dialog-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -11px;
    border-width: 11px;
    border-style: solid;
    /* 内层填充背景色（白色渐变的主色调） */
    border-color: #ffffff transparent transparent transparent;
}

/* 底部控制区：固定在底部 */
.control-panel {
    position: absolute;
    bottom: 5vh;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    /* 修改点：改为左对齐（flex-start），给按钮靠右腾出空间 */
    align-items: flex-start; 
    pointer-events: none;
    /* 修改点：增加左右内边距，防止内容在手机边缘贴得太紧 */
    padding: 0 150px; 
    box-sizing: border-box;
    z-index: 100;
}

/* 任务文字也跟随靠左对齐 */
.task-text {
    font-size: 28px;
    color: #f1c40f;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    /* 修改点：文字改为靠左，和按钮保持一致 */
    text-align: left; 
}

.letter-slots {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.slot {
    width: 60px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    font-weight: bold;
    color: #5e35b1;
    border: 2px solid #b39ddb;
    box-shadow: 0 0 10px rgba(179, 157, 219, 0.4);
}

/* --- 魔法按钮样式 --- */
.action-btn {
    background: linear-gradient(145deg, #fdb76c, #d58cef);
    border: 2px solid #b39ddb;
    padding: 12px 50px; 
    border-radius: 50px;
    color: white;
    font-size: 20px; 
    font-weight: bold;
    cursor: url('../images/wand.png') 5 15, auto;
    outline: none;
    box-shadow: 0 0 20px rgba(126, 87, 194, 0.6);
    display: inline-block; 
    margin: 0 100px 0 auto; /* 保持按钮靠右 */
    animation: magicPulse 2s infinite ease-in-out;
    transition: transform 0.1s;

    position: relative;
    z-index: 101;
    pointer-events: auto;
}

@keyframes magicPulse {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(126, 87, 194, 0.6); }
    50% { transform: scale(1); box-shadow: 0 0 40px rgba(179, 157, 219, 0.9); border-color: #d1c4e9; }
    100% { transform: scale(1); box-shadow: 0 0 20px rgba(126, 87, 194, 0.6); }
}

.action-btn:active {
    transform: scale(0.95);
    animation: none;
}

.loading {
    color: #b39ddb;
    font-size: 20px;
    display: none;
    margin-top: 15px;
    text-shadow: 0 0 5px #000;
    text-align: center;
}


/* --- 魔法水晶球样式（增加厚重实体感版） --- */
.magic-crystal-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 60px;
    height: 420px;
    perspective: 1000px; 
}

.magic-crystal {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    position: relative;
    opacity: 1; /* 整体不再半透明 */
    transform: scale(0.95);
    transition: all 0.5s ease;
    
    /* 核心修改：降低透明度，增加紫色和白色的实体占比 */
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.95) 0%, rgba(200, 180, 240, 0.6) 25%, rgba(130, 100, 200, 0.7) 60%, rgba(60, 20, 120, 0.95) 100%);
    border: 2px solid rgba(255, 255, 255, 0.7);
    /* 核心修改：加深内阴影，特别是边缘的暗部，增加厚重感 */
    box-shadow: 
        0 0 60px rgba(179, 157, 219, 0.5),
        inset 10px 10px 50px rgba(255, 255, 255, 0.5),
        inset -15px -15px 70px rgba(40, 10, 80, 0.9); 
    
    transform-style: preserve-3d;
    animation: crystalRealSpin 10s linear infinite, crystalFloat 4s ease-in-out infinite;
}

/* 核心新增：实体玻璃反光层（模拟厚玻璃表面的强反光，极大增加实体感） */
.magic-crystal::before {
    content: '';
    position: absolute;
    top: 5%;
    left: 10%;
    width: 45%;
    height: 25%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
    filter: blur(3px);
    transform: rotate(-45deg);
    z-index: 2;
    pointer-events: none;
}

/* 水晶球内部的流光层 */
.crystal-glow {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.5), transparent 40%);
    filter: blur(15px);
    transform: translateZ(20px);
    opacity: 0.7;
    animation: crystalGlowSpin 5s linear infinite;
}

/* 水晶球的核心能量 */
.crystal-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 35%;
    height: 35%;
    background: radial-gradient(circle, #fff, #d1c4e9, transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%) translateZ(-10px);
    box-shadow: 0 0 50px #fff, 0 0 80px #b39ddb;
    opacity: 0.9;
}

/* 激活状态 */
.magic-crystal.active {
    opacity: 1;
    transform: scale(1);
    box-shadow: 
        0 0 100px rgba(209, 196, 233, 1),
        inset 10px 10px 60px rgba(255, 255, 255, 0.6),
        inset -15px -15px 80px rgba(40, 10, 80, 1);
    animation: crystalRealSpin 3s linear infinite, crystalFloat 2s ease-in-out infinite;
}

.magic-crystal.active .crystal-glow {
    opacity: 1;
    filter: blur(10px);
    animation: crystalGlowSpin 1.5s linear infinite;
}

/* 动画关键帧保持不变 */
@keyframes crystalRealSpin {
    0% { transform: rotate3d(1, 1, 1, 0deg) scale(0.95); }
    100% { transform: rotate3d(1, 1, 1, 360deg) scale(0.95); }
}

@keyframes crystalGlowSpin {
    0% { transform: translateZ(20px) rotate(0deg); }
    100% { transform: translateZ(20px) rotate(360deg); }
}

@keyframes crystalFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(0.95); }
    50% { transform: translate3d(0, -15px, 0) scale(0.95); }
}



/* --- 水晶球内部内容层 --- */
.crystal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -50%) translateZ(0px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    overflow: hidden;
    border-radius: 50%;
    pointer-events: none; /* 让点击事件穿透到 magicCrystal 上 */
}

/* “召唤”文字样式 */
.crystal-text {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 15px #b39ddb, 0 0 30px #5e35b1;
    animation: textPulse 1.5s infinite ease-in-out;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); text-shadow: 0 0 25px #fff, 0 0 40px #b39ddb; }
}

/* 生成图片的样式 */
.crystal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
    opacity: 0;
    transition: opacity 1s ease-in;
    display: none; /* 默认隐藏 */
}

.crystal-image.show {
    opacity: 1;
}






