:root {
 /* --- TEMA DEFAULT (DARK) --- */
 --bg-dark: #1e1e1e;
 --bg-panel: #252526;
 --bg-header: #333333;
 --accent: #38bdf880;
 --text: #cccccc;
 --border: #3e3e42;
 --input-bg: #3c3c3c;
 --input-hover: #505050;
}

/* --- TEMA WHITE --- */
body.theme-white {
 --bg-dark: #f0f2f5;
 --bg-panel: #ffffff;
 --bg-header: #e4e6eb;
 --accent: lightgray;
 --text: #050505;
 --border: #ccc;
 --input-bg: #ffffff;
 --input-hover: #f2f2f2;
}

/* --- TEMA PASTEL --- */
body.theme-pastel {
 --bg-dark: #fdf6e3;
 --bg-panel: #eee8d5;
 --bg-header: #e6dfc8;
 --accent: #ff62ae80;
 --text: #586e75;
 --border: #d6d1bc;
 --input-bg: #fdf6e3;
 --input-hover: #ece6d3;
}

/* --- TEMA DARK BLUE --- */
body.theme-darkblue {
 --bg-dark: #0f172a;
 --bg-panel: #1e293b;
 --bg-header: #0f172a;
 --accent: #38bdf880;
 --text: #e2e8f0;
 --border: #334155;
 --input-bg: #1e293b;
 --input-hover: #334155;
}

/* --- TEMA WINDOWS XP --- */
body.theme-winxp {
 --bg-dark: #ece9d8;
 --bg-panel: #ffffff;
 --bg-header: #0058e6; /* Azul XP */
 --accent: #316ac5;
 --text: #000000;
 --border: #003399;
 --input-bg: #ffffff;
 --input-hover: #e0e8f3;
}
body.theme-winxp #top-bar {
 background: linear-gradient(to bottom, #0058e6 0%, #3a93ff 5%, #2881fc 10%, #0058e6 100%);
 border-bottom: 2px solid #003399;
 color: white;
}
body.theme-winxp .tab-btn { color: white; }
body.theme-winxp .tab-btn.active { color: black; border-bottom: 2px solid #e58200; } /* Naranja XP */
body.theme-winxp .icon-btn { color: white; }
body.theme-winxp .filename-wrapper { background: #ffffff; color: black; }
body.theme-winxp #filename-display { color: black; }
body.theme-winxp .ribbon-group-label { color: #000; font-weight: bold; }

body {
 margin: 0;
 background-color: #1a1a1a;
 color: var(--text);
 height: 100vh;
 display: flex;
 flex-direction: column;
 font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
 overflow: hidden;
 transition: background-color 0.3s, color 0.3s;
}

/* --- TOP BAR --- */
#top-bar {
 background-color: var(--bg-header);
 height: 35px;
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 0 10px;
 border-bottom: 1px solid var(--border);
 z-index: 30; /* Encima de todo */
 position: relative;
}

.app-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

.left-group, .right-group {
 display: flex;
 align-items: center;
 gap: 8px;
}

.icon-btn {
 background: transparent;
 border: 1px solid transparent;
 color: var(--text);
 cursor: pointer;
 padding: 2px 8px;
 font-size: 14px;
 border-radius: 3px;
 display: flex;
 align-items: center;
 gap: 5px;
}

.icon-small {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
    vertical-align: middle;
}

.icon-btn:hover {
 background-color: rgba(128, 128, 128, 0.2);
}

.separator {
 width: 1px;
 height: 18px;
 background-color: var(--border);
}

.filename-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--bg-header); 
    border: 2px solid var(--bg-header); /* ✨ Borde del mismo color que el fondo */
    padding: 2px 5px;
    height: 28px;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease; /* Transición para ambos */
}

/* ✨ Efecto al pasar el ratón */
.filename-wrapper:hover {
    background-color: var(--input-bg);
    border-color: var(--input-bg); /* ✨ El borde acompaña al nuevo fondo */
}

#filename-display {
 background: transparent;
 border: none;
 color: var(--text);
 font-family: inherit;
 width: 100%;
 outline: none;
 text-align: left;
 padding-left: 5px;
}

.extension {
 opacity: 0.6;
 font-weight: bold;
 pointer-events: none;
}

