/* Minecraft Web Game Stylesheet */

:root {
    --mc-btn-bg: #4a4a4a;
    --mc-btn-border-light: #8c8c8c;
    --mc-btn-border-dark: #1e1e1e;
    --mc-btn-hover-bg: #5c8e32;
    --mc-btn-hover-border-light: #7cb84a;
    --mc-btn-hover-border-dark: #2d4c18;
    --mc-text-shadow: 2px 2px 0px #242424;
    --mc-panel-bg: rgba(16, 16, 16, 0.85);
    --mc-slot-bg: #8b8b8b;
    --mc-slot-border-dark: #373737;
    --mc-slot-border-light: #ffffff;
    --mc-font: 'Press Start 2P', monospace;
    --mc-font-hud: 'VT323', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: var(--mc-font);
    color: #ffffff;
    cursor: default;
}

/* Screens Layout */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.screen.active {
    display: flex;
}

/* Dirt background styling */
.dirt-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2b1f14;
    background-image: 
        radial-gradient(#3c2c1e 10%, transparent 11%),
        radial-gradient(#3c2c1e 10%, transparent 11%),
        linear-gradient(45deg, #1f160e 25%, transparent 25%, transparent 75%, #1f160e 75%, #1f160e),
        linear-gradient(45deg, #1f160e 25%, transparent 25%, transparent 75%, #1f160e 75%, #1f160e);
    background-size: 40px 40px, 40px 40px, 40px 40px, 40px 40px;
    background-position: 0 0, 20px 20px, 0 0, 20px 20px;
    filter: brightness(0.65);
    z-index: -1;
}

.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    text-align: center;
    z-index: 10;
}

.menu-content.container {
    background-color: rgba(0, 0, 0, 0.7);
    border: 4px solid #373737;
    border-radius: 2px;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Game Title */
.game-title {
    font-size: 3.5rem;
    font-family: var(--mc-font);
    color: #c6c6c6;
    letter-spacing: 2px;
    margin-bottom: 30px;
    text-shadow: 4px 4px 0px #383838, -2px -2px 0px #000;
    position: relative;
}

.game-title span {
    color: #5c8e32;
    text-shadow: 4px 4px 0px #223512, -2px -2px 0px #000;
}

/* Splash Text */
.splash-text {
    color: #ffff55;
    font-size: 1.1rem;
    text-shadow: var(--mc-text-shadow);
    transform: rotate(-15deg);
    position: absolute;
    right: 20px;
    top: 90px;
    animation: pulse 0.5s infinite alternate;
    pointer-events: none;
}

@keyframes pulse {
    from { transform: rotate(-15deg) scale(0.95); }
    to { transform: rotate(-15deg) scale(1.1); }
}

/* Minecraft Button style */
.mc-btn {
    font-family: var(--mc-font);
    font-size: 1rem;
    color: #e0e0e0;
    background-color: var(--mc-btn-bg);
    border: 4px solid;
    border-color: var(--mc-btn-border-light) var(--mc-btn-border-dark) var(--mc-btn-border-dark) var(--mc-btn-border-light);
    padding: 14px 20px;
    margin: 8px 0;
    width: 100%;
    cursor: pointer;
    text-align: center;
    text-shadow: var(--mc-text-shadow);
    transition: filter 0.1s;
    outline: none;
}

.mc-btn:hover:not(:disabled) {
    color: #ffffa0;
    background-color: var(--mc-btn-hover-bg);
    border-color: var(--mc-btn-hover-border-light) var(--mc-btn-hover-border-dark) var(--mc-btn-hover-border-dark) var(--mc-btn-hover-border-light);
}

.mc-btn:active:not(:disabled) {
    border-color: var(--mc-btn-border-dark) var(--mc-btn-border-light) var(--mc-btn-border-light) var(--mc-btn-border-dark);
    padding: 15px 19px 13px 21px; /* visual push down */
}

.mc-btn:disabled {
    color: #7a7a7a;
    background-color: #212121;
    border-color: #3a3a3a;
    cursor: not-allowed;
    text-shadow: 2px 2px 0px #080808;
}

.mc-btn-primary {
    background-color: #5c8e32;
    border-color: #7cb84a #2d4c18 #2d4c18 #7cb84a;
}

.mc-btn-danger {
    background-color: #b83c3c;
    border-color: #e06060 #5c1818 #5c1818 #e06060;
}
.mc-btn-danger:hover:not(:disabled) {
    background-color: #d14646;
    border-color: #f26f6f #7c2020 #7c2020 #f26f6f;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 20px;
}

.menu-buttons.horizontal {
    flex-direction: row;
    gap: 10px;
}

/* Screen Title */
.screen-title {
    font-size: 2rem;
    margin-bottom: 25px;
    text-shadow: var(--mc-text-shadow);
    text-align: center;
}

/* Form Styles */
.form-container {
    width: 100%;
    margin-bottom: 20px;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.8rem;
    text-shadow: var(--mc-text-shadow);
    color: #a0a0a0;
}

.mc-input {
    font-family: var(--mc-font);
    font-size: 0.9rem;
    color: #ffffff;
    background-color: #000000;
    border: 3px solid #555555;
    padding: 10px;
    outline: none;
    width: 100%;
}

.mc-input:focus {
    border-color: #ffffff;
}

.info-text {
    font-size: 0.65rem;
    color: #a0a0a0;
    line-height: 1.4;
    text-align: center;
}

/* Toggle Buttons */
.toggle-buttons {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    flex: 1;
    margin: 0;
    font-size: 0.8rem;
}

.toggle-btn.active {
    background-color: #5c8e32;
    border-color: #7cb84a #2d4c18 #2d4c18 #7cb84a;
    color: #ffffa0;
}

/* World List Play Menu */
.world-list-container {
    width: 100%;
    height: 250px;
    border: 4px solid #555;
    background-color: #121212;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 5px;
}

.world-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.world-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a2a2a;
    border: 2px solid transparent;
    padding: 12px;
    cursor: pointer;
}

.world-item:hover {
    background-color: #353535;
    border-color: #555555;
}

.world-item.selected {
    background-color: #4a4a4a;
    border-color: #ffff55;
}

.world-item-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.world-item-name {
    font-size: 0.85rem;
    font-weight: bold;
    color: #ffffff;
}

.world-item-meta {
    font-size: 0.6rem;
    color: #888;
}

.world-list-empty {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    padding: 50px 10px;
}

/* Settings styling */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    margin-bottom: 20px;
    text-align: left;
}

@media (max-width: 600px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-size: 0.75rem;
    text-shadow: var(--mc-text-shadow);
}

.mc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    background: #000;
    border: 2px solid #555;
    outline: none;
}

