/* TKD Placar — visual no padrão shadcn/ui (tema "Orange", base stone), modo escuro por padrão */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800;900&family=Geist+Mono:wght@500;700&display=swap');

:root {
  --background: #0c0a09;
  --foreground: #fafaf9;
  --card: #0c0a09;
  --card-foreground: #fafaf9;
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-foreground: #fafaf9;
  --secondary: #292524;
  --muted: #292524;
  --muted-foreground: #a8a29e;
  --accent: #292524;
  --destructive: #dc2626;
  --border: #292524;
  --input: #292524;
  --ring: #ea580c;
  --radius: .5rem;

  --blue-300: #93c5fd; --blue-500: #3b82f6; --blue-600: #2563eb;
  --red-300: #fca5a5; --red-500: #ef4444; --red-600: #dc2626;
  --yellow-500: #eab308; --yellow-600: #ca8a04;
  --green-500: #22c55e;
  --gray-300: #d1d5db; --gray-500: #6b7280; --gray-600: #4b5563;

  font-family: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
:root.light {
  --background: #ffffff; --foreground: #0c0a09; --card: #ffffff; --card-foreground: #0c0a09;
  --primary: #f97316; --primary-hover: #ea580c; --secondary: #f5f5f4; --muted: #f5f5f4; --muted-foreground: #78716c;
  --accent: #f5f5f4; --destructive: #ef4444; --border: #e7e5e4; --input: #e7e5e4; --ring: #f97316;
  color-scheme: light;
}
* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; min-height: 100%; background: var(--background); color: var(--foreground); }
body { display: flex; flex-direction: column; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 1em; height: 1em; flex: 0 0 auto; }
.mono { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.hidden { display: none !important; }
.muted { color: var(--muted-foreground); }
.italic { font-style: italic; }
.underline-link { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 70px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 20px; background: var(--background); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; }
.brand .i { color: var(--primary); width: 26px; height: 26px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius); font-size: .9rem; font-weight: 500; }
.nav a .i { width: 16px; height: 16px; }
.nav a:hover, .nav a.active { background: var(--accent); }
.nav .sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }
.topbar .right { justify-self: end; display: flex; gap: 8px; }
@media (max-width: 640px) {
  .topbar { grid-template-columns: auto 1fr auto; height: 60px; padding: 0 12px; }
  .brand { font-size: 1.2rem; }
  .nav { justify-content: center; }
  .nav a { padding: 7px 8px; font-size: .78rem; gap: 4px; }
  .nav .sep { display: none; }
  .brand .txt { display: none; }
}

main { flex: 1; width: 100%; padding: 16px; }
main.narrow { max-width: 1200px; margin: 0 auto; }
footer { border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: .8rem; text-align: center; padding: 16px; }

