/* =========================================
   1. IMPORTAÇÕES E CONFIGURAÇÕES BASE
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&display=swap');

html, body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Garante que nada saia da tela */
    background-color: #000;
}

body {
    position: fixed; /* O SEGREDO: Trava o body na tela da TV */
    top: 0;
    left: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    color: white; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    cursor: none !important;
    z-index: 1;
}

.background-container, 
.view-showcase, 
.main-content {
    pointer-events: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Utilitários */
.vanish { opacity: 0 !important; pointer-events: none; transition: opacity 0.3s ease; }

/* =========================================
   2. BACKGROUNDS E VÍDEO
   ========================================= */
.video-bg {
    position: absolute; top: 0;  width: 120%; height: 100%;
    object-fit: cover; transition: opacity 0.5s ease-in-out; z-index: 0;
}
#video-idle { z-index: 1; opacity: 1; }
#video-action { z-index: 2; opacity: 0; }

#blackout-layer {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; opacity: 0; z-index: 5; pointer-events: none;
    transition: opacity 0.2s ease-out;
}
.meta-darkness { opacity: 0.98 !important; }
.strobe-mode { animation: strobe-flash 0.1s infinite; }
@keyframes strobe-flash { 0%, 100% { background-color: black; } 50% { background-color: #300; } }

/* =========================================
   3. TIPOGRAFIA E PAINEL PRINCIPAL (CONTADOR)
   ========================================= */
.content-overlay {
    position: relative; z-index: 10;
    text-align: center; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    width: 100%; height: 100%;
}

.numbers-container {
    background: rgba(0, 0, 0, 0.85); 
    padding: 2vh 4vw; border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex; align-items: baseline; justify-content: center;
    gap: 20px; line-height: 1; margin-bottom: 3vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.big-number {
    font-size: 16rem; font-weight: 900;
    background: linear-gradient(180deg, rgba(255, 60, 0, 0.2) 0%, #ff4500 60%, #ff0000 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
    animation: ember-pulse 3s infinite ease-in-out;
    position: relative; z-index: 20; transform: translateZ(0); 
}
@keyframes ember-pulse { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; filter: drop-shadow(0 0 30px rgba(255, 69, 0, 0.6)); } }

.de-text { font-size: 3rem; font-weight: 700; color: #ccc; font-style: italic; }
.total-number { font-size: 5rem; font-weight: 900; font-style: italic; color: #fff; }
.description { font-size: 1.8rem; font-weight: 700; text-transform: uppercase; line-height: 1.3; max-width: 900px; text-shadow: 2px 2px 4px rgba(0,0,0,1); }
.highlight { color: #ff4d4d; }

/* =========================================
   4. UI - MENU E META BADGE
   ========================================= */
.tv-menu-container {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 20px; z-index: 3000;
    opacity: 0; transition: opacity 0.5s ease-in-out; pointer-events: none; 
}
.tv-menu-container.active { opacity: 1; pointer-events: auto; }

.btn-skip-showcase {
    position: absolute; bottom: 40px; right: 40px; z-index: 100;
    background-color: rgba(255, 255, 255, 0.2); color: white;
    border: 1px solid rgba(255, 255, 255, 0.4); padding: 15px 30px;
    font-size: 1.2rem; font-weight: 700; border-radius: 5px;
    cursor: pointer; text-transform: uppercase; letter-spacing: 2px;
    backdrop-filter: blur(5px); transition: all 0.3s ease;
    display: none;
}
.btn-skip-showcase:hover {
    background-color: #ff4500; border-color: #ff4500;
    transform: scale(1.05); box-shadow: 0 0 20px rgba(255, 69, 0, 0.6);
}

.menu-item {
    background: rgba(0, 0, 0, 0.9); border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px; border-radius: 50px; font-size: 1.2rem; font-weight: bold; color: #fff;
    display: flex; align-items: center; gap: 10px; transition: all 0.2s;
}
.menu-item.focused { border-color: #ff4500; background: rgba(255, 69, 0, 0.2); box-shadow: 0 0 15px rgba(255, 69, 0, 0.5); }
.status-indicator { width: 12px; height: 12px; border-radius: 50%; background-color: #ccc; display: inline-block; }
.sync-on .status-indicator { background-color: #00ff00; box-shadow: 0 0 10px #00ff00; }
.sync-off .status-indicator { background-color: #ff0000; box-shadow: 0 0 10px #ff0000; }

#meta-badge {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0);
    z-index: 2000; font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 8rem;
    text-transform: uppercase; letter-spacing: 5px; text-align: center; line-height: 1.1;
    pointer-events: none; opacity: 0;
    background: linear-gradient(to right, #BF953F, #FCF6BA 20%, #B38728 40%, #FBF5B7 60%, #AA771C 80%, #BF953F 100%);
    background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)); -webkit-text-stroke: 2px rgba(255, 255, 255, 0.5);
}
.shiny-text-enter { animation: stamp-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, shine-move 2s linear infinite; }
@keyframes stamp-in { 0% { opacity: 0; transform: translate(-50%, -50%) scale(5); filter: blur(20px); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); } }
@keyframes shine-move { to { background-position: 200% center; } }

/* =========================================
   5. ANIMAÇÕES (FORJA)
   ========================================= */
.move-to-center {
    position: fixed !important; top: 50% !important; left: 50% !important;
    transform: translate(-50%, -50%) scale(1.4) !important; 
    z-index: 2000 !important; margin: 0 !important; width: auto !important;
    white-space: nowrap !important; text-align: center !important;
}
@keyframes forge-heat {
    0% { transform: translate(-50%, -50%) scale(1.4); color: #fff; }
    40% { transform: translate(-50%, -50%) scale(1.6); color: #ffcc00; text-shadow: 0 0 30px #ff4500; }
    60% { transform: translate(-50%, -50%) scale(1.65); color: #ffffff; text-shadow: 0 0 50px #ffffff; }
    100% { transform: translate(-50%, -50%) scale(1.4); color: #fff; }
}
.counting-forge { position: fixed !important; top: 50% !important; left: 50% !important; z-index: 2000; animation: forge-heat 4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards !important; }

@keyframes drama-pulse { 0% { transform: translate(-50%, -50%) scale(1.4); color: #fff; } 50% { transform: translate(-50%, -50%) scale(1.5); color: #ff3300; } 100% { transform: translate(-50%, -50%) scale(1.4); color: #fff; } }
.counting-drama { position: fixed !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) scale(1.4) !important; z-index: 2000; animation: drama-pulse 0.8s infinite !important; }

@keyframes shake-hard-centered { 0% { transform: translate(-50%, -50%) scale(1.4) rotate(0deg); } 25% { transform: translate(-55%, -45%) scale(1.4) rotate(-5deg); } 75% { transform: translate(-45%, -55%) scale(1.4) rotate(5deg); } 100% { transform: translate(-50%, -50%) scale(1.4) rotate(0deg); } }
.shaking-hard { animation: shake-hard-centered 0.1s infinite !important; }
@keyframes number-pop-vanish-centered { 0% { transform: translate(-50%, -50%) scale(0.9); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; } }
.number-explosion { animation: number-pop-vanish-centered 0.6s ease-out forwards !important; }
@keyframes chaos-shake { 0% { transform: translate(0, 0); } 20% { transform: translate(-15px, 15px); } 40% { transform: translate(15px, -15px); } 60% { transform: translate(-15px, -15px); } 100% { transform: translate(0, 0); } }
.screen-quake { animation: chaos-shake 0.5s ease-out; }

/* =========================================
   6. VIEW SHOWCASE (SPLIT-SCREEN CORRIGIDO)
   ========================================= */

.showcase-layer {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 5000; background-color: #000;
    opacity: 0; pointer-events: none; transition: opacity 0.6s ease-in-out;
    display: flex; overflow: hidden;
}
.showcase-layer.active { opacity: 1 !important; pointer-events: auto !important; }

/* Direita (Fotos) */
.showcase-bg {
    position: absolute; top: 0; right: 0; width: 65vw; height: 100%;
    background-size: cover; background-position: center; z-index: 1;
    transform: scale(1); transition: background-image 1s ease-in-out;
    box-shadow: inset 50px 0 100px rgba(0,0,0,0.9);
}
.showcase-layer.active .showcase-bg { /*animation: slowPan 20s linear infinite;*/ }
/*@keyframes slowPan { from { transform: scale(1.1); } to { transform: scale(1.2); } }

/* Esquerda (Sidebar) */
.showcase-content {
    position: relative; z-index: 10;
    width: 40vw; height: 100vh;
    background: #0a0a0a; /* Fundo preto sólido */
    display: flex; flex-direction: column; 
    justify-content: center; align-items: center;
    padding: 0 2vw; box-sizing: border-box; text-align: center;
    border-right: 5px solid #333; 
    box-shadow: 10px 0 50px rgba(0,0,0,1);
}

.sc-header { margin-bottom: 3vh; display: flex; flex-direction: column; align-items: center; gap: 1vh; }

.sc-badge {
    background: #333; color: #fff; padding: 1vh 2vw; font-size: 1rem;
    font-weight: 700; letter-spacing: 3px; border-radius: 4px; 
    text-transform: uppercase; margin-bottom: 1vh;
}
.sc-location { 
    font-size: 1rem; color: #888; text-transform: uppercase; 
    letter-spacing: 2px; display: flex; align-items: center; gap: 10px;
}
.sc-location::before { content: '📍'; font-size: 1rem; }

/* Logo Box */
.sc-logo-box {
    background: white; padding: 20px; border-radius: 10px;
    margin-bottom: 3vh; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 60%; display: flex; justify-content: center; align-items: center;
}
.sc-logo-box img { max-height: 12vh; max-width: 100%; object-fit: contain; }

/* Infos */
.sc-main { width: 100%; display: flex; flex-direction: column; align-items: center; }
.sc-company-info { margin-bottom: 4vh; }

.sc-name {
    font-size: 2.8rem; font-weight: 900; margin: 0; line-height: 1.1; 
    text-transform: uppercase; color: #fff;
}
.sc-company { 
    font-size: 1.1rem; font-weight: 400; color: #666; margin-top: 10px;
    font-style: italic; text-transform: uppercase; 
}

#idle-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9000; /* ACIMA DE TUDO */
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

#idle-layer.active {
    opacity: 1;
    pointer-events: auto;
}

#idle-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Zoom lento opcional para dar vida */
}

/* Classe auxiliar para o JS usar na hora da troca */
#idle-image.swapping {
    opacity: 0;
}

/* Animação opcional de zoom (Ken Burns effect) */
#idle-layer.active #idle-image {
    
}

@keyframes zoomIdle { from { transform: scale(1); } to { transform: scale(1.1); } }

@keyframes slowZoomIdle {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

/* Dono - Layout Corrigido */
.sc-owner-box {
    margin-top: 2vh; 
    padding: 2vh;
    width: 90%;
    
    /* Flexbox Coluna para empilhar */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* Caixa decorativa sutil */
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.02);

    /* Animação */
    opacity: 0; animation: fadeUp 1s ease-out 0.8s forwards;
}

.sc-owner-label { 
    font-size: 0.9rem; 
    letter-spacing: 3px; 
    text-transform: uppercase; 
    margin-bottom: 0.5vh;
    font-weight: 700;
    color: #888; /* JS pode sobrescrever isso */
}

.sc-owner-name {
    font-size: 2.5rem; 
    font-weight: 900; 
    margin: 0; 
    text-transform: uppercase; 
    letter-spacing: 1px;
    line-height: 1.1;
    color: #fff; /* JS vai sobrescrever */
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

@keyframes glowPulse { 0% { filter: brightness(1); } 50% { filter: brightness(1.3); } 100% { filter: brightness(1); } }
.glow-effect { animation: glowPulse 3s infinite; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Footer */
.sc-footer {
    position: absolute; bottom: 2vh; width: 100%; 
    display: flex; justify-content: center; opacity: 0.4;
    font-size: 0.7rem; letter-spacing: 1px;
}
.sc-line { height: 1px; flex: 1; background: #555; max-width: 15vw; }


#flash-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #fff; z-index: 9999; pointer-events: none;
    opacity: 0;
}

.trigger-flash {
    animation: flash-bang 0.4s ease-out forwards;
}

@keyframes flash-bang {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.1); }
}

/* A Explosão do Número (Mais agressiva e rápida) */
@keyframes super-nova { 
    0% { 
        transform: translate(-50%, -50%) scale(1.4); 
        opacity: 1; 
        filter: blur(0px);
        color: #fff;
    } 
    15% {
        /* O momento do impacto */
        transform: translate(-50%, -50%) scale(2.5); 
        opacity: 1;
        color: #ffaa00; /* Um clarão laranja no meio */
    }
    100% { 
        transform: translate(-50%, -50%) scale(6); 
        opacity: 0; 
        filter: blur(20px);
    } 
}

.number-explosion { 
    animation: super-nova 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) forwards !important; 
}