/* THE ORACLE - CSS Mejorado (basado en style2.css) */
/* Fuente legible + Burbujas de diálogo + Tamaños ajustados */

:root {
    --main-green: #0f0;
    --main-purple: #ff00ff;
    --dark-red: #800000;
    --bright-red: #ff0000;
    --background-dark: #000;
    --background-medium: #111;
    --text-light: #fff;
    --text-dark: #000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--background-dark);
    color: var(--text-light);
    font-family: Arial, sans-serif; /* Fuente legible */
    margin: 0;
    overflow: hidden;
    font-size: 14px; /* Tamaño base ajustado */
}

#arcade-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border: 5px solid var(--main-green);
    border-radius: 15px;
    box-shadow: 0 0 20px var(--main-green), inset 0 0 20px var(--main-green);
    background-color: var(--background-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
}

.hidden {
    display: none !important;
}

/* === BOTONES === */
button {
    font-family: Arial, sans-serif;
    padding: 10px 15px; /* Reducido para ajustar */
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 5px;
    border: 3px solid;
    transition: all 0.2s;
    width: 100%;
    font-size: 0.75em; /* Tamaño ajustado */
    font-weight: bold;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none !important;
    background-color: #222 !important;
    color: #555 !important;
    border-color: #555 !important;
}

.button-green {
    background-color: #222;
    color: var(--main-green);
    border-color: var(--main-green);
    box-shadow: 0 0 10px var(--main-green);
}

.button-green:hover:not(:disabled) {
    background-color: var(--main-green);
    color: var(--background-dark);
}

.button-red {
    background-color: #222;
    color: var(--bright-red);
    border-color: var(--bright-red);
    box-shadow: 0 0 10px var(--bright-red);
}

.button-red:hover:not(:disabled) {
    background-color: var(--bright-red);
    color: var(--background-dark);
}

.button-purple {
    background-color: #222;
    color: var(--main-purple);
    border-color: var(--main-purple);
    box-shadow: 0 0 10px var(--main-purple);
}

.button-purple:hover:not(:disabled) {
    background-color: var(--main-purple);
    color: var(--background-dark);
}

/* === PANTALLA DE TÍTULO === */
#title-screen {
    justify-content: center;
    align-items: center;
}

#lightning-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--text-light);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
}

#title-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

#title-brain {
    font-size: 80px; /* Reducido */
    filter: drop-shadow(0 0 20px var(--main-purple));
    margin-bottom: 15px;
}

#game-title {
    position: relative;
    font-size: 2em; /* Reducido */
    color: var(--main-green);
    text-shadow: 0 0 5px var(--text-light), 0 0 10px var(--text-light), 0 0 20px var(--main-green), 0 0 30px var(--main-green);
    margin: 0 0 30px 0;
    text-align: center;
    line-height: 1.2;
    font-weight: bold;
}

#title-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 80%;
    max-width: 300px;
}

/* === PANTALLA DE JUEGO === */
#main-game-screen {
    padding: 8px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    border-bottom: 2px solid var(--main-green);
    flex-shrink: 0;
    min-height: 35px; /* Altura fija */
}

#back-to-menu-button {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--main-green);
    font-size: 0.7em;
    padding: 5px;
    width: auto;
}

/* === CHAT HISTORY CON BURBUJAS === */
#chat-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Reducido */
    max-height: calc(100vh - 200px); /* Ajustado para que quepa */
}

/* Scrollbar personalizado */
#chat-history::-webkit-scrollbar {
    width: 6px;
}

#chat-history::-webkit-scrollbar-track {
    background: #111;
}

#chat-history::-webkit-scrollbar-thumb {
    background: var(--main-green);
    border-radius: 3px;
}

.message-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
    animation: fade-in 0.5s;
    line-height: 1.6;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    font-size: 20px; /* Reducido */
    flex-shrink: 0;
}

/* Burbujas de diálogo */
.message-bubble {
    padding: 10px 12px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 0.85em;
    line-height: 1.5;
}

/* Burbuja del Oráculo (morado) */
.message-line-brain .message-bubble {
    background-color: rgba(255, 0, 255, 0.2);
    border: 2px solid var(--main-purple);
    color: var(--main-purple);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

/* Burbuja del Jugador (verde) */
.message-line-player .message-bubble {
    background-color: rgba(0, 255, 0, 0.2);
    border: 2px solid var(--main-green);
    color: var(--main-green);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* Burbuja del Sistema (gris) */
.message-line-system .message-bubble {
    background-color: rgba(136, 136, 136, 0.2);
    border: 2px solid #888;
    color: #ccc;
    font-style: italic;
}

/* Nombre del emisor */
.message-sender {
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 0.9em;
}

/* === CONTROLES === */
.player-controls {
    padding-top: 8px;
    border-top: 2px solid var(--main-green);
    flex-shrink: 0;
}

.input-area {
    display: flex;
    width: 100%;
    margin-bottom: 8px;
    gap: 8px;
}

#user-question-input {
    flex-grow: 1;
    background-color: #222;
    border: 2px solid var(--main-green);
    color: var(--text-light);
    padding: 8px;
    font-family: Arial, sans-serif;
    font-size: 0.85em;
    border-radius: 5px;
    box-shadow: 0 0 10px var(--main-green);
}

#user-question-input:focus {
    outline: none;
    box-shadow: 0 0 15px var(--main-green);
}

#ask-button {
    width: 45px;
    height: 45px;
    padding: 8px;
    flex-shrink: 0;
    background-color: #222;
    fill: var(--main-green);
    border: 3px solid var(--main-green);
    border-radius: 5px;
    box-shadow: 0 0 10px var(--main-green);
}

#ask-button:hover:not(:disabled) {
    background-color: var(--main-green);
    fill: var(--background-dark);
}

#ask-button svg {
    width: 100%;
    height: 100%;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.action-buttons > button {
    flex-grow: 1;
    font-size: 0.7em;
    padding: 10px 5px;
}

/* === POP-UPS === */
.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    padding: 20px;
}

.popup-content {
    background-color: var(--background-medium);
    border: 3px solid var(--main-purple);
    box-shadow: 0 0 20px var(--main-purple);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 95%;
    max-width: 400px;
    animation: fade-in 0.3s;
    max-height: 80vh;
    overflow-y: auto;
}

/* === LISTA DE SUGERENCIAS === */
#suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-item {
    background-color: #222;
    border: 2px solid #0f0;
    color: #0f0;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 0.8em;
    border-radius: 5px;
}

.suggestion-item:hover {
    background-color: #0f0;
    color: #000;
    box-shadow: 0 0 10px #0f0;
}

.suggestion-item:active {
    transform: scale(0.98);
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    body {
        font-size: 12px;
    }
    
    #title-brain {
        font-size: 60px;
    }
    
    #game-title {
        font-size: 1.5em;
    }
    
    .message-bubble {
        font-size: 0.8em;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons > button {
        font-size: 0.75em;
    }
}

/* === UTILIDADES === */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}
