/* ---------- Tokens ---------- */
:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f0f0ee;
  --line: #e2e2df;
  --ink: #111113;
  --ink-2: #4b4b52;
  --muted: #7a7a82;
  --accent: #a87f0b;          /* dourado (texto/realce sobre fundo claro) */
  --accent-fill: #d9a91a;     /* dourado para preenchimentos */
  --accent-soft: #f7edcc;
  --on-accent: #111113;
  --track: #e6e6e3;
  --win: #15803d;
  --draw: #8a8a92;
  --loss: #c62828;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .05);
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Barlow Condensed', 'Inter', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c; --surface: #151517; --surface-2: #1d1d20; --line: #2a2a2f;
    --ink: #f4f4f5; --ink-2: #b4b4bb; --muted: #80808a;
    --accent: #e8c547; --accent-fill: #e8c547; --accent-soft: #2e2716; --on-accent: #111113;
    --track: #26262b; --win: #34c46a; --draw: #8f8f99; --loss: #f0544f;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0c; --surface: #151517; --surface-2: #1d1d20; --line: #2a2a2f;
  --ink: #f4f4f5; --ink-2: #b4b4bb; --muted: #80808a;
  --accent: #e8c547; --accent-fill: #e8c547; --accent-soft: #2e2716; --on-accent: #111113;
  --track: #26262b; --win: #34c46a; --draw: #8f8f99; --loss: #f0544f;
  --shadow: none; color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  min-height: 100dvh; padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
@media (min-width: 760px) { body { padding-bottom: 0; } }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
svg[viewBox="0 0 24 24"] { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.num, .display { font-family: var(--display); letter-spacing: .01em; }
.muted { color: var(--muted); }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }

/* ---------- Top bar & navegação ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 18px; white-space: nowrap; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.brand strong { font-weight: 800; }
.tabs { display: none; gap: 4px; margin-left: 12px; }
.tabs a { padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.tabs a:hover { background: var(--surface-2); }
.tabs a.active { background: var(--ink); color: var(--bg); }
.top-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); }
.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 1000; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; text-decoration: none; color: var(--muted); }
.bottom-nav a.active { color: var(--ink); }
.bottom-nav a.active svg { stroke: var(--accent); }
@media (min-width: 760px) { .tabs { display: flex; } .bottom-nav { display: none; } }

main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; outline: none; }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head .link { font-size: 13px; color: var(--muted); text-decoration: none; }
.card-head .link:hover { color: var(--ink); }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 12px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 28px 24px; color: #fff;
  background: repeating-linear-gradient(90deg, #0d0d0e 0 46px, #161618 46px 92px);
  border: 1px solid #222; margin-bottom: 16px;
}
.hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 30%, rgb(232 197 71 / .18), transparent 55%); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero img { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 4px 12px rgb(0 0 0 / .5)); }
.hero .big { font-family: var(--display); font-size: clamp(56px, 12vw, 92px); line-height: .9; color: #e8c547; }
.hero .lead { font-size: 18px; font-weight: 600; }
.hero .sub { color: #b4b4bb; font-size: 14px; margin-top: 4px; }
.hero .wdl { margin-top: 14px; max-width: 420px; }

/* ---------- Stat tiles ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; min-width: 0; }
a.tile:hover { border-color: var(--ink-2); }
.tile .label { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.tile .label svg { width: 15px; height: 15px; }
.tile .value { font-family: var(--display); font-size: 36px; line-height: 1.05; margin-top: 4px; font-weight: 700; }
.tile .foot { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- V/E/D bar ---------- */
.wdl-bar { display: flex; gap: 2px; height: 10px; border-radius: 6px; overflow: hidden; background: var(--track); }
.wdl-bar span { display: block; height: 100%; }
.wdl-bar .w { background: var(--win); } .wdl-bar .d { background: var(--draw); } .wdl-bar .l { background: var(--loss); }
.wdl-legend { display: flex; gap: 14px; font-size: 13px; margin-top: 8px; flex-wrap: wrap; }
.wdl-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.hero .wdl-legend { color: #d4d4d8; }
.res { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.res.V { background: var(--win); } .res.E { background: var(--draw); } .res.D { background: var(--loss); }

/* ---------- Barras horizontais ---------- */
.hbars { display: grid; gap: 9px; }
.scroll { max-height: 460px; overflow: auto; padding-right: 12px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.hbar .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; background: var(--accent-fill); border-radius: 0 4px 4px 0; }
.hbar .val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 24px; text-align: right; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* ---------- Colunas por ano ---------- */
.cols { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 8px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; cursor: default; }
.col .stack { position: relative; width: 100%; max-width: 30px; flex: 1; display: flex; align-items: flex-end; }
.col .ghost { position: absolute; bottom: 0; left: 0; right: 0; background: var(--track); border-radius: 4px 4px 0 0; }
.col .bar { position: relative; width: 100%; background: var(--accent-fill); border-radius: 4px 4px 0 0; }
.col .yl { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col:hover .ghost { background: color-mix(in srgb, var(--track) 70%, var(--ink-2)); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Títulos ---------- */
.trophies { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.trophy { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; background: var(--surface-2); cursor: pointer; text-align: left; }
.trophy.seen { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.trophy.dim { opacity: .45; }
.trophy svg { flex: none; width: 26px; height: 26px; stroke: var(--muted); }
.trophy.seen svg { stroke: var(--accent); }
.trophy b { display: block; font-size: 13px; }
.trophy small { color: var(--ink-2); font-size: 12px; }

/* ---------- Recordes ---------- */
.records { display: grid; gap: 2px; }
.record { display: flex; gap: 12px; align-items: center; padding: 10px 6px; border-radius: 10px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.record:hover { background: var(--surface-2); }
.record .k { font-size: 12px; color: var(--muted); }
.record .v { font-weight: 600; }
.record .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.record .ic svg { width: 18px; height: 18px; }
.record > div { min-width: 0; }
.record .v, .record .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Pé-quente ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare > div { background: var(--surface-2); border-radius: 12px; padding: 14px; }
.compare .num { font-size: 34px; font-weight: 700; }
.compare .hot { outline: 2px solid var(--accent); }

/* ---------- Toolbar & filtros ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.input, .select {
  height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 12px; min-width: 0;
}
.search .input { width: 100%; padding-left: 36px; }
.select { padding-right: 8px; max-width: 100%; }
.input:focus, .select:focus, textarea:focus { outline: 2px solid var(--accent-fill); outline-offset: 0; border-color: transparent; }
.chip {
  height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn {
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--loss); }
.btn:disabled { opacity: .5; cursor: progress; }
.filters-row { display: contents; }
@media (max-width: 640px) {
  .filters-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .filters-row .select { width: 100%; }
}
.summary-line { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }

/* ---------- Lista de jogos ---------- */
.season { margin-bottom: 18px; }
#list, #summary { max-width: 1000px; }
.season-head {
  position: sticky; top: 59px; z-index: 5; display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 4px; background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.season-head h3 { font-family: var(--display); font-size: 24px; }
.season-head span { font-size: 13px; color: var(--muted); }
.match {
  display: grid; grid-template-columns: 44px 72px 1fr; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent;
}
.match:hover { background: var(--surface); border-color: var(--line); }
.match.went { background: var(--accent-soft); }
.match .when { font-size: 13px; line-height: 1.25; }
.match .when b { display: block; font-variant-numeric: tabular-nums; }
.match .when small { color: var(--muted); font-size: 11px; }
.match .body { min-width: 0; }
.match .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scoreline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.team { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 500; }
.team.home { justify-content: flex-end; text-align: right; }
.team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team img, .logo-ph { width: 22px; height: 22px; object-fit: contain; flex: none; }
.logo-ph { border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.team.galo { font-weight: 700; }
.team .short { display: none; }
@media (max-width: 560px) { .team .full { display: none; } .team .short { display: inline; } }
.score { font-family: var(--display); font-size: 20px; font-weight: 700; min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; gap: 4px; }
.score small { font-family: var(--font); font-size: 10px; color: var(--muted); font-weight: 500; }
.went-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1.5px dashed var(--line); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.went-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.went-btn[aria-pressed="true"] { background: var(--accent-fill); border: 1.5px solid var(--accent-fill); color: var(--on-accent); }
.went-btn svg { width: 22px; height: 22px; }
@media (max-width: 560px) {
  .match { grid-template-columns: 40px 1fr; gap: 8px 10px; }
  .match .when { grid-column: 2; display: flex; gap: 8px; align-items: baseline; }
  .match .when b { display: inline; }
  .match .went-btn { grid-row: 1 / span 2; }
  .match .body { grid-column: 2; }
  .team img, .logo-ph { width: 18px; height: 18px; }
  .team { font-size: 14px; }
}
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- Mapa ---------- */
.map-layout { display: grid; gap: 16px; grid-template-columns: 1fr; }
.map-wrap { position: relative; align-self: start; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
@media (min-width: 1000px) { .map-layout { grid-template-columns: minmax(0, 1fr) 340px; } .map-wrap { position: sticky; top: 76px; } }
#map { height: min(68vh, 640px); min-height: 380px; background: var(--surface-2); }
.map-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.place-list { display: grid; gap: 4px; max-height: 300px; overflow: auto; padding-right: 8px; }
.place { display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: 14px; border-radius: 8px; }
.place .n { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.place img.flag { width: 22px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.uf-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.uf { width: 42px; height: 32px; display: grid; place-items: center; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.uf.on { background: var(--accent-fill); color: var(--on-accent); }
.leaflet-container { font: inherit; }
/* Mapa-base escuro: inverte as cores dos tiles do OSM no tema escuro */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.4); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.4); } }
:root .leaflet-tile-pane { filter: saturate(.35); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; }
.leaflet-popup-content h4 { margin: 0 0 2px; font-size: 15px; }
.pop-games { margin-top: 8px; max-height: 180px; overflow: auto; display: grid; gap: 3px; }
.pop-games div { display: flex; gap: 6px; align-items: center; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--muted); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface-2); }
.versus td.best { font-weight: 700; color: var(--accent); }
.versus td.best::after { content: ' ▲'; font-size: 9px; vertical-align: 1px; }
.versus td { white-space: normal; }
.versus th:not(:first-child), .versus td:not(:first-child) { width: 34%; }

/* ---------- Modal ---------- */
dialog {
  border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink);
  width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgb(0 0 0 / .35);
}
dialog::backdrop { background: rgb(0 0 0 / .55); backdrop-filter: blur(2px); }
@media (max-width: 560px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2 { font-size: 16px; flex: 1; }
.modal-content { padding: 16px; }
.board { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; text-align: center; padding: 6px 0 14px; }
.board img, .board .logo-ph { width: 56px; height: 56px; margin: 0 auto 6px; }
.board .logo-ph { font-size: 18px; }
.board .tn { font-weight: 600; font-size: 14px; }
.board .sc { font-family: var(--display); font-size: 48px; font-weight: 700; line-height: 1; }
.board .pens { font-size: 12px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.fact { background: var(--surface-2); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.fact .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.goals { display: grid; gap: 4px; margin-bottom: 16px; }
.goal { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 8px; font-size: 14px; }
.goal .l { text-align: right; } .goal .m { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.lineup { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.lineup span { font-size: 13px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); }
.lineup span.sub { background: transparent; border: 1px dashed var(--line); }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .input, .field .select { width: 100%; }
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.score-input { display: flex; align-items: center; gap: 8px; }
.score-input .input { width: 64px; text-align: center; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.modal-actions .spacer { flex: 1; }
.hint { font-size: 12px; color: var(--muted); }
.note-box { background: var(--accent-soft); border-radius: 12px; padding: 12px; margin-bottom: 16px; }

/* ---------- Tooltip & toast ---------- */
#tooltip {
  position: fixed; z-index: 3000; pointer-events: none; background: var(--ink); color: var(--bg);
  font-size: 12px; padding: 6px 9px; border-radius: 8px; max-width: 260px; white-space: pre-line; line-height: 1.4;
}
#toast {
  position: fixed; z-index: 3000; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgb(0 0 0 / .25);
  max-width: calc(100vw - 32px);
}
@media (min-width: 760px) { #toast { bottom: 24px; } }

@media (prefers-reduced-motion: no-preference) {
  .card, .tile, .hero { animation: rise .35s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}

/* ---------- Login / conta ---------- */
.avatar { font-weight: 700; font-size: 15px; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.avatar:hover { color: var(--bg); opacity: .85; }
body.logged-out .tabs, body.logged-out .bottom-nav, body.logged-out #btn-settings, body.logged-out #btn-account { display: none; }
body.logged-out { padding-bottom: 0; }
.auth-wrap { min-height: calc(100dvh - 140px); display: grid; place-items: center; }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; box-shadow: var(--shadow); }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand img { margin: 0 auto 10px; width: 64px; height: 64px; object-fit: contain; }
.auth-brand h1 { font-size: 24px; font-weight: 500; }
.auth-brand p { margin: 4px 0 0; font-size: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { border: 0; background: none; padding: 9px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.auth-form { display: grid; gap: 14px; }
.auth-submit { width: 100%; justify-content: center; height: 46px; margin-top: 4px; }
.auth-error { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--loss); background: color-mix(in srgb, var(--loss) 10%, transparent); }
.auth-foot { text-align: center; margin: 16px 0 0; }
.auth-info { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--win); background: color-mix(in srgb, var(--win) 10%, transparent); }
.auth-foot a { color: var(--ink-2); }

/* ---------- Cartão de desempenho (Minha conta) ---------- */
.pcard {
  --pc-win: #34d399; --pc-draw: #fbbf24; --pc-loss: #fb7185;
  background: #0b0b0d; color: #e7e7ea; border: 1px solid #222226; border-radius: 18px;
  padding: 18px 18px 16px; text-align: center; margin-bottom: 4px;
}
.pcard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.pcard-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.pcard-brand img { width: 22px; height: 22px; object-fit: contain; }
.pcard-select { background: #18181b; color: #e7e7ea; border: 1px solid #2c2c31; border-radius: 9px; height: 32px; padding: 0 8px; font-size: 13px; }
.pcard-season { font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: #8a8a93; font-weight: 600; margin-bottom: 14px; }
.pcard-ring { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.pcard-ring circle { fill: none; stroke-width: 9; }
.pcard-ring .track { stroke: #232327; }
.pcard-ring .arc { stroke: #d4d4da; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.pcard-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; font-weight: 700; color: #e7e7ea; font-variant-numeric: tabular-nums; }
.pcard-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #8a8a93; font-weight: 600; margin-top: 8px; }
.pcard-wdl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0 18px; }
.pcard-wdl b { display: block; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pcard-wdl span, .pcard-goals span { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8a8a93; font-weight: 600; margin-top: 4px; }
.pcard-goals { display: grid; grid-template-columns: 1fr 1fr; background: #121215; border: 1px solid #26262b; border-radius: 14px; padding: 12px 0; max-width: 340px; margin: 0 auto; }
.pcard-goals > div + div { border-left: 1px solid #2c2c31; }
.pcard-goals b { font-size: 24px; color: #fff; font-variant-numeric: tabular-nums; }
.pcard-foot { font-size: 12px; color: #6b6b73; margin-top: 16px; }

/* ---------- Aba Meu Dashboard ---------- */
.season-filters .select { flex: 1 1 170px; }
.clear-filters { flex: none; width: 40px; height: 40px; }
.clear-filters:disabled { opacity: .4; cursor: default; }
@media (max-width: 640px) {
  .season-filters { display: grid; grid-template-columns: 1fr 1fr 40px; grid-template-areas: "year year clear" "comp venue venue" "mando opp opp"; }
  .season-filters .select { width: 100%; }
  #s-year { grid-area: year; } #s-comp { grid-area: comp; } #s-venue { grid-area: venue; } #s-mando { grid-area: mando; } #s-opp { grid-area: opp; } #s-clear { grid-area: clear; }
}
.bottom-nav a { text-align: center; line-height: 1.15; }