/* --- RIBBON (PESTAÑAS) --- */
#ribbon {
 background-color: var(--bg-panel);
 border-bottom: 1px solid var(--border);
 display: flex;
 flex-direction: column;
 z-index: 20; /* Encima de sidebar */
 position: relative;
}

.tabs {
 display: flex;
 background-color: var(--bg-header);
 padding-top: 5px;
}

/* Ancho dinámico para pestañas */
.tab-btn {
 background: transparent;
 border: none;
 color: var(--text);
 padding: 6px 15px;
 width: auto; 
 text-align: center;
 cursor: pointer;
 font-size: 12px;
 border-top-left-radius: 3px;
 border-top-right-radius: 3px;
 transition: background-color 0.2s;
}

.tab-btn.active {
 background-color: var(--bg-panel);
 font-weight: bold;
}

.tab-btn.disabled {
 opacity: 0.5;
 cursor: default;
}
.tab-btn.disabled:hover {
 background-color: transparent;
}

/* MODIFICADO: Altura aumentada para estilo Word */
.tab-content {
 height: 85px; 
 padding: 5px 10px;
 display: flex;
 align-items: stretch; /* Estirar para que los grupos ocupen todo el alto */
 background-color: var(--bg-panel);
 gap: 5px;
}

.tab-pane {
 display: none;
 width: 100%;
 height: 100%;
}

/* --- Ajuste específico para separadores en la Ribbon --- */
.tab-pane .separator {
    height: 85px;       /* Altura mayor (el contenedor mide 85px) */
    align-self: center; /* Centrado verticalmente (ignora el estiramiento del padre) */
    background-color: rgba(128, 128, 128, 0.4); /* Opcional: un poco más visible */
}

.tab-pane.active {
 display: flex;
 align-items: stretch;
 gap: 5px;
}

/* --- ESTILOS DE GRUPOS RIBBON (TIPO WORD) --- */
.ribbon-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    height: 100%;
    background: transparent;
}

.ribbon-group-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-grow: 1; /* Ocupa el espacio superior */
    justify-content: center;
}

.ribbon-group-label {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin-top: 2px;
    padding-top: 2px;
    width: 100%;
	user-select: none;
}

/* Botón Grande (Pegar) */
.ribbon-btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60px;
    min-width: 45px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    cursor: pointer;
    border-radius: 3px;
    gap: 2px;
	font-size: 12px;
	line-height: 1;
}
.ribbon-btn-large .icon {
  font-size: 28px;
}

/* Estilo para cuando el botón Spray (o cualquier botón grande) está activo */
.ribbon-btn-large.active {
    background-color: #a0a0a0; /* Fondo más oscuro */
    border: 2px inset #fff;    /* Borde hundido */
    box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4); /* Sombra interior */
}

/* Ajuste para que la imagen pixel art se vea bien */
.ribbon-btn-large .pixel-icon {
    display: block;
    image-rendering: pixelated;
}

/* NUEVO: Clase para la imagen dentro del botón de la Ribbon */
.icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-bottom: 2px;
    image-rendering: pixelated;
	cursor: unset;
}

/* Columna de botones pequeños (Cortar/Copiar) */
.ribbon-btn-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ribbon-btn-small {
    display: flex;
    align-items: center;
    gap: 5px;

    height: 24px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    text-align: left;
}
.ribbon-btn-small:hover {
    background-color: #999; /* Un poco más claro */
    border: 1px solid #FFF; /* El borde blanco que querías */
    cursor: pointer;
}


/* --- SIDEBAR (HERRAMIENTAS FLOTANTE) --- */
#toolbar-sidebar {
 position: absolute;
 top: 218px; /* Ajustado para estar debajo de la cinta (TopBar + Ribbon ~153px) */
 left: 15px; /* Separación del borde izquierdo */
 bottom: auto; /* IMPORTANTE: Ya no se estira hasta abajo */
 height: auto; /* La altura se ajusta al contenido de los botones */
 width: 44px;  /* Ancho compacto */
 
 /* Estética Flotante */
 background-color: var(--bg-panel);
 border: 1px solid var(--border);
 border-radius: 8px; /* Bordes redondeados */
 box-shadow: 0 4px 15px rgba(0,0,0,0.5); /* Sombra para dar efecto de elevación */
 
 display: flex;
 flex-direction: column; /* Asegura 1 sola columna vertical */
 align-items: center;
 padding: 4px 0; /* Relleno superior e inferior */
 z-index: 100; /* Asegura que flote sobre el canvas */
}

