/* =========================================
   GAMEPLAY.CSS - ESTILOS DOS MINIGAMES
   ========================================= */

/* --- BOTÃO VOLTAR (Canto Superior Esquerdo) --- */
.menu-back-link {
    position: absolute; top: 20px; left: 20px; text-decoration: none; color: #a0a0a0; font-weight: bold;
    display: flex; align-items: center; gap: 5px; z-index: 300; font-size: 14px; transition: color 0.2s;
}
.menu-back-link:hover { color: #c8aa6e; }

/* --- BARRA DE PESQUISA DO JOGO (ESSENCIAL!) --- */
.search-container { 
    position: relative; margin-bottom: 25px; width: 100%; max-width: 500px; 
    margin-left: auto; margin-right: auto; /* Centraliza */
}

/* O input onde o jogador digita */
.search-container input { 
    width: 100%; padding: 12px 15px; font-size: 16px; 
    background-color: #1e2328; border: 2px solid #3c3c3c; 
    color: #f0f0f0; border-radius: 4px; outline: none; 
    transition: border-color 0.3s; text-align: center; 
}
.search-container input:focus { 
    border-color: #c8aa6e; box-shadow: 0 0 8px rgba(200, 170, 110, 0.2); 
}

/* Lista de Sugestões (Dropdown Automático) */
#suggestions { 
    position: absolute; width: 100%; background-color: #1e2328; 
    border: 1px solid #c8aa6e; border-top: none; max-height: 200px; 
    overflow-y: auto; display: none; z-index: 100; border-radius: 0 0 4px 4px; 
}
.suggestion-item { 
    padding: 10px; cursor: pointer; text-align: left; 
    border-bottom: 1px solid #333; display: flex; align-items: center; 
    gap: 10px; font-size: 14px; 
}
.suggestion-item:hover { background-color: #2a3138; }
.suggestion-photo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.suggestion-icon { width: 30px; height: auto; border-radius: 4px; box-shadow: 0 0 5px rgba(0,0,0,0.5);}

/* --- CONTAINER DE RESULTADOS (As linhas de palpites) --- */
.results-container {
    width: 100%; padding-bottom: 10px; display: flex; flex-direction: column; overflow-x: auto; 
    scrollbar-width: thin; scrollbar-color: #c8aa6e #1e2328;
}
.results-container::-webkit-scrollbar { height: 8px; }
.results-container::-webkit-scrollbar-track { background: #1e2328; }
.results-container::-webkit-scrollbar-thumb { background: #c8aa6e; border-radius: 4px; }

/* Grid das Tabelas */
@media (min-width: 1025px) { .results-container { overflow: visible !important; display: block; } }
.headers, .guess-row { display: grid; grid-template-columns: 80px 0.8fr 0.6fr 1fr 1.2fr 1fr 0.6fr 1fr 0.8fr; gap: 6px; width: 100%; align-items: center; }
.headers { font-weight: bold; font-size: 12px; color: #a0a0a0; text-transform: uppercase; padding-bottom: 8px; border-bottom: 1px solid #333; margin-bottom: 8px; text-align: center; padding-right: 14px; }

/* Caixinhas de Resposta (Verde/Vermelho) */
@keyframes flipIn { 0% { transform: rotateX(90deg); opacity: 0; } 100% { transform: rotateX(0deg); opacity: 1; } }
.box {
    background-color: #1e2328; border: 1px solid #333; display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600; height: 55px; word-break: break-word; opacity: 1; 
    animation: flipIn 0.5s ease-out forwards; color: white; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); position: relative; border-radius: 4px;
}
.correct { background-color: #2cba52; border-color: #1a8a38; }
.incorrect { background-color: #cd2e3a; border-color: #961b24; }
.arrow-up::after { content: "↑"; font-size: 16px; margin-left: 5px; display: inline-block; }
.arrow-down::after { content: "↓"; font-size: 16px; margin-left: 5px; display: inline-block; }

.player-info { position: relative; justify-content: center; padding: 0; cursor: help; background-color: transparent !important; border: none !important; overflow: visible; margin-left: 15px; }
.player-photo { width: 50px; height: 50px; border: 2px solid #444; object-fit: cover; border-radius: 6px; transition: transform 0.2s; }
.player-info:hover .player-photo { transform: scale(1.1); }

/* Tooltips (Bandeiras, Informações extras) */
.header-item, .player-info { position: relative; cursor: help; display: flex; align-items: center; justify-content: center; }
.header-tooltip, .player-tooltip {
    visibility: hidden; background-color: #111; color: #c8aa6e; text-align: center; border-radius: 4px; padding: 8px 12px;
    position: absolute; z-index: 999999; left: 50%; transform: translateX(-50%); width: max-content; max-width: 200px;
    font-size: 12px; font-weight: normal; border: 1px solid #c8aa6e; box-shadow: 0 4px 15px rgba(0,0,0,0.8); opacity: 0; transition: opacity 0.2s;
}
.header-tooltip { top: 100%; margin-top: 10px; }
.header-tooltip::after { content: ""; position: absolute; bottom: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: transparent transparent #c8aa6e transparent; }
.player-tooltip { bottom: 100%; margin-bottom: 10px; }
.player-tooltip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: #c8aa6e transparent transparent transparent; }
.header-item:hover .header-tooltip, .player-info:hover .player-tooltip { visibility: visible; opacity: 1; }
/* Correção de sobreposição */
.header-item:hover, .player-info:hover, .box:hover { z-index: 10000 !important; position: relative !important; transform: none !important; opacity: 1 !important; background-color: #1e2328; }

/* Jogador de Ontem */
.yesterday-section { margin-top: 40px; width: 100%; display: flex; justify-content: center;}
.yesterday-box {
    margin-top: 20px; padding: 8px 20px; background-color: rgba(30, 35, 40, 0.8); border: 1px solid #444; border-radius: 50px; 
    display: flex; align-items: center; gap: 12px; font-size: 13px; color: #b0b0b0; transition: border-color 0.3s;
}
.yesterday-box:hover { border-color: #c8aa6e; }
.y-photo { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid #c8aa6e; }
.y-name { color: #c8aa6e; font-weight: bold; text-transform: uppercase; }

/* Legenda */
.legend-container {
    margin-top: 40px; margin-bottom: 50px; padding: 15px; background-color: #111316; border: 1px solid #c8aa6e; 
    border-radius: 4px; width: 100%; max-width: 600px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); position: relative; z-index: 1;
}
.legend-title { color: white; font-size: 16px; font-weight: bold; text-align: center; margin-bottom: 15px; font-family: serif; }
.legend-grid { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.legend-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.legend-box { width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: bold; color: white; text-shadow: 1px 1px 2px black; border-radius: 4px; }
.legend-label { font-size: 11px; color: #ccc; text-transform: uppercase; }
.l-green { background-color: #2cba52; } .l-orange { background-color: #e68c17; } .l-red { background-color: #cd2e3a; }

/* Mensagem de Vitória */
.victory-msg {
    margin-top: 30px; margin-bottom: 30px; text-align: center; display: none; animation: flipIn 0.5s ease-out forwards;
    background-color: #1e2328; border: 2px solid #2cba52; padding: 20px; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.5);
    width: 100%; max-width: 600px; position: relative; z-index: 100;
}
.victory-title { color: #2cba52; font-size: 24px; font-weight: bold; margin-bottom: 10px; }
.victory-timer { color: #c8aa6e; font-size: 16px; }

/* Balões Flutuantes (Erro/Acerto) - Usado em vários jogos */
.error-tooltip, .success-tooltip {
    position: absolute; color: white; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; text-transform: uppercase;
    white-space: nowrap; pointer-events: none; z-index: 200; box-shadow: 0 2px 4px rgba(0,0,0,0.5); transform: translate(-50%, -100%); margin-top: -8px;
}
.error-tooltip { background: #cd2e3a; animation: floatAndFade 1.5s forwards; }
.error-tooltip::after { content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); border-width: 4px 4px 0; border-style: solid; border-color: #cd2e3a transparent transparent transparent; }

.success-tooltip { background: #2cba52; animation: floatAndFade 2s forwards; }
.success-tooltip::after { content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); border-width: 4px 4px 0; border-style: solid; border-color: #2cba52 transparent transparent transparent; }

@keyframes floatAndFade {
    0% { opacity: 0; transform: translate(-50%, -80%); } 15% { opacity: 1; transform: translate(-50%, -100%); }
    80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120%); }
}

@media (max-width: 768px) {
    .headers, .guess-row { min-width: 1000px; grid-template-columns: 60px 0.8fr 0.6fr 1fr 1.2fr 1fr 0.6fr 1fr 0.8fr; gap: 4px; }
    .box, .header-item { white-space: nowrap; font-size: 11px; }
    .player-photo { width: 35px; height: 35px; }
    .menu-back-link { top: 15px; left: 15px; font-size: 12px; }
    .menu-back-link .material-icons { font-size: 18px; }
}