/* ================================================================= 
   ESTILOS EXCLUSIVOS DO GAME (game.php)
   ================================================================= */

/* 1. LAYOUT GERAL */
body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background-color: #0a0806;
    padding: 20px 0; 
}

/* 2. O CELULAR */
.app-wrap {
    padding: 0 !important; 
    background-color: var(--bg);
    width: 100%; max-width: 420px;
    height: auto; 
    min-height: 85vh;
    border-radius: 32px; 
    border: 1px solid #333 !important;
    box-shadow: 0 0 0 8px #1a1614, 0 30px 60px rgba(0,0,0,0.8) !important;
    
    overflow: hidden; 
    position: relative; display: flex; flex-direction: column;
    margin: 0 auto;
}

/* Garante compatibilidade */
.phone-frame { display: none; } 

/* 3. PALCO VISUAL (IMAGEM) */
.game-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; 
    flex: none; 
    border-bottom: 2px solid var(--gold);
    background: radial-gradient(circle at center bottom, #3d3228 0%, var(--bg) 70%);
    
    overflow: visible !important; 
    z-index: 20; 
    margin: 0;
}

/* 4. ELEMENTOS DO CABE?ALHO */
.hero-menu-glass-btn {
    position: absolute; 
    top: 20px; right: 20px; left: auto;
    z-index: 25; width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    transition: transform 0.2s, background 0.2s;
    color: #fff;
}
.hero-menu-glass-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.05); }
.hero-menu-glass-btn:active { transform: scale(0.95); }
.hero-menu-glass-btn svg { fill: #ffffff; width: 24px; height: 24px; }

#loading {
    position: absolute; color: var(--gold); z-index: 20;
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    font-weight: bold; text-transform: uppercase; letter-spacing: 1px;
    font-size: 14px; text-shadow: 0 2px 4px #000;
}

/* 5. IMAGENS DO CAVALO */
.image-container { width: 100%; height: 100%; position: relative; padding: 0; margin: 0; }

.horse-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center center;
    transition: opacity 0.6s ease-in-out;
}

#img-overlay { opacity: 0; z-index: 2; }
#img-base { opacity: 1; z-index: 1; }

/* 6. BADGE E FAVORITO */
.badge-container {
    position: absolute;
    bottom: -28px; 
    left: 50%; transform: translateX(-50%);
    z-index: 50; display: flex; align-items: center; gap: 10px;
    width: max-content; max-width: 95%;
    filter: drop-shadow(0 6px 8px rgba(0,0,0,0.8)); 
}