/* Ajuste de los botones para que encajen mejor en la barra flotante */
.tool-btn {
 width: 36px; /* Ligeramente más pequeños para estética compacta */
 height: 36px;
 background: transparent;
 border: 1px solid transparent;
 color: var(--text);
 cursor: pointer;
 border-radius: 8px; /* Coincidir con el estilo redondeado */
 font-size: 22px; /* AUMENTADO SEGÚN PETICIÓN */
 display: flex;
 justify-content: center;
 align-items: center;
 margin-bottom: 2px;
}

.tool-btn:hover {
 background-color: rgba(128,128,128,0.2);
}

.tool-btn.active {
 background-color: var(--accent);
 color: white;
 
 border: 1px solid rgba(255,255,255,0.3);
}

/* --- WORKSPACE (LIENZO COMPLETO) --- */
#workspace {
 position: absolute;
 top: 195px; /* ✨ ACTUALIZADO: Antes era 167. Sumamos la barra de mundos */
 left: 0; 
 width: 100%; 
 bottom: 0;
 background-color: #1a1a1a;
 overflow: hidden;
}

canvas {
 display: block;
 image-rendering: pixelated;
 outline: none;
 width: 100%;
 height: 100%;
}

/* --- OVERLAYS --- */
#coords-overlay {
 position: absolute;
 top: 0px;
 left: 85px;
 font-family: 'Consolas', 'Courier New', monospace;
 font-size: 24px;
 color: white;
 text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
 pointer-events: none;
 z-index: 10;
}

/* ZOOM TRANSPARENTE CON SOMBRA */
#zoom-floating {
 position: absolute;
 bottom: 10px;
 right: 20px;
 background: transparent; 
 padding: 0px 0px;
 display: flex;
 align-items: center;
 gap: 10px;
 color: white;
 font-size: 12px;
 z-index: 10;
 text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
 transition: right 0.3s ease-in-out; /* ✨ NUEVO: Animación de deslizamiento suave */
}

#zoom-floating input[type=range] {
 cursor: pointer;
 width: 120px;
 box-shadow: 0 0 5px rgba(0,0,0,0.8);
 border-radius: 5px;
}

/* --- CONSOLA --- */
#console-overlay {
 display: none;
 position: absolute;
 bottom: 20px;
 left: 20px;
 pointer-events: none;
 z-index: 20;
 display: flex;
 flex-direction: column;
}

#console-suggestion {
 color: #aaa;
 background: rgba(0,0,0,0.6);
 padding: 2px 5px;
 border-radius: 3px;
 font-family: 'Consolas', monospace;
 font-size: 12px;
 margin-bottom: 2px;
 pointer-events: auto;
}

#console-input {
 pointer-events: auto;
 background-color: rgba(0, 0, 0, 0.8);
 color: #ffffff;
 font-family: 'Consolas', monospace;
 border: 1px solid #555;
 padding: 8px;
 width: 300px;
 font-size: 14px;
 border-radius: 4px;
 box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* --- MODALES --- */
.modal {
 display: none;
 position: fixed;
 z-index: 100;
 left: 0;
 top: 0;
 width: 100%;
 height: 100%;
 background-color: rgba(0,0,0,0.5);
 backdrop-filter: blur(2px);
}

@keyframes retroModalOpen {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-content {
 background-color: var(--bg-panel);
 color: var(--text);
 margin: 1.5% auto;
 padding: 20px;
 border: 1px solid var(--border);
 width: 600px;
 max-width: 90vw;

 overflow-y: auto;
 border-radius: 5px;
 box-shadow: 0 4px 15px rgba(0,0,0,0.5);
 animation: retroModalOpen 0.15s cubic-bezier(0.25, 1, 0.25, 1);
}

.close-modal {
 color: var(--text);
 float: right;
 font-size: 28px;
 font-weight: bold;
 cursor: pointer;
 opacity: 0.7;
}

.close-modal:hover {
 opacity: 1;
}

/* Logros en 2 Columnas */
#achievements-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

#achievements-list label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;

    text-overflow: ellipsis;
}

