@font-face { font-family: "Barlow"; src: url("/static/fonts/Barlow-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/fonts/Barlow-SemiBold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }
:root {
  --bg: #111214; --panel: #1A1B1E; --panel-2: #212226; --line: #2A2C31; --text: #F2F3F5; --muted: #8B8F97;
  --blue: #1E90FF; --green: #3BD671; --red: #ED4245; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: "Barlow", system-ui, sans-serif; font-weight: 500; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 14px 28px;
  background: rgba(17,18,20,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 19px; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.nav { display: flex; gap: 6px; }
.nav a { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; letter-spacing: .4px; }
.nav a.active, .nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { box-shadow: inset 0 0 0 1px var(--blue); }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.me form { margin: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; }
.me-name { font-weight: 600; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 26px 28px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--blue); background: var(--blue); color: #fff; font: inherit; font-weight: 600; cursor: pointer; letter-spacing: .3px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--blue); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.icon { width: 38px; height: 38px; padding: 0; font-size: 22px; }
.btn.discord { background: #5865F2; border-color: #5865F2; width: 100%; padding: 12px; margin-top: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.weekbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.week-title { display: flex; flex-direction: column; }
.week-title strong { font-size: 22px; font-weight: 700; }
.label { color: var(--muted); font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; }
.scope { margin-left: auto; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .value { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.stat .label { margin-top: 6px; }
.stat.small .value { font-size: 22px; }
.tone-pos { color: var(--green); } .tone-neg { color: var(--red); } .tone-zero, .tone-none { color: var(--text); }
.chart-card { padding: 18px 18px 10px; height: 360px; margin-bottom: 18px; position: relative; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; padding: 16px 18px; margin-bottom: 18px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.filters select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font: inherit; font-size: 14px; min-width: 150px; text-transform: none; letter-spacing: 0; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }
.table-card { margin-bottom: 18px; overflow: hidden; }
.table-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.table-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.count { color: var(--muted); font-weight: 600; font-size: 13px; margin-left: 6px; background: var(--panel-2); padding: 2px 8px; border-radius: 999px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; letter-spacing: 1.1px; text-transform: uppercase; padding: 10px 18px; white-space: nowrap; }
td { padding: 10px 18px; border-top: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover { background: rgba(30,144,255,.05); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 22px; }
.total-row td { font-weight: 700; border-top: 2px solid var(--line); }
.page-title { font-size: 24px; margin: 0 0 18px; }
.small-title { font-size: 14px; font-weight: 500; margin-left: 8px; }
.center-card { min-height: 70vh; display: grid; place-items: center; }
.login { padding: 34px 32px; width: min(420px, 100%); text-align: center; }
.login h1 { margin: 0 0 6px; font-size: 28px; }
.alert { background: rgba(237,66,69,.12); border: 1px solid rgba(237,66,69,.4); color: #ffb3b4; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat .value { font-size: 26px; } .chart-card { height: 280px; } }
@media (max-width: 560px) { .topbar { padding: 12px 14px; gap: 12px; flex-wrap: wrap; } .me-name { display: none; } .wrap { padding: 18px 14px 40px; }
  .stat { padding: 14px; } .stat .value { font-size: 22px; } .stat.small .value { font-size: 18px; } .scope { margin-left: 0; width: 100%; } }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #fff; background: rgba(30,144,255,.18); box-shadow: inset 0 0 0 1px var(--blue); margin-right: 8px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 10px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--panel-2);
  border: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.chip strong { color: var(--text); font-weight: 600; }
.chip:hover { border-color: var(--red); }
.clear { font-size: 13.5px; color: var(--blue); margin-left: 4px; }
.clear:hover { text-decoration: underline; }
.note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.stats.is-filtered .stat { border-color: rgba(30,144,255,.45); }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: #b9d9ff; background: rgba(30,144,255,.14); vertical-align: 1px; }
.tag.live { color: #b8f5cf; background: rgba(59,214,113,.14); }
.tag.muted-tag { color: var(--muted); background: var(--panel-2); }
.gap-row td { color: var(--muted); font-style: italic; }
.section-row td { color: var(--muted); font-size: 11.5px; letter-spacing: 1.1px; text-transform: uppercase; padding-top: 18px; }
.legend { font-size: 13px; }
.link { color: var(--text); border-bottom: 1px dotted var(--muted); }
.link:hover { color: var(--blue); border-color: var(--blue); }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .stats.three { grid-template-columns: 1fr; } .legend { display: none; } }
/* ---- adicionar/apagar registos */
.add-btn { margin-left: auto; white-space: nowrap; }
.add-btn + .me { margin-left: 12px; }
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal.small { width: min(420px, 100%); }
.modal h2 { margin: 0 0 8px; font-size: 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }
.tab { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 7px 14px;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.tab.active { color: var(--text); border-color: var(--blue); background: rgba(30,144,255,.14); }
.add-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.field[hidden], .row-2[hidden], .computed[hidden] { display: none; }
.field .muted { text-transform: none; letter-spacing: 0; }
.field input, .field select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 15px; text-transform: none; letter-spacing: 0; width: 100%; color-scheme: dark; }
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.computed { margin: -2px 0 0; color: var(--muted); font-size: 14px; }
.computed strong { color: var(--green); font-size: 18px; }
.member-field { position: relative; }
.member-results { list-style: none; margin: 0; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  max-height: 240px; overflow-y: auto; text-transform: none; letter-spacing: 0; }
.member-results li { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 7px 8px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 14px; }
.member-results li img { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; }
.member-results li small { color: var(--muted); font-size: 12px; }
.member-results li:hover, .member-results li:focus { background: rgba(30,144,255,.12); outline: none; }
.member-results li.muted { display: block; cursor: default; color: var(--muted); }
.member-results li.disabled { opacity: .45; cursor: not-allowed; }
.member-picked { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--blue);
  border-radius: 10px; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 15px; }
.member-picked[hidden] { display: none; }
.member-picked img { width: 28px; height: 28px; border-radius: 50%; }
.member-picked .icon-btn { margin-left: auto; }
.form-error { margin: 0; padding: 9px 12px; border-radius: 10px; background: rgba(237,66,69,.12); border: 1px solid rgba(237,66,69,.4); color: #ffb3b4; font-size: 14px; }
.form-error[hidden] { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn[disabled] { opacity: .5; cursor: wait; }
.icon-btn { background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 8px; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 4px 8px; }
.icon-btn:hover { color: var(--text); border-color: var(--line); }
.icon-btn.del:hover { color: var(--red); border-color: rgba(237,66,69,.5); }
th.act, td.act { width: 1%; padding-left: 4px; padding-right: 10px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2a1f; color: #c9f7d7;
  border: 1px solid rgba(59,214,113,.5); padding: 11px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  max-width: calc(100vw - 32px); }
.toast.error { background: #2a1d1d; color: #ffb3b4; border-color: rgba(237,66,69,.5); }
.toast[hidden] { display: none; }
@media (max-width: 560px) {
  .add-btn { order: 3; width: 100%; margin-left: 0; }
  .add-btn + .me { margin-left: auto; }
  .row-2 { grid-template-columns: 1fr; }
  .modal { padding: 16px; }
}
/* ---- sorteio Kick */
.raffle-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.raffle-head .page-title { margin-bottom: 14px; }
.conn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.conn[data-state="connected"] { color: var(--text); }
.conn[data-state="connected"] .conn-dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.conn[data-state="connecting"] .conn-dot, .conn[data-state="reconnecting"] .conn-dot { background: #F0B232; animation: pulse 1s infinite; }
.conn[data-state="error"] .conn-dot { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rf-kw { color: #1BB2FF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; margin-top: 18px; }
.rf-main, .rf-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rf-side { position: sticky; top: 84px; }
.rf-card { padding: 18px 20px; }
.rf-card .table-head { padding: 0 0 10px; }
.rf-status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.rf-pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .4px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); margin-right: 8px; }
.rf-pill[data-state="open"] { color: #0b1d26; background: #1BB2FF; border-color: #1BB2FF; }
.rf-pill[data-state="closed"] { color: #F0B232; border-color: rgba(240,178,50,.5); }
.rf-fast { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; cursor: pointer; }
.rf-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-controls .btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn.rf-draw { background: #1BB2FF; border-color: #1BB2FF; color: #06131a; padding-left: 26px; padding-right: 26px; }
.btn.danger-ghost:hover { border-color: var(--red); color: #ffb3b4; }
.rf-fair { font-size: 13px; margin: 12px 0 0; word-break: break-all; }
.rf-fair code, .rf-dl code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.reel-wrap { position: relative; overflow: hidden; margin-top: 16px; height: 116px; border-radius: 12px; background: var(--panel-2);
  border: 1px solid var(--line); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.reel-marker { position: absolute; z-index: 2; left: 50%; top: 0; bottom: 0; width: 3px; transform: translateX(-50%);
  background: #1BB2FF; box-shadow: 0 0 14px #1BB2FF; }
.reel { display: flex; gap: 10px; height: 100%; align-items: center; padding: 0 10px; will-change: transform; }
.reel-empty { width: 100%; text-align: center; }
.tile { flex: 0 0 112px; height: 92px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600;
  overflow: hidden; padding: 0 6px; }
.tile span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.won { border-color: #1BB2FF; box-shadow: 0 0 0 2px #1BB2FF inset, 0 0 24px rgba(27,178,255,.45); }
.rf-av { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800;
  color: #0b0c0e; background: #5865F2; font-size: 15px; }
.rf-av.big { width: 64px; height: 64px; flex-basis: 64px; font-size: 28px; }
.rf-winner { display: flex; gap: 16px; align-items: center; margin-top: 16px; padding: 16px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(27,178,255,.16), rgba(27,178,255,.03)); border: 1px solid rgba(27,178,255,.45); }
.rf-winner[hidden], .rf-wchat[hidden] { display: none; }
.rf-winner .label { font-size: 12px; letter-spacing: 1.5px; color: #1BB2FF; font-weight: 700; }
.rf-winner-name { font-size: 28px; font-weight: 800; line-height: 1.1; margin: 2px 0 6px; word-break: break-all; }
.rf-winner-meta { font-size: 13px; margin-top: 6px; }
.rf-wchat { margin-top: 14px; }
.rf-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.rb { font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 2px 6px; border-radius: 5px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted); text-transform: uppercase; }
.rb-subscriber, .rb-founder { color: #53FC18; border-color: rgba(83,252,24,.4); }
.rb-moderator { color: #00C27A; border-color: rgba(0,194,122,.4); }
.rb-vip { color: #F0B232; border-color: rgba(240,178,50,.4); }
.rb-og { color: #1BB2FF; border-color: rgba(27,178,255,.4); }
.rb-broadcaster { color: #ED4245; border-color: rgba(237,66,69,.4); }
.rf-settings { display: flex; flex-direction: column; gap: 12px; }
.rf-settings textarea { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14px; resize: vertical; text-transform: none; letter-spacing: 0; }
.rf-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; text-transform: none; letter-spacing: 0; color: var(--text); font-size: 14px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chk input { accent-color: #1BB2FF; width: 16px; height: 16px; }
.rf-pane { padding-bottom: 10px; }
.rf-search { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 5px 12px;
  font: inherit; font-size: 13px; width: 130px; }
.entry-list, .chat-list, .rf-winners { list-style: none; margin: 0; padding: 0; }
.entry-list { max-height: 340px; overflow-y: auto; }
.entry { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.entry .rf-av { width: 26px; height: 26px; flex-basis: 26px; font-size: 12px; }
.entry .e-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .e-w { margin-left: auto; color: #53FC18; font-weight: 700; font-size: 12px; }
.entry.inel { opacity: .45; }
.chat-list { max-height: 380px; overflow-y: auto; font-size: 13.5px; }
.rf-wchat .chat-list { max-height: 200px; }
.chat-line { padding: 5px 6px; border-radius: 6px; line-height: 1.35; word-break: break-word; }
.chat-line .c-time { color: var(--muted); font-size: 11px; margin-right: 6px; }
.chat-line .c-name { font-weight: 700; margin: 0 6px 0 4px; }
.chat-line.hit { background: rgba(27,178,255,.13); box-shadow: inset 3px 0 0 #1BB2FF; }
.empty-li { padding: 14px 4px; }
.rf-winners li { padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rf-winners li.rerolled strong { text-decoration: line-through; color: var(--muted); }
.rf-winners { padding: 0 20px 8px 40px; list-style: decimal; color: var(--muted); }
.rf-winners strong { color: var(--text); }
.rf-dl { display: grid; grid-template-columns: 220px 1fr; gap: 8px 14px; margin: 6px 0 12px; font-size: 14px; }
.rf-dl dt { color: var(--muted); } .rf-dl dd { margin: 0; word-break: break-all; }
.rf-explain { line-height: 1.55; margin-top: 0; }
.rf-verify-form { max-width: 420px; }
.ok { color: var(--green); font-weight: 600; margin-left: 8px; } .bad { color: var(--red); font-weight: 600; margin-left: 8px; }
.rf-win-row td { background: rgba(27,178,255,.12); font-weight: 700; }
@media (max-width: 980px) {
  .rf-grid { grid-template-columns: 1fr; }
  .rf-side { position: static; }
  .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rf-dl { grid-template-columns: 1fr; }
}
.table-card .rf-dl { padding: 0 20px; }
