/* styles.css: padroniza e corrige o fundo da home, mantendo o resto intacto */
@font-face {
  font-family: "Supercell Magic";
  src: url("assets/Supercell-Magic.eot");
  src: url("assets/Supercell-Magic.eot?#iefix") format("embedded-opentype"),
    url("assets/Supercell-Magic.woff2") format("woff2"),
    url("assets/Supercell-Magic.woff") format("woff"),
    url("assets/Supercell-Magic.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --surface: #0a1024;
  --card: #0f1936;
  --elev: #121e41;
  --line: #243464;
  --txt: #f3f6ff;
  --muted: #a9b4d0;
  --brand: #62e6ff;
  --accent: #caa6ff;
  --ok: #35e0a1;
  --danger: #ff6b7a;
  --warn: #ffd267;
  --radius: 16px;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  --pad: clamp(20px, 5vw, 32px);
  --grad: linear-gradient(90deg, var(--brand), var(--accent));
  --chromatic-grad: linear-gradient(
    90deg,
    #ff6ec7,
    #ffd166,
    #06d6a0,
    #118ab2,
    #caa6ff,
    #ff6ec7
  );
  --chromatic-duration: 10s;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  background: var(--bg);
}
body {
  margin: 0;
  padding-top: env(safe-area-inset-top);
  padding-left: max(env(safe-area-inset-left), 12px);
  padding-right: max(env(safe-area-inset-right), 12px);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    "Helvetica Neue", Arial;
  color: var(--txt);
  background: var(--bg);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* fundo especial só na home (detecta .hero sem alterar HTML) */
body:has(.hero)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
      1000px 600px at 80% -10%,
      rgba(202, 166, 255, 0.1),
      transparent 60%
    ),
    radial-gradient(
      900px 600px at 0% 20%,
      rgba(98, 230, 255, 0.1),
      transparent 60%
    );
  opacity: 0.8;
}
body:has(.hero)::after {
  content: "";
  position: fixed;
  inset: -40% -40% auto;
  height: 60vh;
  z-index: -1;
  pointer-events: none;
  background: var(--chromatic-grad);
  filter: blur(80px);
  opacity: 0.22;
  animation: brandGradient var(--chromatic-duration) linear infinite;
}
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
:focus {
  outline: none;
}
:focus-visible {
  box-shadow: 0 0 0 3px rgba(98, 230, 255, 0.35),
    0 0 0 6px rgba(98, 230, 255, 0.18);
  border-radius: 12px;
}
h1,
h2,
h3,
h4,
.hero-title,
.section-title,
.brand-text,
.panel-title,
.season-name {
  font-family: "Supercell Magic", "Inter", sans-serif;
  letter-spacing: 0.2px;
}
h1,
.hero-title {
  font-size: clamp(26px, 6.5vw, 42px);
}
h2,
.section-title,
.panel-title {
  font-size: clamp(18px, 3.2vw, 24px);
}
h3 {
  font-size: clamp(16px, 2.8vw, 18px);
}
small {
  color: var(--muted);
}
.brand-text,
.hero-title,
.section-title,
.panel-title,
.season-name {
  background: var(--chromatic-grad);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandGradient var(--chromatic-duration) linear infinite;
  text-shadow: 0 0 12px rgba(98, 230, 255, 0.12);
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-text,
  .hero-title,
  .section-title,
  .panel-title,
  .season-name {
    color: var(--brand);
    background: none;
    animation: none;
  }
}
.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(var(--pad), calc(16px + env(safe-area-inset-left)));
  padding-right: max(var(--pad), calc(16px + env(safe-area-inset-right)));
}
.section {
  padding: 20px 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.section-title {
  margin: 0;
}
.section-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.input-wrap input,
select {
  background: var(--elev);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--txt);
  outline: none;
}
.input-wrap input::placeholder {
  color: #98a3c4;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  transform: translateZ(0);
  margin-left: calc(-1 * max(env(safe-area-inset-left), 12px));
  margin-right: calc(-1 * max(env(safe-area-inset-right), 12px));
}
.header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0px;
  text-decoration: none;
}
.brand-icon {
  width: 60px;
  height: 60px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 2px 8px rgba(202, 166, 255, 0.25));
}
.brand:hover .brand-icon {
  transform: rotate(-6deg) scale(1.04);
  box-shadow: inset 0 0 0 2px rgba(202, 166, 255, 0.28),
    0 10px 30px rgba(202, 166, 255, 0.25);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.header-actions a{
  width: 50px;
  height: 50px;
  display: inline-grid;
  place-items: center;
}
.header-actions a:hover {
  transform: translateY(-1px);
  border-color: rgba(98, 230, 255, 0.35);
}
.header-actions img{
  width: 100%;
  height: auto;   /* mantém proporção */
  display: block;
  filter: drop-shadow(0 2px 8px rgba(98,230,255,.18));
}
.hero {
  padding: 26px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hero-wrap {
  display: block;
}
.hero-subtitle {
  color: var(--muted);
  margin: 6px 0 0;
}
.btn {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--elev);
  color: var(--txt);
  padding: 9px 13px;
  border-radius: 12px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(98, 230, 255, 0.35);
  background: var(--elev);
  text-decoration: none;
  color: var(--txt);
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.15s ease;
  will-change: transform;
  touch-action: manipulation;
}
.btn-back::before {
  content: "←";
  font-size: 16px;
  line-height: 1;
}
.btn-back:hover {
  transform: translateY(-1px);
  border-color: rgba(98, 230, 255, 0.5);
}
.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 240px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 2px 10px 2px;
  scroll-padding-inline: 16px;
}
.carousel::-webkit-scrollbar {
  height: 6px;
}
.carousel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
    filter 0.2s ease;
  will-change: transform;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.5s ease forwards;
  cursor: pointer;
}
.card:nth-child(1) {
  animation-delay: 0.02s;
}
.card:nth-child(2) {
  animation-delay: 0.07s;
}
.card:nth-child(3) {
  animation-delay: 0.12s;
}
.card:nth-child(4) {
  animation-delay: 0.17s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(98, 230, 255, 0.45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  filter: saturate(110%);
}
.card-cover {
  aspect-ratio: 16/9;
  width: 100%;
  object-fit: cover;
  background: #0c1229;
}
.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-title {
  margin: 0;
  font-size: 16px;
  align-self: center;
  text-align: center;
}
.card-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  align-self: center;
}
.card-link {
  position: absolute;
  inset: 0;
}
.players-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.player {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease, filter 0.2s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.5s ease 0.12s forwards;
}
.player:hover {
  border-color: rgba(98, 230, 255, 0.35);
  transform: translateY(-1px);
  filter: saturate(108%);
}
.player-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #0c1229;
  object-fit: cover;
}
.player-name {
  margin: 0;
  font-size: 16px;
}
.player-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.player-toggle {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}
.player-details {
  grid-column: 1/-1;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 6px;
}
.player.is-open .player-details {
  max-height: 180px;
  padding: 6px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(202, 166, 255, 0.18);
  border: 1px solid rgba(202, 166, 255, 0.35);
  font-size: 11px;
  color: #efe9ff;
  margin: 4px 6px 0 0;
}
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.table,
.table-rank {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 420px;
  max-width: 100%;
}
.table thead th,
.table-rank thead th {
  position: sticky;
  top: 0;
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0)
    ),
    var(--card);
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  background-clip: padding-box;
}
.table thead th:first-child,
.table-rank thead th:first-child {
  border-top-left-radius: calc(var(--radius) - 2px);
}
.table thead th:last-child,
.table-rank thead th:last-child {
  border-top-right-radius: calc(var(--radius) - 2px);
}
.table tbody td,
.table-rank tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.table tbody tr:hover,
.table-rank tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}
.table-rank tbody tr:nth-child(1) {
  background: linear-gradient(90deg, rgba(98, 230, 255, 0.1), transparent);
}
.table-rank tbody tr:nth-child(2) {
  background: linear-gradient(90deg, rgba(202, 166, 255, 0.1), transparent);
}
.table-rank tbody tr:nth-child(3) {
  background: linear-gradient(90deg, rgba(255, 210, 103, 0.1), transparent);
}
.rank-pos-chip {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(98, 230, 255, 0.45);
  background: rgba(98, 230, 255, 0.14);
  font-weight: 700;
}
.season-hero {
  padding: 12px 0 0;
}
.season-hero-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
}
.season-cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.season-name {
  margin: 0;
}
.season-meta {
  margin: 4px 0 0;
  color: var(--muted);
}
.season-panels .grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-title {
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(
      90deg,
      rgba(98, 230, 255, 0.08),
      rgba(202, 166, 255, 0.06)
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  color: var(--txt);
}
.panel-body {
  padding: 12px;
}
.panel-body ul {
  margin: 0;
  padding-left: 18px;
}
.panel-body li {
  margin: 6px 0;
  color: var(--txt);
}
.prose p {
  margin: 0 0 8px;
}
.kpis-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
.grid-2-1 {
  display: grid;
  gap: 12px;
  grid-template-columns: 2fr 1fr;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-footer small {
  color: #c7d2f1;
}
.footer-dev-logo {
  height: 48px;
  opacity: 0.95;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(98, 230, 255, 0.18));
  transition: transform 0.15s ease;
}
.footer-dev-logo:hover {
  transform: translateY(-1px);
}
.player--person .player-name {
  background: linear-gradient(120deg, #b6891a, #ffd267, #fff2a6, #b6891a);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandGradient var(--chromatic-duration) linear infinite;
}
.table-rank.serie-a,
.table-rank.serie-b {
  --edge: var(--brand);
  --row: rgba(98, 230, 255, 0.1);
}
.table-rank.serie-a tbody tr:nth-child(-n + 3),
.table-rank.serie-b tbody tr:nth-child(-n + 3) {
  background: transparent;
}
.table-rank.serie-a {
  --edge: var(--ok);
  --row: rgba(53, 224, 161, 0.12);
}
.table-rank.serie-a tbody tr.g4,
.table-rank.serie-b tbody tr.g4 {
  box-shadow: inset 4px 0 0 0 var(--edge);
  background: var(--row);
}
.table-rank.serie-a tbody tr.g4 td:first-child,
.table-rank.serie-b tbody tr.g4 td:first-child {
  font-weight: 700;
}
.table-rank.serie-a tbody tr.relegation {
  box-shadow: inset 4px 0 0 0 var(--danger);
  background: rgba(255, 107, 122, 0.12);
}
.table-rank.serie-a tbody tr.relegation td:first-child {
  font-weight: 700;
}
.table-rank.serie-a tbody tr:hover,
.table-rank.serie-b tbody tr:hover {
  filter: saturate(110%);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes brandGradient {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .card,
  .player {
    opacity: 1 !important;
    transform: none !important;
  }
  .brand-text,
  .hero-title,
  .section-title,
  .panel-title,
  .season-name {
    animation: none !important;
  }
}
@media (max-width: 719.98px) {
  .kpis-grid {
    grid-template-columns: 1fr;
  }
  .grid-2-1 {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 720px) {
  .hero-wrap {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
  }
  .players-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .season-hero-wrap {
    grid-template-columns: 320px 1fr;
  }
  .season-panels .grid-3 {
    grid-template-columns: 2fr 1fr;
  }
  .carousel {
    grid-auto-columns: minmax(200px, 240px);
  }
}
@media (min-width: 1200px) {
  .container {
    max-width: 1240px;
  }
}
/* NOVO: gradientes específicos e animados para títulos das séries */
:root {
  --gold-grad: linear-gradient(
    120deg,
    #b6891a 0%,
    #ffd267 35%,
    #fff2a6 60%,
    #b6891a 100%
  );
  --silver-grad: linear-gradient(
    120deg,
    #9aa3ad 0%,
    #e5e7eb 35%,
    #ffffff 60%,
    #9aa3ad 100%
  );
}
.section:has(#carousel-bagreleirao-a) .section-title {
  background: var(--gold-grad);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandGradient var(--chromatic-duration) linear infinite;
  text-shadow: 0 0 12px rgba(255, 210, 103, 0.12);
}
.section:has(#carousel-bagreleirao-b) .section-title {
  background: var(--silver-grad);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandGradient var(--chromatic-duration) linear infinite;
  text-shadow: 0 0 12px rgba(229, 231, 235, 0.12);
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .section:has(#carousel-bagreleirao-a) .section-title {
    color: #ffd267;
    background: none;
    animation: none;
  }
  .section:has(#carousel-bagreleirao-b) .section-title {
    color: #e5e7eb;
    background: none;
    animation: none;
  }
}
/* Canonical solid background */
:root { --bg: #070b18; }

html, body {
  background-color: var(--bg) !important;
  background-image: none !important;
}

header, .site-header, .navbar, nav {
  position: static !important;
  top: auto !important;
}

html, body, #root, .app, .page, .layout, .wrapper {
  background-image: none !important;
}

body::before, body::after,
.page::before, .layout::before,
.wrapper::before, .wrapper::after {
  content: none !important;
}

/* Perf: evitar trabalho fora da viewport */
.panel, .carousel, .players-grid, .season-hero, .section { content-visibility: auto; contain-intrinsic-size: 1px 500px; }
.player, .card { contain: content; }
img[loading="lazy"] { content-visibility: auto; }