#achievements-list label:hover {
 background-color: rgba(128, 128, 128, 0.1);
 border-radius: 4px;
}

.modal-actions {
 margin-bottom: 10px;
 padding-bottom: 4px;
 display: flex;
 gap: 10px;
}

.settings-row {
 margin-bottom: 15px;
}
.settings-row label {
 display: block;
 margin-bottom: 5px;
 font-weight: bold;
}
.settings-row select {
 width: 100%;
 padding: 8px;
}

/* MODAL SAVE - DISEÑO HORIZONTAL Y TEXTOS NEGROS */
#save-structure-modal .modal-content { width: 500px; background: #C6C6C6; border: 2px solid #555; padding: 15px; display: flex; flex-direction: column; gap: 10px; }
#struct-save-preview { width: 460px; height: 295px; background: #8B8B8B; border: 2px solid #373737; margin: 0 auto; display: block; image-rendering: pixelated; }

.save-form-row { 
    display: flex; 
    flex-direction: row; /* Horizontal */
    align-items: center; /* Centrado vertical */
    margin-bottom: 5px;
}
.save-form-row label { 
    width: 100px; /* Ancho fijo para la etiqueta a la izquierda */
    text-align: right; 
    font-size: 12px; 
    font-weight: bold; 
    color: #000; /* Texto Negro */
    margin-right: 15px; 
}
.save-form-row input, .save-form-row select { 
    flex: 1; /* Ocupa el resto del espacio a la derecha */
    padding: 5px; 
    border: 2px solid #555; 
    background: #FFF; 
    font-family: inherit; 
}

.save-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
/* --- BOTÓN VERDE (Guardar / Yes) --- */
.btn-confirm-save, .btn-yes {
  background: #4CAF50;
  color: white;
  border: 2px solid #2E7D32;
  cursor: pointer;
}
.btn-confirm-save:hover, .btn-yes:hover {
  background: #66BB6A; /* Un verde un poco más claro al pasar el mouse */
}

.btn-cancel, .btn-no {
  background: #d32f2f;
  color: white;
  border: 2px solid #b71c1c;
  cursor: pointer;
}
.btn-cancel:hover, .btn-no:hover {
  background: #e53935; /* Un rojo un poco más claro al pasar el mouse */
}

/* UI GENERAL */
select, button, .input-group input {
 background: var(--input-bg);
 color: var(--text);
 border: 1px solid var(--border);
 padding: 5px 2px;
 font-family: inherit;
 outline: none;
}

button:hover { 
 background: var(--input-hover); 
 cursor: pointer;
}

.input-group {
 display: flex;
 align-items: center;
}



/* --- ESTILOS DE DIMENSIONES MODIFICADOS --- */
.dimensions-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
}

.dim-item {
    background: #555;
    border: 2px solid #333;
    width: 120px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.dim-item:hover {
    background: #666;
    border-color: #FFF;
    transform: translateY(-2px);
}

/* Modificado para soportar etiquetas IMG */
.dim-preview {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
    border: 2px solid #222;
    background-color: #000; /* Fondo negro por si la imagen tiene transparencia */
    image-rendering: pixelated;
    object-fit: cover; /* Ajuste para la imagen */
}

.dim-name {
    color: white;
    font-weight: bold;
    font-size: 12px;
}


/* --- Estilos para Botones de Estructuras Rápidas --- */
.quick-struct-btn {
    width: 66px;
    height: 66px;
    padding: 0px;
    border: 1px solid #555;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

/* Efecto Hover: Borde blanco */
.quick-struct-btn:hover {
    border: 2px solid lightgray;
    background: var(--input-hover);
}

/* Efecto Activo (Seleccionado): Hundido y más oscuro */
.quick-struct-btn.active {
    background: #666; /* Más oscuro */
    border: 4px inset #FFF; /* Borde hundido */

}

/* Estilo para slots vacíos */
.quick-struct-btn.empty-slot {
    background: #444;
    cursor: default;
    opacity: 0.5;
    border: 1px solid #333;
}
.quick-struct-btn.empty-slot:hover {
    border: 1px solid #333; /* Sin efecto hover si está vacío */
    background: #444;
}


/* --- CORRECCIÓN: ALTURA MODAL CONFIRMACIÓN --- */
#custom-confirm-modal .modal-content {
    height: auto !important;       /* Permite crecer según el contenido */
	weight: 350px;
    min-height: 160px;             /* Altura mínima para que no se vea aplastado */
    display: flex;
    flex-direction: column;
}

#custom-confirm-modal .mbw-modal-body {
    flex: 1;                       /* Ocupa el espacio disponible */
    display: flex;
    flex-direction: column;
    justify-content: center;       /* Centra verticalmente el texto y botones */
    align-items: center;
    padding: 20px 10px;            /* Espaciado interno */
}