.mc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--mc-btn-bg);
    border: 3px solid;
    border-color: var(--mc-btn-border-light) var(--mc-btn-border-dark) var(--mc-btn-border-dark) var(--mc-btn-border-light);
    cursor: pointer;
}

.mc-slider::-webkit-slider-thumb:hover {
    background: #5c8e32;
    border-color: #7cb84a #2d4c18 #2d4c18 #7cb84a;
}

.controls-guide {
    width: 100%;
    margin-top: 15px;
    border-top: 2px dashed #444;
    padding-top: 15px;
    text-align: left;
}

.controls-guide h3 {
    font-size: 0.8rem;
    color: #ffff55;
    margin-bottom: 10px;
    text-shadow: var(--mc-text-shadow);
}

.controls-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.55rem;
    color: #cccccc;
    line-height: 1.3;
}

.controls-list div span {
    color: #ffffa0;
    font-weight: bold;
    display: inline-block;
    min-width: 60px;
}

.menu-footer {
    margin-top: 40px;
    font-size: 0.55rem;
    color: #888888;
    text-shadow: var(--mc-text-shadow);
}

/* Active Game Screens & HUD */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: none;
}

#game-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Crosshair */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

#crosshair::before, #crosshair::after {
    content: '';
    position: absolute;
    background-color: rgba(255, 255, 255, 0.7);
}

