:root {
  --bg: #0e0d12;
  --surface: #18161f;
  --surface-2: #221f2b;
  --border: #2d2938;
  --text: #ece9f2;
  --muted: #9a94a8;
  --accent: #d4a24c;
  --live: #e5484d;
  --twitch: #9146ff;
  --kick: #53fc18;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button { font: inherit; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; color: var(--accent); }

/* ---------- topo ---------- */
.top {
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 16px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
h1 { margin: 0; font-size: 28px; letter-spacing: .5px; }
h1 span { color: var(--accent); }
.subtitle { margin: 4px 0 0; color: var(--muted); }
.auth { display: flex; flex-wrap: wrap; gap: 8px; }
.login-btn, .account {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 14px;
  text-decoration: none; border: 0; cursor: pointer;
}
.login-btn.twitch { background: var(--twitch); color: #fff; }
.login-btn.kick { background: var(--kick); color: #0b0b0b; }
.account { background: var(--surface); color: var(--text); cursor: default; border: 1px solid var(--border); }
.account .dot { width: 8px; height: 8px; border-radius: 50%; }
.account.twitch .dot { background: var(--twitch); }
.account.kick .dot { background: var(--kick); }
.account button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; font-size: 13px; }
.account button:hover { color: var(--text); }

main { max-width: 1600px; margin: 0 auto; padding: 8px 16px 48px; }
section { margin-bottom: 32px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 18px; }
.status { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.link-button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 13px; }
.link-button:hover { color: var(--text); }
.notice { background: #2a2210; border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; }

.filters { display: flex; gap: 6px; }
.filters button {
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  border-radius: 99px; padding: 3px 12px; font-size: 13px; cursor: pointer;
}
.filters button[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }

/* ---------- selo da plataforma ---------- */
.pill { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: .3px; }
.pill.twitch { background: var(--twitch); color: #fff; }
.pill.kick { background: var(--kick); color: #0b0b0b; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform .15s, box-shadow .15s; border: 0; padding: 0; color: inherit; text-align: left;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--accent); outline: none; }
.card.is-watching { box-shadow: 0 0 0 2px var(--accent); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.badge.live { top: 8px; left: 8px; background: var(--live); color: #fff; }
.thumb .pill { position: absolute; top: 8px; left: 78px; }
.badge.uptime { top: 8px; right: 8px; background: rgba(0,0,0,.75); }
.badge.viewers { bottom: 8px; left: 8px; background: rgba(0,0,0,.75); }
.badge.watching { bottom: 8px; right: 8px; background: var(--accent); color: #0b0b0b; }
.info { padding: 12px; }
.name { font-weight: 600; }
.title { color: var(--muted); font-size: 14px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { background: var(--surface-2); color: var(--muted); font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.tag.hit { color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 64px 16px; }
.empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* ---------- lives abertas (vídeo + chat lado a lado) ---------- */
/* Cada vídeo precisa ter pelo menos 400x300 (regra de embed da Twitch para contar a visualização): 533px de vídeo + 320px de chat. */
.watching { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 880px), 1fr)); gap: 20px; }
.tile { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.tile-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-width: 0; }
.tile-title { color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; min-width: 0; }
.tile-link { color: var(--muted); text-decoration: none; font-size: 16px; }
.tile-link:hover, .tile-close:hover { color: var(--text); }
.tile-close { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; }
.tile-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.video { aspect-ratio: 16 / 9; background: #000; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* O chat acompanha a altura do vídeo. */
.chat { position: relative; border-left: 1px solid var(--border); background: var(--bg); }
.chat-inner { position: absolute; inset: 0; display: flex; flex-direction: column; }
.chat-status { color: var(--muted); font-size: 12px; padding: 4px 10px; }
.chat-status:empty { display: none; }
.chat-messages { list-style: none; margin: 0; padding: 6px 10px; overflow-y: auto; flex: 1; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-messages li { padding: 2px 0; }
.chat-messages .user { font-weight: 700; }
.chat-messages .action { font-style: italic; }
.chat-messages .system { color: var(--muted); font-style: italic; }
.chat-messages .system.error { color: #ff8a8d; }
.chat-messages img.emote { height: 24px; vertical-align: middle; margin: -4px 1px; }
.chat-footer { border-top: 1px solid var(--border); padding: 8px; }
.chat-form { display: flex; gap: 6px; }
.chat-form input {
  flex: 1; min-width: 0; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; font: inherit; font-size: 13px;
}
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-form button { border: 0; border-radius: 6px; padding: 0 12px; font-weight: 600; cursor: pointer; }
.chat-form.twitch button { background: var(--twitch); color: #fff; }
.chat-form.kick button { background: var(--kick); color: #0b0b0b; }
.chat-form button:disabled { opacity: .5; cursor: default; }
.chat-footer .login-btn { width: 100%; justify-content: center; }
.chat-footer .hint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 6px; }

@media (max-width: 900px) {
  .tile-body { grid-template-columns: 1fr; }
  .chat { border-left: 0; border-top: 1px solid var(--border); height: 380px; }
}

/* ---------- painel de curadoria ---------- */
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; margin-top: 6px; }
.admin-login { max-width: 340px; margin: 40px auto; display: flex; flex-direction: column; gap: 10px; background: var(--surface); padding: 24px; border-radius: var(--radius); }
.admin-login input { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 9px 10px; font: inherit; }
.admin-login button, .btn { border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 600; cursor: pointer; background: var(--surface-2); color: var(--text); }
.admin-login button { background: var(--accent); color: #0b0b0b; }
.btn.approve { background: #2f9e44; color: #fff; }
.btn.reject { background: #c92a2a; color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.admin-error { color: #ff8a8d; margin: 0; }
.admin-info { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: grid; gap: 4px; font-size: 14px; }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-tabs button { background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 5px 14px; cursor: pointer; }
.admin-tabs button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.admin-list { display: grid; gap: 12px; }
.admin-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 12px; }
.admin-thumb { aspect-ratio: 16 / 9; background: var(--surface-2); border-radius: 6px; overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-decoration: none; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-title-line .name { color: var(--text); text-decoration: none; font-size: 16px; }
.admin-live { color: var(--live); font-size: 13px; font-weight: 600; }
.admin-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 170px; }
@media (max-width: 760px) {
  .admin-row { grid-template-columns: 1fr; }
  .admin-actions { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- contas do painel ---------- */
.admin-login h2 { margin: 0 0 6px; font-size: 18px; }
.admin-login h3 { margin: 14px 0 0; font-size: 15px; }
.admin-login label { font-size: 13px; color: var(--muted); margin-bottom: -6px; }
.admin-login .hint, .hint { color: var(--muted); font-size: 12px; margin: -4px 0 0; }
.admin-setup { max-width: 420px; }
.admin-setup #username-field { display: flex; flex-direction: column; gap: 10px; }
.setup-steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.setup-steps strong { color: var(--text); }
.qr { background: #fff; border-radius: 8px; padding: 8px; width: 220px; height: 220px; margin: 4px auto; display: grid; place-items: center; color: #333; font-size: 13px; text-align: center; }
.qr svg { width: 100%; height: 100%; }
details { font-size: 13px; color: var(--muted); }
details summary { cursor: pointer; }
.secret { display: block; margin-top: 6px; word-break: break-all; font-size: 14px; letter-spacing: .5px; }
.admin-user { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.disclaimer { max-width: 1600px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- anúncios flutuantes ---------- */
.announcements { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 12px; width: min(360px, calc(100vw - 32px)); }
.announcement {
  position: relative; display: block; background: var(--surface); color: var(--text); text-decoration: none;
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 40px 14px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55); animation: announcement-in .25s ease-out;
}
.announcement:hover { background: var(--surface-2); }
.announcement strong { display: block; color: var(--accent); margin-bottom: 4px; }
.announcement p { margin: 0; font-size: 14px; white-space: pre-line; }
.announcement-cta { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }
.announcement-close { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.announcement-close:hover { color: var(--text); }
@keyframes announcement-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .announcements { right: 16px; left: 16px; bottom: 16px; width: auto; } }

/* ---------- painel: seções ---------- */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.admin-nav button { background: none; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.admin-nav button[aria-selected="true"] { background: var(--surface); color: var(--text); }
.admin-nav .count { background: var(--accent); color: #0b0b0b; border-radius: 99px; padding: 0 7px; font-size: 12px; margin-left: 6px; }
.admin-section h2 { font-size: 17px; margin: 0 0 12px; }
.admin-section h3 { font-size: 15px; margin: 22px 0 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.stat .value { font-size: 28px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--surface-2); border-radius: 99px; padding: 3px 10px; font-size: 13px; }
.chip.twitch { border: 1px solid var(--twitch); }
.chip.kick { border: 1px solid var(--kick); }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data code { font-size: 12px; }
table.data .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.badge-inline { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); }
.badge-inline.blocked { background: #c92a2a; color: #fff; }
.badge-inline.active { background: #2f9e44; color: #fff; }
.badge-inline.me { background: var(--accent); color: #0b0b0b; }
.form-card { background: var(--surface); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; max-width: 640px; }
.form-card label { font-size: 13px; color: var(--muted); }
.form-card input, .form-card textarea, .form-card select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 14px; width: 100%;
}
.form-card textarea { min-height: 80px; resize: vertical; }
.form-card .inline { display: flex; gap: 8px; align-items: center; }
.form-card .inline > * { flex: 1; }
.form-card .actions { display: flex; gap: 10px; align-items: center; }
.btn.primary { background: var(--accent); color: #0b0b0b; }
.ok-msg { color: #69db7c; font-size: 13px; }
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px; }
.tag-editor .chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); }
.tag-editor .chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 15px; line-height: 1; }
.tag-editor input { flex: 1; min-width: 140px; border: 0; background: none; padding: 4px; }
.tag-editor input:focus { outline: none; }
.preview-box { position: relative; min-height: 120px; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px; display: flex; justify-content: flex-end; align-items: flex-end; }
.preview-box .announcement { width: 320px; animation: none; }

/* ---------- atalho para streamers ---------- */
.streamer-cta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 24px; padding: 14px 18px; border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(212, 162, 76, .22), rgba(145, 70, 255, .18) 60%, rgba(83, 252, 24, .12));
  border: 1px solid var(--accent); color: var(--text); text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.streamer-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212, 162, 76, .25); }
.streamer-cta-icon { font-size: 26px; }
.streamer-cta-text { flex: 1; min-width: 220px; }
.streamer-cta-button { background: var(--accent); color: #0b0b0b; font-weight: 700; padding: 8px 14px; border-radius: 8px; white-space: nowrap; }
.empty a { color: var(--accent); font-weight: 600; }

/* ---------- guia para streamers ---------- */
.home-link { color: inherit; text-decoration: none; }
.guide { max-width: 1000px; }
.guide-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.guide-hero h2 { margin: 0 0 8px; font-size: 22px; }
.guide-hero p { margin: 0 0 14px; color: var(--muted); }
.guide-hero p strong { color: var(--text); }
.guide-tags { display: flex; flex-wrap: wrap; gap: 20px; margin: 18px 0 14px; }
.guide-tags > div { display: flex; flex-direction: column; gap: 6px; }
.guide-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.copy-chip {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--bg); border: 2px dashed var(--accent); color: var(--accent); border-radius: 8px;
  padding: 10px 16px; font: 700 22px ui-monospace, Consolas, monospace;
}
.copy-chip span { font: 600 12px system-ui, sans-serif; color: var(--muted); }
.copy-chip:hover span { color: var(--text); }
.guide-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; margin-bottom: 20px; }
.guide-card { background: var(--surface); border-radius: var(--radius); padding: 20px; border-top: 3px solid var(--border); }
.guide-card.twitch { border-top-color: var(--twitch); }
.guide-card.kick { border-top-color: var(--kick); }
.guide-card h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-size: 17px; }
.guide-card ol, .guide-info ol, .guide-info ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.guide-info { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 32px; }
.guide-info h3 { margin: 0 0 12px; font-size: 17px; }
.guide-info h3:not(:first-child) { margin-top: 22px; }
.guide-flow strong { color: var(--accent); }
