: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: 10px; width: 100%; }

/* ESTILO DEL LOGO (IMAGEN) */
.game-logo {
    display: block;
    margin: 0 auto 5px auto;
    max-width: 90%;           
    width: 350px;             
    height: auto;             
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

@media (max-width: 400px) {
    .game-logo { width: 280px; }
}

/* CONTENEDOR DE LA IMAGEN DEL PERRO */
#dog-image-container {
    width: 100%;
    height: 220px; /* Altura fija para evitar saltos */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    background-color: #000;
    border-radius: 8px;
    border: 2px solid #333;
    overflow: hidden;
    position: relative;
}

#dog-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Loader giratorio */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #538d4e;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    position: absolute;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 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: 45px; height: 45px;
    border: 2px solid var(--border);
    display: flex; justify-content: center; align-items: center;
    font-size: 1.6rem; 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 (RAZA) */
#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: 28px; height: 28px;
    border: 2px solid var(--filled);
    border-radius: 4px;
    display: flex; justify-content: center; align-items: center;
    font-size: 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 {
    background-color: #1a1a1b;
    border: 1px solid #333;
    border-radius: 8px;
    color: #d7dadc;
    width: 100%;
    box-sizing: border-box;
    margin-top: 20px;
    padding: 20px;
    text-align: center;
}
.footer-links { margin-top: 15px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.footer-links a {
    color: #d7dadc; text-decoration: none; border: 1px solid #538d4e;
    padding: 8px 12px; border-radius: 5px; font-size: 0.85rem; transition: all 0.2s;
}
.footer-links a:hover { background-color: #538d4e; color: white; }
.thanks-anim { color: #e6b800; font-weight: bold; font-size: 1.2rem; animation: pulseSlow 2.5s infinite ease-in-out; margin-bottom: 5px; }

/* 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; 
}

/* IMAGEN EN EL RESULTADO */
#result-dog-image img {
    max-width: 200px;
    border-radius: 10px;
    border: 2px solid #538d4e;
    margin: 10px 0;
}

.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; } }
.shake { animation: shake 0.5s; }
@keyframes shake { 0% { transform: translateX(1px); } 10% { transform: translateX(-1px); } 20% { transform: translateX(-3px); } 30% { transform: translateX(3px); } 40% { transform: translateX(1px); } 50% { transform: translateX(-1px); } 60% { transform: translateX(-3px); } 70% { transform: translateX(3px); } 80% { transform: translateX(-1px); } 90% { transform: translateX(1px); } 100% { transform: translateX(1px); } }

.seo-content { max-width: 700px; margin: 40px auto 20px auto; padding: 20px; background-color: #1a1a1b; border-radius: 8px; color: #d7dadc; line-height: 1.6; border: 1px solid #333; font-size: 0.95rem; }
.seo-content h2, .seo-content h3 { color: #538d4e; margin-top: 20px; }
.seo-content ul { list-style-type: none; padding-left: 0; }
.seo-content li { margin-bottom: 5px; }

/* --- ESTILOS DEL MENÚ LATERAL (HAMBURGUESA) --- */
.menu-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #538d4e; /* Verde del juego */
    z-index: 3000;
    background: rgba(18, 18, 19, 0.8); /* Fondo semi-transparente */
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid #333;
    transition: 0.2s;
}
.menu-btn:hover { color: white; border-color: #538d4e; }

.sidenav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 3001;
    top: 0;
    left: 0;
    background-color: #121213;
    overflow-x: hidden;
    transition: 0.3s;
    border-right: 1px solid #333;
    padding-top: 60px;
    box-shadow: 5px 0 20px rgba(0,0,0,0.8);
}

.sidenav a {
    padding: 10px 15px 10px 30px;
    text-decoration: none;
    font-size: 1.1rem;
    color: #d7dadc;
    display: block;
    transition: 0.3s;
    border-bottom: 1px solid #222;
}

.sidenav a:hover { color: #538d4e; background: #1a1a1b; }

.sidenav .closebtn {
    position: absolute;
    top: 0;
    right: 20px;
    font-size: 36px;
    margin-left: 50px;
    border-bottom: none;
}

/* Sombra oscura al abrir menú */
#overlay-menu {
    position: fixed; display: none; width: 100%; height: 100%;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.7);
    z-index: 2999;
}

/* --- ESTILOS DEL ARTÍCULO INFERIOR --- */
.article-section {
    width: 100%;
    max-width: 800px;
    margin-top: 40px;
    padding: 20px;
    background-color: #1a1a1b;
    border-radius: 8px;
    border: 1px solid #333;
    text-align: left;
    color: #d7dadc;
}
.article-section h2 { color: #538d4e; margin-top: 0; border-bottom: 1px solid #444; padding-bottom: 10px; }
.article-section h3 { color: #e6b800; margin-top: 25px; margin-bottom: 5px; }
.article-section p { line-height: 1.6; margin-bottom: 15px; color: #ccc; }

.credit-box {
    margin-top: 40px;
    padding: 15px;
    background: #121213;
    border-left: 4px solid #538d4e;
    font-size: 0.9rem;
}
.credit-box a { color: #538d4e; text-decoration: none; font-weight: bold; }