/* Degola — visual "sports daily": papel, verde CBF, amarelo Brasil. */
:root {
  --paper: #f4f1e6;
  --card: #fffdf6;
  --ink: #1d2a1c;
  --muted: #66735f;
  --line: #e2dcc8;
  --green-900: #063d22;
  --green-700: #046a38;
  --green-500: #009c3b;
  --green-100: #e3f0e4;
  --yellow: #ffdf00;
  --blue: #1d6fd1;
  --orange: #d97a06;
  --red: #cf2e2e;
  --red-wash: #fbe9e7;
  --radius: 14px;
  --font: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
}
a { color: var(--green-700); }

/* ---------- header ---------- */
.topbar {
  width: 100%;
  background:
    radial-gradient(900px 320px at 85% -10%, rgba(255, 223, 0, .13), transparent 70%),
    radial-gradient(700px 300px at 0% 120%, rgba(0, 156, 59, .35), transparent 70%),
    var(--green-900);
  color: #f5f7f2;
  border-bottom: 6px solid var(--yellow);
  padding: max(14px, env(safe-area-inset-top)) 0 clamp(14px, 2.4vw, 22px);
}
.wrap {
  max-width: 1280px; margin: 0 auto;
  padding-left: max(clamp(14px, 3vw, 24px), env(safe-area-inset-left));
  padding-right: max(clamp(14px, 3vw, 24px), env(safe-area-inset-right));
}
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: block; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.brand-word { font-size: 24px; font-weight: 900; letter-spacing: -0.03em; }
.hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 28px; flex-wrap: wrap;
  padding-top: clamp(18px, 3.6vw, 34px);
}
.hero-copy { max-width: 680px; }
.kicker {
  margin: 0 0 8px; font-size: 12px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--yellow);
}
h1 {
  margin: 0 0 10px; font-weight: 900; letter-spacing: -0.035em;
  font-size: clamp(34px, 6vw, 60px); line-height: .98; text-wrap: balance;
}
.subtitle { margin: 0; color: #cfdacb; font-size: clamp(15px, 1.6vw, 17px); line-height: 1.45; text-wrap: pretty; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.league-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 2px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.league-tabs::-webkit-scrollbar { display: none; }
.league-tabs a {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; scroll-snap-align: start;
  font-family: var(--font); color: #d7e1d3; text-decoration: none;
  border: 1.5px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04); border-radius: 999px;
  padding: 8px 15px 8px 10px; font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.league-tabs a:hover { border-color: var(--yellow); color: var(--yellow); }
.league-tabs a.active { background: var(--yellow); border-color: var(--yellow); color: var(--green-900); }
.lg-flag { width: 22px; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.18); }

.btn {
  font-family: var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; color: #f5f7f2; border: 1.5px solid rgba(255,255,255,.25); border-radius: 999px;
  padding: 10px 17px; cursor: pointer; font-size: 14.5px; font-weight: 700; line-height: 1.1;
  transition: transform .12s, filter .15s, border-color .15s, color .15s, background .15s;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:hover { border-color: var(--yellow); color: var(--yellow); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .league-tabs a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--green-900); font-weight: 800; box-shadow: 0 8px 22px -10px rgba(255,223,0,.7); }