/* Asegurar que los botones tengan espacio */
#custom-confirm-modal .confirm-actions {
    margin-top: 20px;
    width: 100%;
    justify-content: center;
}



/* --- ESTILOS DE ESTRUCTURAS (LIBRARY) --- */
.struct-item {
    background: #555;
    border: 2px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;

}

/* Efecto al pasar el ratón */
.struct-item:hover {
    background: #666;
    border-color: #FFF;

}

/* Efecto cuando está seleccionada */
.struct-item.selected {
    background: #777;
    border-color: #FFD700; /* Dorado */

}



/* --- TOOLTIP DE INVENTARIO FLOTANTE (WORKSPACE) --- */
#chest-tooltip-overlay {
        position: absolute;
        z-index: 1500;

        padding: 8px; /* Espacio para que el mouse entre fácilmente */

        border-radius: 4px;
        pointer-events: auto; /* Permite que el mouse interactúe con el panel */
    }

#chest-tooltip-grid {
    display: grid;
    grid-template-columns: repeat(9, 24px); /* Fijo a 24px por slot */
    gap: 0px 2px;
    background: #8B8B8B;
    padding: 0px 4px 0px 0px;
    border: 2px inset #555;
}

.chest-tooltip-slot {
    width: 32px;
    height: 32px;
    background: #8B8B8B;
    border: 2px inset #FFF;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.chest-tooltip-slot canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}


/* Borde morado para el slot encantado */
.struct-chest-preview .slot.enchanted {
    border: 2px solid #a200ff; /* Color morado de encantamiento */
    box-shadow: 0 0 8px #a200ff inset; /* Brillo interno opcional */
    position: relative;
    overflow: hidden;
}

/* Efecto de brillitos animado */
.struct-chest-preview .slot.enchanted::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 2px),
        radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 2px);
    background-size: 15px 15px;
    background-position: 0 0, 7px 7px;
    animation: sparkles 2s linear infinite;
    pointer-events: none; /* Para que no bloquee los clics en el ítem */
    opacity: 0.6;
    z-index: 2;
}

@keyframes sparkles {
    0% { background-position: 0 0, 7px 7px; opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { background-position: 0 15px, 7px 22px; opacity: 0.3; }
}

/* Estilo básico para el tooltip de los encantamientos */
.struct-chest-preview .slot .tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(16, 0, 30, 0.95);
    color: #fff;
    padding: 6px 10px;
    border: 1px solid #5a00a3;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    font-size: 12px;
    pointer-events: none;
    text-align: center;
}

.struct-chest-preview .slot:hover .tooltip {
    visibility: visible;
}

/* Color específico para el texto del encantamiento */
.tooltip-enchant {
    color: #ffaa00; /* Color dorado/naranja clásico o puedes usar #a200ff */
    display: block;
}



/* Estilo general para el título del ítem en el tooltip */
.enchant-tooltip strong {
    color: #fff;
    font-size: 24px;
    display: block;
    margin-bottom: 4px;
    line-height: 1;
}

/* Estilo para cada línea de encantamiento */
.tooltip-enchant {
    color: #ffaa00;
    display: block;
    line-height: 1.1;
    margin-top: 2px;
}



/* --- WORLD TABS (Estilo Photoshop) --- */
#world-tabs {
    display: flex;
    flex-direction: row;
    background-color: var(--bg-dark); /* Fondo oscuro del editor */
    padding: 4px 8px 0 8px; /* Espacio arriba y a los lados */
    gap: 2px;
    overflow-x: auto; /* Scroll si hay muchas pestañas */
    border-bottom: 1px solid var(--border);
}

