/* dala-list — TV ao vivo. Azul-tinta de madrugada, âmbar de tubo, vermelho só para "ao vivo". */
:root {
    --ink: #0C1524;
    --surface: #14213A;
    --raised: #1B2B49;
    --line: #253A5E;
    --paper: #E8EDF6;
    --mist: #8796B3;
    --amber: #FFB547;
    --amber-ink: #2A1A00;
    --signal: #FF5247;
    --ok: #6FD3A0;

    --font: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
    --step--1: 0.8125rem;
    --step-0: 0.9375rem;
    --step-1: 1.125rem;
    --step-2: 1.5rem;
    --step-3: 2.25rem;
    --step-4: clamp(2.75rem, 7vw, 4.5rem);
    --radius-s: 6px;
    --radius-m: 12px;
    --radius-l: 28px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.5;
    font-variation-settings: "wdth" 100;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- peças comuns ---------- */
.wordmark {
    font-weight: 800;
    font-variation-settings: "wdth" 75, "opsz" 96;
    letter-spacing: -0.01em;
    text-decoration: none;
    line-height: 1;
}
.live {
    display: inline-flex; align-items: center; gap: 0.4em;
    font-size: var(--step--1); color: var(--mist);
}
.live::before {
    content: ""; width: 0.55em; height: 0.55em; border-radius: 50%;
    background: var(--signal); box-shadow: 0 0 0 3px rgb(255 82 71 / 0.18);
}
.field { display: grid; gap: 6px; }
.field > span { font-size: var(--step--1); color: var(--mist); }
.input {
    width: 100%;
    padding: 11px 14px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    font-size: var(--step-0);
}
.input:hover { border-color: #33507F; }
.input:focus-visible { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgb(255 181 71 / 0.2); }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-s);
    border: 1px solid var(--line);
    background: transparent;
    font-size: var(--step-0); font-weight: 600;
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--raised); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: #FFC46B; }
.btn-quiet { border-color: transparent; color: var(--mist); }
.btn-quiet:hover { color: var(--paper); }
.btn-danger:hover { border-color: var(--signal); color: #FF8A82; background: transparent; }
.btn-s { padding: 6px 10px; font-size: var(--step--1); }

/* ---------- login: a tela "liga" ---------- */
.login-page {
    min-height: 100dvh;
    display: grid; place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(ellipse 70% 50% at 50% 45%, #13213B 0%, var(--ink) 70%);
}
.screen {
    position: relative;
    width: min(440px, 100%);
    padding: 40px 36px 36px;
    border-radius: var(--radius-l);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 0 0 10px #0A111E, 0 0 0 11px var(--line), 0 40px 80px -30px #000;
    overflow: hidden;
    animation: power-on 0.9s cubic-bezier(.2,.7,.2,1) both;
}
.screen::after {           /* linhas de varredura, só dentro da tela */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgb(255 255 255 / 0.025) 0 1px, transparent 1px 3px);
}
.screen > * { position: relative; z-index: 1; animation: settle 0.5s 0.65s ease-out both; }
@keyframes power-on {
    0%   { transform: scale(0.6, 0.004); filter: brightness(4); }
    45%  { transform: scale(1, 0.004); filter: brightness(3); }
    100% { transform: scale(1, 1); filter: brightness(1); }
}
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }
.screen .wordmark { font-size: var(--step-4); display: block; margin: 0 0 10px; }
.screen .lede { margin: 0 0 28px; color: var(--mist); max-width: 30ch; }
.screen form { display: grid; gap: 16px; }
.screen .btn-primary { margin-top: 6px; padding: 13px 16px; font-size: var(--step-1); }
.notice {
    margin: 0 0 20px; padding: 10px 14px;
    border-left: 3px solid var(--signal);
    background: rgb(255 82 71 / 0.08);
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
    font-size: var(--step--1);
}
.login-foot { margin: 22px 0 0; font-size: var(--step--1); color: var(--mist); }

/* ---------- barra do topo ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 20px;
    background: rgb(12 21 36 / 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar .wordmark { font-size: var(--step-2); }
.topbar nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.search { position: relative; flex: 1; max-width: 560px; }
.search .input { padding-left: 40px; background: var(--surface); border-color: var(--surface); }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--mist); }
.search kbd {
    position: absolute; right: 10px; top: 50%; translate: 0 -50%;
    font: inherit; font-size: 12px; color: var(--mist);
    border: 1px solid var(--line); border-radius: 4px; padding: 0 6px;
}

/* ---------- guia de canais ---------- */
.guide {
    display: grid;
    grid-template-columns: 250px 1fr;
    align-items: start;
}
.cats {
    position: sticky; top: 63px;
    max-height: calc(100dvh - 63px);
    overflow-y: auto;
    padding: 16px 10px 24px 16px;
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
}
.cats button {
    display: flex; justify-content: space-between; gap: 10px; width: 100%;
    padding: 7px 10px;
    border: 0; border-radius: var(--radius-s);
    background: none; text-align: left; cursor: pointer;
    color: var(--mist); font-size: var(--step--1);
}
.cats button:hover { color: var(--paper); background: var(--surface); }
.cats button[aria-pressed="true"] { color: var(--paper); background: var(--raised); box-shadow: inset 3px 0 0 var(--amber); }
.cats .n { font-variant-numeric: tabular-nums; opacity: 0.7; }

