/* Minecraft UI 元素样式 - 使用CSS绘制 */

/* ========== Minecraft 方块纹理 (CSS绘制) ========== */

/* 草方块纹理 - 使用真实Minecraft纹理 */
.mc-texture-grass {
    background-image: url('../textures/blocks/grass_side_carried.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

/* 石头纹理 - 使用真实Minecraft纹理 */
.mc-texture-stone {
    background-image: url('../textures/blocks/stone.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

/* 木板纹理 - 使用真实Minecraft纹理 */
.mc-texture-wood {
    background-image: url('../textures/blocks/planks_oak.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

/* 钻石块纹理 - 使用真实Minecraft纹理 */
.mc-texture-diamond {
    background-image: url('../textures/blocks/diamond_block.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

/* 金块纹理 - 使用真实Minecraft纹理 */
.mc-texture-gold {
    background-image: url('../textures/blocks/gold_block.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

/* ========== Minecraft 物品栏样式 ========== */

.mc-inventory-slot {
    position: relative;
    width: 64px;
    height: 64px;
    background: #8b8b8b;
    border: 3px solid;
    border-color: #373737 #fff #fff #373737;
    box-shadow: 
        inset 2px 2px 0 rgba(0, 0, 0, 0.5),
        inset -2px -2px 0 rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    image-rendering: pixelated;
}

.mc-inventory-slot::before {
    content: '';
    position: absolute;
    inset: 3px;
    background: 
        linear-gradient(135deg, transparent 48%, #555 48%, #555 52%, transparent 52%),
        linear-gradient(45deg, transparent 48%, #555 48%, #555 52%, transparent 52%),
        #8b8b8b;
    opacity: 0.3;
}

.mc-inventory-slot.selected {
    border-color: #fff #373737 #373737 #fff;
    background: #a0a0a0;
}

/* 物品栏网格 */
.mc-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 64px);
    gap: 8px;
    padding: 20px;
    background: rgba(33, 33, 33, 0.95);
    border: 4px solid;
    border-color: #000 #555 #555 #000;
    box-shadow: 
        inset 3px 3px 0 rgba(0, 0, 0, 0.8),
        inset -3px -3px 0 rgba(100, 100, 100, 0.3);
}

/* ========== Minecraft 成就框样式 ========== */

.mc-achievement {
    position: relative;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid;
    border-color: #000 #3d3d3d #3d3d3d #000;
    padding: 15px 20px;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 
        0 0 0 2px #000,
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 4px 0 #000;
    image-rendering: pixelated;
}

.mc-achievement::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #4a4a4a 50%, 
        transparent 100%
    );
}

.mc-achievement-icon {
    width: 48px;
    height: 48px;
    background: #8b8b8b;
    border: 2px solid;
    border-color: #373737 #fff #fff #373737;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.mc-achievement-content {
    flex: 1;
}

.mc-achievement-title {
    font-family: 'Minecraft', sans-serif;
    font-size: 14px;
    color: #ffff00;
    text-shadow: 2px 2px 0 #3f3f00;
    margin-bottom: 5px;
}

.mc-achievement-desc {
    font-family: 'Minecraft', sans-serif;
    font-size: 10px;
    color: #aaa;
}

.mc-achievement.unlocked {
    background: linear-gradient(180deg, #3a3a1a 0%, #2a2a0a 100%);
    border-color: #000 #5a5a3a #5a5a3a #000;
}

.mc-achievement.unlocked::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    color: #00ff00;
    font-size: 20px;
    text-shadow: 2px 2px 0 #003f00;
}

/* ========== Minecraft 按钮样式 (原版风格) ========== */

.mc-button-original {
    position: relative;
    padding: 12px 30px;
    background: linear-gradient(180deg, #c6c6c6 0%, #7b7b7b 100%);
    border: none;
    box-shadow: 
        0 0 0 2px #000,
        inset 0 2px 0 #fff,
        inset 0 -2px 0 #555,
        0 4px 0 #000;
    color: #fff;
    font-family: 'Minecraft', sans-serif;
    font-size: 14px;
    text-shadow: 2px 2px 0 #3f3f3f;
    cursor: pointer;
    transition: all 0.1s;
    image-rendering: pixelated;
}

.mc-button-original:hover {
    background: linear-gradient(180deg, #e0e0e0 0%, #9a9a9a 100%);
}

.mc-button-original:active {
    transform: translateY(2px);
    box-shadow: 
        0 0 0 2px #000,
        inset 0 2px 0 #fff,
        inset 0 -2px 0 #555,
        0 2px 0 #000;
}

.mc-button-original.disabled {
    background: linear-gradient(180deg, #7b7b7b 0%, #4a4a4a 100%);
    color: #a0a0a0;
    cursor: not-allowed;
}

/* ========== Minecraft 经验条样式 ========== */

.mc-exp-bar {
    position: relative;
    height: 10px;
    background: #000;
    border: 2px solid;
    border-color: #000 #3d3d3d #3d3d3d #000;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.mc-exp-bar-fill {
    height: 100%;
    background: linear-gradient(180deg, #aafb00 0%, #7fb900 50%, #5f8a00 100%);
    box-shadow: 
        inset 0 -2px 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    transition: width 0.5s ease;
    position: relative;
}

.mc-exp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%
    );
    animation: exp-shine 2s linear infinite;
}

@keyframes exp-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== Minecraft 统计面板样式 ========== */

.mc-stats-panel {
    background: rgba(0, 0, 0, 0.85);
    border: 4px solid;
    border-color: #000 #3d3d3d #3d3d3d #000;
    padding: 20px;
    box-shadow: 
        inset 3px 3px 0 rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 0, 0, 0.8);
}

.mc-stats-panel::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* ========== Minecraft 标题样式 ========== */

.mc-title {
    font-family: 'Minecraft', sans-serif;
    font-size: clamp(1.5rem, 5vw, 3rem);
    color: #fff;
    text-shadow: 
        3px 3px 0 #3f3f3f,
        4px 4px 0 #000;
    letter-spacing: 2px;
    text-align: center;
    image-rendering: pixelated;
}

.mc-title.gold {
    color: #ffff00;
    text-shadow: 
        3px 3px 0 #3f3f00,
        4px 4px 0 #000;
}

.mc-title.diamond {
    color: #55ffff;
    text-shadow: 
        3px 3px 0 #003f3f,
        4px 4px 0 #000;
}

/* ========== Minecraft 数字显示 ========== */

.mc-number {
    font-family: 'Minecraft', sans-serif;
    font-size: clamp(2rem, 6vw, 4rem);
    color: #fff;
    text-shadow: 
        2px 2px 0 #3f3f3f,
        3px 3px 0 #000;
    image-rendering: pixelated;
}

.mc-number.gold {
    color: #ffff00;
    text-shadow: 
        2px 2px 0 #3f3f00,
        3px 3px 0 #000;
}

/* ========== Minecraft 方块堆叠图表 ========== */

.mc-block-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
    height: 400px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #000;
}

.mc-block-column {
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
    min-width: 40px;
}

.mc-block {
    width: 100%;
    height: 20px;
    image-rendering: pixelated;
    animation: blockStack 0.3s ease-out backwards;
}

@keyframes blockStack {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========== Minecraft 工具提示 ========== */

.mc-tooltip {
    position: absolute;
    background: rgba(16, 0, 16, 0.94);
    border: 2px solid;
    border-color: #100010 #2a0a2f #2a0a2f #100010;
    padding: 8px 12px;
    font-family: 'Minecraft', sans-serif;
    font-size: 12px;
    color: #fff;
    text-shadow: 2px 2px 0 #3f003f;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

/* ========== Minecraft 粒子效果 ========== */

.mc-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    pointer-events: none;
    animation: particle-float 2s ease-out forwards;
}

@keyframes particle-float {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx, 0), var(--ty, -100px)) scale(0);
        opacity: 0;
    }
}

/* ========== Minecraft TNT 爆炸效果 ========== */

.mc-explosion {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, 
        #fff 0%, 
        #ff6600 30%, 
        #ff0000 60%, 
        transparent 100%
    );
    animation: explode 0.6s ease-out;
    pointer-events: none;
}

@keyframes explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* ========== Minecraft 聊天框样式 ========== */

.mc-chat-box {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 0, 0, 0.8);
    padding: 10px;
    font-family: 'Minecraft', 'Courier New', monospace;
    font-size: 14px;
    color: #fff;
    max-height: 200px;
    overflow-y: auto;
}

.mc-chat-message {
    margin-bottom: 5px;
    text-shadow: 1px 1px 0 #000;
}

/* ========== 响应式调整 ========== */

@media (max-width: 768px) {
    .mc-inventory-slot {
        width: 48px;
        height: 48px;
    }
    
    .mc-achievement {
        padding: 10px 15px;
        min-height: 60px;
    }
    
    .mc-achievement-icon {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    .mc-achievement-title {
        font-size: 11px;
    }
    
    .mc-achievement-desc {
        font-size: 8px;
    }
    
    .mc-block-chart {
        height: 300px;
    }
}