#crosshair::before {
    top: 9px;
    left: 0;
    width: 20px;
    height: 2px;
}

#crosshair::after {
    top: 0;
    left: 9px;
    width: 2px;
    height: 20px;
}

/* Block Name HUD Info */
#block-name-hud {
    position: absolute;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.25s;
    font-family: var(--mc-font);
    color: #ffffa0;
    text-align: center;
}

/* Save Toast */
#saving-toast {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(16, 120, 16, 0.85);
    border: 3px solid #7cb84a;
    padding: 10px 20px;
    font-size: 0.8rem;
    color: #fff;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}

/* HUD Overlay */
#hud-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100vw;
    padding-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.stats-bars {
    display: flex;
    justify-content: space-between;
    width: 362px;
    margin-bottom: 4px;
}

.hearts-row, .food-row {
    display: flex;
    gap: 2px;
}

/* Simple CSS Hearts and Food */
.mc-heart, .mc-food {
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

.mc-heart {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" shape-rendering="crispEdges"><path d="M1,0 h2 v1 h-2 z M6,0 h2 v1 h-2 z M0,1 h3 v1 h-3 z M6,1 h3 v1 h-3 z M0,2 h9 v1 h-9 z M0,3 h9 v1 h-9 z M1,4 h7 v1 h-7 z M2,5 h5 v1 h-5 z M3,6 h3 v1 h-3 z M4,7 h1 v1 h-1 z" fill="%23e30000"/><path d="M2,1 h1 v1 h-1 z M7,1 h1 v1 h-1 z" fill="%23ff6b6b"/><path d="M0,0 h1 v1 h-1 z M4,0 h2 v1 h-2 z M8,0 h1 v1 h-1 z M0,1 h1 v1 h-1 z M3,1 h1 v1 h-1 z M5,1 h1 v1 h-1 z M8,1 h1 v1 h-1 z M0,2 h1 v1 h-1 z M8,2 h1 v1 h-1 z M1,5 h1 v1 h-1 z M7,5 h1 v1 h-1 z M2,6 h1 v1 h-1 z M6,6 h1 v1 h-1 z M3,7 h1 v1 h-1 z M5,7 h1 v1 h-1 z M4,8 h1 v1 h-1 z" fill="%23000"/></svg>');
}

.mc-heart.empty {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" shape-rendering="crispEdges"><path d="M1,0 h2 v1 h-2 z M6,0 h2 v1 h-2 z M0,1 h9 v1 h-9 z M0,2 h9 v1 h-9 z M0,3 h9 v1 h-9 z M1,4 h7 v1 h-7 z M2,5 h5 v1 h-5 z M3,6 h3 v1 h-3 z M4,7 h1 v1 h-1 z" fill="%23444444"/><path d="M0,0 h1 v1 h-1 z M4,0 h2 v1 h-2 z M8,0 h1 v1 h-1 z M0,1 h1 v1 h-1 z M3,1 h1 v1 h-1 z M5,1 h1 v1 h-1 z M8,1 h1 v1 h-1 z M0,2 h1 v1 h-1 z M8,2 h1 v1 h-1 z M1,5 h1 v1 h-1 z M7,5 h1 v1 h-1 z M2,6 h1 v1 h-1 z M6,6 h1 v1 h-1 z M3,7 h1 v1 h-1 z M5,7 h1 v1 h-1 z M4,8 h1 v1 h-1 z" fill="%23000"/></svg>');
}

.mc-food {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" shape-rendering="crispEdges"><path d="M3,0 h2 v1 h-2 z M2,1 h5 v1 h-5 z M1,2 h7 v1 h-7 z M1,3 h7 v1 h-7 z M1,4 h7 v1 h-7 z M2,5 h5 v1 h-5 z M3,6 h4 v1 h-4 z M4,7 h2 v1 h-2 z" fill="%23945b23"/><path d="M6,1 h1 v1 h-1 z M5,2 h2 v1 h-2 z M4,3 h1 v1 h-1 z M6,3 h1 v1 h-1 z" fill="%23c28546"/><path d="M2,0 h1 v1 h-1 z M5,0 h1 v1 h-1 z M1,1 h1 v1 h-1 z M7,1 h1 v1 h-1 z M0,2 h1 v1 h-1 z M8,2 h1 v1 h-1 z M0,3 h1 v1 h-1 z M8,3 h1 v1 h-1 z M0,4 h1 v1 h-1 z M8,4 h1 v1 h-1 z M1,5 h1 v1 h-1 z M7,5 h1 v1 h-1 z M2,6 h1 v1 h-1 z M7,6 h1 v1 h-1 z M3,7 h1 v1 h-1 z M6,7 h1 v1 h-1 z M4,8 h2 v1 h-2 z" fill="%23000"/></svg>');
}

.mc-food.empty {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" shape-rendering="crispEdges"><path d="M3,0 h2 v1 h-2 z M2,1 h5 v1 h-5 z M1,2 h7 v1 h-7 z M1,3 h7 v1 h-7 z M1,4 h7 v1 h-7 z M2,5 h5 v1 h-5 z M3,6 h4 v1 h-4 z M4,7 h2 v1 h-2 z" fill="%23444444"/><path d="M2,0 h1 v1 h-1 z M5,0 h1 v1 h-1 z M1,1 h1 v1 h-1 z M7,1 h1 v1 h-1 z M0,2 h1 v1 h-1 z M8,2 h1 v1 h-1 z M0,3 h1 v1 h-1 z M8,3 h1 v1 h-1 z M0,4 h1 v1 h-1 z M8,4 h1 v1 h-1 z M1,5 h1 v1 h-1 z M7,5 h1 v1 h-1 z M2,6 h1 v1 h-1 z M7,6 h1 v1 h-1 z M3,7 h1 v1 h-1 z M6,7 h1 v1 h-1 z M4,8 h2 v1 h-2 z" fill="%23000"/></svg>');
}

/* Hotbar slots */
.hotbar-container {
    background-color: rgba(0, 0, 0, 0.4);
    border: 4px solid #3c3c3c;
    border-radius: 2px;
    padding: 2px;
    pointer-events: auto;
}

.hotbar-slots {
    display: flex;
    gap: 4px;
}

.inv-slot {
    width: 44px;
    height: 44px;
    background-color: var(--mc-slot-bg);
    border: 3px solid;
    border-color: var(--mc-slot-border-dark) var(--mc-slot-border-light) var(--mc-slot-border-light) var(--mc-slot-border-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    image-rendering: pixelated;
}

.inv-slot:hover {
    background-color: #a0a0a0;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.4);
}

.inv-slot.selected {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px #ffff55, inset 0 0 6px rgba(0, 0, 0, 0.5);
    background-color: #8b8b8b;
}

/* Hotbar item textures and badges */
.item-icon {
    width: 32px;
    height: 32px;
    pointer-events: none;
    image-rendering: pixelated;
}

.item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-family: var(--mc-font-hud);
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 0px #000;
    pointer-events: none;
}

/* UI Overlay Screen Panels (Inventory, Crafting, Chest) */
.game-ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 150;
    font-family: var(--mc-font);
}