/* ---------- botões (shadcn) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 36px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--primary); color: var(--primary-foreground);
  font-size: .875rem; font-weight: 500; cursor: pointer; user-select: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: background .15s, opacity .15s, color .15s;
}
.btn .i { width: 16px; height: 16px; }
.btn:hover { background: var(--primary-hover); }
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.outline { background: var(--background); border-color: var(--input); color: var(--foreground); }
.btn.outline:hover, .btn.ghost:hover, .btn.secondary:hover { background: var(--accent); }
.btn.secondary { background: var(--secondary); color: var(--foreground); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--foreground); }
.btn.destructive { background: var(--destructive); color: #fafaf9; }
.btn.destructive:hover { background: #b91c1c; }
.btn.blue { background: var(--blue-500); color: #fff; }
.btn.blue:hover { background: var(--blue-600); }
.btn.red { background: var(--red-500); color: #fff; }
.btn.red:hover { background: var(--red-600); }
.btn.soft { background: color-mix(in srgb, var(--primary) 45%, transparent); color: var(--foreground); }
.btn.soft:hover { background: color-mix(in srgb, var(--primary) 65%, transparent); }
.btn.sm { height: 32px; padding: 0 12px; font-size: .8rem; }
.btn.lg { height: 40px; padding: 0 32px; }
.btn.icon { width: 36px; padding: 0; }
.btn.block { width: 100%; }

/* ---------- cartões ---------- */
.card { position: relative; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.card-header { padding: 24px 24px 0; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-weight: 600; letter-spacing: -.01em; line-height: 1; margin: 0; font-size: 1rem; }
.card-desc { color: var(--muted-foreground); font-size: .875rem; margin: 0; }
.card-content { padding: 24px; }
.card-footer { padding: 0 24px 24px; }
.card.pad { padding: 24px; }
.card.primary { border-color: var(--primary); }
.card.blue { background: color-mix(in srgb, var(--blue-500) 12%, var(--card)); }
.card.red { background: color-mix(in srgb, var(--red-500) 12%, var(--card)); }
.card .flag { position: absolute; top: -1px; right: 20px; width: 40px; height: 20px; border-radius: 0 0 6px 6px; }
.card.blue .flag, .flag.blue { background: var(--blue-500); }
.card.red .flag, .flag.red { background: var(--red-500); }
.uline { display: inline-block; width: fit-content; border-bottom: 2px solid var(--primary); padding-bottom: 2px; }
.uline.blue { border-color: var(--blue-500); }
.uline.red { border-color: var(--red-500); }
.separator { height: 1px; background: var(--border); width: 100%; margin: 16px 0; }

/* ---------- selos (badges) ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 2px 10px; border-radius: 6px; font-size: .75rem; font-weight: 600; border: 1px solid transparent; background: var(--primary); color: #fafaf9; }
.badge.outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.badge.secondary { background: var(--secondary); color: var(--foreground); }
.badge.warning { background: var(--yellow-600); }
.badge.blue { background: var(--blue-600); }
.badge.red { background: var(--red-600); }
.badge.destructive { background: var(--destructive); }
.badge.green { background: #15803d; }
.badge.paused { background: #57534e; color: #fafaf9; }
.badge.rest { background: #0369a1; color: #fafaf9; }

/* ---------- formulários ---------- */
.page-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; }
.page-head .back { margin-bottom: 8px; }
.page-head h1, h1.title { font-size: 1.875rem; font-weight: 700; margin: 8px 0 0; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head p, .sub { color: #a3a3a3; font-size: .875rem; margin: 0; }
.form { max-width: 320px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.form.wide { max-width: 420px; }
.field label { display: block; font-weight: 500; font-size: .875rem; margin-bottom: 8px; }
.input, .field input, .field select, .field textarea {
  width: 100%; height: 36px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--input);
  background: transparent; outline: none; font-size: .875rem; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.field textarea { height: auto; padding: 8px 12px; resize: vertical; }
.field select option, select option { background: var(--background); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { box-shadow: 0 0 0 1px var(--ring); }
.field small { color: var(--muted-foreground); font-size: .8rem; display: block; margin-top: 6px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.form .btn[type="submit"] { align-self: center; }
input.big-code { height: 48px; font-size: 1.4rem; font-weight: 700; letter-spacing: .2em; text-align: center; }
input.big-code::placeholder { letter-spacing: normal; font-size: 1rem; font-weight: 500; }

/* ---------- home ---------- */
.hero { min-height: calc(100vh - 140px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background-image: radial-gradient(color-mix(in srgb, var(--foreground) 12%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
.hero em { color: var(--muted-foreground); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.75rem); line-height: 1.1; margin: 10px auto 32px; max-width: 900px; font-weight: 700; letter-spacing: -.03em; }
.hero h1 span { color: var(--primary); }
.hero .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 1100px; margin: 24px auto; }

/* ---------- etiqueta de código (canto direito) ---------- */
.code-tab { align-self: flex-end; margin-right: -16px; display: flex; align-items: center; gap: 24px; padding: 8px 16px; background: var(--secondary); border-radius: var(--radius) 0 0 var(--radius); }
.code-tab .lbl { font-weight: 700; font-size: 1.5rem; }
.code-tab .val { font-weight: 700; font-size: 2.25rem; letter-spacing: .04em; }
@media (max-width: 640px) { .code-tab { gap: 12px; } .code-tab .lbl { font-size: 1rem; } .code-tab .val { font-size: 1.6rem; } }

/* ---------- criar ring: resultado ---------- */
.code-box { text-align: center; max-width: 440px; }
.code-box .code { font-size: 3rem; font-weight: 800; letter-spacing: .2em; margin: 6px 0; }
.code-box .pin { font-size: 1.8rem; font-weight: 700; letter-spacing: .2em; }
.links { display: grid; gap: 8px; margin-top: 16px; text-align: left; }
.link-row { display: flex; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 8px; font-size: .82rem; }
.link-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-foreground); }

/* ---------- mesa ---------- */
.mesa { display: flex; flex-direction: column; gap: 32px; }
.mesa-top { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.mesa-top > :first-child { width: 100%; }
@media (max-width: 768px) { .mesa-top { align-items: stretch; } .mesa-top .actions-right { justify-content: center; } }
.round-box { font-size: 1.25rem; font-weight: 700; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.actions-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.grid2 > * { min-width: 0; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; gap: 28px; } }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 1.5rem; font-weight: 700; margin: 0 0 12px; letter-spacing: -.01em; }
.sec-title .i { width: 22px; height: 22px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; } }
.pair .card-title { font-size: 1.05rem; font-weight: 700; }
.value-box { font-weight: 700; font-size: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); text-align: center; padding: 2px 0; width: 100%; }
.value-box.flex { display: flex; justify-content: center; gap: 8px; padding: 8px 0; }
.btn-pair { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-top: 16px; }
.btn-pair .btn { flex: 1 1 120px; min-width: 0; }
.btn-col { display: flex; flex-direction: column; gap: 8px; }
.foot-note { text-align: center; color: var(--muted-foreground); font-size: .85rem; font-style: italic; margin: 0; }

/* temporizador */
.timer-card .clock { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 24px; font-weight: 700; font-size: 3.75rem; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.timer-card .clock .colon { font-size: 1rem; color: var(--muted-foreground); }
.timer-card .clock.warn { color: var(--yellow-500); }
.timer-card .clock.danger { color: var(--red-500); }
.timer-card .clock.rest { color: #38bdf8; }
.timer-card .clock.done { color: var(--muted-foreground); }
.timer-card .clock.golden { color: var(--primary); font-size: 2.25rem; gap: 12px; }
.timer-card .clock.golden .i { width: 36px; height: 36px; }
.timer-mode.golden { color: var(--primary); }
.timer-mode { text-align: center; font-size: .75rem; font-weight: 700; letter-spacing: .2em; color: #38bdf8; min-height: 1em; }
.adj { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.adj .btn { height: 32px; padding: 0 10px; min-width: 46px; font-size: .8rem; }
@media (max-width: 560px) { .adj { display: grid; grid-template-columns: repeat(4, 1fr); } .adj .btn { min-width: 0; } }
.adj .btn.minus { background: transparent; color: var(--muted-foreground); box-shadow: none; }
.adj .btn.minus:hover { background: var(--accent); color: var(--foreground); }
.stack { display: flex; flex-direction: column; align-items: center; gap: 0; }
.stack .btn { min-width: 100px; }
.stack .separator { margin: 12px 0; }
.set-time { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.set-time .input { width: 110px; text-align: center; font-weight: 700; }
.config-box { margin-top: 12px; padding: 12px; border: 1px dashed var(--primary); border-radius: var(--radius); }
.config-box label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; font-size: .85rem; font-weight: 500; margin-bottom: 6px; }
.config-box .input { text-align: center; font-weight: 700; }
.medical { margin-top: 10px; font-size: .85rem; color: var(--muted-foreground); text-align: center; }
.medical.danger { color: var(--red-500); }

/* placar dos juízes na mesa */
.judge-grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.jbox { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.jbox .head { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted-foreground); margin-bottom: 6px; }
.jbox .scores { display: flex; gap: 8px; }
.jbox .scores div { flex: 1; text-align: center; border-radius: 6px; padding: 4px 0; font-weight: 700; font-size: 1.4rem; }
.jbox .s-blue { background: color-mix(in srgb, var(--blue-500) 22%, transparent); border: 1px solid var(--blue-500); }
.jbox .s-red { background: color-mix(in srgb, var(--red-500) 22%, transparent); border: 1px solid var(--red-500); }
.jbox.win-blue { border-color: var(--blue-500); }
.jbox.win-red { border-color: var(--red-500); }
.votes-line { margin-top: 12px; text-align: center; font-size: .9rem; }

/* indicadores: cartões e bolinhas */
.ycard { width: 12px; height: 16px; border-radius: 2px; background: var(--gray-500); }
.ycard.on { background: var(--yellow-500); }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gray-500); }
.dot.on { background: var(--yellow-500); }
.dot.on.five { background: var(--primary); }

/* juízes conectados */
.judges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.jchip { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted-foreground); }
.jchip.on { color: var(--green-500); border-color: color-mix(in srgb, var(--green-500) 45%, var(--border)); }
.jchip.off { color: var(--yellow-500); border-color: color-mix(in srgb, var(--yellow-500) 45%, var(--border)); }
.jkick { border: 0; background: transparent; color: var(--muted-foreground); cursor: pointer; padding: 0; display: inline-flex; }
.jkick:hover { color: var(--red-500); }

/* menu suspenso (Controle de Rounds) */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.menu .lbl { padding: 6px 8px; font-size: .85rem; font-weight: 600; }
.menu .item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 4px; background: transparent; font-size: .85rem; cursor: pointer; text-align: left; }
.menu .item:hover:not(:disabled) { background: var(--accent); }
.menu a.item { color: inherit; text-decoration: none; }
.menu .item .i { width: 15px; height: 15px; }
.menu .item:disabled { opacity: .5; cursor: default; }
.menu .item b { font-weight: 700; }
.menu .item .num { width: 22px; font-weight: 700; }
.menu .sep { height: 1px; background: var(--border); margin: 4px -4px; }

/* abas */
.tabs-list { display: flex; gap: 0; padding: 4px; border-radius: calc(var(--radius) + 2px); background: var(--muted); color: var(--muted-foreground); width: 100%; justify-content: center; overflow-x: auto; }
.tabs-list button { border: 0; background: transparent; padding: 4px 12px; border-radius: 6px; font-size: .875rem; font-weight: 500; cursor: pointer; white-space: nowrap; color: inherit; }
.tabs-list button.active { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.tab-panel { margin-top: 8px; }

/* tabelas */
.table-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl caption { caption-side: bottom; color: var(--muted-foreground); font-size: .85rem; margin-top: 14px; }
.tbl th { height: 40px; padding: 0 8px; text-align: left; font-weight: 500; color: var(--muted-foreground); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:hover td { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.pos { color: var(--green-500); font-weight: 700; }
.neg { color: var(--red-500); font-weight: 700; }

/* lutas do ring */
.add-fight { display: grid; grid-template-columns: 1.3fr 1fr 1fr .9fr auto; gap: 8px; margin: 4px 0 8px; }
@media (max-width: 900px) { .add-fight { grid-template-columns: 1fr 1fr; } .add-fight > :first-child { grid-column: span 2; } }
.custom-times { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; font-size: .85rem; font-weight: 500; }
.custom-times label { display: flex; align-items: center; gap: 6px; }
.custom-times .input { width: 80px; text-align: center; font-weight: 700; }
.bulk { margin: 6px 0 12px; font-size: .875rem; }
.bulk summary { cursor: pointer; color: var(--muted-foreground); }
.bulk textarea { width: 100%; margin: 8px 0; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--input); background: transparent; outline: none; font-family: inherit; resize: vertical; }
.bulk code { background: var(--muted); padding: 1px 6px; border-radius: 4px; }
.dot-blue, .dot-red { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot-blue { background: var(--blue-500); } .dot-red { background: var(--red-500); }
.vs { color: var(--muted-foreground); margin: 0 6px; }
tr.active-fight td { background: color-mix(in srgb, var(--green-500) 8%, transparent); }
tr.finished-fight td { opacity: .7; }
.tbl .acts { display: grid; grid-template-columns: 76px repeat(4, 32px); gap: 4px; justify-content: end; align-items: center; }
.tbl .acts .act-main { width: 76px; justify-content: center; }
.tbl .acts .btn.icon { width: 32px; height: 32px; }
.empty { text-align: center; padding: 40px 24px; }

/* banner */
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); font-size: .9rem; }
.banner .i { width: 20px; height: 20px; color: var(--primary); }

/* ---------- juiz ---------- */
.judge-cards { display: flex; gap: 4px; }
.judge-cards .card { flex: 1; min-width: 0; }
.judge-cards .name { font-size: 1.875rem; font-weight: 700; line-height: 1.2; margin: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.judge-cards .name .uline, .pair .card-title .uline { display: inline; border: 0; padding: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--primary); }
.judge-cards .name .uline.blue, .pair .card-title .uline.blue { text-decoration-color: var(--blue-500); }
.judge-cards .name .uline.red, .pair .card-title .uline.red { text-decoration-color: var(--red-500); }
.pair .card-title { line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: 2px; }
.total-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.total-box { display: grid; place-items: center; min-width: 64px; height: 64px; padding: 0 8px; border-radius: 6px; font-weight: 700; font-size: 1.25rem; }
.card.blue .total-box { background: color-mix(in srgb, var(--blue-500) 20%, transparent); border: 1px solid var(--blue-500); }
.card.red .total-box { background: color-mix(in srgb, var(--red-500) 20%, transparent); border: 1px solid var(--red-500); }
.score-area { display: flex; gap: 4px; align-items: flex-start; }
.score-col { display: flex; flex-direction: column; gap: 8px; }
.score-col.grow { flex: 1; }
.score-col .lbl { font-size: .875rem; font-style: italic; color: var(--muted-foreground); }
.score-btns { display: flex; gap: 8px; flex-wrap: nowrap; }
.score-btns .btn { flex: 0 1 64px; min-width: 0; width: 64px; height: 64px; padding: 0; font-size: 1.125rem; font-weight: 700; background: var(--background); border-color: var(--input); }
.score-btns .btn:hover { background: var(--accent); }
.score-btns .btn.plus { color: var(--green-500); }
.score-btns .btn.minus { color: var(--red-500); }
@media (max-width: 1200px) { .score-area { flex-direction: column; align-items: stretch; gap: 16px; } .score-col { width: 100%; min-width: 0; } }
@media (max-width: 640px) {
  .judge-cards .card-header, .judge-cards .card-content, .judge-cards .card-footer { padding-left: 12px; padding-right: 12px; }
  .judge-cards .name { font-size: 1.6rem; }
}
/* celular EM PÉ: botões empilhados (como no site de referência) */
@media (max-width: 640px) and (orientation: portrait) {
  .score-area { align-items: center; }
  .score-col { align-items: center; }
  .score-btns { flex-direction: column; }
  .score-btns .btn { width: 56px; height: 56px; flex: 0 0 auto; }
}
/* celular DEITADO (tela baixa): botões em fila, topo não fixo, menos espaço vertical */
@media (orientation: landscape) and (max-height: 500px) {
  .topbar { position: static; height: 52px; }
  main { padding-top: 10px; padding-bottom: 10px; }
  main[style*="gap:32px"] { gap: 14px !important; }
  .page-head h1, h1.title { font-size: 1.4rem; margin-top: 2px; }
  .judge-cards .card-header { padding-top: 14px; }
  .judge-cards .card-content { padding-top: 10px; padding-bottom: 10px; }
  .judge-cards .card-footer { padding-bottom: 14px; }
  .judge-cards .name { font-size: 1.35rem; }
  .total-wrap { gap: 8px; }
  .total-box { height: 48px; min-width: 52px; font-size: 1.1rem; }
  .score-area { flex-direction: column; align-items: stretch; gap: 10px; }
  .score-col { width: 100%; align-items: stretch; }
  .score-btns { flex-direction: row; flex-wrap: nowrap; }
  .score-btns .btn { flex: 1 1 0; width: auto; min-width: 0; height: 48px; }
  .score-col:not(.grow) .score-btns .btn { flex: 0 0 auto; width: 56px; }
}

/* ---------- overlay de estado (juiz e placar) ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 24px;
  background: rgba(0,0,0,.85); backdrop-filter: blur(4px); color: #fff; }
.overlay.show { display: flex; }
.overlay .row-ic { display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: center; font-size: clamp(1.8rem, 5vh, 4rem); font-weight: 600; }
.overlay .row-ic .i { width: clamp(64px, 11vh, 128px); height: clamp(64px, 11vh, 128px); }
.overlay .big { font-size: clamp(2.5rem, min(8vw, 12vh), 8rem); font-weight: 700; text-decoration: underline; text-underline-offset: 10px; line-height: 1.1; }
.overlay .winner-label { font-size: clamp(1.3rem, 3.6vh, 3rem); }
.overlay .winner-color { font-size: clamp(3.4rem, min(20vw, 18vh), 12rem); font-weight: 900; line-height: 1; letter-spacing: .02em; }
.overlay .winner-color.blue { color: var(--blue-500); }
.overlay .winner-color.red { color: var(--red-500); }
.overlay .winner-sub { font-size: clamp(1.4rem, min(5vw, 6vh), 4rem); font-weight: 600; line-height: 1.15; opacity: .92; }
.overlay .reason { opacity: .75; font-size: clamp(.95rem, 2.2vh, 1.6rem); }
.overlay .sub-line { opacity: .75; font-size: clamp(.95rem, 2.4vh, 1.8rem); }

/* ---------- placar (TV) ---------- */
body.tv .topbar, body.tv footer { display: none; }
body.tv main { padding: 0; }
.board { display: flex; width: 100%; height: 100vh; justify-content: space-between; gap: 40px; background: var(--secondary); position: relative; overflow: hidden; }
.side { height: 100%; padding: 16px 24px; display: flex; flex-direction: column; justify-content: center; gap: clamp(16px, 2.4vh, 32px); flex: 0 0 clamp(320px, 27vw, 560px); width: clamp(320px, 27vw, 560px); color: #fff; box-shadow: 0 10px 15px rgba(0,0,0,.3); }
.side.blue { background: var(--blue-600); border-right: 2px solid var(--blue-500); }
.side.red { background: var(--red-600); border-left: 2px solid var(--red-500); }
.side .line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side.red .line { flex-direction: row-reverse; }
.side .name { font-size: clamp(2rem, min(3.3vw, 6.5vh), 4.5rem); font-weight: 700; text-align: center; width: 100%; line-height: 1.1; overflow-wrap: anywhere; }
.side .sepline { height: 1px; width: 100%; }
.side.blue .sepline { background: var(--blue-500); }
.side.red .sepline { background: var(--red-500); }
.side .big-num { font-size: clamp(3rem, 7vh, 5rem); font-weight: 700; line-height: 1; }
.side .i { width: clamp(30px, 4.2vh, 48px); height: clamp(30px, 4.2vh, 48px); stroke-width: 2.5; }
.side .cards { display: flex; gap: 8px; }
.side .cards .ycard { width: clamp(40px, 4.6vh, 56px); height: clamp(48px, 5.6vh, 68px); border-radius: 4px; background: #fff; }
.side .cards .ycard.on { background: var(--yellow-500); }
.side .tag { font-size: clamp(1.875rem, 4vh, 2.75rem); font-weight: 700; }
.circle { width: clamp(48px, 5.6vh, 66px); height: clamp(48px, 5.6vh, 66px); border-radius: 50%; background: #fff; display: grid; place-items: center; color: #000; }
.circle.on { background: var(--green-500); }
.circle .i { width: 24px; height: 24px; }
.side .dots5 { display: flex; gap: 8px; }
.center { padding: 16px 0; flex: 1; display: flex; flex-direction: column; gap: clamp(10px, 2vh, 24px); min-width: 0; }
.center h1 { text-align: center; font-size: clamp(1.6rem, min(4vh, 2.6vw), 3rem); font-weight: 700; margin: 0; line-height: 1.15; }
.center .ring-name { text-align: center; color: var(--muted-foreground); font-size: clamp(.9rem, 1.8vh, 1.3rem); margin-top: 4px; }
.center .body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.jrow { display: flex; justify-content: space-between; gap: 40px; }
.jsq { position: relative; width: clamp(120px, min(24vh, 15vw), 300px); aspect-ratio: 1; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: clamp(3rem, min(13vh, 8vw), 9.5rem); color: #fff; font-variant-numeric: tabular-nums; }
.jsq.neutral { background: var(--gray-600); border: 1px solid var(--gray-300); }
.jsq.blue { background: var(--blue-600); border: 1px solid var(--blue-300); }
.jsq.red { background: var(--red-600); border: 1px solid var(--red-300); }
.jsq .n { position: absolute; top: 8px; left: 8px; width: clamp(32px, 4.2vh, 48px); height: clamp(32px, 4.2vh, 48px); border-radius: 50%; display: grid; place-items: center; font-size: clamp(1.1rem, 2.4vh, 1.6rem); font-weight: 600; }
.jsq.neutral .n { background: var(--gray-500); } .jsq.blue .n { background: var(--blue-500); } .jsq.red .n { background: var(--red-500); }
.clock-wrap { display: flex; flex-direction: column; align-items: center; }
.clock-wrap.stopped .rnd, .clock-wrap.stopped .big { opacity: .5; text-decoration: line-through; }
.clock-wrap .rnd { font-size: clamp(1.8rem, min(5.5vh, 3.5vw), 4rem); font-weight: 600; background: color-mix(in srgb, var(--border) 50%, transparent); border: 1px solid var(--border); border-radius: 6px 6px 0 0; padding: 8px 16px; }
.clock-wrap .big { font-size: clamp(4rem, min(17vh, 11vw), 13rem); font-weight: 700; padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px 6px 0 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock-wrap .big.rest { color: #38bdf8; }
.tv-tools { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; opacity: .25; transition: opacity .2s; }
.tv-tools:hover { opacity: 1; }
@media (max-width: 900px) {
  .board { flex-direction: column; height: auto; min-height: 100vh; gap: 0; }
  .side { flex: 0 0 auto; width: 100%; height: auto; }
  .jsq { width: 28vw; }
}

/* ---------- histórico ---------- */
.hist-fight { margin-bottom: 12px; }
.hist-fight > summary { cursor: pointer; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; list-style: none; padding: 16px 20px; }
.hist-fight > summary::-webkit-details-marker { display: none; }
.hist-fight .inner { padding: 0 20px 20px; }
.judge-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
@media (max-width: 700px) { .judge-sum { grid-template-columns: 1fr 1fr; } }

/* ---------- toast ---------- */
.offline-banner { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 120; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 640px); padding: 12px 16px; border-radius: var(--radius); background: #7f1d1d; color: #fff; border: 1px solid var(--red-500); box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: .9rem; }
.offline-banner .i { width: 18px; height: 18px; flex: 0 0 auto; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.tv .offline-banner { font-size: max(.9rem, calc(1.8 * var(--u))); }
.send-status { min-height: 22px; font-size: .85rem; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted-foreground); margin: -16px 0 -8px; }
.send-status .i { width: 16px; height: 16px; }
.send-status.sending { color: var(--yellow-500); }
.send-status.sending .i { animation: spin 1s linear infinite; }
.send-status.ok { color: var(--green-500); }
.send-status.err { color: var(--red-500); font-weight: 600; }
.score-btns .btn.tapped { animation: tapflash .45s ease; }
@keyframes tapflash { 0% { transform: scale(.92); box-shadow: 0 0 0 3px var(--green-500); } 100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; } }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; color: var(--green-500); margin-left: 4px; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
.tv-preview { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: calc(var(--radius) + 4px); border: 1px solid var(--border); background: #000; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.tv-preview iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
body.preview .tv-tools, body.preview .conn, body.preview .offline-banner { display: none !important; }
.pause-bar { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 14px 16px; border-radius: calc(var(--radius) + 4px); border: 2px solid var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); }
.pause-bar .ttl { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; letter-spacing: .04em; color: var(--primary); }
.pause-bar .ttl .i { width: 22px; height: 22px; }
.pause-bar .txt { font-size: .95rem; max-width: 620px; }
.pause-bar .mine { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-size: 1rem; }
.pause-bar .mine b.blue { color: var(--blue-500); } .pause-bar .mine b.red { color: var(--red-500); }
.score-btns .btn.locked { opacity: .28; }
.pause-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.pause-list .it { display: inline-flex; align-items: center; gap: 6px; }
.pause-list .it b.blue { color: var(--blue-500); } .pause-list .it b.red { color: var(--red-500); }
.pause-list .wait { opacity: .6; }
.banner.paused-marks { align-items: flex-start; border-width: 2px; }
.confirm-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.72); }
.confirm-modal .box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; text-align: center; padding: 22px 20px; border-radius: calc(var(--radius) + 6px); border: 2px solid var(--primary); background: var(--card); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.confirm-modal .q { font-size: 1.05rem; font-weight: 600; }
.confirm-modal .big-pt { font-size: 2rem; font-weight: 800; }
.confirm-modal .big-pt.blue { color: var(--blue-500); } .confirm-modal .big-pt.red { color: var(--red-500); }
.confirm-modal .acts { display: flex; gap: 10px; }
.confirm-modal .acts .btn { flex: 1; height: 54px; font-size: 1.05rem; }
.adj-list { display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.adj-row { display: grid; grid-template-columns: minmax(0, max-content) 3ch minmax(0, 1fr) auto auto; align-items: center; gap: 8px; font-size: .9rem; }
.adj-row > span:first-child { white-space: nowrap; }
.adj-all > span:first-child { white-space: normal; line-height: 1.2; }
.adj-row b { font-size: 1.05rem; min-width: 2ch; text-align: right; }
.adj-row small { opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adj-row .btn.sm { min-width: 40px; }
.adj-row .adj-done { color: var(--primary); opacity: 1; font-weight: 600; }
.adj-row .adj-minus, .adj-row .adj-plus { font-weight: 700; min-width: 42px; padding: 0 10px; white-space: nowrap; }
.adj-row .adj-plus { background: var(--green-600, #16a34a); color: #fff; }
.adj-row .adj-plus:hover:not(:disabled) { filter: brightness(1.1); }
.adj-row .adj-minus:disabled, .adj-row .adj-plus:disabled { opacity: .3; }
.adj-all { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-weight: 600; }
.adj-head { font-size: .72rem; color: var(--muted-foreground); margin-bottom: -2px; }
.adj-head span:nth-child(2) { justify-self: center; }
.audit-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; cursor: pointer; border: 1px solid; background: transparent; color: inherit; font-family: inherit; }
.audit-chip .i { width: 16px; height: 16px; }
.audit-chip.attention { border-color: var(--yellow-500); color: var(--yellow-500); background: color-mix(in srgb, var(--yellow-500) 12%, transparent); }
.audit-chip.alert { border-color: var(--red-500); color: var(--red-500); background: color-mix(in srgb, var(--red-500) 14%, transparent); }
.audit-level { display: inline-flex; padding: 2px 8px; border-radius: 6px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.audit-level.ok { background: color-mix(in srgb, var(--green-500) 18%, transparent); color: var(--green-500); }
.audit-level.attention { background: color-mix(in srgb, var(--yellow-500) 20%, transparent); color: var(--yellow-500); }
.audit-level.alert { background: color-mix(in srgb, var(--red-500) 22%, transparent); color: var(--red-500); }
.audit-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.audit-dot.attention { background: var(--yellow-500); } .audit-dot.alert { background: var(--red-500); }
.audit-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.audit-table td, .audit-table th { white-space: nowrap; }
.audit-table td.num, .audit-table th { text-align: center; }
.audit-table td:first-child, .audit-table th:first-child { text-align: left; }
.audit-table .small { font-size: .75rem; }
.audit-table .muted, .audit-alerts .muted { color: var(--muted-foreground); }
.audit-table tr.muted td { color: var(--muted-foreground); }
.audit-table .warn { color: var(--yellow-500); } .audit-table .neg { color: var(--red-500); }
.s-blue-t, .blue-t { color: var(--blue-500); font-weight: 700; } .s-red-t, .red-t { color: var(--red-500); font-weight: 700; }
.audit-alerts { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.audit-alerts li { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; line-height: 1.4; }
.audit-okline { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--green-500); font-size: .9rem; }
.audit-okline .i { width: 16px; height: 16px; }
.audit-intro .card-desc { margin: 6px 0 12px; }
.audit-legend { display: grid; gap: 8px; }
.audit-legend .lg { display: grid; grid-template-columns: 78px 1fr; gap: 10px; align-items: center; font-size: .9rem; line-height: 1.35; }
.audit-legend .audit-level { justify-content: center; }
.audit-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: .85rem; color: var(--muted-foreground); line-height: 1.4; }
.audit-note .i { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; color: var(--yellow-500); }
.audit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.audit-summary { display: flex; align-items: center; gap: 6px; margin: 8px 0 14px; font-size: .95rem; }
.audit-summary .i { width: 18px; height: 18px; color: var(--green-500); }
.jcards, .rcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.jcard, .rcard { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.jcard.ok, .rcard.ok { border-left-color: var(--green-500); }
.jcard.attention, .rcard.attention { border-left-color: var(--yellow-500); }
.jcard.alert, .rcard.alert { border-left-color: var(--red-500); background: color-mix(in srgb, var(--red-500) 6%, var(--card)); }
.jcard.off { opacity: .6; border-left-color: var(--border); }
.jhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1rem; }
.jrow2 { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; flex-wrap: wrap; }
.jrow2 > span:first-child { color: var(--muted-foreground); }
.jnotes-t { font-size: .82rem; font-weight: 600; margin: 4px 0 4px; }
.jnotes ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; line-height: 1.4; }
.jnotes li.alert::marker { color: var(--red-500); } .jnotes li.attention::marker { color: var(--yellow-500); }
.jfine { display: flex; align-items: center; gap: 6px; color: var(--green-500); font-size: .88rem; }
.jfine .i { width: 16px; height: 16px; }
.rsug { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }
.rsug .i { width: 16px; height: 16px; }
.rsug.ok { color: var(--green-500); } .rsug.attention { color: var(--yellow-500); } .rsug.alert { color: var(--red-500); }
.rlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .86rem; }
.rlist li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rlist li > span:first-child { color: var(--muted-foreground); }
.rlist li b { min-width: 2ch; text-align: right; }
.jhead .muted { font-weight: 400; font-size: .85rem; color: var(--muted-foreground); }
.neg { color: var(--red-500); } .warn { color: var(--yellow-500); }
.grid2 > .span-all { grid-column: 1 / -1; }
#toasts { position: fixed; bottom: 48px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--background); border: 1px solid var(--border); padding: 14px 16px; border-radius: var(--radius); font-size: .875rem; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 360px; animation: slidein .2s ease; }
.toast.error { border-color: var(--destructive); }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }
.conn { position: fixed; bottom: 12px; right: 12px; z-index: 60; background: var(--background); }
.conn.in-bar { position: static; align-self: center; height: 24px; }
@media (max-width: 640px) { .conn.in-bar { font-size: 0; padding: 0; width: 12px; height: 12px; border-radius: 50%; border: 0; background: transparent; gap: 0; } .conn.in-bar::before { width: 10px; height: 10px; } }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- complementos ---------- */
.hint { color: var(--muted-foreground); font-size: .85rem; }
.roles .card { display: flex; flex-direction: column; gap: 10px; }
.roles .card h2 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.roles .card p { color: var(--muted-foreground); margin: 0; font-size: .875rem; flex: 1; }
.roles .card .emoji { width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.roles .card .emoji .i { width: 22px; height: 22px; }
.roles .card .row .btn { flex: 1; }
.roles .card > .btn { align-self: stretch; }
.steps { max-width: 1100px; margin: 0 auto 24px; }
.steps h2 { margin: 0 0 10px; font-size: 1.1rem; font-weight: 600; }
.steps ol { color: var(--muted-foreground); line-height: 1.8; padding-left: 20px; margin: 0; font-size: .9rem; }
.steps b { color: var(--foreground); }
.area { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.area small { color: var(--muted-foreground); font-size: .75rem; display: block; }
@media (max-width: 560px) { .hero .actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 320px; } .hero { min-height: calc(100vh - 120px); } }
.link-row b { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.links { grid-template-columns: minmax(0, 1fr); } .link-row { min-width: 0; } .link-row span { min-width: 0; } .link-row .btn { flex: 0 0 auto; } .code-box { width: 100%; }
.hist-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 8px 0 24px; } .hist-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 420px) { .judge-cards .name { font-size: 1.45rem; } }

.side .name-line { align-items: center; }
.side .name { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
:root.light .card { box-shadow: 0 1px 2px rgba(0,0,0,.06); } :root.light .btn { box-shadow: 0 1px 2px rgba(0,0,0,.08); } :root.light .menu, :root.light .toast { box-shadow: 0 10px 30px rgba(0,0,0,.12); }
@media (max-width: 340px) { .topbar { gap: 4px; padding: 0 8px; } .nav a { padding: 6px 6px; gap: 0; } .nav a .i { display: none; } .topbar .right { gap: 4px; } .brand .i { width: 22px; height: 22px; } }

/* ==========================================================================
   PLACAR (TV) — escala proporcional à tela
   --u = 1% da altura de uma tela 16:9 que cabe na janela. Em Full HD, 1u ≈ 10,8 px;
   em HD ≈ 7,2 px; em 4K ≈ 21,6 px. Tudo no placar é medido em "u", então ele fica
   com a mesma proporção em qualquer TV. Os max(…) garantem um tamanho mínimo.
   ========================================================================== */
body.tv { --u: min(1vh, 0.5625vw); }
body.tv .board { gap: calc(4 * var(--u)); }
body.tv .side {
  flex: 0 0 max(300px, calc(48 * var(--u)));
  width: max(300px, calc(48 * var(--u)));
  padding: calc(1.6 * var(--u)) calc(2.4 * var(--u));
  gap: max(14px, calc(2.4 * var(--u)));
}
body.tv .side .name { font-size: max(2rem, calc(5.8 * var(--u))); }
body.tv .side .big-num { font-size: max(2.6rem, calc(7 * var(--u))); }
body.tv .side .i { width: max(28px, calc(4.2 * var(--u))); height: max(28px, calc(4.2 * var(--u))); }
body.tv .side .cards { gap: max(6px, calc(0.8 * var(--u))); }
body.tv .side .cards .ycard { width: max(34px, calc(4.6 * var(--u))); height: max(42px, calc(5.6 * var(--u))); border-radius: max(4px, calc(0.4 * var(--u))); }
body.tv .side .tag { font-size: max(1.6rem, calc(4 * var(--u))); }
body.tv .side .dots5 { gap: max(6px, calc(0.8 * var(--u))); }
body.tv .circle { width: max(40px, calc(5.6 * var(--u))); height: max(40px, calc(5.6 * var(--u))); }
body.tv .circle .i { width: max(20px, calc(2.6 * var(--u))); height: max(20px, calc(2.6 * var(--u))); }
body.tv .center { padding: max(12px, calc(1.6 * var(--u))) 0; gap: max(10px, calc(2 * var(--u))); }
body.tv .center h1 { font-size: max(1.4rem, calc(4 * var(--u))); }
body.tv .center .ring-name { font-size: max(.85rem, calc(1.8 * var(--u))); }
body.tv .jrow { gap: calc(4 * var(--u)); }
body.tv .jsq { width: max(110px, calc(24 * var(--u))); font-size: max(3rem, calc(13 * var(--u))); border-radius: max(6px, calc(0.6 * var(--u))); }
body.tv .jsq .n { top: max(6px, calc(0.8 * var(--u))); left: max(6px, calc(0.8 * var(--u))); width: max(28px, calc(4.2 * var(--u))); height: max(28px, calc(4.2 * var(--u))); font-size: max(1rem, calc(2.4 * var(--u))); }
body.tv .clock-wrap .rnd { font-size: max(1.6rem, calc(5.5 * var(--u))); padding: calc(0.8 * var(--u)) calc(1.6 * var(--u)); }
body.tv .clock-wrap .big { font-size: max(3.6rem, calc(17 * var(--u))); padding: calc(0.8 * var(--u)) calc(1.6 * var(--u)); }
body.tv .medical { font-size: max(.85rem, calc(1.8 * var(--u))); }
body.tv .tv-tools .btn { height: max(28px, calc(3.2 * var(--u))); font-size: max(.75rem, calc(1.3 * var(--u))); padding: 0 max(10px, calc(1.2 * var(--u))); }
body.tv .conn { font-size: max(.7rem, calc(1.2 * var(--u))); }
/* telas de aviso (vencedor, parado, aguardando) no placar */
body.tv .overlay { gap: max(12px, calc(1.8 * var(--u))); }
body.tv .overlay .row-ic { font-size: max(1.8rem, calc(5 * var(--u))); }
body.tv .overlay .row-ic .i { width: max(72px, calc(18 * var(--u))); height: max(72px, calc(18 * var(--u))); }
body.tv .overlay .big { font-size: max(2.4rem, calc(12 * var(--u))); text-underline-offset: calc(1 * var(--u)); }
body.tv .overlay .winner-label { font-size: max(1.2rem, calc(3.6 * var(--u))); }
body.tv .overlay .winner-color { font-size: max(3rem, calc(18 * var(--u))); }
body.tv .overlay .winner-sub { font-size: max(1.3rem, calc(6 * var(--u))); }
body.tv .overlay .reason, body.tv .overlay .sub-line { font-size: max(.95rem, calc(2.2 * var(--u))); }
/* placar em tela estreita (celular / tablet em pé): faixas empilhadas */
@media (max-width: 900px) {
  body.tv .side { flex: 0 0 auto; width: 100%; }
  body.tv .jsq { width: min(40vw, 200px); font-size: min(18vw, 6rem); }
  body.tv .clock-wrap .big { font-size: min(22vw, 7rem); }
  body.tv .center h1 { font-size: min(6vw, 1.8rem); }
}
body.tv .jrow { width: min(100%, calc(90 * var(--u))); margin: 0 auto; }

/* ---------- telas grandes (monitores 2K/4K): conteúdo centralizado e fonte um pouco maior ---------- */
.mesa { max-width: 1680px; margin: 0 auto; width: 100%; }
body:not(.tv) main:has(.judge-cards) { max-width: 1400px; margin: 0 auto; }
@media (min-width: 1800px) { html:not(:has(body.tv)) { font-size: 17px; } }
@media (min-width: 2400px) { html:not(:has(body.tv)) { font-size: 18px; } .mesa { max-width: 1840px; } }
.brand { white-space: nowrap; } @media (max-width: 760px) { .brand .txt { display: none; } }
.judge-cards .name { padding-bottom: .32em; } .pair .card-title { padding-bottom: 8px; } .side .name { padding-bottom: 2px; }
body.tv .side { padding: max(14px, calc(1.6 * var(--u))) max(18px, calc(2.4 * var(--u))); } @media (max-width: 900px) { body.tv .conn { top: 8px; bottom: auto; right: 8px; } body.tv .tv-tools { position: fixed; } }
/* tablets e telas médias: botões do juiz maiores, preenchendo a linha */
@media (min-width: 641px) and (max-width: 1400px) and (min-height: 501px) {
  .score-btns .btn { flex: 1 1 0; width: auto; max-width: 132px; height: 76px; font-size: 1.35rem; }
  .score-col:not(.grow) .score-btns .btn { flex: 0 0 auto; width: 76px; }
}
