/**
 * BLOCO 1: RESET, BLINDAGEM E VARIÁVEIS
 * -------------------------------------------------------------------------
 */
:root {
    --accent:   #00d4ff;
    --gold:     #f1c40f;
    --done:     #2ecc71;
    --danger:   #ff4b2b;
    --bg-dark:  #05070a;
    --panel-bg: #0d1117;
    --item-bg:  #161b22;
}

#gg-game-root, 
#gg-game-root * { 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

/* Força textos claros no ambiente escuro */
#gg-game-root p, 
#gg-game-root h2, 
#gg-game-root h3, 
#gg-game-root h4, 
#gg-game-root span, 
#gg-game-root li { 
    color: #ffffff !important; 
    margin-bottom: 10px;
}

/* Legibilidade: Texto preto apenas em fundos muito claros (Botões/Ativos) */
#gg-game-root .gg-nav-item.active *,
#gg-game-root .gg-btn-back,
#gg-game-root .gg-btn-send,
#gg-game-root .gg-btn-analyze {
    color: #000000 !important;
}


/**
 * BLOCO 2: ESTRUTURA GRID PRINCIPAL
 * -------------------------------------------------------------------------
 */
#gg-game-root.gg-layout { 
    display: grid; 
    grid-template-columns: 280px 1fr 320px; 
    height: 95vh; 
    background: var(--bg-dark) !important; 
    overflow: hidden; 
    border: 1px solid #333; 
}


/**
 * BLOCO 3: SIDEBAR ESQUERDA E FOOTER
 * -------------------------------------------------------------------------
 */
.gg-sidebar { 
    background: var(--panel-bg) !important; 
    padding: 20px; 
    border-right: 1px solid #333; 
    display: flex; 
    flex-direction: column; 
}

.gg-sidebar-content { flex-grow: 1; overflow-y: auto; }

/* Logo e Brand */
.gg-header-area { margin-bottom: 25px; text-align: center; }
.gg-case-logo { max-width: 100%; height: auto; border-bottom: 2px solid var(--accent); padding-bottom: 15px; }
.gg-brand { color: var(--accent) !important; font-weight: 900; border-bottom: 2px solid var(--accent); padding-bottom: 10px; text-transform: uppercase; }

