:root {
    --bg-color: #050811;
    --text-primary: #ffffff;
    --text-secondary: #8b9bb4;
    --accent: #00e676; 
    --blue-glow: rgba(41, 121, 255, 0.4);
    --green-glow: rgba(0, 230, 118, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; 
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Fundo Animado com Efeito Radar */
.bg-radar {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200vw; height: 200vw;
    background: radial-gradient(circle, var(--blue-glow) 0%, transparent 40%);
    opacity: 0.3;
    animation: rotateBackground 60s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes rotateBackground {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.tv-container {
    position: relative;
    z-index: 10;
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 20px 40px 10px 40px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.btn-dash-completo {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
    transition: 0.3s;
    font-size: 1rem;
    white-space: nowrap;
}

/* Header */
.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.tv-control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tv-control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
}

.tv-control-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.header-title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: var(--text-secondary);
}

.live-pulse {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #ff1744;
}

.badge-rt {
    background: rgba(255, 23, 68, 0.15);
    border: 1px solid #ff1744;
    color: #ff1744;
    font-size: 0.9rem;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.4);
}

.live-pulse .dot {
    width: 15px;
    height: 15px;
    background-color: #ff1744;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 23, 68, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 23, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 23, 68, 0); }
}

/* Header Left & Logo styles */
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}
.tv-logo {
    height: 125px;
    width: auto;
    object-fit: contain;
}
.highlight-date {
    color: var(--accent);
}

/* Fonte de Dados Pill */
.tv-source-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 30px;
    margin-bottom: 15px;
    font-size: 0.95rem; /* Aumentado em +1px */
    color: var(--text-secondary);
    text-align: center;
    align-self: center;
    backdrop-filter: blur(5px);
    width: fit-content;
}
.tv-source-pill i {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

/* KPIs Supremos */
.kpis-section {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent);
    border-radius: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.kpi-block {
    text-align: center;
}

.kpi-label {
    font-size: 1.5rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.kpi-value {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 30px var(--blue-glow);
    font-variant-numeric: tabular-nums;
}

/* Palco Central (Multi-Cena) */
.stage-section {
    position: relative;
    flex: 1;
    width: 100%;
}

.scene {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease-in-out;
    display: flex;
    flex-direction: column;
}

.scene-active {
    opacity: 1;
    pointer-events: auto;
}

.scene-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.chart-container {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 0;
}

#cinemaChart, #sentimentChart, #sponsorsChart, #playersChart {
    width: 100% !important;
    height: 100% !important;
}

/* Ticker Rodapé */
.ticker-footer {
    position: relative;
    width: 100%;
    min-height: 95px;
    height: auto;
    background: #000;
    border-top: 3px solid var(--accent);
    display: flex;
    align-items: center;
    z-index: 1000;
    padding: 10px 0;
    flex-shrink: 0;
}

.ticker-label {
    background: var(--accent);
    color: #000;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: 900;
    font-size: 1.2rem;
    gap: 10px;
    z-index: 2;
    white-space: nowrap;
}

.ticker-wrap {
    flex: 1;
    padding: 10px 20px;
    display: flex;
    align-items: center;
}

.ticker-content {
    font-size: 1.25rem;
    color: #fff;
    white-space: normal;
    line-height: 1.4;
    width: 100%;
}



/* Efeito Typing Gemini */
.typing-effect {
    border-right: 3px solid var(--accent);
    animation: blinkCursor 0.7s infinite;
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

/* Tweets Flutuantes (Popups) */
#tweet-popups-layer, #sponsor-popups-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; /* Para não bloquear hover do gráfico */
    overflow: hidden;
}

.floating-tweet {
    position: absolute;
    width: 260px;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 24px var(--green-glow), inset 0 0 10px rgba(0,230,118,0.2);
    transform: scale(0);
    opacity: 0;
    pointer-events: auto;
    animation: popUpElastic 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.fl-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.fl-header img {
    width: 32px; height: 32px; border-radius: 50%;
    border: 2px solid #fff;
}
.fl-author {
    font-weight: 800;
    color: #fff;
    font-size: 0.95rem;
}
.fl-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.fl-likes {
    margin-top: 6px;
    color: var(--accent);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 5px;
}

@keyframes popUpElastic {
    0% { transform: scale(0) translateY(20px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.fade-out {
    animation: fadeOut 1s forwards !important;
}

@keyframes fadeOut {
    to { opacity: 0; transform: scale(0.8) translateY(-10px); }
}

/* Responsividade de Altura para Modo TV */
@media (max-height: 1080px) {
    .tv-container {
        padding: 10px 30px 5px 30px;
    }
    .tv-header {
        margin-bottom: 8px;
        padding-bottom: 5px;
    }
    .header-title {
        font-size: 1.8rem;
    }
    .live-pulse {
        font-size: 1.2rem;
    }
    .kpis-section {
        margin-bottom: 10px;
        padding: 6px;
    }
    .kpi-label {
        font-size: 1.0rem;
    }
    .kpi-value {
        font-size: 3.0rem;
    }
    .scene-title {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    .ticker-footer {
        min-height: 70px;
        height: auto;
        padding: 4px 0;
    }
    .tv-container {
        height: auto;
        flex: 1;
    }
    .tv-source-pill {
        margin-bottom: 6px;
        font-size: 0.85rem;
        padding: 4px 12px;
    }
    .tv-logo {
        height: 85px;
    }
    .ticker-label {
        font-size: 0.95rem;
        padding: 0 15px;
    }
    .ticker-content {
        font-size: 1.05rem;
    }
}
@media (max-height: 900px) {
    .tv-container {
        padding: 5px 20px 2px 20px;
    }
    .tv-header {
        margin-bottom: 5px;
        padding-bottom: 3px;
    }
    .header-title {
        font-size: 1.5rem;
    }
    .live-pulse {
        font-size: 1.0rem;
    }
    .kpis-section {
        margin-bottom: 6px;
        padding: 4px;
    }
    .kpi-label {
        font-size: 0.85rem;
    }
    .kpi-value {
        font-size: 2.2rem;
    }
    .scene-title {
        font-size: 1.1rem;
        margin-bottom: 2px;
    }
    .ticker-footer {
        min-height: 60px;
        padding: 2px 0;
    }
    .tv-source-pill {
        margin-bottom: 4px;
        font-size: 0.75rem;
        padding: 2px 10px;
    }
    .tv-logo {
        height: 65px;
    }
    .ticker-label {
        font-size: 0.85rem;
    }
    .ticker-content {
        font-size: 0.95rem;
    }
}

/* --- Tela de Autenticação --- */
.auth-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 17, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(15px);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.auth-card {
    background: rgba(10, 15, 30, 0.85);
    border: 1px solid rgba(0, 230, 118, 0.15);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 230, 118, 0.05);
    border-radius: 28px;
    width: 90%;
    max-width: 500px;
    padding: 40px 30px;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    transition: all 0.5s ease;
}

.auth-card:hover {
    border-color: rgba(0, 230, 118, 0.35);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 230, 118, 0.15);
    transform: translateY(-2px);
}

.auth-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-bottom: 5px;
}

.auth-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.auth-logo-divider {
    width: 1px;
    height: 35px;
    background: rgba(255, 255, 255, 0.15);
}

.auth-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1px;
    margin: 0;
}

.green-text {
    color: var(--accent);
    background: linear-gradient(135deg, #00e676 0%, #00b0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: 1.1rem;
    color: #8b9bb4;
    margin: 0;
    line-height: 1.4;
}

.auth-instruction {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: -10px;
    margin-bottom: 5px;
}

.auth-form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-input {
    width: 100%;
    background: #090807;
    border: 1px solid rgba(0, 230, 118, 0.2);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 1.1rem;
    color: #ffffff;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--green-glow);
    background: #0d0c0a;
}

.auth-input-error {
    border-color: #ff1744 !important;
    animation: shake 0.4s ease;
}

.auth-error-msg {
    color: #ff1744;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 5px;
}

.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #00e676 0%, #00b0ff 100%);
    color: #000000;
    border: none;
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px var(--green-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.6), 0 0 50px rgba(0, 176, 255, 0.4);
    filter: brightness(1.15);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-footer {
    font-size: 0.8rem;
    color: rgba(139, 155, 180, 0.4);
    margin-top: 10px;
}

/* Esconder o container principal do TV se não autenticado */
.tv-container {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tv-container.auth-success {
    opacity: 1;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}