.ui-panel {
    background-color: #c6c6c6;
    border: 4px solid;
    border-color: #ffffff #555555 #555555 #ffffff;
    padding: 16px;
    width: 90%;
    max-width: 680px;
    color: #404040;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.5);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #8b8b8b;
    padding-bottom: 8px;
}

.panel-header span {
    font-size: 1.1rem;
    font-weight: bold;
    color: #303030;
    text-shadow: 1px 1px 0px #ffffff;
}

.close-ui-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #404040;
    outline: none;
}
.close-ui-btn:hover {
    color: #a00000;
}

.inventory-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inventory-left-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inventory-layout.creative-mode {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
    align-items: start;
}

.ui-panel.inventory-panel.creative-panel {
    max-width: 800px;
}

.creative-catalog-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}

.creative-search-container {
    width: 100%;
}

#creative-catalog-search {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--mc-font);
    font-size: 0.65rem;
    padding: 6px;
    background-color: #000;
    border: 2px solid #555;
    color: #fff;
    outline: none;
}

#creative-catalog-search:focus {
    border-color: #ffff55;
}

.creative-grid-container {
    height: 236px;
    overflow-y: auto;
    background-color: #8b8b8b;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 6px;
}

#creative-catalog-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.section-title {
    font-size: 0.7rem;
    margin-bottom: 4px;
    display: block;
    color: #505050;
    text-shadow: 1px 1px 0px #ffffff;
}

