:root {
    --bg: #121213;
    --text: #ffffff;
    --correct: #538d4e;
    --absent: #3a3a3c;
    --border: #3a3a3c;
    --filled: #565758;
    --key-bg: #818384;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Arial', sans-serif;
    margin: 0;
    user-select: none;
    overflow-x: hidden;
}

.main-layout { display: flex; justify-content: center; min-height: 100vh; }
.hidden { display: none !important; }

/* ANUNCIOS */
.ad-sidebar { width: 160px; background: #1a1a1b; display: none; margin: 10px; border: 1px dashed #444; align-items: center; justify-content: center; color: #555; }
.ad-banner { width: 100%; height: 90px; background: #1a1a1b; display: flex; align-items: center; justify-content: center; margin: 10px 0; border: 1px dashed #444; color: #555; }
@media (min-width: 1000px) { .ad-sidebar { display: flex; } }

/* CENTRO */
.game-center { flex: 0 1 500px; display: flex; flex-direction: column; padding: 0 10px; width: 100%; align-items: center; }

header { text-align: center; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 20px; width: 100%; }

/* ESTILO DEL LOGO */
.game-logo {
    display: block;
    margin: 0 auto;
    max-width: 100%;  /* Se adapta al móvil */
    width: 350px;     /* Tamaño base ideal */
    height: auto;
}

/* GRID INTENTOS (6x5) */
#guess-grid-container {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 20px;
    padding: 10px;
}
.guess-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}
.tile {
    width: 48px; height: 48px;
    border: 2px solid var(--border);
    display: flex; justify-content: center; align-items: center;
    font-size: 1.8rem; font-weight: bold; text-transform: uppercase;
    box-sizing: border-box;
    transition: transform 0.6s;
}
.tile[data-state="active"] { border-color: var(--filled); animation: pop 0.1s; }
.tile.correct { background-color: var(--correct); border-color: var(--correct); animation: flipIn 0.5s forwards; }
.tile.absent { background-color: var(--absent); border-color: var(--absent); animation: flipIn 0.5s forwards; }

/* FRASE */
#phrase-board {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px; width: 100%;
}
.word-group { display: flex; gap: 3px; margin-bottom: 5px; }
.phrase-tile {
    width: 30px; height: 30px;
    border: 2px solid var(--filled);
    border-radius: 4px;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.1rem; font-weight: bold;
    color: white; 
}
.phrase-tile.revealed {
    background-color: var(--correct);
    border-color: var(--correct);
    animation: bounceReveal 0.6s forwards;
}

/* TECLADO */
#keyboard-container { width: 100%; margin-top: auto; max-width: 500px; }
.keyboard-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 6px; }
.key {
    background: var(--key-bg); color: white; font-weight: bold; padding: 15px 0; flex: 1; border-radius: 4px;
    cursor: pointer; text-align: center; display: flex; justify-content: center; align-items: center;
}
#key-ENTER, #key-BACKSPACE { flex: 1.5; font-size: 0.8rem; }

/* FOOTER */
footer { text-align: center; margin-top: 20px; padding: 20px 0; border-top: 1px solid #333; width: 100%; }
.thanks-anim { color: #ff0055; font-weight: bold; font-size: 1.5rem; animation: pulseSlow 2.5s infinite ease-in-out; margin-bottom: 10px;}
.footer-links a { color: white; text-decoration: none; margin: 0 10px; border: 1px solid white; padding: 5px 10px; border-radius: 5px; font-size: 0.9rem; }

/* MODALES */
#interstitial-modal, #result-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
}
.ad-content { background: #222; padding: 20px; border-radius: 10px; text-align: center; width: 300px; border: 1px solid #444; }

.result-content { 
    background: #121213; border: 1px solid #555; padding: 20px; width: 90%; max-width: 450px; 
    text-align: center; position: relative; box-shadow: 0 0 20px rgba(0,0,0,0.8);
    max-height: 90vh; overflow-y: auto; 
}

.ad-multiplex {
    width: 100%; min-height: 250px; background-color: #1a1a1b; border: 1px dashed #444;
    display: flex; justify-content: center; align-items: center; color: #555; margin: 15px 0;
}

.fake-video-ad { height: 150px; background: black; display: flex; justify-content: center; align-items: center; margin: 10px 0; border: 1px solid #555; }
#close-ad-btn { background: #ff0055; border: none; padding: 10px; color: white; margin-top: 10px; cursor: pointer; border-radius: 5px; }
.close-btn { position: absolute; top: 10px; right: 15px; cursor: pointer; font-size: 24px; color: #aaa; z-index: 10; }

#play-again-btn {
    background-color: #538d4e; color: white; border: none; padding: 15px 20px;
    font-size: 1.1rem; font-weight: bold; margin-top: 10px; cursor: pointer; border-radius: 5px; width: 100%;
}
#play-again-btn:hover { background-color: #4a7a45; }

/* ANIMACIONES */
@keyframes pop { 50% { transform: scale(1.1); } }
@keyframes flipIn { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes bounceReveal { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulseSlow { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.1); opacity: 1; } }