/* Estilo general para el contenedor del editor RPG */
#rpgmaker {
    font-family: Arial, sans-serif;
    background-color: #2c2c2c;
    color: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    position: relative;
}

#editor-container {
    display: flex;
    gap: 15px;
}

/* --- Controles de Partida --- */
#game-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    display: flex;
    gap: 10px;
}
#game-controls button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
#start-game-btn {
    background-color: #28a745;
    color: white;
}
#start-game-btn:hover {
    background-color: #218838;
}
#stop-game-btn {
    background-color: #dc3545;
    color: white;
}
#stop-game-btn:hover {
    background-color: #c82333;
}

/* --- CORRECCIÓN: Ocultar editor cuando el juego está activo --- */
.game-active #tools-column,
.game-active #map-editor-column {
    opacity: 0.3;
    pointer-events: none;
}


/* Estilos para las columnas */
#tools-column, #map-editor-column, #scene-column {
    background-color: #3a3a3a;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #4a4a4a;
    transition: opacity 0.5s;
}

#tools-column {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#map-editor-column {
    flex: 2;
}

#scene-column {
    flex: 3;
}

h2, h3 {
    color: #00aaff;
    border-bottom: 2px solid #00aaff;
    padding-bottom: 5px;
    margin-top: 0; display: none;
}

small {
    color: #aaa;
    font-style: italic;
    display: block;
    text-align: center;
}

/* Estilos para el selector de modo */
#mode-selector {
    display: flex;
    border: 1px solid #4a4a4a;
    border-radius: 5px;
    overflow: hidden;
}
#mode-selector button {
    flex: 1;
    padding: 10px;
    border: none;
    background-color: #2c2c2c;
    color: #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 12px;
}
#mode-selector button.active {
    background-color: #00aaff;
    font-weight: bold;
}
#mode-selector button:not(.active):hover {
    background-color: #4a4a4a;
}

/* Estilos del importador de assets */
#import-assets-btn {
    background-color: #00aaff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    transition: background-color 0.3s;
}

#import-assets-btn:hover {
    background-color: #0088cc;
}

#asset-list {
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    background-color: #2c2c2c;
    border: 1px solid #4a4a4a;
    padding: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.asset-item {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s;
}

.asset-item:hover, .asset-item.selected {
    border-color: #00aaff;
}
.asset-item.player-skin-selected {
    border-color: #28a745;
    box-shadow: 0 0 10px #28a745;
}

/* Preview de asset y skin */
.texture-preview {
    width: 100%;
    height: 128px;
    background-color: #2c2c2c;
    border: 1px solid #4a4a4a;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Canvas del mapa y 3D */
#map-canvas {
    background-color: #1e1e1e;
    border: 1px solid #4a4a4a;
    cursor: crosshair;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

#three-canvas-container {
    width:auto;
    height: 40dvh; 
    aspect-ratio: 16 / 9;
    position: relative;
    right: 0%;
    top: 0%;
    background-color: #1e1e1e;
    border: 1px solid #4a4a4a;
}

#three-canvas-container canvas {
    display: block;
}
