/* Balcão TCG — mobile-first, minimalista */
:root {
  --bg: #F5F6F8;
  --surface: #ffffff;
  --surface-2: #EEF0F3;
  --text: #12141A;
  --muted: #5B6070;
  --line: #E3E5EA;
  --accent: #2F4BFF;
  --accent-soft: #E8ECFF;
  --accent-ink: #ffffff;
  --amber: #FFB020;
  --amber-soft: #FFF3D6;
  --ok: #18834b;
  --ok-soft: #e5f4ec;
  --warn: #9a5700;
  --warn-soft: #fbf0df;
  --danger: #c7322b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(18, 20, 26, .04), 0 6px 24px rgba(18, 20, 26, .05);
  --tab-h: 64px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1015;
    --surface: #171A21;
    --surface-2: #20242D;
    --text: #EDEEF2;
    --muted: #A6ABB8;
    --line: #2B2F3A;
    --accent: #7B8CFF;
    --accent-soft: #1C2347;
    --accent-ink: #0B0F2A;
    --amber: #FFB020;
    --amber-soft: #33270f;
    --ok: #4cc685;
    --ok-soft: #17301f;
    --warn: #f0a94a;
    --warn-soft: #33270f;
    --danger: #ff6b63;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px);
}
body.is-public { padding-bottom: 32px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
.top h1, .section h2, .login h2, .hero h2, .next strong, .stat strong, .stat b { font-family: var(--display); }
.ic { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; }

/* ---------- Topo ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  padding-top: env(safe-area-inset-top);
}
.top-in {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 10px;
}
.top-title { flex: 1; min-width: 0; }
.top-title .store {
  display: block; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.top-title h1 {
  font-size: 24px; font-weight: 750; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.icon-btn.primary { background: var(--text); color: var(--bg); border-color: transparent; }

.wrap { max-width: 760px; margin: 0 auto; padding: 6px 16px 0; }

/* ---------- Navegação inferior ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.tabbar a.on { color: var(--accent); }
@media (min-width: 820px) {
  .tabbar {
    left: 50%; right: auto; bottom: 18px; transform: translateX(-50%);
    width: 520px; height: 64px; padding: 0 6px;
    border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  }
  body { padding-bottom: 110px; }
}

/* ---------- Blocos ---------- */
.section { margin: 22px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section h2 { font-size: 17px; font-weight: 700; }
.section a { font-size: 14px; font-weight: 600; color: var(--accent); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.pad { padding: 16px; }
.stack > * + * { margin-top: 12px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; min-height: 60px;
}
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .ic.chev { color: var(--muted); opacity: .6; }
a.row:active, button.row:active { background: var(--surface-2); }

.av {
  --h: 10;
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 45% 32%);
}
@media (prefers-color-scheme: dark) { .av { background: hsl(var(--h) 30% 22%); color: hsl(var(--h) 70% 80%); } }
.av.lg { width: 64px; height: 64px; font-size: 22px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
}
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; }
.stat b { display: block; font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Botões ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px;
  font: 600 16px/1 var(--font); color: var(--text); background: var(--surface);
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.dark { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btns > .btn { flex: 1; }

/* ---------- Formulários ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: 16px/1.3 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  outline: none; appearance: none; -webkit-appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .field + .field { margin-top: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.searchbar { position: relative; margin-bottom: 12px; }
.searchbar .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbar .input { padding-left: 44px; border-radius: 99px; }

/* ---------- Abas ---------- */
.tabs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 4px -16px 14px; padding: 0 16px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; padding: 9px 15px; border-radius: 99px;
  font-size: 14px; font-weight: 650; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
}
.tabs a.on { background: var(--text); color: var(--bg); border-color: transparent; }

/* ---------- Mesas (pareamentos) ---------- */
.round-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s ease; }

.match { padding: 14px; }
.match + .match { margin-top: 10px; }
.match .mhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.match .tbl-no { font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.match.busy { opacity: .6; pointer-events: none; }
.match.done { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.match.done .tbl-no { color: var(--ok); }
.seg { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
.seg button {
  appearance: none; cursor: pointer; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text);
  min-height: 58px; padding: 8px 10px; border-radius: 13px;
  font: 600 15px/1.2 var(--font); text-align: center;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden; text-overflow: ellipsis;
  transition: background .15s, border-color .15s, color .15s;
}
.seg button small { display: block; font-size: 11px; font-weight: 650; color: var(--muted); margin-top: 2px; }
.seg .mid { min-width: 64px; font-size: 13px; color: var(--muted); }
.seg button.sel { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.seg button.sel small { color: var(--ok); }
.seg button.lost { opacity: .55; }
.seg .mid.sel { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.match .more { margin-top: 8px; display: flex; justify-content: flex-end; gap: 6px; }
.linkbtn { appearance: none; border: 0; background: none; font: 600 13px var(--font); color: var(--muted); cursor: pointer; padding: 6px 4px; }
.linkbtn.on { color: var(--danger); }
.bye { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }

/* ---------- Classificação ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.tbl .r { text-align: right; }
.tbl .name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tbl tr.drop td { color: var(--muted); }
.tbl tr.cut td { border-bottom: 2px dashed var(--accent); }
.pos { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 750; font-size: 13px; background: var(--surface-2); }
.pos.p1 { background: #f6d76b; color: #5a4300; }
.pos.p2 { background: #dcdde2; color: #3c3d45; }
.pos.p3 { background: #ecc29c; color: #5a3110; }

/* ---------- Bracket ---------- */
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.bracket .col { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.bracket h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.bm { padding: 8px 10px; font-size: 14px; }
.bm div { display: flex; justify-content: space-between; padding: 4px 0; }
.bm .w { font-weight: 700; color: var(--ok); }

/* ---------- Outros ---------- */
.toast {
  margin: 4px 0 14px; padding: 12px 14px; border-radius: 12px;
  font-size: 14px; font-weight: 600; background: var(--ok-soft); color: var(--ok);
  animation: fadeout .4s ease 4s forwards;
}
.toast.err { background: var(--accent-soft); color: var(--danger); }
.toast.warn { background: var(--warn-soft); color: var(--warn); }
@keyframes fadeout { to { opacity: 0; height: 0; margin: 0; padding: 0; } }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .ic { margin: 0 auto 10px; opacity: .7; }
.empty strong { display: block; color: var(--text); font-size: 16px; }
.empty p { margin: 6px 0 0; font-size: 14px; }

.hero { display: flex; gap: 14px; align-items: center; }
.hero h2 { font-size: 21px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

.next {
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  background: var(--text); color: var(--bg); border-radius: var(--radius);
}
.next .btn.primary { border: 0; }
.next p { margin: 0; font-size: 14px; opacity: .8; }
.next strong { font-size: 18px; }

details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }

.login { min-height: 80vh; display: grid; place-items: center; }
.login .card { width: 100%; max-width: 380px; }
.pill-points { font-weight: 750; font-variant-numeric: tabular-nums; }
.plus { color: var(--ok); }
.minus { color: var(--danger); }
.hide { display: none !important; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- Área do jogador ---------- */
.mine { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
.tbl tr.me td { background: var(--accent-soft); }
.tbl tr.me td.name { color: var(--accent); }
li.me { background: var(--accent-soft); }
li.me .t { color: var(--accent); }
.links { display: flex; flex-direction: column; gap: 10px; text-align: center; margin-top: 18px; font-size: 14px; }
.links a { color: var(--accent); font-weight: 600; }
.links .muted a { color: var(--muted); font-weight: 500; text-decoration: underline; }
.intro { text-align: center; margin: 4px 0 18px; }
.intro p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.table-card { padding: 18px 16px; }
.table-card .big { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.table-card .vs { font-size: 17px; font-weight: 650; margin-top: 6px; }
.table-card .meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.next .badge { background: rgba(255,255,255,.14); color: inherit; }
@media (prefers-color-scheme: dark) { .next .badge { background: rgba(0,0,0,.12); } }
.code-box { text-align: center; padding: 20px 16px; border: 2px dashed var(--accent); background: var(--accent-soft); }
.code-box .code { font: 800 32px/1.1 var(--mono); letter-spacing: .08em; color: var(--accent); margin: 8px 0; }
.result-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--line); }
.result-dot.win { background: var(--ok); } .result-dot.loss { background: var(--danger); }
.result-dot.tie { background: var(--warn); } .result-dot.bye { background: var(--ok); opacity: .5; }
.result-dot.pending { background: transparent; border: 2px solid var(--warn); }

/* ---------- Senha de administrador (mini formulário que abre ao tocar) ---------- */
details.gate { flex: 1 1 0; min-width: 0; }
details.gate[open] { flex-basis: 100%; }
details.gate > summary { list-style: none; cursor: pointer; width: 100%; }
details.gate > summary::-webkit-details-marker { display: none; }
details.gate[open] > summary { background: var(--surface-2); color: var(--text); }
.gate-form {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 8px;
  box-shadow: var(--shadow); text-align: left;
}
.gate-form .field + .field { margin-top: 12px; }
.late-add { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.late-add details.gate { flex: 0 1 auto; }
.late-add details.gate[open] { flex: 1 1 100%; }
.late-add details.gate > summary { width: auto; }
.next .late-btn { background: transparent; color: inherit; border-color: rgba(127,127,127,.45); min-height: 40px; font-size: 14px; }
.next .late-btn .ic { opacity: .8; }

/* ---------- Cronômetro ---------- */
.timer { --tc: var(--text); text-align: center; }
.timer .t-label { font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.timer .t-clock { font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--tc); font-variant-numeric: tabular-nums; }
.timer .t-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.timer .t-bar i { display: block; height: 100%; width: 0; background: var(--tc); border-radius: 99px; transition: width .25s linear; }
.timer.t-prep { --tc: var(--warn); }
.timer.t-warn { --tc: var(--warn); }
.timer.t-extra { --tc: var(--danger); }
.timer.t-over { --tc: var(--danger); }
.timer-md.t-extra .t-label, .timer-sm.t-extra .t-label { color: var(--danger); }
.timer.t-over .t-clock { animation: blink 1s steps(2, start) infinite; }
.timer.t-paused { --tc: var(--muted); }
.timer.t-paused .t-clock { opacity: .6; }
.timer.t-done { --tc: var(--ok); }
@keyframes blink { to { opacity: .45; } }
.timer-sm { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 12px; text-align: left; }
.timer-sm .t-label { grid-column: 1; }
.timer-sm .t-clock { grid-column: 2; grid-row: 1; font-size: 26px; text-align: right; }
.timer-sm .t-bar { grid-column: 1 / -1; margin-top: 8px; }
.timer-md .t-clock { font-size: 56px; margin-top: 4px; }
.timer-box { margin: 12px 0 2px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.timer-box .t-bar { background: var(--line); }
.timer-actions { justify-content: center; margin-top: 12px; }
.timer-actions > form { flex: 1 1 0; }
.timer-actions .btn { width: 100%; }

/* ---------- Telão ---------- */
body.is-wide .wrap, body.is-wide .top-in { max-width: 1240px; }
.telao-hero {
  margin: 4px 0 18px; padding: 22px 18px 20px; border-radius: 22px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow);
}
.telao-hero .telao-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; font-size: 15px; }
.telao-hero .telao-meta .muted { color: inherit; opacity: .65; }
.telao-hero .timer { --tc: var(--bg); }
.telao-hero .timer .t-label { color: inherit; opacity: .7; margin-top: 14px; font-size: 13px; }
.telao-hero .timer .t-clock { font-size: clamp(84px, 26vw, 230px); margin: 4px 0 2px; }
.telao-hero .timer .t-bar { background: rgba(127,127,127,.3); height: 8px; max-width: 760px; margin: 14px auto 0; }
.telao-hero .timer.t-prep, .telao-hero .timer.t-warn { --tc: #f5b041; }
.telao-hero .timer.t-over, .telao-hero .timer.t-extra { --tc: #ff6b5e; }
.telao-hero .timer.t-extra .t-label { color: #ff6b5e; opacity: 1; font-size: clamp(15px, 2.2vw, 26px); letter-spacing: .04em; }
.badge.extra { background: var(--accent-soft); color: var(--danger); }
.telao-hero .timer.t-done { --tc: #4cc685; }
.telao-hero .timer.t-paused .t-clock { opacity: .45; }
.telao-h { font-size: 17px; margin: 0 0 10px; display: none; }
@media (max-width: 999px) { .telao-grid .m-hide { display: none; } }
@media (min-width: 1000px) {
  .telao-tabs { display: none; }
  .telao-h { display: block; }
  .telao-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  body.is-wide .row { min-height: 54px; }
  body.is-wide .row .t { font-size: 17px; }
  body.is-wide .tbl { font-size: 16px; }
}

@media (max-width: 380px) {
  .stats { gap: 8px; }
  .stat b { font-size: 20px; }
  .seg button { font-size: 14px; min-height: 54px; }
}

/* ---------- v4: check-in, relatos, ausência, offline ---------- */
.checkin-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.checkin-bar .grow { flex: 1; }
li.review { background: var(--warn-soft); }
.btn.checkin-on { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.report-line { font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 10px; margin: -2px 0 10px;
  background: var(--surface-2); color: var(--muted); display: flex; gap: 6px; align-items: center; }
.report-line.partial { background: var(--ok-soft); color: var(--ok); }
.report-line.conflict { background: var(--accent-soft); color: var(--danger); }
.match.conflict { border-color: var(--danger); }
.match.queued { border-style: dashed; border-color: var(--warn); }
.match.queued .tbl-no::after { content: ' · aguardando envio'; color: var(--warn); text-transform: none; letter-spacing: 0; font-weight: 600; }
.noshow-row { justify-content: flex-start; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.noshow-row details.gate { flex: 1 1 100%; }
.noshow-row details.gate > summary.linkbtn { width: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--danger); background: none; }
.report-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.report-box .seg button { min-height: 50px; }
#net-banner { position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 8px); z-index: 60;
  max-width: 560px; margin: 0 auto; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4;
  background: var(--text); color: var(--bg); box-shadow: 0 8px 30px rgba(0,0,0,.25); }
#net-banner.off { background: #5b4300; color: #fff3d6; }
#net-banner.err { background: var(--danger); color: #fff; }
#net-banner .nb-err { margin-top: 6px; font-weight: 600; }
#net-banner .nb-ok { margin-top: 8px; appearance: none; border: 0; border-radius: 10px; padding: 8px 14px; font: 600 14px var(--font); background: rgba(255,255,255,.2); color: inherit; }
.user-actions { flex-basis: 100%; gap: 6px; padding-left: 52px; }
.user-actions > form, .user-actions > details.gate { flex: 0 0 auto; }
.user-actions > details.gate[open] { flex-basis: 100%; }

/* ---------- v5: juiz, conquistas, avisos, estatísticas ---------- */
#judge-alerts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 10px); z-index: 55;
  max-width: 560px; margin: 0 auto; padding: 12px; border-radius: 16px; background: var(--danger); color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: jpulse 1.6s ease-in-out infinite; }
body.is-public #judge-alerts { bottom: 16px; }
@media (min-width: 820px) { #judge-alerts { bottom: 100px; } }
@keyframes jpulse { 50% { box-shadow: 0 10px 30px rgba(199,50,43,.6), 0 0 0 6px rgba(199,50,43,.25); } }
#judge-alerts .ja-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
#judge-alerts .ja-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.25); }
#judge-alerts .ja-txt { flex: 1; font-size: 15px; line-height: 1.3; }
#judge-alerts .ja-txt small { opacity: .85; }
#judge-alerts .btn.primary { background: #fff; color: var(--danger); }
.judge-box { margin-top: 12px; }
.judge-btn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach { position: relative; padding: 14px 12px 12px; text-align: center; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ach .ic-big { font-size: 34px; line-height: 1; height: 40px; display: grid; place-items: center; }
.ach .an { font-weight: 750; font-size: 14px; margin-top: 8px; line-height: 1.2; }
.ach .ad { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.ach .ap { height: 5px; border-radius: 99px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.ach .ap i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.ach .av2 { font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.ach.locked .ic-big { filter: grayscale(1); opacity: .35; }
.ach.done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: linear-gradient(180deg, var(--ok-soft), var(--surface) 70%); }
.ach.done .av2 { color: var(--ok); font-weight: 650; }
.ach-sum { display: flex; align-items: center; gap: 14px; }
.ach-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ach-ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-grid .card { padding: 14px; }
.stat-grid b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-grid span { font-size: 12px; color: var(--muted); font-weight: 600; }
.wl-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin-top: 10px; }
.wl-bar i { display: block; height: 100%; }
.announce { border-left: 4px solid var(--accent); }
.announce .at { font-weight: 750; }
.announce .ab { font-size: 14px; margin-top: 4px; white-space: pre-line; }
.announce .am { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- v7: ranking público, divulgação ---------- */
.rank-public { max-width: 640px; margin: 0 auto; }
.rank-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; margin: 14px 0 12px; }
.pod { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px; text-align: center; min-width: 0; }
.pod .pos { width: 34px; height: 34px; font-size: 16px; border-radius: 50%; }
.pod .pn { font-weight: 700; margin-top: 8px; font-size: 14px; overflow-wrap: anywhere; line-height: 1.25; }
.pod .pp { font-weight: 800; font-size: 20px; margin-top: 4px; }
.pod .pp small { font-size: 12px; font-weight: 600; color: var(--muted); }
.pod-1 { padding-top: 20px; padding-bottom: 18px; border-color: #e9c84a; box-shadow: 0 6px 24px rgba(233, 200, 74, .18); }
.pod-1 .pos { width: 42px; height: 42px; font-size: 19px; }
.pod.me { outline: 2px solid var(--accent); }
.qr-card { display: grid; gap: 12px; justify-items: center; text-align: center; }
.qr-card .qr { width: min(240px, 70vw); aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #fff; }
.qr-card .qr svg { width: 100%; height: 100%; display: block; }
.qr-card .link { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.poster { min-height: 100vh; display: grid; place-items: center; background: #fff; color: #111; padding: 24px; text-align: center; }
.poster h1 { font-size: 34px; margin: 0 0 6px; letter-spacing: -.02em; }
.poster p { font-size: 18px; margin: 0 0 22px; color: #444; }
.poster .qr { width: min(420px, 80vw); margin: 0 auto; }
.poster .qr svg { width: 100%; height: auto; display: block; }
.poster .url { font-size: 13px; color: #666; margin-top: 14px; overflow-wrap: anywhere; }
.poster .store { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #666; margin-bottom: 18px; }
@media print { .poster { min-height: auto; padding: 0; } .no-print { display: none !important; } }

.prize-total { display: flex; gap: 14px; align-items: center; margin-top: 10px; background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.prize-total .pt-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--accent); color: var(--accent-ink, #fff); flex: 0 0 auto; }
.prize-total .pt-val { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 2px 0; }

/* ---------- v9: SaaS (marca, painel do dono) ---------- */
.brand-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.brand-logo .bl-word { font-family: var(--display); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.brand-logo .bl-tag { background: #2F4BFF; color: #fff; font-family: var(--display); font-weight: 700; padding: .25em .45em; border-radius: .5em; line-height: 1; }
.brand-mark { flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.stat { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.stat strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