.result-badge {
    background-color: var(--gold); color: #15100c;
    padding: 8px 20px; border-radius: 99px;
    font-size: 1.1rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.5px; border: 2px solid #fff;
    text-align: center; min-width: 120px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.badge-container .fav-btn {
    opacity: 1 !important; transform: scale(1) !important; animation: none !important; 
    background: rgba(0, 0, 0, 0.6); 
    border: 1px solid rgba(255, 255, 255, 0.3); backdrop-filter: blur(4px);
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    height: auto; min-height: 48px; padding: 4px 12px; 
    border-radius: 12px; margin-left: 0; gap: 0px; 
}

.badge-container .fav-row { display: flex; align-items: center; gap: 4px; margin-bottom: 1px; }
.badge-container .fav-icon { width: 18px; height: 18px; stroke: #fff; margin-bottom: 0; }
.badge-container .fav-text { font-size: 16px; color: #fff; font-weight: 800; margin-right: 0; line-height: 1; }
.badge-container .fav-label { font-size: 8px; text-transform: uppercase; color: #ccc; font-weight: 600; line-height: 1; letter-spacing: 0.5px; }

.badge-container .fav-btn.ativo { background: rgba(239, 68, 68, 0.3); border-color: #ef4444; }
.badge-container .fav-btn.ativo .fav-icon { stroke: #ef4444; fill: #ef4444; animation: heartPulse 0.4s ease-out; }
.badge-container .fav-btn.ativo .fav-text { color: #ef4444; }
.badge-container .fav-btn.ativo .fav-label { color: #fca5a5; }

/* 7. CONTROLES E TEXTOS (Parte Marrom) */
.controls-wrapper {
    flex: 1; width: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: flex-start;
    padding: 40px 20px 20px 20px; 
    background-color: var(--bg);
    position: relative;
    z-index: 10; 
    padding-bottom: 130px; 
}

.summary-text { text-align: center; color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; margin-bottom: 20px; min-height: 20px; }
.genetics-box {
    background-color: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--gold); border-radius: 8px; padding: 15px; margin-bottom: 25px;
    width: 100%; font-size: 0.85rem; color: #e5e5e5; line-height: 1.5; text-align: left;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.genetics-box h4 { margin: 10px 0 6px 0; color: var(--gold); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.genetics-box h4:first-child { margin-top: 0; }
.genetics-box p { margin: 0 0 8px 0; }
.geno-tag { background: #2a221b; color: var(--gold); border: 1px solid #4a3b32; padding: 1px 6px; border-radius: 4px; font-family: monospace; font-weight: bold; margin-right: 5px; }

/* 8. JOYSTICK FIXO NO RODAP? */
.slots-container { 
    position: fixed; 
    bottom: 0; 
    left: 50%; transform: translateX(-50%); 
    width: 100%; max-width: 420px; 
    display: flex; gap: 10px; justify-content: space-between; 
    padding: 15px 10px 20px 10px; 
    margin: 0;
    z-index: 100; 
    
    /* Fundo escuro para leitura */
    background: rgb(48 28 12 / 94%); 
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(212, 175, 55, 0.3); 
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5); 
    border-radius: 25px 25px 0px 0px; 
}

.slot-wrapper { display: flex; flex-direction: column; align-items: center; width: 23%; }

.gene-slot {
    width: 100%; aspect-ratio: 1 / 1; 
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(223, 172, 111, 0.3); 
    border-radius: 16px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer; transition: all 0.2s ease; padding: 4px;
}
.gene-slot.filled { 
    border-color: var(--gold); 
    background: rgba(30, 23, 18, 0.9); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.slot-val { font-size: 1.8rem; font-weight: 700; color: #fff; line-height: 1; margin-bottom: 4px; }
.slot-desc { font-size: 0.5rem; color: #ccc; text-transform: uppercase; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.slot-category { font-size: 0.6rem; color: var(--gold); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; }

/* Bot?es de A??o */
.actions-row { display: flex; gap: 10px; width: 100%; margin-top: 10px; margin-bottom: 20px; }
.btn-action {
    flex: 1; background: transparent; color: var(--text-muted);
    border: 1px solid #444; padding: 12px; border-radius: 10px;
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px; transition: 0.2s;
}
.btn-primary { border-color: var(--gold); color: var(--gold); background: rgba(223, 172, 111, 0.1); }

/* 9. NAV E MODAL */
.nav-buttons-container { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-bottom: 30px; }
.btn-nav-big {
    width: 100%; background: linear-gradient(135deg, #2a221b 0%, #1f1814 100%);
    border: 1px solid #443a33; color: var(--text-main); padding: 15px;
    border-radius: 12px; font-size: 1rem; font-weight: 700; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px;
    text-decoration: none; box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.btn-nav-big:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 12px rgba(223, 172, 111, 0.15); color: var(--gold); }
.btn-nav-big svg { width: 20px; height: 20px; fill: currentColor; }

/* ========================================================= 
   [MODIFICADO] MODAL BACKDROP TRANSPARENTE 
   ========================================================= */
.modal-backdrop { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    
    /* Fundo Transparente para manter contato visual com o cavalo */
    background: transparent; 
    backdrop-filter: none;
    
    z-index: 1000; 
    display: none; 
    justify-content: center; align-items: flex-end; 
}

.modal-backdrop.open { display: flex; }

.modal-content { 
    background: #1f1b17; /* Mant?m fundo do modal vis?vel */
    width: 100%; max-width: 420px; 
    border-radius: 20px 20px 0 0; 
    padding: 25px 20px 40px 20px; 
    box-shadow: 0 -10px 50px rgba(0,0,0,0.9); /* Sombra forte para separar do fundo transparente */
    border-top: 1px solid #444; 
    animation: slideUp 0.25s ease-out; 
}

.modal-title { text-align: center; font-size: 1rem; font-weight: 600; margin-bottom: 20px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.options-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt-btn { background: #2a221b; color: #fff; border: 1px solid #444; padding: 15px 0; border-radius: 10px; font-size: 1.4rem; font-weight: 700; cursor: pointer; text-align: center; position: relative; overflow: hidden; transition: 0.1s; }
.opt-btn span { display: block; font-size: 0.65rem; font-weight: normal; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; }
.opt-btn.selected { border-color: var(--gold); background: #3d2f24; box-shadow: 0 0 12px var(--gold-glow); }
.opt-btn.selected::after { content: '?'; position: absolute; top: 5px; right: 7px; font-size: 14px; color: var(--gold); font-weight: bold; }
.opt-E { color: #fff; } .opt-e { color: #fca5a5; }
.opt-A { color: #fdba74; } .opt-Cr { color: #fde047; }
.opt-Rn { color: #d1d5db; } .opt-D { color: #fcd34d; }
.opt-TO { color: #fff; }
.opt-btn.selected.opt-E, .opt-btn.selected.opt-e, .opt-btn.selected.opt-A, .opt-btn.selected.opt-Cr, .opt-btn.selected.opt-Rn, .opt-btn.selected.opt-D, .opt-btn.selected.opt-G { filter: brightness(1.1); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* 9. ANIMA??O "TOQUE AQUI" */
@keyframes pulse-border {
    0% { border-color: rgba(223, 172, 111, 0.3); box-shadow: 0 0 0 0 rgba(223, 172, 111, 0.0); }
    50% { border-color: var(--gold); box-shadow: 0 0 15px 0 rgba(223, 172, 111, 0.6); }
    100% { border-color: rgba(223, 172, 111, 0.3); box-shadow: 0 0 0 0 rgba(223, 172, 111, 0.0); }
}

@keyframes float-label {
    0% { transform: translate(-50%, 0); opacity: 0; }
    15% { transform: translate(-50%, -5px); opacity: 1; }
    85% { transform: translate(-50%, -5px); opacity: 1; }
    100% { transform: translate(-50%, 0); opacity: 0; }
}

.gene-slot.piscando {
    animation: pulse-border 2s infinite ease-in-out !important;
    z-index: 100; position: relative;
}

.gene-slot.piscando::after {
    content: "TOQUE AQUI";
    position: absolute;
    top: -25px; left: 50%; transform: translateX(-50%);
    background-color: var(--gold); color: #15100c;
    font-size: 10px; font-weight: 800; padding: 4px 10px;
    border-radius: 12px; white-space: nowrap;
    animation: float-label 2s ease-in-out 3 forwards;
    pointer-events: none; 
}

.gene-slot.piscando::before {
    content: ""; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
    border-width: 8px; border-style: solid;
    border-color: var(--gold) transparent transparent transparent;
    opacity: 0;
    animation: float-label 2s ease-in-out 3 forwards;
}

/* RESPONSIVIDADE */
@media (max-width: 480px) {
    body { padding: 0; align-items: flex-start; background-color: #15100c; }
    .app-wrap { 
        padding: 0 !important; 
        max-width: 100%; min-height: 100vh; border-radius: 0; border: none !important; box-shadow: none !important; 
        height: auto; 
    }
    .game-stage { aspect-ratio: auto; height: 45vh; }
    .modal-content { max-width: 100%; }
    
    /* Remove arredondamento inferior no mobile puro */
    .slots-container { border-radius: 0; }
}

/* Estado Bloqueado (Aguardando Base) */
.gene-slot.locked {
    opacity: 0.3; /* Fica bem apagado/transparente */
    filter: grayscale(1); /* Tira a cor */
    border-color: #333 !important; /* Borda escura quase invisível */
    cursor: default;
}

/* Opcional: Efeito de transição suave quando desbloquear */
.gene-slot {
    transition: all 0.3s ease;
}