* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    min-height: 100vh;
    padding: 10px;
}

.game-container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    height: 100vh;
    gap: 15px;
}

/* 顶部状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 15px 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 2px solid #4cc9f0;
}

.player-stats {
    display: flex;
    gap: 25px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.7rem;
}

.health i {
    color: #d00000;
}

.mana i {
    color: #4cc9f0;
}

.shield i {
    color: #d68b1b;
}

.coins i {
    color: #fffb00;
}


.game-info {
    text-align: right;
}

.game-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #f9c74f;
    margin-bottom: 5px;
}

.game-version {
    font-size: 0.9rem;
    color: #adb5bd;
}

.dungeon-level {
    font-size: 1.7rem;
    font-weight: bold;
    color: #e1e3e6;
}

/* 战斗区域 */
.battle-area {
    position: relative;
    height: 30vh;
    min-height: 250px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.battle-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-layer {
    background: linear-gradient(45deg, #2d3741, #1c2833);
    z-index: 1;
}

.background-layer img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 拉伸并裁剪 */
    pointer-events: none;
    /* 防止干扰点击 */
    image-rendering: pixelated;
    /* 现代浏览器 */
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    /* IE */

}

.monster-layer {
    z-index: 2;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: flex-end;
    box-sizing: content-box;
}

.monster {
    width: 320px;
    height: 320px;
    margin-bottom: 10px;
}

.monster-image {
    position: relative;
    left: 50%;
    /* 先移到父节点中心线 */
    top: 0;
    /* 垂直位置不变（贴着父节点顶部）*/
    transform: translateX(-50%);
    /* 再向左移自身宽度的一半，实现水平居中 */
    /* 垂直 + 水平都 auto => 居中 */
    aspect-ratio: 1;
    width: auto;
    height: 250px;
    image-rendering: pixelated;
    align-items: center;
    justify-content: center;

}

.monster-state {
    padding-top: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;


}

.monster-state i {
    padding-left: 15px;
    padding-right: 8px;
}

.monster-state span {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    height: auto;
}

.monster-think {
    position: relative;
    left: 90%;
    /* 水平居中 */
    top: 20%;
    /* 偏上：20% 可改 15% / 10% */
    transform: translate(-50%, -50%);
    /* 精准居中自身中心点 */
    pointer-events: none;
    /* 可选：防止小图挡住鼠标事件 */
}

.monster-think i {
    padding-left: 15px;
    padding-right: 8px;
    font-size: 2rem;
}

.monster-think span {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    height: auto;
}

.hide {
    display: none;
}


.drop-target {
    border: 4px dashed gold;
}

.effects-layer {
    z-index: 3;
    pointer-events: none;
    box-sizing: content-box;
}

.battle-info-bar {
    font-size: 1.5rem;
    font-weight: normal;
    position: absolute;
    left: 15px;
    top: 15px;
    color: gold;
    z-index: 4;
    padding: 5px;
    -webkit-text-stroke: 1px gold;
    /* 金色描边 */
}

.test-btn,
.test-btn-2,
.transition-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #4361ee;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 4;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
}

.test-btn:hover,
.transition-btn:hover {
    transform: translateY(-3px);
}

/* 道具区域 */
.inventory-area {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    gap: 15px;
    overflow-x: auto;
    min-height: 100px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid #f9c74f;
}

.inventory-item {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.inventory-item:hover {
    transform: translateY(-5px);
}

.inventory-item i {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.inventory-item img {
    border-radius: 10px;
    /* 圆角大小 */
}

/*描述信息*/
.tooltip {
    position: fixed;
    pointer-events: none;
    /* 不拦截鼠标 */
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 4px;
    font-size: 1.2em;
    transform: translate(-50%, -100%);
    /* 水平居中、垂直在光标上方 */
    margin-top: -8px;
    /* 与光标留一点空隙 */
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 9999;
    /* white-space: nowrap; */
    /* 新增：固定宽度 + 自动换行 */
    white-space: normal;
    /* 允许换行 */
    width: 200px;
    /* 固定宽度，按需调整 */
    word-break: break-word;
    /* 长单词也能断行 */
}

.tooltip.show {
    opacity: 1;
}

.tooltip-image {
    max-width: 140px;
    max-height: 200px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);

}


/* 按钮区域 */
.buttons-area {
    display: flex;
    gap: 15px;
    padding: 15px 0;
}

.game-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #db4113, #aa5626);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-btn.action {
    background: linear-gradient(135deg, gold, goldenrod);
    color: midnightblue;
    font-size: 1.2rem;

}

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(226, 39, 5, 0.4);
}

.game-btn:active {
    transform: translateY(1px);
}

.game-btn[disabled] {
    /* cursor: not-allowed; */
    opacity: 0.8;
    background: linear-gradient(135deg, #4b4644, #4e3b2f);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        height: auto;
        min-height: 100vh;
    }

    .status-bar {
        flex-direction: column;
        gap: 15px;
    }

    .player-stats {
        width: 100%;
        justify-content: space-around;
    }

    .game-info {
        width: 100%;
        text-align: center;
    }

    .buttons-area {
        flex-wrap: wrap;
    }

    .game-btn {
        min-width: calc(50% - 8px);
    }

    .card {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .stat-item {
        font-size: 1rem;
    }

    .game-title {
        font-size: 1.5rem;
    }

    .inventory-item {
        min-width: 70px;
        height: 70px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .card {
        height: 100px;
    }

    .card i {
        font-size: 2rem;
    }
}