/* Ocultar la barra de scroll en las pestañas */
#world-tabs::-webkit-scrollbar { height: 4px; }
#world-tabs::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

.world-tab {
    display: flex;
    align-items: center;
    background-color: #2d2d2d; /* Color de pestaña inactiva */
    color: #999;
    padding: 6px 12px;
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
    cursor: pointer;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    max-width: 180px;
    min-width: 100px;
    border: 1px solid transparent;
    border-bottom: none;
    user-select: none;
    transition: background-color 0.2s;
}

.world-tab:hover {
    background-color: #383838;
    color: #ccc;
}

/* Pestaña Activa: Se fusiona con el panel de abajo */
.world-tab.active {
    background-color: var(--bg-panel);
    color: var(--text);
    border-color: var(--border);
    position: relative;
    z-index: 25;
    margin-bottom: -1px; /* Para tapar el borde inferior */
    border-bottom: 1px solid var(--bg-panel);
}

.world-tab-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
    pointer-events: none; /* Para que el clic vaya al tab */
}

.world-tab-close {
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.5;
    transition: all 0.2s;
}

.world-tab-close:hover {
    background-color: #c42b1c; /* Rojo estilo cierre de ventana */
    color: white;
    opacity: 1;
}


/* Estado Bloqueado (Conflicto de nivel) */
.enchant-option.disabled-enchant {
    background-color: #666 !important;
    border: 2px solid #444 !important;
    color: #aaa !important;
    pointer-events: none; /* Bloquea el clic */
    filter: grayscale(100%);
    box-shadow: none;
    transform: none; /* Evita que se haga grande al pasar el ratón */
}



/* --- CUSTOM ITEMS CREATOR --- */
.enchant-option {
    background-color: #FFEFAD; /* Amarillo mostaza pastel */
    border: 2px solid #CFC07C; /* Borde mostaza */
    color: #333;
    padding: 6px 10px;
    font-family: 'Eight Bit Dragon', monospace;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: none !important;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.enchant-option:hover {
    transform: scale(1.05);
	transition: none !important;
}





/* Estilo unificado para el Tooltip Mágico Flotante */
.enchant-tooltip-floating {
    position: fixed;
    z-index: 9999999 !important; /* Por encima de todo */
    background-color: rgba(16, 0, 16, 0.9) !important; /* Fondo oscuro y sutil */
    border: 2px solid #2e0066 !important; /* Borde morado oscuro */
    border-image: linear_gradient(to bottom, #2e0066, #160033) 1; /* Efecto de degradado en el borde */
    color: #a0a0a0 !important; /* Texto gris claro por defecto */
    font-family: 'Pixeltype', sans-serif !important; /* Tu fuente pixel art */
    font-size: 20px !important;
    padding: 8px 12px !important;
    pointer-events: none; /* No interfiere con los clics */
    white-space: nowrap; /* Evita que el texto se parta en varias líneas */
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5); /* Sombra nítida estilo Minecraft */
    display: none; /* Oculto por defecto */
}

/* Estilo para el título dorado dentro del tooltip */
.enchant-tooltip-floating strong {
    color: #ffaa00 !important; /* Dorado/Amarillo Minecraft */
    display: block;
    margin-bottom: 4px;
}


/* --- NOTICIAS --- */
.news-card {
    background: #8B8B8B; border: 2px outset #FFF; padding: 10px; 
    margin-bottom: 10px; cursor: pointer; display: flex; gap: 15px; align-items: center;
}
.news-card:hover { background: #A0A0A0; }
.news-card img { width: 80px; height: 80px; object-fit: cover; border: 2px inset #FFF; }

/* Animación de alerta (Brillo dorado) */
.news-unread { animation: glowNews 1.5s infinite alternate; }
@keyframes glowNews { 
    0% { box-shadow: 0 0 5px #ffaa00; background-color: #ffaa0033; border-color: #ffaa00; } 
    100% { box-shadow: 0 0 15px #ff0000; background-color: #ff000055; border-color: #ff0000; } 
}


/* --- BOTÓN FLOTANTE "BACK" (SECCIÓN NOTICIAS) --- */
#news-back-btn {
    position: absolute; 
    top: 8px; 
    left: 8px; 
    border: 2px outset #FFF; 
    background: rgba(139, 139, 139, 0.9); 
    color: #000; 
    font-weight: bold; 
    cursor: pointer; 
    padding: 5px 10px; 
    z-index: 10; 
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    transition: background 0.2s ease, transform 0.1s ease; /* Transición suave */
}

/* Efecto al pasar el ratón por encima (Hover) */
#news-back-btn:hover {
    background: rgba(255, 255, 255, 0.9); /* Se vuelve más claro/blanco */
    color: #000;
}

/* Efecto al hacer clic (Active) */
#news-back-btn:active {
    border: 2px inset #FFF; /* Cambia el borde para que parezca hundido */
    background: rgba(100, 100, 100, 0.9); /* Se oscurece */
    transform: translateY(2px); /* Baja 2 píxeles para dar peso */
    box-shadow: 0px 0px 2px rgba(0,0,0,0.5);
}


/* --- GALERÍA DE NOTICIAS (3 por fila) --- */
.news-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* ⬅️ ESTA ES LA MAGIA: 3 columnas exactas */
    gap: 10px;
    margin-top: 15px;
    padding: 10px 5px;
}

.news-gallery-img {
    width: 100%; /* Hace que la imagen llene su tercio de la pantalla */
    height: 100px;
    object-fit: cover;
    border: 2px solid #555;
    cursor: zoom-in;
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out;
    image-rendering: auto; /* Mantiene las fotos reales nítidas */
}

.news-gallery-img:hover {
    border-color: #FFF;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    z-index: 10; /* Evita que al crecer se quede por debajo de otra imagen */
}

/* --- VISOR DE IMAGEN A PANTALLA COMPLETA (LIGHTBOX) --- */
#lightbox-modal {
    display: none;
    position: fixed;
    z-index: 99999; /* Por encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
}

#lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border: 4px solid #FFF;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    image-rendering: pixelated;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 2px 2px 0 #000;
}
.lightbox-close:hover { color: #FFD700; }


/* --- ESTILO DE VIÑETAS PIXELADAS PARA LAS NOTICIAS --- */
.pixel-list {
    list-style: none; /* Quitamos los círculos redondos por defecto */
    padding-left: 20px;
    margin-top: 5px;
}

/* --- ESTILO PARA ETIQUETAS TIPO CÓDIGO [Beta] --- */
.code-tag {
    background-color: gray;
    color: white; /* Un verde estilo consola/Matrix */
    font-family: 'Consolas', monospace;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #444;
    font-size: 12px;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5);
}