/* Slot containers */
.inv-grid-27, .inv-grid-hotbar-mirror {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
    background-color: #8b8b8b;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 6px;
}

/* Survival Crafting Styling */
.survival-crafting-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #b0b0b0;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 10px;
    gap: 15px;
}

.player-preview-card {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.player-avatar-render {
    width: 60px;
    height: 90px;
    background-color: #55b6e9; /* Sky blue bg */
    border: 3px solid #373737;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Simple 8-bit Steve in CSS */
.steve-head {
    width: 24px;
    height: 24px;
    background-color: #e5a075; /* skin */
    border-bottom: 4px solid #583c27; /* beard */
    position: relative;
    margin-bottom: 2px;
}
.steve-head::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: #583c27; /* hair */
}
.steve-body {
    width: 32px;
    height: 48px;
    background-color: #0087a3; /* teal shirt */
    border-bottom: 12px solid #233e7d; /* blue pants */
}

.player-stats-text p {
    font-size: 0.65rem;
    color: #2b2b2b;
    text-shadow: 1px 1px 0px #ffffff;
    margin-bottom: 4px;
}

.crafting-2x2-box, .crafting-3x3-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crafting-label {
    font-size: 0.65rem;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    color: #404040;
    text-shadow: 1px 1px 0px #ffffff;
}

.crafting-grid-2x2 {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: #8b8b8b;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 4px;
}

.grid-row {
    display: flex;
    gap: 4px;
}

.crafting-slot, .crafting-table-slot {
    background-color: #8b8b8b;
}

.crafting-arrow {
    font-size: 1.8rem;
    color: #3c3c3c;
    text-shadow: 1px 1px 0px #ffffff;
    animation: bounceRight 1s infinite alternate;
}

@keyframes bounceRight {
    from { transform: translateX(0); }
    to { transform: translateX(5px); }
}

.crafting-output-container {
    background-color: #8b8b8b;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 6px;
}

.crafting-output-slot {
    width: 52px;
    height: 52px;
    background-color: #a0a0a0;
    border-color: #ffffff #373737 #373737 #ffffff;
}

/* Crafting Table 3x3 Overlay Styling */
.crafting-3x3-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #b0b0b0;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 12px;
    gap: 15px;
}

.crafting-grid-3x3 {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: #8b8b8b;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 4px;
}

.recipe-book {
    flex: 1;
    background-color: #c6c6c6;
    border: 2px solid #8b8b8b;
    padding: 8px;
    height: 146px;
    overflow-y: auto;
    font-size: 0.5rem;
    text-align: left;
    color: #333;
}

.recipe-book h4 {
    margin-bottom: 6px;
    color: #a00000;
}

.recipe-book ul {
    list-style-type: none;
    padding-left: 2px;
}

.recipe-book li {
    margin-bottom: 6px;
    line-height: 1.4;
    border-bottom: 1px dashed #aaa;
    padding-bottom: 4px;
}

/* Chest items overlay */
.chest-slots-section {
    background-color: #b0b0b0;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 10px;
}

/* Screen Overlays (Pause, Death) */
.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.screen-overlay.red-tint {
    background-color: rgba(139, 0, 0, 0.7);
}

.pause-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.75);
    border: 4px solid #373737;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.menu-subtitle {
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-shadow: var(--mc-text-shadow);
}

.death-title {
    font-size: 2.5rem;
    color: #ff5555;
    margin-bottom: 10px;
    text-shadow: 3px 3px 0px #3f0000;
    animation: shake 0.5s infinite;
}

