:root {
    --bg: #0d0f14;
    --bg2: #13161e;
    --border: rgba(255,255,255,0.07);
    --text: #dde1ec;
    --muted: #6b7194;
    --azul: #4f7cff;
    --verde: #22c97a;
    --amber: #f0a500;
    --roxo: #a78bfa;
    --esmer: #10b981;
    --red: #b91026;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
}

#frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#ctrl {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 46px;
    background: rgba(13,15,20,0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 7px;
    z-index: 9999;
    transition: opacity .4s, transform .4s;
}

#ctrl.hidden {
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

.mon-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    flex-shrink: 0;
}

.mon-btn .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mon-btn[data-idx="0"].active {
    background: rgba(79,124,255,.15);
    border-color: var(--azul);
    color: var(--azul);
    font-weight: 500;
}

.mon-btn[data-idx="1"].active {
    background: rgba(240,165,0,.15);
    border-color: var(--amber);
    color: var(--amber);
    font-weight: 500;
}

.mon-btn[data-idx="2"].active {
    background: rgba(167,139,250,.15);
    border-color: var(--roxo);
    color: var(--roxo);
    font-weight: 500;
}

.mon-btn[data-idx="3"].active {
    background: rgba(16,185,129,.15);
    border-color: var(--esmer);
    color: var(--esmer);
    font-weight: 500;
}

.mon-btn[data-idx="4"].active {
    background: rgba(18, 88, 153, 0.15);
    border-color: var(--red);
    color: var(--red);
    font-weight: 500;
}

.mon-btn[data-idx="0"] .dot {
    background: var(--azul);
}

.mon-btn[data-idx="1"] .dot {
    background: var(--amber);
}

.mon-btn[data-idx="2"] .dot {
    background: var(--roxo);
}

.mon-btn[data-idx="3"] .dot {
    background: var(--esmer);
}

.mon-btn[data-idx="4"] .dot {
    background: var(--red);
}

#prog-track {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

#prog-fill {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 1s linear;
}

#next-label {
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

#countdown-val {
    font-size: 11px;
    color: var(--muted);
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
}

.ctrl-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all .18s;
    flex-shrink: 0;
}

.ctrl-btn:hover {
    border-color: var(--verde);
    color: var(--verde);
}

#btn-pause.paused {
    border-color: var(--amber);
    color: var(--amber);
}

/* ── Botão TV ── */
#btn-tv {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
    transition: all .18s;
    flex-shrink: 0;
    white-space: nowrap;
}

#btn-tv:hover {
    border-color: #f0a500;
    color: #f0a500;
}

#btn-tv.tv-ativo {
    background: rgba(240,165,0,.15);
    border-color: #f0a500;
    color: #f0a500;
    font-weight: 500;
}

#btn-tv .tv-icon {
    font-size: 13px;
}

/* Divisor vertical */
.sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}

#monitor-badge {
    position: fixed;
    top: 10px;
    right: 25px;
    background: rgba(13,15,20,0.85);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    color: var(--muted);
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 6px;
}

#monitor-badge .live {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Badge modo TV */
#tv-badge {
    position: fixed;
    top: 10px;
    left: 200px;
    background: rgba(240,165,0,.15);
    border: 1px solid rgba(240,165,0,.4);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 11px;
    color: #f0a500;
    z-index: 9998;
    display: none;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

#tv-badge.visivel {
    display: none !important;
}

/* Logo central fixo */
#monitor-logo {
    position: top;             /* fixa na viewport */
    top: 5px;                    /* distância do topo */
    left: 50%;                   /* centraliza horizontal */
    transform: translateX(-50%); /* ajuste central exato */
    z-index: 9999;               /* acima de tudo */
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;        /* evita interferir em cliques */
}

/* Logo */
#logo {
    height: 32px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

#logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

#overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
    z-index: 9997;
    transition: opacity .35s ease;
}

#overlay.fade-in {
    opacity: 1;
    pointer-events: all;
}

#overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}