.pixel-list li {
    position: relative;
    margin-bottom: 8px;
    font-size: 14px;
    color: #000;
}

/* Dibujamos un pequeño bloque cuadrado como viñeta */
.pixel-list li::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 5px;
    width: 6px;
    height: 6px;
    background-color: #8B8B8B;
    border: 2px solid #373737;
    box-sizing: border-box;
}


/* --- ANIMACIÓN PARA NOTICIAS NO LEÍDAS --- */
@keyframes newsPulse {
    0% { background-color: #8B8B8B; border-color: #FFF; }
    50% { background-color: #4AF626; border-color: #222; color: #000; }
    100% { background-color: #8B8B8B; border-color: #FFF; }
}

.news-unread {
    animation: newsPulse 1.5s infinite;
    /* Forzamos el borde para que destaque más cuando parpadea */
    border: 2px outset #FFF !important; 
}


/* --- FILTROS DE CLIMA PARA EL MUNDO --- */
#canvas {
    transition: filter 1.5s ease-in-out; 
}

/* Filtro para Lluvia Normal (Más grisáceo) */
.canvas-raining {
    filter: brightness(0.65) saturate(0.60); 
}

/* ✨ NUEVO: Filtro para Tormenta (Tus valores exactos) ✨ */
.canvas-thunder {
    filter: brightness(0.33) saturate(0.99); 
}


/* ✨ ESTILOS DEL BOTÓN WORLD INFO ✨ */
#btn-world-info {
    background-color: var(--bg-header);
}

/* El efecto hover SOLO funcionará si el botón NO está deshabilitado */
#btn-world-info:not(:disabled):hover {
    background-color: var(--bg-panel);
}


/* Botones compactos para el Quick Access de Mobs */
.quick-mob-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: background 0.2s, border 0.2s;
}

.quick-mob-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
}