.death-sub {
    font-size: 1rem;
    margin-bottom: 30px;
    text-shadow: var(--mc-text-shadow);
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* Dragging helper */
.dragged-item-helper {
    position: absolute;
    width: 38px;
    height: 38px;
    pointer-events: none;
    z-index: 9999;
    image-rendering: pixelated;
    display: none;
}

.dragged-item-helper img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.dragged-item-helper .item-count {
    font-size: 1.1rem;
}

/* Scrollbar retro styling */
::-webkit-scrollbar {
    width: 16px;
}

::-webkit-scrollbar-track {
    background: #111;
    border: 3px solid #373737;
}

::-webkit-scrollbar-thumb {
    background: var(--mc-btn-bg);
    border: 3px solid;
    border-color: var(--mc-btn-border-light) var(--mc-btn-border-dark) var(--mc-btn-border-dark) var(--mc-btn-border-light);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mc-btn-hover-bg);
    border-color: var(--mc-btn-hover-border-light) var(--mc-btn-hover-border-dark) var(--mc-btn-hover-border-dark) var(--mc-btn-hover-border-light);
}

/* --- ADDED FEATURES STYLING --- */

/* 1. Keybinding rebinding controls grid */
.controls-rebind-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 180px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.45);
    border: 3px solid #373737;
    padding: 8px;
    margin-bottom: 12px;
}
.rebind-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6rem;
    color: #cccccc;
    padding: 6px 4px;
    border-bottom: 1px dashed #444;
}
.rebind-row span {
    color: #ffffa0;
    font-weight: bold;
}
.rebind-btn {
    width: 130px;
    font-size: 0.55rem;
    padding: 6px 8px;
    margin: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.rebind-btn.waiting {
    background-color: #b83c3c;
    border-color: #e06060 #5c1818 #5c1818 #e06060;
    color: #ffffff;
    animation: pulseRed 0.5s infinite alternate;
}
@keyframes pulseRed {
    from { opacity: 0.6; }
    to { opacity: 1.0; }
}

/* 2. Furnace Smelting Overlay styling */
.furnace-panel {
    max-width: 440px;
}
.furnace-smelting-section {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #b0b0b0;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 16px;
}
.furnace-slots-container {
    display: flex;
    align-items: center;
    gap: 32px;
}
.furnace-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.furnace-slot {
    background-color: #8b8b8b;
}
.furnace-flame-indicator {
    width: 28px;
    height: 28px;
    background-repeat: no-repeat;
    background-size: contain;
    image-rendering: pixelated;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" shape-rendering="crispEdges"><path d="M6,0 h2 v2 h-2 z M4,2 h6 v2 h-6 z M2,4 h10 v2 h-10 z M1,6 h12 v2 h-12 z M0,8 h14 v6 h-14 z" fill="%23444444"/></svg>');
}
.furnace-flame-indicator.lit {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" shape-rendering="crispEdges"><path d="M6,0 h2 v2 h-2 z M4,2 h6 v2 h-6 z M2,4 h10 v2 h-10 z M1,6 h12 v2 h-12 z M0,8 h14 v6 h-14 z" fill="%23e65c00"/><path d="M5,4 h4 v4 h-4 z M3,6 h8 v4 h-8 z M2,8 h10 v2 h-10 z" fill="%23ff9900"/><path d="M6,6 h2 v4 h-2 z M5,8 h4 v2 h-4 z" fill="%23ffcc00"/></svg>');
    animation: flameFlicker 0.25s infinite alternate;
}
@keyframes flameFlicker {
    from { filter: brightness(0.9) saturate(0.9); }
    to { filter: brightness(1.2) saturate(1.1); }
}
.furnace-arrow-indicator {
    width: 44px;
    height: 30px;
    background-repeat: no-repeat;
    background-size: contain;
    image-rendering: pixelated;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 15" shape-rendering="crispEdges"><path d="M0,5 h14 v5 h-14 z M14,2 h2 v11 h-2 z M16,4 h2 v7 h-2 z M18,6 h2 v3 h-2 z M20,7 h2 v1 h-2 z" fill="%23444444"/></svg>');
    position: relative;
}
.furnace-arrow-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--cook-progress, 0%);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 15" shape-rendering="crispEdges"><path d="M0,5 h14 v5 h-14 z M14,2 h2 v11 h-2 z M16,4 h2 v7 h-2 z M18,6 h2 v3 h-2 z M20,7 h2 v1 h-2 z" fill="%235c8e32"/></svg>');
    background-size: 44px 30px;
    background-repeat: no-repeat;
    pointer-events: none;
    transition: width 0.1s linear;
}
.furnace-output-container {
    background-color: #8b8b8b;
    border: 3px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    padding: 6px;
}
.furnace-output-slot {
    width: 52px;
    height: 52px;
    background-color: #a0a0a0;
    border-color: #ffffff #373737 #373737 #ffffff;
}