/* Itens de Menu */
.gg-list { list-style: none !important; padding: 0 !important; margin: 0 0 20px 0 !important; }
.gg-section-title { font-size: 0.75rem; text-transform: uppercase; color: #8b949e !important; margin: 20px 0 10px 0 !important; letter-spacing: 1px; }

.gg-nav-item { 
    padding: 12px 15px !important; 
    background: var(--item-bg) !important; 
    margin-bottom: 8px !important; 
    border-radius: 6px; 
    cursor: pointer; 
    display: flex !important; 
    align-items: center; 
    gap: 10px; 
    border: 1px solid #333 !important; 
    transition: 0.2s;
}
.gg-nav-item:hover { border-color: var(--accent) !important; background: #1f2428 !important; }
.gg-nav-item.active { background: var(--accent) !important; border-color: var(--accent) !important; }

/* Footer (Progresso/Tempo) */
.gg-sidebar-footer { border-top: 1px solid #333; padding-top: 20px; margin-top: auto; }
.gg-stat-label { font-size: 0.65rem; text-transform: uppercase; color: #8b949e !important; display: block; margin-bottom: 5px; }
.gg-stat-val { font-size: 0.9rem; font-weight: bold; color: var(--accent) !important; }

.gg-progress-container { width: 100%; height: 8px; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 8px; border: 1px solid #222; }
.gg-progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.5s ease; box-shadow: 0 0 10px var(--accent); }

.gg-btn-board { 
    background: transparent !important; 
    border: 1px solid var(--accent) !important; 
    color: var(--accent) !important; 
    width: 100%; padding: 12px; border-radius: 6px; 
    font-weight: bold; cursor: pointer; font-size: 0.75rem;
    margin-top: 10px;
}
.gg-btn-board:hover { background: var(--accent) !important; color: #000 !important; }


/**
 * BLOCO 4: PALCO CENTRAL E SCROLLBARS
 * -------------------------------------------------------------------------
 */
.gg-main-stage { 
    background: #000; 
    overflow-y: auto; 
    height: 100%; 
    position: relative; 
}

/* Scrollbar Customizada para o Palco Central e Chat */
.gg-main-stage::-webkit-scrollbar, 
.gg-messages::-webkit-scrollbar { 
    width: 6px; 
}
.gg-main-stage::-webkit-scrollbar-track, 
.gg-messages::-webkit-scrollbar-track { 
    background: #05070a; 
}
.gg-main-stage::-webkit-scrollbar-thumb, 
.gg-messages::-webkit-scrollbar-thumb { 
    background: #222; 
    border-radius: 10px; 
}
.gg-main-stage::-webkit-scrollbar-thumb:hover, 
.gg-messages::-webkit-scrollbar-thumb:hover { 
    background: var(--accent); 
}

/* Padding de Respiro para Briefings, Lab e Hubs */
.gg-content-padding { 
    padding: 40px !important; 
}

/* Padding específico para a área de texto da Cena */
.gg-scene-info { 
    padding: 40px !important; 
    background: #000; 
    border-top: 1px solid #333; 
}
.gg-scene-info h3 { 
    margin-bottom: 10px !important; 
    color: var(--accent) !important; 
}

/**
 * BLOCO 5: CENAS E HOTSPOTS (SLIDER & 16:9 ASPECT RATIO)
 * -------------------------------------------------------------------------
 */
.gg-photo-area { 
    position: relative; 
    width: 100%; 
    aspect-ratio: 16 / 9; /* Força a proporção 1920x1080 */
    background: #000; 
    overflow: hidden; 
}

/* Slides */
.gg-slide { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; /* Garante que a foto preencha o 16:9 sem esticar */
    opacity: 0; 
    transition: opacity 0.6s ease-in-out; 
    z-index: 1;
}
.gg-slide.active { opacity: 0.7; z-index: 2; }

/* Navegação Discreta (Imersiva) */
.gg-slider-prev, .gg-slider-next {
    position: absolute; 
    top: 0; 
    bottom: 0;
    width: 60px;
    background: transparent !important; 
    border: none !important; 
    color: rgba(255, 255, 255, 0.15) !important; /* Quase invisível por padrão */
    cursor: pointer;
    z-index: 100; 
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    outline: none;
}

/* Efeito de Hover: Revela a seta com brilho sutil */
.gg-slider-prev:hover, .gg-slider-next:hover { 
    color: var(--accent) !important; 
    background: linear-gradient(to right, rgba(0,212,255,0.05), transparent) !important;
    text-shadow: 0 0 10px var(--accent);
}

.gg-slider-next:hover {
    background: linear-gradient(to left, rgba(0,212,255,0.05), transparent) !important;
}

.gg-slider-prev { left: 0; }
.gg-slider-next { right: 0; }

/* Hotspots */
.gg-hotspot { 
    position: absolute; 
    width: 26px; height: 26px; 
    background: var(--accent) !important; 
    border: 3px solid #fff !important; 
    border-radius: 50%; 
    z-index: 110; 
    transform: translate(-50%, -50%); 
    cursor: pointer; 
    box-shadow: 0 0 15px var(--accent);
    display: none; 
}
.gg-hotspot.visible { display: block; }
.gg-hotspot-suspect { background: #2ecc71 !important; box-shadow: 0 0 15px #2ecc71; }

/* Coletados */
.gg-hotspot.collected { opacity: 0.3; background: #555 !important; border-color: #777 !important; animation: none; box-shadow: none; }
.gg-hotspot-suspect.collected { opacity: 0.5; background: #1e8449 !important; border-color: #27ae60 !important; }

/* Animações (Pulso) */
.gg-hotspot.visible:not(.collected) { animation: gg-pulse 1.5s infinite; }
.gg-hotspot-suspect.visible:not(.collected) { animation: gg-pulse-suspect 1.5s infinite; }

@keyframes gg-pulse { 
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 
    70% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } 
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } 
}
@keyframes gg-pulse-suspect { 
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 
    70% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; background: #2ecc71; } 
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } 
}

/**
 * BLOCO 6: INTERROGATÓRIO E CHAT
 * -------------------------------------------------------------------------
 */
.gg-interrogatorio-screen { 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    overflow: hidden; 
}

.gg-interro-nav { 
    padding: 15px 40px; 
    background: #111; 
    border-bottom: 1px solid #333; 
}

/* Foto do Suspeito (Proporcional) */
.gg-photo-stage { 
    height: 35vh !important; 
    min-height: 35vh; 
    background: #000; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    border-bottom: 2px solid #222; 
}
.gg-photo-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Container do Chat */
.gg-chat-box { 
    flex-grow: 1; 
    padding: 20px 40px !important; 
    background: #080808; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}

.gg-messages { 
    flex-grow: 1; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; /* Espaço entre balões */
    padding-bottom: 20px;
}

/* Balões de Mensagem (Style WhatsApp) */
.msg { 
    padding: 12px 18px !important; 
    border-radius: 18px; 
    max-width: 75%; 
    font-size: 0.95rem; 
    line-height: 1.4; 
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Suspeito (Esquerda) */
.msg.bot { 
    background: #1c2128 !important; 
    border: 1px solid #333;
    color: #fff !important;
    align-self: flex-start; 
    border-bottom-left-radius: 4px;
}

/* Detetive / Usuário (Direita) */
.msg.user { 
    background: var(--accent) !important; 
    color: #000 !important; 
    align-self: flex-end; 
    font-weight: 600;
    border-bottom-right-radius: 4px;
}

/* Indicador de "Digitando..." */
.gg-typing-indicator {
    background: #1c2128;
    padding: 12px 18px;
    border-radius: 18px;
    display: none; /* Ativado via JS */
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #8b949e !important;
    font-size: 0.8rem;
    font-style: italic;
    border: 1px solid #333;
}

.gg-typing-dots span {
    animation: gg-blink 1.4s infinite both;
    height: 5px; width: 5px;
    background-color: #8b949e;
    display: inline-block;
    border-radius: 50%;
    margin: 0 2px;
}
.gg-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.gg-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes gg-blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* Input de Chat polido */
.gg-form { display: flex; gap: 12px; margin-top: 10px; padding: 15px 0; border-top: 1px solid #222; }
.gg-form input { flex-grow: 1; background: #000 !important; border: 1px solid #333 !important; padding: 14px; border-radius: 6px; color: #fff !important; }
.gg-btn-send { background: var(--accent) !important; color: #000 !important; border: none !important; padding: 0 30px; border-radius: 6px; font-weight: 900 !important; text-transform: uppercase; cursor: pointer; }

/**
 * BLOCO 7: HUB DE SUSPEITOS E LISTAS
 * -------------------------------------------------------------------------
 */
.gg-suspect-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 20px; 
    margin-top: 25px; 
}

.gg-suspect-card { 
    background: #111; 
    border: 1px solid #333; 
    padding: 15px; 
    border-radius: 10px; 
    text-align: center; 
    cursor: pointer; 
    transition: 0.3s;
}
.gg-suspect-card:hover { border-color: var(--accent); transform: translateY(-5px); }
.gg-suspect-card img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }


/**
 * BLOCO 8: LABORATÓRIO E CARDS
 * -------------------------------------------------------------------------
 */
.gg-lab-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
    gap: 20px; 
}

.gg-lab-card { 
    background: var(--item-bg); 
    border: 1px solid #333; 
    padding: 20px; 
    border-radius: 12px; 
    text-align: center; 
}

.gg-lab-card img { 
    width: 100%; 
    height: 120px; 
    object-fit: cover; 
    border-radius: 8px; 
    margin-bottom: 15px; 
    border: 1px solid #444; 
}

/* Botão Analisar Formatado */
.gg-btn-analyze { 
    background: var(--gold) !important; 
    color: #000 !important;
    border: none !important; 
    width: 100%; 
    padding: 12px; 
    border-radius: 6px; 
    font-weight: 900 !important; 
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.gg-btn-analyze:hover {
    background: #fff !important;
}

/* Status Processado */
.gg-status-done { 
    display: inline-block;
    padding: 6px 12px;
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71 !important;
    border: 1px solid #2ecc71;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 10px;
}

/**
 * BLOCO 9: BANDEJA E CENA (ESTILOS INDEPENDENTES)
 * -------------------------------------------------------------------------
 */

/* 9.1 Regras Comuns */
.gg-tray-item { 
    background: var(--item-bg) !important; 
    border: 1px solid #333 !important; 
    border-radius: 8px; 
    cursor: pointer !important; 
    transition: all 0.2s ease;
    display: flex;
    overflow: hidden;
}
.gg-tray-item:hover { 
    border-color: var(--accent) !important; 
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.1);
}

/* 9.2 ESTILO BANDEJA LATERAL (Vertical) */
.gg-tray { display: block; padding: 5px; } 
.gg-tray .gg-tray-item { 
    flex-direction: column; 
    padding: 10px; 
    text-align: center; 
    margin-bottom: 15px !important; 
}
.gg-tray .gg-tray-item img { 
    width: 100%; height: 70px; 
    object-fit: cover; border-radius: 4px; margin-bottom: 8px; 
}

/* 9.3 ESTILO LISTA ABAIXO DA CENA (Horizontal) */
.gg-tray-mini { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 15px; 
    margin: 25px 40px !important; /* Alinhado com o padding do briefing */
}
.gg-tray-mini .gg-tray-item { 
    flex-direction: row; 
    align-items: center; 
    padding: 12px; 
    gap: 15px;
}
.gg-tray-mini .gg-tray-item img { 
    width: 80px !important; 
    height: 60px !important; 
    object-fit: cover; 
    border-radius: 4px;
    flex-shrink: 0;
}

.item-info-wrapper { display: flex; flex-direction: column; text-align: left; flex-grow: 1; }
.item-info-wrapper span { font-size: 0.9rem; font-weight: bold; color: #fff !important; white-space: normal !important; line-height: 1.2; }
.item-status { font-size: 0.65rem; text-transform: uppercase; margin-top: 4px; font-weight: 800; }

.gg-tray-item.needs-lab { border-left: 3px solid var(--gold) !important; }
.gg-tray-item.needs-lab .item-status { color: var(--gold) !important; }
.gg-tray-item.type-depoimento { border-left: 3px solid #2ecc71 !important; }
.gg-tray-item.type-depoimento .item-status { color: #2ecc71 !important; }

/**
 * BLOCO 10: MODAL DE EVIDÊNCIA (POPUP)
 * -------------------------------------------------------------------------
 */
.gg-modal { 
    display: none; 
    position: fixed; 
    z-index: 10000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.95); 
    justify-content: center; 
    align-items: center; 
}

.gg-modal-content { 
    background: #0d1117 !important; 
    border: 2px solid var(--accent); 
    border-radius: 15px; 
    max-width: 550px; width: 90%; 
    position: relative; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
}

.gg-modal-media { width: 100%; background: #000; display: flex; justify-content: center; }
.gg-modal-media img { max-width: 100%; max-height: 300px; object-fit: contain; }

.gg-modal-body { padding: 30px; text-align: left; }
.gg-modal-body h2 { color: var(--accent) !important; font-size: 1.4rem; margin-bottom: 15px !important; }
.gg-modal-body p { color: #ccc !important; line-height: 1.5; margin-bottom: 20px !important; }

.gg-close-modal { 
    position: absolute; 
    right: 20px; top: 15px; 
    font-size: 32px; 
    cursor: pointer; 
    color: #fff !important; 
    z-index: 10; 
    line-height: 1;
}


/**
 * BLOCO 11: ACUSAÇÃO E INTEL
 * -------------------------------------------------------------------------
 */
.gg-intel { 
    justify-content: space-between; 
    padding: 25px !important; /* Mais respiro nas bordas da sidebar */
}

.gg-intel-header { 
    margin-bottom: 30px; 
}

.gg-drex-box { 
    background: #1c2128; 
    padding: 18px; 
    border-left: 4px solid var(--accent); 
    margin-bottom: 25px; 
    border-radius: 4px;
}

.gg-tray-title {
    margin-bottom: 15px !important;
    letter-spacing: 2px;
}

/* Botão Acusar com margem superior */
.gg-btn-accuse { 
    margin-top: 30px !important;
    background: var(--danger) !important; 
    color: #ffffff !important; 
    width: 100%; 
    padding: 18px; 
    border: none !important; 
    font-weight: 800; 
    border-radius: 8px; 
    cursor: pointer; 
    letter-spacing: 1px;
    text-transform: uppercase;
}

/**
 * BLOCO 12: QUADRO DE INVESTIGAÇÃO (ESTILO MIRO)
 * -------------------------------------------------------------------------
 */
.gg-board-wrapper { width: 100%; height: 100%; display: flex; flex-direction: column; background: #1a1a1a; overflow: hidden; }
.gg-board-controls { padding: 20px; background: rgba(0,0,0,0.7); border-bottom: 1px solid #333; z-index: 10; }

.gg-board-canvas { 
    flex-grow: 1; 
    position: relative; 
    overflow: hidden; 
    background-image: radial-gradient(#333 1px, transparent 1px); 
    background-size: 30px 30px; 
}

.gg-postit { 
    position: absolute; width: 150px; 
    padding: 12px; background: var(--gold); 
    color: #000 !important; border-radius: 3px; 
    box-shadow: 5px 5px 15px rgba(0,0,0,0.5); 
    cursor: grab; z-index: 5; 
}
.gg-postit img { width: 100%; height: 80px; object-fit: cover; border-radius: 2px; margin-bottom: 8px; }
.gg-postit-text { width: 100%; border: none; background: transparent; color: #000 !important; font-weight: bold; resize: none; overflow: hidden; }

.gg-btn-action-board {
    background: var(--accent) !important;
    color: #000 !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}