:root {
  color-scheme: dark;
  --bg: #11140f;
  --surface: #1b2018;
  --surface-raised: #222820;
  --text: #f4f2eb;
  --muted: #a3ae9a;
  --accent: #d2ff58;
  --line: #333d2e;
  --danger: #ff8373;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); transition: background-color 180ms ease, color 180ms ease; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: absolute; top: -60px; left: 20px; z-index: 30; padding: 12px 16px; color: #111; background: var(--accent); font-weight: 800; }
.skip-link:focus { top: 12px; }
.site-header { width: min(1200px, calc(100% - 64px)); min-height: 94px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: #f3f2ed; }
.brand-mark img { width: 29px; height: 29px; object-fit: contain; }
.brand-wordmark { display: grid; gap: 0; font-size: 13px; line-height: .91; letter-spacing: .13em; }
.brand-wordmark strong:first-child { font-size: 12px; }
.brand-wordmark strong:last-child { font-size: 17px; letter-spacing: .09em; }
.brand-divider { height: 29px; width: 1px; margin: 0 3px 0 5px; background: var(--line); }
.brand-description { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .13em; line-height: 1.45; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.public-badge, .manual-label, .eyebrow, .section-kicker, .panel-topline, .event-tab, .category-tab, .site-footer { font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.public-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 17%, transparent); }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 17px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 800; transition: transform 120ms ease, background 120ms ease, border-color 120ms ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-outline { border-color: var(--line); background: transparent; }
.button-outline:hover { border-color: var(--accent); }
.button-primary { color: #11140f; background: var(--accent); }
.button-primary:hover { filter: brightness(1.07); }
.button-quiet { border-color: var(--line); background: transparent; color: var(--muted); }
.button-quiet:hover { color: var(--text); border-color: var(--muted); }
.button-small { min-height: 36px; padding: 0 12px; font-size: 11px; }

.page-shell { width: min(1200px, calc(100% - 64px)); margin: 0 auto; }
.hero { padding: 42px 0 23px; }
.eyebrow-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.eyebrow-mark { width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg); }
.manual-label { color: var(--muted); font-size: 9px; }
.hero h1 { max-width: 850px; margin: 0 0 9px; font-size: clamp(34px, 5.2vw, 66px); letter-spacing: -.055em; line-height: 1.02; font-weight: 850; }
.hero-subtitle { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.category-tabs { display: flex; gap: 9px; margin-top: 36px; border-bottom: 1px solid var(--line); }
.category-tab { position: relative; min-width: 156px; padding: 13px 17px 16px; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-align: left; transition: color 150ms ease; }
.category-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: transparent; content: ""; }
.category-tab:hover { color: var(--text); }
.category-tab[aria-selected="true"] { color: var(--text); }
.category-tab[aria-selected="true"]::after { background: var(--accent); }
.category-index { margin-right: 12px; color: var(--accent); font-variant-numeric: tabular-nums; }

.leaderboard-panel { overflow: hidden; margin: 0 0 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 24px 70px rgb(0 0 0 / 13%); }
.panel-topline { min-height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 0 23px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.panel-topline span:first-child { color: var(--accent); }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 27px 24px 24px; }
.section-kicker { margin: 0 0 8px; color: var(--accent); font-size: 9px; }
.panel-heading h2 { margin: 0; font-size: clamp(22px, 3.2vw, 32px); letter-spacing: -.035em; line-height: 1.1; }
.team-count { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.event-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 18px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.event-tab { position: relative; flex: 0 0 auto; min-height: 47px; padding: 0 13px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; }
.event-tab:hover { color: var(--text); }
.event-tab[aria-current="page"] { color: var(--text); }
.event-tab[aria-current="page"]::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; background: var(--accent); content: ""; }
.table-scroll { overflow-x: auto; }
.leaderboard-table { width: 100%; border-collapse: collapse; text-align: left; }
.leaderboard-table th { height: 43px; padding: 0 20px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.leaderboard-table td { height: 72px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.leaderboard-table tbody tr:last-child td { border-bottom: 0; }
.leaderboard-table tbody tr { transition: background-color 120ms ease; }
.leaderboard-table tbody tr:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.rank-column { width: 128px; }
.status-column { width: 190px; text-align: right; }
.leaderboard-table td:last-child { text-align: right; }
.position-badge { min-width: 43px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 15px; font-weight: 850; font-variant-numeric: tabular-nums; }
.position-badge.rank-top { border-color: color-mix(in srgb, var(--accent) 46%, var(--line)); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.team-name { font-weight: 750; letter-spacing: -.012em; }
.result-status { color: var(--muted); font-size: 11px; }
.result-status.is-entered { color: var(--accent); }
.empty-state { padding: 62px 24px 68px; text-align: center; }
.empty-icon { width: 42px; height: 42px; display: inline-grid; place-items: center; margin-bottom: 13px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-size: 20px; }
.empty-state h3 { margin: 0 0 7px; font-size: 17px; }
.empty-state p { margin: 0 auto 18px; max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.text-button { padding: 6px; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 800; }
.text-button:hover { text-decoration: underline; }
.panel-footnote { display: flex; align-items: flex-start; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.5; }
.footnote-mark { width: 15px; height: 15px; flex: 0 0 auto; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 9px; font-weight: 800; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 0 30px; color: var(--muted); font-size: 8px; letter-spacing: .09em; }
.site-footer strong { color: var(--text); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-separator { padding: 0 6px; color: var(--line); }

.dialog { width: min(480px, calc(100% - 30px)); max-height: min(90vh, 820px); overflow: auto; padding: 25px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); box-shadow: 0 28px 100px rgb(0 0 0 / 58%); }
.dialog::backdrop { background: rgb(5 8 5 / 76%); backdrop-filter: blur(4px); }
.login-dialog { padding: 25px 27px 27px; }
.dialog-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 27px; }
.dialog-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 6px; color: #11140f; background: var(--accent); font-size: 13px; font-weight: 900; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 21px; line-height: 1; }
.icon-button:hover { color: var(--text); border-color: var(--muted); }
.dialog h2 { margin: 0 0 8px; font-size: 27px; letter-spacing: -.04em; }
.dialog-copy, .admin-intro { color: var(--muted); font-size: 13px; line-height: 1.6; }
.dialog-copy { margin: 0 0 22px; }
.login-form label, .admin-content label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
input[type="text"], input[type="password"], input[type="number"], select { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: var(--bg); font-size: 13px; }
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input[type="color"] { width: 43px; height: 37px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); cursor: pointer; }
input[type="number"] { width: 100%; max-width: 88px; min-height: 38px; text-align: center; font-variant-numeric: tabular-nums; }
select { appearance: auto; }
.form-message { min-height: 18px; margin: 7px 0 0; color: var(--danger); font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.admin-dialog { width: min(980px, calc(100% - 28px)); max-height: min(92vh, 900px); padding: 0; }
.admin-dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 25px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.admin-dialog-header .section-kicker { margin-bottom: 5px; }
.admin-dialog-header h2 { margin: 0; font-size: 23px; }
.admin-header-actions { display: flex; align-items: center; gap: 9px; }
.admin-intro { margin: 0; padding: 14px 25px; border-bottom: 1px solid var(--line); font-size: 12px; }
.admin-message { display: none; margin: 14px 25px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.admin-message.is-visible { display: block; }
.admin-message.is-error { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); }
.admin-message.is-success { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }
.admin-content { padding: 0 25px 20px; }
.admin-section { padding: 23px 0; border-bottom: 1px solid var(--line); }
.admin-section:last-child { border-bottom: 0; }
.admin-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.admin-section-heading h3 { margin: 0 0 5px; font-size: 15px; }
.admin-section-heading p { max-width: 600px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.admin-section-number { color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .13em; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-field { min-width: 0; }
.admin-field.full-width { grid-column: 1 / -1; }
.admin-field .hint { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 15px; }
.preset-button { min-height: 37px; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 750; }
.preset-button:hover, .preset-button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); }
.preset-swatch { width: 11px; height: 11px; border: 1px solid rgb(255 255 255 / 20%); border-radius: 50%; background: var(--swatch); }
.color-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.color-field { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 4px; }
.color-field label { margin-bottom: 8px; font-size: 10px; }
.color-input-row { display: flex; align-items: center; gap: 7px; }
.color-value { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; text-transform: uppercase; }
.manage-columns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.manage-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--bg) 36%, transparent); }
.manage-card h4 { margin: 0 0 12px; font-size: 12px; }
.inline-add { display: grid; grid-template-columns: minmax(0,1fr) minmax(120px,.7fr) auto; gap: 8px; align-items: end; }
.inline-add.event-add { grid-template-columns: minmax(0,1fr) auto; }
.inline-add label { margin-bottom: 5px; font-size: 10px; }
.inline-add .button { min-height: 42px; padding: 0 12px; white-space: nowrap; font-size: 10px; }
.manage-list { display: grid; gap: 8px; margin-top: 14px; }
.manage-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 7px; border: 1px solid var(--line); border-radius: 4px; }
.manage-item input { min-height: 36px; font-size: 11px; }
.manage-item-category { min-width: 0; display: grid; gap: 4px; }
.manage-item-category small { padding-left: 2px; color: var(--muted); font-size: 9px; }
.remove-button { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 750; }
.remove-button:hover { border-color: var(--danger); color: var(--danger); }
.manage-empty, .rank-empty { margin: 11px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.rank-category { margin-top: 17px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; }
.rank-category:first-child { margin-top: 0; }
.rank-category-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.rank-category-heading h4 { margin: 0; font-size: 12px; }
.rank-category-heading span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .1em; }
.rank-group { padding-top: 13px; }
.rank-group + .rank-group { margin-top: 13px; padding-top: 14px; border-top: 1px dashed var(--line); }
.rank-group-title { margin: 0 0 10px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.rank-rows { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 12px; }
.rank-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px; border-radius: 4px; background: color-mix(in srgb, var(--text) 3%, transparent); }
.rank-row span { overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rank-row input { min-height: 34px; max-width: 76px; }
.rank-help { margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.admin-dialog-footer { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 9px; padding: 14px 25px; border-top: 1px solid var(--line); background: var(--surface); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: min(420px, calc(100vw - 40px)); padding: 12px 16px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--surface-raised); box-shadow: 0 12px 35px rgb(0 0 0 / 28%); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 180ms ease, transform 180ms ease; font-size: 12px; line-height: 1.45; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .site-header, .page-shell { width: min(100% - 34px, 600px); }
  .site-header { min-height: 77px; gap: 12px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-mark img { width: 25px; height: 25px; }
  .brand-wordmark strong:last-child { font-size: 14px; }
  .brand-description, .brand-divider, .public-badge { display: none; }
  .header-actions { gap: 0; }
  .button-outline { min-height: 38px; padding: 0 11px; font-size: 10px; }
  .hero { padding-top: 28px; }
  .manual-label { max-width: 125px; text-align: right; font-size: 8px; line-height: 1.45; }
  .hero h1 { margin-top: 0; font-size: clamp(32px, 9vw, 48px); }
  .hero-subtitle { max-width: 410px; font-size: 13px; }
  .category-tabs { gap: 0; margin-top: 27px; }
  .category-tab { min-width: 50%; padding: 12px 10px 14px; font-size: 9px; }
  .category-index { margin-right: 7px; }
  .panel-topline { padding: 0 14px; }
  .panel-heading { padding: 21px 14px 18px; }
  .team-count { padding: 7px 8px; font-size: 9px; }
  .event-tabs { padding: 0 8px; }
  .event-tab { padding: 0 11px; font-size: 8px; }
  .leaderboard-table th { padding: 0 12px; }
  .leaderboard-table td { height: 64px; padding: 9px 12px; font-size: 12px; }
  .rank-column { width: 76px; }
  .status-column { width: 122px; }
  .position-badge { min-width: 36px; height: 34px; font-size: 13px; }
  .result-status { font-size: 9px; }
  .panel-footnote { padding: 12px; font-size: 9px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 7px; font-size: 7px; }
  .manage-columns { grid-template-columns: 1fr; gap: 12px; }
  .color-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .color-field:last-child { grid-column: 1 / -1; }
  .rank-rows { grid-template-columns: 1fr; }
  .admin-dialog-header { padding: 17px 15px 14px; }
  .admin-dialog-header h2 { font-size: 20px; }
  .admin-intro { padding: 11px 15px; font-size: 11px; }
  .admin-content { padding: 0 15px 16px; }
  .admin-message { margin: 12px 15px 0; }
  .admin-section { padding: 18px 0; }
  .admin-section-heading { margin-bottom: 13px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-field.full-width { grid-column: auto; }
  .inline-add { grid-template-columns: minmax(0,1fr) 124px; }
  .inline-add .name-field { grid-column: 1 / -1; }
  .inline-add.event-add { grid-template-columns: minmax(0,1fr) auto; }
  .admin-dialog-footer { padding: 11px 15px; }
  .admin-dialog-footer .button { flex: 1; min-height: 40px; padding: 0 8px; font-size: 10px; }
}

@media (max-width: 390px) {
  .site-header, .page-shell { width: calc(100% - 26px); }
  .brand { gap: 8px; }
  .brand-wordmark strong:first-child { font-size: 10px; }
  .brand-wordmark strong:last-child { font-size: 12px; }
  .button-outline { padding: 0 8px; font-size: 9px; }
  .eyebrow-row { align-items: flex-start; }
  .eyebrow { font-size: 8px; }
  .manual-label { font-size: 7px; }
  .leaderboard-table th { font-size: 8px; }
  .status-column { width: 105px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Apuração automática: navegação do painel, resultados por equipe e pontos */
.admin-tabs { position: sticky; top: 78px; z-index: 1; display: flex; gap: 5px; overflow-x: auto; padding: 12px 25px; border-bottom: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; }
.admin-tabs [role="tab"] { min-height: 38px; flex: 0 0 auto; padding: 0 13px; border: 1px solid transparent; border-radius: 4px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.admin-tabs [role="tab"]:hover, .admin-tabs [role="tab"][aria-selected="true"] { border-color: var(--line); color: var(--text); background: color-mix(in srgb, var(--text) 4%, transparent); }
.admin-tabs [role="tab"][aria-selected="true"] { box-shadow: inset 0 -2px var(--accent); }
.admin-tab-panel[hidden] { display: none !important; }
.event-manage-item { grid-template-columns: minmax(110px, 1fr) minmax(190px, 1.2fr) auto; }
.event-manage-item select { min-height: 36px; font-size: 10px; }
.inline-add.event-add { grid-template-columns: minmax(100px, 1fr) minmax(110px, .75fr) auto; }
.result-event-section { padding-top: 20px; }
.result-category-block { margin-top: 17px; padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: color-mix(in srgb, var(--bg) 32%, transparent); }
.result-category-block h4 { margin: 0 0 10px; font-size: 11px; }
.result-entry-list { display: grid; gap: 7px; }
.result-entry { min-width: 0; display: grid; grid-template-columns: minmax(140px, 1fr) minmax(145px, .8fr); align-items: end; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; }
.result-entry:has(.time-field) { grid-template-columns: minmax(140px, 1fr) minmax(145px, .8fr); }
.result-entry .result-team { align-self: center; overflow: hidden; font-size: 11px; font-weight: 750; text-overflow: ellipsis; }
.result-entry label { min-width: 0; margin: 0; color: var(--muted); font-size: 9px; }
.result-entry input, .result-entry select { margin-top: 5px; min-height: 36px; font-size: 11px; }
.result-entry input[type="number"] { max-width: none; text-align: left; }
.points-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; max-width: 600px; }
.point-row { display: grid !important; grid-template-columns: 1fr minmax(100px, .8fr) 24px; align-items: center; gap: 8px; margin: 0 !important; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--text) !important; }
.point-row span { font-size: 11px; font-weight: 750; }
.point-row input { min-height: 35px !important; text-align: right; }
.point-row small { color: var(--muted); font-size: 9px; }
.public-result { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .admin-tabs { top: 64px; padding: 10px 15px; }
  .admin-tabs [role="tab"] { min-height: 35px; padding: 0 10px; font-size: 9px; }
  .event-manage-item { grid-template-columns: minmax(0, 1fr) auto; }
  .event-manage-item select { grid-column: 1 / -1; grid-row: 2; }
  .inline-add.event-add { grid-template-columns: minmax(0, 1fr) minmax(90px, .8fr); }
  .inline-add.event-add button { grid-column: 1 / -1; }
  .result-entry, .result-entry:has(.time-field) { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .result-entry .result-team { grid-column: auto; }
  .points-grid { grid-template-columns: 1fr; }
  .leaderboard-table th, .leaderboard-table td { padding-right: 9px; padding-left: 9px; }
  .public-result { font-size: 11px; }
}
@media (max-width: 390px) {
  .result-entry, .result-entry:has(.time-field) { grid-template-columns: minmax(0, 1fr); }
}

.legacy-notice { margin: 13px 0 16px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line)); border-radius: 4px; color: var(--muted); background: color-mix(in srgb, var(--accent) 5%, transparent); font-size: 11px; line-height: 1.5; }


/* Referência visual: placar esportivo editorial, rosa e creme. */
:root {
  color-scheme: light;
  --bg: #fff6f2;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #241a20;
  --muted: #7a6b73;
  --accent: #e60b6a;
  --line: #f2dcd8;
  --cream: #fceae4;
  --tint: color-mix(in srgb, var(--accent) 9%, #fff);
  --display: "Anton", "Bebas Neue", Impact, "Haettenschweiler", "Arial Narrow", sans-serif;
}
body { background: var(--bg); color: var(--text); }
.site-header { width: min(780px, calc(100% - 24px)); min-height: 66px; border: 0; border-bottom: 4px solid var(--accent); padding: 0 12px; color: #fff; background: #241a20; }
.brand { gap: 9px; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; background: var(--cream); }
.brand-mark img { width: 26px; height: 26px; }
.brand-wordmark { color: #fff; font-family: var(--display); letter-spacing: .08em; }
.brand-wordmark strong:first-child { font-size: 12px; }
.brand-wordmark strong:last-child { font-size: 16px; letter-spacing: .08em; }
.header-actions { gap: 8px; }
.header-actions .button-outline { min-height: 36px; border: 0; border-radius: 8px; padding: 0 11px; color: #fff; background: rgb(255 255 255 / 14%); font-size: 11px; }
.header-actions .button-outline:hover { border: 0; background: rgb(255 255 255 / 23%); }
.page-shell { width: min(780px, calc(100% - 24px)); }
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 15px 10px 14px; color: var(--text); background: var(--cream); }
.hero .streak { position: absolute; z-index: -1; background: var(--accent); pointer-events: none; opacity: .9; }
.hero .streak-a { top: -11px; left: -28px; width: 170px; height: 54px; transform: rotate(-8deg); clip-path: polygon(0 15%,8% 0,22% 18%,37% 2%,54% 18%,71% 3%,88% 15%,100% 0,100% 84%,86% 100%,69% 81%,52% 98%,34% 82%,18% 100%,4% 84%); }
.hero .streak-b { bottom: 18px; left: -29px; width: 154px; height: 47px; transform: rotate(-7deg); clip-path: polygon(0 20%,11% 3%,27% 21%,45% 5%,62% 23%,79% 7%,100% 19%,96% 59%,100% 92%,82% 100%,64% 81%,46% 98%,28% 82%,10% 100%,3% 70%); }
.hero-in { position: relative; z-index: 1; width: min(100%, 780px); min-height: 116px; margin: 0 auto; display: grid; grid-template-columns: 36% minmax(0, 1fr); align-items: center; gap: 4px; }
.hero-mark { width: 100px; height: 100px; display: grid; place-items: center; justify-self: center; border: 5px solid rgb(255 255 255 / 76%); border-radius: 50%; background: var(--surface); box-shadow: 0 4px 12px rgb(120 20 60 / 16%); }
.hero-mark img { width: 74px; height: 74px; object-fit: contain; }
.hero h1 { margin: 0; color: var(--text); font: 400 clamp(26px, 5.6vw, 38px)/1.05 var(--display); text-align: center; text-transform: uppercase; letter-spacing: .015em; }
.category-tabs { position: relative; z-index: 1; display: flex; justify-content: center; gap: 8px; overflow-x: auto; margin: 3px auto 0; padding: 8px 0 4px; border: 0; scrollbar-width: none; }
.category-tab { min-width: 0; flex: 0 0 auto; padding: 7px 19px; border: 2px solid var(--accent); border-radius: 999px; color: var(--accent); background: var(--surface); font: 400 17px/1.2 var(--display); letter-spacing: .04em; text-align: center; text-transform: uppercase; white-space: nowrap; }
.category-tab[aria-selected="true"] { border-color: var(--accent); color: #fff; background: var(--accent); }
.category-tab[aria-selected="true"]::after { display: none; }
.category-index { display: none; }
.brush { position: relative; z-index: 1; height: 11px; margin: 0 0 10px; background: var(--accent); clip-path: polygon(0 38%,4% 7%,10% 52%,16% 14%,24% 60%,32% 10%,41% 50%,49% 6%,58% 56%,67% 12%,76% 54%,84% 8%,93% 48%,100% 12%,100% 100%,0 100%); }
.leaderboard-panel { margin: 0 auto 20px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 3px 12px rgb(36 26 32 / 6%); }
.event-tabs { display: flex; gap: 0; overflow-x: auto; margin: 1px 0 9px; padding: 0 5px; border-bottom: 2px solid var(--line); scrollbar-width: none; }
.event-tab { min-height: 42px; flex: 1 0 auto; margin-bottom: -2px; padding: 8px 12px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; font: 400 15px/1.2 var(--display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.event-tab[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); }
.event-tab[aria-current="page"]::after { display: none; }
.table-scroll { border-radius: 9px; }
.leaderboard-table { table-layout: auto; background: var(--surface); }
.leaderboard-table th { height: 36px; padding: 0 7px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .06em; text-align: center; }
.leaderboard-table th:nth-child(2), .leaderboard-table td:nth-child(2) { text-align: left; }
.leaderboard-table td { height: 54px; padding: 7px 7px; border-bottom: 1px solid var(--line); font-size: 13px; text-align: center; }
.leaderboard-table th:last-child, .leaderboard-table td:last-child { text-align: right; }
.leaderboard-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, #fff); }
.leaderboard-table tbody tr.p1 td, .leaderboard-table tbody tr.p2 td, .leaderboard-table tbody tr.p3 td { background: var(--tint); }
.rank-column { width: 48px; }
.status-column { width: 76px; }
.position-badge { min-width: 29px; width: 29px; height: 29px; border: 0; border-radius: 50%; color: var(--text); background: #f3e6ec; font-size: 12px; }
.position-badge.rank-top { border: 0; color: var(--text); background: #f3e6ec; }
.position-badge.rank-gold { color: #241a20; background: #ffd43b; }
.position-badge.rank-silver { color: #241a20; background: #dfe3e8; }
.position-badge.rank-bronze { color: #241a20; background: #e6b17c; }
.team-name { display: block; line-height: 1.18; }
.points-cell { color: var(--accent); font: 400 21px/1 var(--display) !important; white-space: nowrap; }
.public-result { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.empty-state { padding: 35px 18px; }
.empty-state h3 { font: 400 19px/1.2 var(--display); text-transform: uppercase; }
.empty-icon { border-color: var(--line); color: var(--accent); }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover { filter: brightness(1.06); }
.button-outline { border-color: var(--line); color: var(--accent); background: var(--surface); }
.button-outline:hover { border-color: var(--accent); }
.button-quiet { border-color: var(--line); color: var(--muted); background: var(--surface); }
.dialog { border-color: var(--line); border-radius: 14px; background: var(--surface); }
.admin-dialog-header { background: var(--surface); }
.admin-tabs { background: var(--surface); }
.manage-card { border-radius: 10px; background: color-mix(in srgb, var(--cream) 36%, #fff); }
.manage-item, .color-field, .rank-category { border-radius: 8px; }
.preset-button { border-radius: 999px; }
.preset-button:hover, .preset-button[aria-pressed="true"] { border-color: var(--accent); }
.admin-dialog-footer { background: var(--surface); }
.skip-link { color: #241a20; background: #ffd43b; }
@media (max-width: 480px) {
  .site-header { min-height: 57px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-mark img { width: 23px; height: 23px; }
  .brand-wordmark strong:last-child { font-size: 14px; }
  .page-shell { width: calc(100% - 20px); }
  .hero { padding: 11px 7px 9px; }
  .hero-in { min-height: 89px; grid-template-columns: 31% minmax(0, 1fr); }
  .hero-mark { width: 72px; height: 72px; border-width: 4px; }
  .hero-mark img { width: 53px; height: 53px; }
  .hero h1 { font-size: clamp(22px, 7vw, 29px); }
  .category-tabs { justify-content: flex-start; gap: 6px; padding: 8px 2px 3px; }
  .category-tab { padding: 6px 13px; font-size: 15px; }
  .brush { height: 9px; margin-bottom: 8px; }
  .leaderboard-panel { padding: 5px; border-radius: 11px; }
  .event-tabs { margin-bottom: 6px; padding: 0 2px; }
  .event-tab { min-height: 39px; padding: 7px 9px; font-size: 13px; }
  .leaderboard-table th { padding: 0 4px; font-size: 9px; }
  .leaderboard-table td { height: 49px; padding: 6px 4px; font-size: 12px; }
  .rank-column { width: 38px; }
  .status-column { width: 62px; }
  .position-badge { min-width: 26px; width: 26px; height: 26px; font-size: 11px; }
  .points-cell { font-size: 19px !important; }
  .public-result { font-size: 11px; }
  .admin-dialog { width: calc(100% - 14px); }
}


/* Conteúdo do campeonato: capa, integrantes, programação e descrições. */
.hero-cover { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero.has-cover::after { position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgb(36 26 32 / 64%), rgb(36 26 32 / 34%)); content: ""; }
.hero.has-cover .hero-mark { border-color: rgb(255 255 255 / 82%); background: rgb(255 255 255 / 95%); }
.hero.has-cover h1 { color: #fff; text-shadow: 0 2px 14px rgb(0 0 0 / 26%); }
.team-cell { min-width: 0; }
.team-members { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.public-info-panel { margin: 0 0 14px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 12px rgb(36 26 32 / 5%); }
.public-info-panel h2 { margin: 0 0 10px; color: var(--accent); font: 400 18px/1.2 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.event-description-panel { padding: 0; overflow: hidden; }
.event-description-panel details { padding: 0; }
.event-description-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 11px 17px; color: var(--accent); cursor: pointer; font: 400 16px/1.2 var(--display); letter-spacing: .025em; list-style: none; text-transform: uppercase; }
.event-description-panel summary::-webkit-details-marker { display: none; }
.event-description-panel summary::after { content: "+"; font: 700 19px/1 ui-sans-serif, sans-serif; }
.event-description-panel details[open] summary::after { content: "−"; }
.event-description-panel details[open] summary { border-bottom: 1px solid var(--line); }
.event-description-panel p { margin: 0; padding: 14px 17px 17px; color: var(--text); font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.schedule-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.schedule-item { display: grid; grid-template-columns: 66px minmax(0,1fr); gap: 13px; padding: 10px 0; border-top: 1px solid var(--line); }
.schedule-item:first-child { border-top: 0; }
.schedule-item time { color: var(--accent); font: 400 16px/1.25 var(--display); font-variant-numeric: tabular-nums; }
.schedule-item span { min-width: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }

.admin-content textarea { width: 100%; min-height: 68px; resize: vertical; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--bg); font: inherit; font-size: 12px; line-height: 1.45; }
.admin-content textarea:focus-visible, .admin-content input[type="time"]:focus-visible, .admin-content input[type="file"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.admin-content input[type="time"] { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--bg); font: inherit; font-size: 13px; }
.admin-content input[type="file"] { width: 100%; min-height: 42px; color: var(--text); font-size: 11px; }
.admin-content input[type="file"]::file-selector-button { min-height: 36px; margin-right: 9px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--accent); background: var(--surface); font: inherit; font-weight: 750; cursor: pointer; }
.header-image-editor { display: grid; grid-template-columns: minmax(0,1fr) minmax(150px,220px); align-items: center; gap: 16px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--cream) 28%, #fff); }
.header-image-controls > small { display: block; margin: 4px 0 10px; color: var(--muted); font-size: 10px; }
.header-image-controls .remove-button { min-height: 38px; }
.header-image-preview { min-height: 90px; display: grid; place-items: center; overflow: hidden; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 10px; }
.header-image-preview img { display: block; width: 100%; aspect-ratio: 2.2 / 1; object-fit: cover; }
.team-manage-item { grid-template-columns: minmax(0,1fr) auto; align-items: start; }
.team-admin-fields { min-width: 0; display: grid; gap: 7px; }
.team-admin-fields > small { padding-left: 2px; color: var(--muted); font-size: 10px; }
.team-admin-fields > label { margin: 2px 0 -3px; font-size: 10px; }
.team-admin-fields > label span { color: var(--muted); font-weight: 500; }
.team-admin-fields textarea { min-height: 54px; }
.event-manage-item { grid-template-columns: minmax(0,1fr); align-items: stretch; }
.event-field-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(115px,.75fr) auto; align-items: center; gap: 8px; }
.event-description-editor { padding: 0 1px 2px; }
.event-description-editor summary { padding: 5px 2px; color: var(--accent); cursor: pointer; font-size: 10px; font-weight: 750; }
.event-description-editor textarea { margin-top: 7px; }
.schedule-editor-heading { margin-bottom: 12px; }
.schedule-editor-list { display: grid; gap: 8px; }
.schedule-editor-row { display: grid; grid-template-columns: minmax(100px,.55fr) minmax(0,1.6fr) auto; align-items: end; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--cream) 25%, #fff); }
.schedule-editor-row label { min-width: 0; margin: 0; }
.schedule-editor-row label input { display: block; margin-top: 5px; }
.schedule-editor-row .remove-button { min-height: 42px; }

@media (max-width: 640px) {
  .site-header, .page-shell { width: calc(100% - 16px); }
  .site-header { min-height: 55px; padding: 0 7px; }
  .header-actions .button-outline { min-height: 40px; }
  .hero { padding: 9px 6px 8px; }
  .hero-in { min-height: 80px; grid-template-columns: minmax(64px,.29fr) minmax(0,1fr); gap: 5px; }
  .hero-mark { width: 66px; height: 66px; border-width: 4px; }
  .hero-mark img { width: 48px; height: 48px; }
  .hero h1 { font-size: clamp(21px, 6.7vw, 30px); line-height: 1.08; overflow-wrap: anywhere; }
  .category-tabs { justify-content: center; gap: 6px; padding: 7px 0 3px; }
  .category-tab { max-width: 49%; min-height: 40px; padding: 6px 10px; font-size: clamp(12px, 4vw, 15px); white-space: normal; }
  .leaderboard-panel { margin-bottom: 13px; padding: 4px; }
  .event-tabs { scroll-snap-type: x proximity; }
  .event-tab { min-height: 44px; padding: 8px 10px; scroll-snap-align: start; }
  .table-scroll { overflow-x: hidden; }
  .leaderboard-table { width: 100%; table-layout: fixed; }
  .leaderboard-table th { height: 34px; padding: 0 3px; font-size: 8px; letter-spacing: .025em; }
  .leaderboard-table td { height: auto; min-height: 50px; padding: 7px 3px; font-size: 11px; }
  .leaderboard-table .rank-column { width: 35px; }
  .leaderboard-table .status-column { width: 58px; }
  .leaderboard-table th:nth-child(2), .leaderboard-table td:nth-child(2) { padding-left: 5px; }
  .position-badge { width: 25px; min-width: 25px; height: 25px; font-size: 10px; }
  .team-name { font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; }
  .team-members { margin-top: 3px; font-size: 9px; line-height: 1.25; }
  .points-cell { font-size: 16px !important; }
  .public-result { font-size: 10px; white-space: nowrap; }
  .public-info-panel { margin-bottom: 11px; padding: 13px; border-radius: 10px; }
  .event-description-panel { padding: 0; }
  .event-description-panel summary { min-height: 46px; padding: 10px 13px; }
  .event-description-panel p { padding: 12px 13px 14px; font-size: 12px; }
  .schedule-item { grid-template-columns: 52px minmax(0,1fr); gap: 9px; padding: 9px 0; }
  .schedule-item time { font-size: 15px; }
  .schedule-item span { font-size: 12px; }
  dialog.admin-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: 96dvh; margin: 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 17px 17px 0 0; }
  .admin-dialog-header { min-height: 58px; }
  .admin-tabs { top: 57px; gap: 3px; padding: 8px 12px; }
  .admin-tabs [role="tab"] { min-height: 40px; padding: 0 12px; font-size: 10px; }
  .admin-dialog-footer { padding-bottom: max(11px, env(safe-area-inset-bottom)); }
  .admin-content input[type="text"], .admin-content input[type="number"], .admin-content input[type="time"], .admin-content select, .admin-content textarea { font-size: 16px; }
  .manage-columns { gap: 10px; }
  .manage-card { padding: 12px; }
  .team-admin-fields > label { margin-top: 4px; }
  .team-admin-fields textarea { min-height: 62px; }
  .event-field-row { grid-template-columns: minmax(0,1fr) minmax(98px,.62fr); gap: 7px; }
  .event-field-row .remove-button { grid-column: 1 / -1; min-height: 40px; justify-self: end; }
  .event-manage-item select { min-height: 42px; }
  .header-image-editor { grid-template-columns: minmax(0,1fr) 105px; gap: 9px; padding: 10px; }
  .header-image-preview { min-height: 62px; }
  .header-image-controls .remove-button { min-height: 40px; }
  .schedule-editor-row { grid-template-columns: minmax(95px,.6fr) minmax(0,1.4fr); gap: 8px; padding: 9px; }
  .schedule-editor-row .remove-button { grid-column: 1 / -1; min-height: 40px; justify-self: end; }
  .schedule-editor .admin-section-heading { align-items: center; }
  .schedule-editor .admin-section-heading .button { min-height: 40px; }
}

@media (max-width: 380px) {
  .site-header, .page-shell { width: calc(100% - 12px); }
  .brand { gap: 6px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-mark img { width: 20px; height: 20px; }
  .brand-wordmark strong:last-child { font-size: 12px; }
  .header-actions .button-outline { padding: 0 8px; font-size: 9px; }
  .hero-in { grid-template-columns: 60px minmax(0,1fr); }
  .hero-mark { width: 57px; height: 57px; }
  .hero-mark img { width: 42px; height: 42px; }
  .leaderboard-table .rank-column { width: 32px; }
  .leaderboard-table .status-column { width: 54px; }
  .points-cell { font-size: 14px !important; }
  .team-members { font-size: 8px; }
  .header-image-editor { grid-template-columns: minmax(0,1fr) 88px; }
}
