/* =========================================
   STYLE.CSS - CSS GLOBAL (Base + Variáveis)
   ========================================= */

:root {
  --bg: #070A0C;
  --line: #2B3439;
  --line2: #1C2429;
  --text: #E7E3DA;
  --muted: #B9B3A7;
  --gold: #C6A24A;
  --gold2: #E2C978;
  --neon-green: #53FC18; 
  --shadow: 0 18px 60px rgba(0,0,0,.65);

  /* Variáveis de Medida */
  --gap: 16px;
  --chatW: 360px;
  --headerH: 140px;
  --playerH: 85px; 
}

* { box-sizing: border-box; }

html, body { 
    height: 100%; margin: 0; padding: 0;
    overflow-y: auto; overflow-x: hidden;
}

body {
  background: radial-gradient(1200px 700px at 50% 0%, #141C20 0%, var(--bg) 55%, #040608 100%);
  color: var(--text);
  font: 14px/1.45 "Trebuchet MS", Arial, sans-serif;
  display: flex; flex-direction: column;
}

a { color: var(--gold2); text-decoration: none; transition: 0.3s; }
a:hover { color: #fff; text-shadow: 0 0 10px var(--gold); }

/* --- COMPONENTES GLOBAIS --- */
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; } 
::-webkit-scrollbar-track { background: #000; } 
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* Botões Padrão */
.btn-gold {
    background: var(--gold); color: #000; border: none; padding: 5px 15px;
    font-size: 10px; font-weight: bold; border-radius: 4px; cursor: pointer; transition: 0.2s;
}
.btn-gold:hover { background: #fff; }

.btn-link { 
    padding: 6px 10px; border: 1px solid var(--line); font-size: 10px; 
    text-transform: uppercase; background: #000; color: var(--text); 
    cursor: pointer; display: inline-block; transition: 0.2s; 
}
.btn-link:hover { border-color: var(--gold); color: var(--gold2); }

/* --- ESTRUTURA PADRÃO DAS PÁGINAS (Live Frame) --- */
#content { width: 100%; margin: 0; padding-bottom: 20px; }
.live-wrap { max-width: 1600px; margin: 18px auto; padding: 0 12px; }

.live-frame { 
    padding: 18px; 
    background: linear-gradient(180deg, rgba(15,20,23,.88), rgba(7,10,12,.86)); 
    border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); 
}

.live-shell { display: grid; grid-template-columns: var(--chatW) 1fr var(--chatW); gap: var(--gap); min-height: 720px; }

.side, .playerbox { 
    background: #0b1013; border: 1px solid var(--line); 
    display: flex; flex-direction: column; overflow: hidden; position: relative;
}

.box-head { 
    padding: 10px 12px; background: #10161a; border-bottom: 1px solid var(--line2); 
    display: flex; justify-content: space-between; align-items: center; 
}
.box-head .label { color: var(--gold2); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }

.box-body, .side-body { flex: 1; position: relative; width: 100%; height: 100%; }
iframe, .embed-host { width: 100%; height: 100%; border: 0; display: block; }

/* --- FOOTER --- */
#footer { text-align: center; width: 100%; display: block; padding: 20px 0; color: var(--muted); font-size: 12px; }

/* Responsividade Básica */
@media (max-width: 1000px) {
    .live-shell { grid-template-columns: 1fr; height: auto; }
    .side { height: 500px; }
}

/* =========================================
   CORREÇÃO RESPONSIVA - PAREAMENTO VÍDEO/CHAT
   ========================================= */

@media (max-width: 1024px) {
    
    .live-wrap { padding: 0 5px; margin-top: 10px; }

    /* Transforma o container principal em uma coluna flexível */
    .live-shell {
        display: flex;
        flex-direction: column;
        gap: 15px;
        height: auto !important;
    }

    /* O TRUQUE: Remove a caixa ".center" visualmente, soltando os vídeos */
    .live-shell .center {
        display: contents; 
    }

    /* --- ORDENAÇÃO DOS ELEMENTOS --- */

    /* 1º: Vídeo da Twitch */
    .live-shell .center .playerbox:nth-child(1) {
        order: 1;
        width: 100%;
        aspect-ratio: 16/9;
        height: auto;
    }

    /* 2º: Chat da Twitch */
    .live-shell .side:last-of-type {
        order: 2;
        width: 100%;
        height: 400px;
        margin-bottom: 30px;
        border-bottom: 2px solid var(--gold);
    }

    /* 3º: Vídeo da Kick */
    .live-shell .center .playerbox:nth-child(2) {
        order: 3;
        width: 100%;
        aspect-ratio: 16/9;
        height: auto;
    }

    /* 4º: Chat da Kick */
    .live-shell .side:first-of-type {
        order: 4;
        width: 100%;
        height: 400px;
    }

    /* Ajustes visuais do Menu para celular */
    .navbar { gap: 5px; justify-content: center; }
    .navbar a { flex-grow: 1; text-align: center; font-size: 10px; padding: 8px; }
    #blog-title { font-size: 18px; margin-top: 5px; }
    .header-main { width: 100%; }
}

/* =========================================
   RESTAURAÇÃO DO LAYOUT ANTIGO (DESKTOP)
   ========================================= */

/* Apenas para Desktop (Telas maiores que 1024px) */
@media (min-width: 1025px) {
    
    /* 1. Traz de volta a divisão exata 50/50 do seu CSS antigo */
    .live-shell .center {
        display: grid;
        grid-template-rows: 1fr 1fr;
        gap: var(--gap);
        height: 100%;
    }

    /* 2. Garante que a caixa do player ocupe 100% desse espaço dividido */
    .live-shell .center .playerbox {
        height: 100%; 
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    /* 3. Estica a área do vídeo (box-body) para preencher o resto */
    .live-shell .center .playerbox .box-body {
        flex: 1;
        height: auto;
    }

    /* 4. Força o iframe/vídeo a preencher 100% da área */
    .live-shell .center .playerbox .box-body iframe,
    .live-shell .center .playerbox .box-body .embed-host,
    .live-shell .center .playerbox .box-body object,
    .live-shell .center .playerbox .box-body video {
        width: 100%;
        height: 100%;
        display: block;
        border: none;
    }
}

/* =========================================
   AJUSTE FINAL: OCULTAR MENU INTERNO
   (Essencial para o layout Hub de Comando)
   ========================================= */
#header {
    display: none !important;
}

#content {
    padding-top: 20px;
}
/* --- BOTÃO CHAMATIVO PARA ABRIR AS REGRAS --- */
.btn-open-rules {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px solid #C6A24A; /* Borda Dourada */
    color: #C6A24A;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
}

.btn-open-rules:hover {
    background: rgba(198, 162, 74, 0.1);
    box-shadow: 0 0 15px rgba(198, 162, 74, 0.2);
}

/* Estado quando aceito */
.btn-open-rules.rules-accepted {
    background: #C6A24A;
    color: #000;
    border-color: #C6A24A;
}

/* --- O POP-UP (MODAL) --- */
.rules-modal-overlay {
    display: none; /* Escondido por padrão */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Fundo preto transparente */
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rules-modal-content {
    background: #111;
    border: 1px solid #C6A24A;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh; /* Altura máxima */
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease;
}

/* Cabeçalho do Modal */
.rules-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0a0a0a;
    border-radius: 12px 12px 0 0;
}
.rules-header h3 { margin: 0; color: #fff; font-size: 16px; }
.btn-close-modal { background: none; border: none; color: #888; font-size: 24px; cursor: pointer; }

/* Corpo do Texto (Com Scroll) */
.rules-body {
    padding: 20px;
    overflow-y: auto; /* Scroll Vertical */
    text-align: left;
    color: #ccc;
    font-size: 13px;
    line-height: 1.6;
}

/* Formatação do Texto das Regras */
.rules-body h4 { color: #C6A24A; margin-top: 20px; margin-bottom: 5px; border-bottom: 1px solid #333; display: inline-block; }
.rules-body strong { color: #fff; }
.rules-body ul { padding-left: 20px; margin: 10px 0; }
.rules-body .danger-text { color: #ff4444; font-weight: bold; }

/* Rodapé do Modal (Checkbox) */
.rules-footer {
    padding: 20px;
    background: #0a0a0a;
    border-top: 1px solid #333;
    border-radius: 0 0 12px 12px;
}

.agreement-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    cursor: pointer;
}
.agreement-box input { width: 20px; height: 20px; accent-color: #C6A24A; cursor: pointer; }
.agreement-box label { cursor: pointer; color: #fff; font-size: 14px; user-select: none; }

.btn-confirm-rules {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    cursor: not-allowed;
    background: #333;
    color: #666;
    transition: 0.3s;
}

/* Animação */
@keyframes fadeIn { from {opacity:0; transform:scale(0.95);} to {opacity:1; transform:scale(1);} }

/* Scrollbar Bonita */
.rules-body::-webkit-scrollbar { width: 8px; }
.rules-body::-webkit-scrollbar-track { background: #111; }
.rules-body::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.rules-body::-webkit-scrollbar-thumb:hover { background: #C6A24A; }