.channels { padding: 20px 24px 40px; min-width: 0; }
.channels-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.channels-head h1 {
    margin: 0; font-size: var(--step-3); line-height: 1.1;
    font-weight: 700; font-variation-settings: "wdth" 80, "opsz" 72;
}
.channels-head .count { color: var(--mist); font-variant-numeric: tabular-nums; }
.grid {
    display: grid; gap: 2px 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.ch {
    display: flex; align-items: center; gap: 14px;
    padding: 10px; border-radius: var(--radius-m);
    text-decoration: none;
}
.ch:hover { background: var(--surface); }
.ch:hover .ch-name { color: var(--amber); }
.ch img {
    flex: none; width: 64px; height: 44px; object-fit: contain;
    padding: 5px; border-radius: var(--radius-s);
    background: #F2F5FA;
}
.ch-text { min-width: 0; display: grid; }
.ch-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-cat { font-size: var(--step--1); color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--mist); padding: 40px 0; max-width: 46ch; margin: 0; }
.admin .empty { padding: 0; }
.empty strong { display: block; color: var(--paper); font-size: var(--step-1); margin-bottom: 4px; }
.more { display: flex; justify-content: center; padding: 24px 0 0; }

/* ---------- player ---------- */
.player-page { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: #000; }
.player-bar { background: var(--ink); }
.player-bar .now { display: grid; min-width: 0; }
.player-bar .now strong {
    font-size: var(--step-1); font-weight: 700; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-note { font-size: var(--step--1); color: var(--mist); margin-left: 8px; }
.stage { position: relative; display: grid; place-items: center; min-height: 0; }
.stage video { width: 100%; max-height: calc(100dvh - 63px); background: #000; display: block; }
.stage-msg {
    position: absolute; inset: 0;
    display: grid; place-items: center; padding: 24px 16px;
    background: var(--ink);
}
.stage-msg > div { max-width: 46ch; }
.stage-msg h2 { margin: 0 0 8px; font-size: var(--step-2); line-height: 1.2; }
.stage-msg p { margin: 0 0 18px; color: var(--mist); }
.stage-msg .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- caixa "assistir no app" ---------- */
dialog {
    width: min(480px, calc(100% - 32px));
    padding: 28px; border-radius: var(--radius-m);
    background: var(--surface); color: var(--paper);
    border: 1px solid var(--line);
}
dialog::backdrop { background: rgb(5 9 16 / 0.7); }
dialog h2 { margin: 0 0 6px; font-size: var(--step-2); line-height: 1.2; }
dialog p { margin: 0 0 16px; color: var(--mist); }
.cred { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 20px; }
.cred dt { color: var(--mist); font-size: var(--step--1); align-self: center; }
.cred dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- admin ---------- */
.admin { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; display: grid; gap: 32px; }
.admin h1 { margin: 0; font-size: var(--step-3); line-height: 1.1; font-variation-settings: "wdth" 80, "opsz" 72; }
.admin h2 { margin: 0 0 14px; font-size: var(--step-1); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.form-row .wide { grid-column: 1 / -1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.form-end { display: flex; justify-content: flex-end; margin-top: 16px; }
.ticket {
    border: 1px dashed var(--amber); border-radius: var(--radius-m);
    padding: 20px; background: rgb(255 181 71 / 0.06);
}
.ticket h2 { margin-bottom: 4px; }
.ticket p { margin: 0 0 14px; color: var(--mist); font-size: var(--step--1); }
.flash-err { border-left: 3px solid var(--signal); padding: 10px 14px; background: rgb(255 82 71 / 0.08); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.flash-ok { color: var(--ok); }
.people { display: grid; }
.person {
    display: grid; gap: 12px 16px; align-items: end;
    grid-template-columns: minmax(180px, 1.2fr) 160px minmax(140px, 1fr) auto;
    padding: 16px 0; border-top: 1px solid var(--line);
}
.person:first-child { border-top: 0; padding-top: 0; }
.who { display: grid; gap: 2px; align-self: center; }
.who strong { font-size: var(--step-1); overflow-wrap: anywhere; }
.who small { color: var(--mist); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--step--1); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.on { color: var(--ok); }
.status.off { color: #FF8A82; }
.check { display: flex; align-items: center; gap: 8px; font-size: var(--step--1); padding-bottom: 10px; }
.check input { accent-color: var(--amber); width: 16px; height: 16px; }
.person-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.person-extra { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }

/* ---------- celular ---------- */
@media (max-width: 760px) {
    .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
    .topbar .search { order: 3; flex-basis: 100%; max-width: none; }
    .search kbd { display: none; }
    .guide { grid-template-columns: 1fr; }
    .cats {
        position: sticky; top: 109px; z-index: 10; max-height: none;
        display: flex; gap: 6px; overflow-x: auto;
        padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line);
        background: var(--ink);
    }
    .cats button { width: auto; flex: none; white-space: nowrap; border: 1px solid var(--line); border-radius: 99px; }
    .cats button[aria-pressed="true"] { box-shadow: none; border-color: var(--amber); }
    .cats .n { display: none; }
    .channels { padding: 16px; }
    .grid { grid-template-columns: 1fr; }
    .screen { padding: 32px 22px 26px; }
    .form-row { grid-template-columns: 1fr; }
    .person { grid-template-columns: 1fr; }
    .person-extra { grid-template-columns: 1fr; }
    .person-actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .screen, .screen > * { animation: none; }
}