.btn.primary:hover { filter: brightness(1.06); color: var(--green-900); }
.btn.sim { padding: 9px 20px 9px 16px; gap: 11px; text-align: left; border-radius: 18px; }
.btn.sim svg { width: 20px; height: 20px; }
.sim-txt { display: flex; flex-direction: column; gap: 2px; }
.sim-txt small { font-size: 12px; font-weight: 600; opacity: .72; letter-spacing: 0; }
.btn.light { background: #fff; border-color: #fff; color: var(--green-900); }
.btn.light:hover { color: var(--green-700); border-color: #fff; filter: brightness(.97); }
.btn.ghost { color: #d7e1d3; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.small svg { width: 14px; height: 14px; }
.btn.icon { width: 36px; height: 36px; padding: 0; }
.btn.icon svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr);
  gap: 20px; padding-top: 22px; padding-bottom: 10px; align-items: start;
}
/* minmax(0, …): sem isso a coluna não encolhe abaixo da largura da tabela e o card vaza da tela */
@media (max-width: 980px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.card { min-width: 0; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(12px, 2vw, 20px);
  box-shadow: 0 1px 0 var(--line), 0 12px 28px -18px rgba(6, 61, 34, .35);
}
.card-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
.card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head .hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.card-head.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sim-status {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--green-100); border: 1px solid #bcd8bd;
  padding: 3px 11px; border-radius: 999px; white-space: nowrap;
}
.sim-status.done { color: var(--green-700); }

/* ---------- standings ---------- */
.table-scroll { overflow-x: auto; margin: 0 calc(clamp(12px, 2vw, 20px) * -1); padding: 0 clamp(12px, 2vw, 20px); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
thead th {
  position: sticky; top: 0; background: var(--green-900); color: #eef3ea;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 9px 7px; white-space: nowrap; z-index: 1;
}
thead th:first-child { border-radius: 8px 0 0 8px; }
thead th:last-child { border-radius: 0 8px 8px 0; }
tbody td { padding: 6px 7px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; font-size: 14.5px; }
tbody tr:nth-child(even) { background: #faf7ec; }
tbody tr:hover { background: var(--green-100); }
tbody tr:last-child td { border-bottom: none; }
.c-pos { width: 40px; }
.pos-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--green-900); color: #fff; font-weight: 800; font-size: 13px;
}
tr.zone-z4 .pos-num { background: var(--red); }
.c-team { text-align: left !important; font-weight: 600; }
.team-cell { display: flex; align-items: center; gap: 9px; }
.name-short { display: none; }
.crest { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; flex-shrink: 0; }
.crest img { width: 30px; height: 30px; object-fit: contain; }
.crest .badge { display: none; }
.crest.noimg .badge { display: inline-flex; }
.badge {
  align-items: center; justify-content: center; min-width: 34px; height: 22px; padding: 0 6px;
  border-radius: 6px; font-size: 10.5px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.delta { font-size: 11px; margin-left: 2px; font-weight: 700; }
.delta.up { color: var(--green-500); } .delta.down { color: var(--red); } .delta.same { color: #b7bfae; }
tr.zone-g4 td.c-pos { box-shadow: inset 4px 0 0 var(--blue); }
tr.zone-g6 td.c-pos { box-shadow: inset 4px 0 0 var(--orange); }
tr.zone-z4 td.c-pos { box-shadow: inset 4px 0 0 var(--red); }
tr.zone-z4 { background: var(--red-wash); }
tr.zone-z4:nth-child(even) { background: #f7ddd8; }
tr.z4-first td { border-top: 2.5px solid var(--red); padding-top: 10px; }
.c-pct { min-width: 0; }
.pct-val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
#standings .c-sub { min-width: 64px; text-align: right; }
#standings .c-sub[data-ch="title"] .pct-val { color: #7a5c00; }
#standings .c-sub[data-ch="rel"] .pct-val { color: #a02121; }
#standings .c-sub svg { display: block; margin: 0 auto; }
#standings.hide-title [data-ch="title"], #standings.hide-rel [data-ch="rel"] { display: none; }
.no-chance { color: #c3bba6; font-weight: 700; }
.ch-toggles { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.chtoggle {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid #c9c2ab; border-radius: 999px; padding: 5px 12px;
  font-size: 13px; font-weight: 700; color: var(--green-900); cursor: pointer;
  background: #f4efe0;
}
.chtoggle input { accent-color: var(--green-700); width: 15px; height: 15px; margin: 0; cursor: pointer; }
.langpick { position: relative; }
#lang-btn { display: inline-flex; align-items: center; gap: 8px; }
#lang-btn img { width: 22px; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); display: block; }
#lang-btn .caret { width: 12px; height: 12px; opacity: .8; }
#lang-btn { padding: 8px 12px; }
#lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  background: #0d3b26; border: 1.5px solid #4c7a5e; border-radius: 14px;
  padding: 6px; min-width: 150px; box-shadow: 0 14px 30px -12px rgba(0,0,0,.5);
}
#lang-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: transparent; border: 0; border-radius: 9px; cursor: pointer;
  color: #f5f7f2; font-family: var(--font); font-size: 14px; font-weight: 700;
  padding: 8px 10px;
}
#lang-menu button:hover { background: rgba(255, 223, 0, .14); }
#lang-menu img { width: 22px; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; }
.sw.g4 { background: var(--blue); } .sw.g6 { background: var(--orange); } .sw.z4 { background: var(--red); }
.sw.zplay { background: #b3541e; }
tr.zone-playoff td.c-pos { box-shadow: inset 4px 0 0 #b3541e; }
tr.zone-playoff { background: #faf0e2; }
.up { color: var(--green-500); } .down { color: var(--red); }

/* ---------- rounds ---------- */
.round-nav { display: flex; gap: 6px; align-items: center; }
#round-select {
  font-family: var(--font); font-weight: 700; background: var(--green-900); color: #fff;
  border: none; border-radius: 999px; padding: 7px 12px; font-size: 14px; cursor: pointer;
}
.rounds-card .btn { color: var(--green-900); border-color: #c9d6c4; background: #fff; }
.rounds-card .btn:hover { border-color: var(--green-700); color: var(--green-700); }
.rounds-card .btn.ai { background: var(--green-900); border-color: var(--green-900); color: var(--yellow); }
.rounds-card .btn.ai:hover { filter: brightness(1.15); color: var(--yellow); }
.round-actions { display: flex; gap: 6px; }
.round-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin: 12px 0 4px; }
.round-grid button {
  font-family: var(--font); background: #f0ebda; border: 1px solid var(--line); color: var(--ink);
  border-radius: 9px; padding: 7px 0; font-size: 13px; font-weight: 600; cursor: pointer; position: relative;
}
.round-grid button:hover { border-color: var(--green-500); color: var(--green-700); }
.round-grid button.active { background: var(--green-900); color: #fff; font-weight: 800; border-color: var(--green-900); }
.round-grid button.done { background: var(--green-100); border-color: #9cc4a0; color: var(--green-700); }
.round-grid button.done::before { content: "✓ "; font-size: 11px; }
.round-grid button.has-pending::after {
  content: ""; position: absolute; top: 5px; right: 6px;
  width: 7px; height: 7px; border-radius: 99px; background: var(--orange);
}
.round-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 0 2px; }
.round-head h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }

.match {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  padding: 9px 4px; border-bottom: 1px dashed var(--line);
}
.match:last-child { border-bottom: none; }
.mteam { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; min-width: 0; }
.mteam.home { justify-content: flex-end; text-align: right; }
.mteam span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mteam.pickable { cursor: pointer; border-radius: 10px; padding: 4px 6px; margin: -4px -6px; }
.mteam.pickable:hover { background: var(--green-100); }
.mteam.pickable:focus-visible { outline: 2px solid var(--green-500); outline-offset: 1px; }
.mteam.picked { background: var(--green-100); box-shadow: inset 0 0 0 1.5px var(--green-500); }
.mteam.picked span.name { color: var(--green-900); font-weight: 800; }
.pick-tip { margin: 4px 0 6px; font-size: 13px; color: var(--muted); }
.linklike {
  font-family: var(--font); background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 12px; text-decoration: underline; padding: 2px 4px;
}
.linklike:hover { color: var(--red); }
.match:not(.is-edited) .linklike { visibility: hidden; }
.match .crest { width: 34px; height: 34px; }
.match .crest img { width: 34px; height: 34px; }
.score { display: flex; align-items: center; gap: 5px; }
.score input {
  font-family: var(--font); width: 46px; text-align: center; font-size: 19px; font-weight: 800;
  padding: 6px 2px; border-radius: 10px; border: 2px solid var(--line);
  background: #fff; color: var(--ink); caret-color: var(--green-700);
}
.score input:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px var(--green-100); }
.score input.user { border-color: var(--orange); background: #fff8ea; }
.score button.x {
  font-family: var(--font); background: #f0ebda; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); font-weight: 800; font-size: 14px; line-height: 1;
  width: 30px; height: 30px; cursor: pointer;
}
.score button.x:hover { border-color: var(--green-500); color: var(--green-700); }
.score button.x.picked { background: var(--green-900); border-color: var(--green-900); color: #fff; }
.mrow2 { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; justify-content: center; }
.tag {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  border-radius: 99px; padding: 2px 9px;
}
.tag.oficial { background: var(--green-100); color: var(--green-700); }
.tag.palpite { background: #f7e8c8; color: #9a5b00; }
.tag.jev { background: var(--green-900); color: var(--yellow); letter-spacing: .04em; }
.tag.aberto { background: #eee9d8; color: var(--muted); }
.rounds-foot { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- como funciona ---------- */
.faq { padding-top: 26px; }
.faq h2 { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; margin: 0 0 12px; }
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
@media (max-width: 760px) { .faq-grid { grid-template-columns: minmax(0, 1fr); } }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.faq summary {
  cursor: pointer; font-weight: 800; font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 800; color: var(--green-700); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: #3d4a3b; font-size: 14.5px; line-height: 1.55; }

/* ---------- footer ---------- */
.foot { color: var(--muted); font-size: 13px; padding-top: 22px; padding-bottom: max(36px, env(safe-area-inset-bottom)); }
.foot p { max-width: 920px; margin: 0 0 6px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px)); z-index: 100;
  transform: translate(-50%, 16px); opacity: 0; transition: opacity .2s, transform .2s;
  max-width: min(92vw, 460px); background: var(--green-900); color: #fff; border: 1.5px solid rgba(255,223,0,.5);
  border-radius: 14px; padding: 12px 16px; font-size: 14.5px; font-weight: 600; text-align: center;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.55);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast, .btn { transition: none; } }

@media (max-width: 640px) {
  /* tabela rola na horizontal (colunas sticky removidas: Chrome sobrepõe células sticky em tabelas) */
  .table-scroll { -webkit-overflow-scrolling: touch; }
  .mteam span.name { font-size: 13px; }
  .score input { width: 44px; font-size: 18px; padding: 9px 2px; }
  .score button.x { width: 40px; height: 44px; font-size: 16px; }
  /* evita zoom automático do iOS ao focar (<16px) e delay de double-tap */
  #round-select { font-size: 16px; }
  button, input, select { touch-action: manipulation; }
  .mteam.pickable, .score button.x { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
  thead th { font-size: 10.5px; padding: 8px 5px; }
  tbody td { font-size: 13.5px; padding: 6px 5px; }
  /* modo compacto: mostra as colunas pedidas (P J V SG GP %) e esconde E D GC */
  .m-hide { display: none; }
  tbody td { font-size: 13px; padding: 6px 4px; }
  thead th { padding: 8px 4px; }
  .team-cell { gap: 6px; }
  .crest, .crest img { width: 26px; height: 26px; }
  .match .crest, .match .crest img { width: 30px; height: 30px; }
  .c-pct { min-width: 0; }
  .round-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
  .round-grid button { padding: 11px 0; }
  .mteam.pickable { padding: 8px 6px; margin: -8px -6px; }
  .actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .actions .btn.primary { grid-column: 1 / -1; padding: 12px 17px; font-size: 15.5px; justify-content: center; }
  .actions .btn { padding: 11px 12px; }
  #round-select { flex: 1; }
}
/* telas bem estreitas: siglas no lugar dos nomes p/ tudo caber sem rolagem */
@media (max-width: 480px) {
  .s-hide { display: none; }
  .pos-num { width: 24px; height: 24px; font-size: 12px; border-radius: 7px; }
  #standings .c-sub { min-width: 54px; }
  tbody td, thead th { padding-left: 3px; padding-right: 3px; }
  .team-cell .name-full, .mteam .name-full { display: none; }
  .team-cell .name-short, .mteam .name-short { display: inline; font-weight: 800; }
}