/* 3. Floating Item Name Tooltip in inventory overlay */
.mc-tooltip {
    position: absolute;
    background-color: rgba(16, 0, 16, 0.95);
    border: 3px solid #280a5c; /* Minecraft purple bevel */
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    font-family: var(--mc-font);
    font-size: 0.6rem;
    color: #ffffff;
    pointer-events: none;
    z-index: 9999;
    display: none;
    white-space: nowrap;
    border-radius: 2px;
}
.mc-tooltip span {
    color: #ffff55; /* Yellow for specific metadata info */
    display: block;
    font-size: 0.5rem;
    margin-top: 4px;
}

/* 4. Conic-gradient Voxel breaking progress ring around crosshair */
#crosshair.mining::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(rgba(255, 255, 85, 0.8) var(--mine-percent, 0%), rgba(255, 255, 255, 0.1) var(--mine-percent, 0%));
    mask: radial-gradient(circle, transparent 13px, black 14px);
    -webkit-mask: -webkit-radial-gradient(circle, transparent 13px, black 14px);
    pointer-events: none;
}

/* Command Console Styles */
.console-overlay-style {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 380px;
    height: 450px;
    background: rgba(16, 16, 20, 0.85);
    border: 3px solid #4a4a4f;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
    color: #f0f0f0;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    display: flex;
    flex-direction: column;
    z-index: 1500;
    pointer-events: auto;
    padding: 10px;
    box-sizing: border-box;
}

.console-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.console-header {
    font-size: 10px;
    color: #55ff55;
    border-bottom: 2px solid #4a4a4f;
    padding-bottom: 8px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.console-history {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    line-height: 1.4;
    word-wrap: break-word;
    font-family: 'VT323', monospace;
    font-size: 14px;
}

/* Custom scrollbar for retro styling */
.console-history::-webkit-scrollbar {
    width: 6px;
}
.console-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
.console-history::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.console-input-row {
    display: flex;
    align-items: center;
    border-top: 2px solid #4a4a4f;
    padding-top: 8px;
}

.console-prefix {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    color: #ffaa00;
    margin-right: 8px;
}

.console-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #4a4a4f;
    color: #ffffff;
    font-family: 'VT323', monospace;
    font-size: 16px;
    padding: 6px;
    outline: none;
}
.console-input:focus {
    border-color: #55ff55;
}

.console-log-cmd {
    color: #ffaa00;
}
.console-log-info {
    color: #ffffff;
}
.console-log-success {
    color: #55ff55;
}
.console-log-error {
    color: #ff5555;
}

/* 5. Alloy Furnace Custom Overlay Layout styles */
.furnace-inputs-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.alloy-plus-sign {
    font-family: var(--mc-font);
    font-size: 1.5rem;
    font-weight: bold;
    color: #404040;
    text-shadow: 1px 1px 0px #ffffff;
    user-select: none;
}
@keyframes pulse-fire {
    0% { box-shadow: inset 0 0 40px rgba(255, 69, 0, 0.5); }
    100% { box-shadow: inset 0 0 100px rgba(255, 69, 0, 0.95); }
}

