@font-face {
  font-family: "Anton";
  src: url("assets/fonts/Anton-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --blue: #007eff;
  --blue-deep: #0061e5;
  --blue-ink: #003a8c;
  --pink: #f8519f;
  --yellow: #ffba00;
  --white: #ffffff;
  --ink: #0b1b3a;
  --display: "Anton", "Impact", sans-serif;
  --wide: "Archivo", "Arial Black", sans-serif;
  --names: "Poppins", "Arial Black", sans-serif;
  --radius: 4px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  font-family: var(--wide);
  font-stretch: 125%;
  background-color: var(--blue);
}
/* Official background art, pinned behind the content (fixed attachment is unreliable on iOS). */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: var(--blue) url("assets/bg-desktop.webp") center top / cover no-repeat;
}
@media (max-width: 719px) { body::after { background-image: url("assets/bg-mobile.webp"); } }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; gap: 16px;
  max-width: 880px; margin: 0 auto; padding: 24px 16px 8px;
}
.logo { width: 92px; height: auto; flex: none; }
.top-title h1 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(30px, 7vw, 48px); line-height: 1; text-transform: uppercase; letter-spacing: .01em;
}
.updated { margin: 6px 0 0; font-size: 11px; font-weight: 500; opacity: .85; letter-spacing: .02em; }

.wrap { max-width: 880px; margin: 0 auto; padding: 16px 16px 40px; }

/* ---------- Filters ---------- */
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 18px; }
.days { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.days::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.day {
  flex: none; min-width: 64px; padding: 8px 10px; border: 2px solid rgba(255,255,255,.7); border-radius: 12px;
  background: transparent; text-align: center; line-height: 1;
}
.day b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; text-transform: uppercase; }
.day small { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; }
.day[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.day.today:not([aria-pressed="true"]) { border-color: var(--yellow); }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip {
  flex: none; border: 1.5px solid rgba(255,255,255,.65); background: rgba(0,0,0,.08);
  padding: 7px 12px; font-size: 12px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  border-radius: 999px;
}
.chips.small .chip { padding: 5px 10px; font-size: 11px; }
.chip[aria-pressed="true"] { background: var(--white); color: var(--blue); border-color: var(--white); }
.chip .star { color: var(--yellow); margin-left: 4px; }

.row-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1.5px solid rgba(255,255,255,.65); border-radius: 999px; overflow: hidden; }
.seg button {
  border: 0; background: transparent; padding: 6px 11px; font-size: 11px; font-weight: 800; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px;
}
.seg button[aria-pressed="true"] { background: var(--white); color: var(--blue); }

.dot { display: inline-block; width: 10px; height: 10px; flex: none; }
.dot-f { background: var(--pink); }
.dot-m { background: var(--yellow); }

/* ---------- Game list ---------- */
.venue { margin-top: 26px; }
.venue-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.venue-head h2, .venue-head span { margin: 0; font-family: var(--display); font-weight: 400; line-height: 1; text-transform: uppercase; }
.venue-head h2 { font-size: clamp(30px, 8vw, 46px); }
.venue-head span { font-size: clamp(20px, 5vw, 34px); }

.bar {
  --h: 54px; --cut: 18px; --scw: 24px; --bar: var(--pink);
  display: grid; grid-template-columns: 40px minmax(0, 1fr) var(--scw) auto var(--scw) minmax(0, 1fr); align-items: center; column-gap: 4px;
  height: var(--h); padding-left: 10px; padding-right: 10px; background: var(--bar); color: var(--white);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
}
.game.m .bar { --bar: var(--yellow); }

.when { display: grid; justify-items: start; line-height: 1; font-family: var(--display); text-transform: uppercase; }
.when .hora { font-size: 17px; }
.when .mod-m { font-size: 13px; margin-top: 2px; }
.mod { display: none; }

.team {
  font-family: var(--names); font-weight: 800; font-size: clamp(9.5px, 2.8vw, 12.5px); line-height: 1.05; text-transform: uppercase;
  overflow-wrap: normal; word-break: keep-all; hyphens: none;
}
.team.away { text-align: right; }
.team em { font-style: italic; font-weight: 300; margin-left: .25em; white-space: nowrap; display: inline-block; }
.team.mine { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.team.lose { opacity: .6; }

/* VS mark fills the bar's full height, as in the art; its knocked-out letters show the bar colour. */
.vs { position: relative; height: var(--h); display: flex; }
.vs img { height: 100%; width: auto; display: block; }
.sc { font-family: var(--display); font-size: 21px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-sc { text-align: right; }
.vs img { flex: none; }
.sets {
  position: absolute; left: 50%; bottom: 3px; translate: -50% 0; padding: 1px 5px; border-radius: 3px;
  background: var(--bar); font-size: 8px; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
}
.tag { font-family: var(--wide); font-size: 7.5px; font-weight: 800; letter-spacing: .06em; margin-top: 3px; white-space: nowrap; }

.obs { margin: 4px 0 0 10px; font-size: 11px; font-weight: 700; }
.empty { padding: 32px 16px; text-align: center; border: 2px dashed rgba(255,255,255,.5); font-weight: 700; }

@media (max-width: 379px) {
  .bar { --h: 46px; --cut: 15px; --scw: 20px; grid-template-columns: 36px minmax(0, 1fr) var(--scw) auto var(--scw) minmax(0, 1fr); column-gap: 3px; padding-left: 8px; padding-right: 8px; }
  .when .hora { font-size: 15px; }
  .team { font-size: 9.5px; }
  .sc { font-size: 17px; }
}
@media (max-width: 339px) { .team { font-size: 8px; } }

@media (min-width: 720px) {
  .bar { --h: 76px; --cut: 26px; --scw: 72px; grid-template-columns: 100px minmax(0, 1fr) var(--scw) auto var(--scw) minmax(0, 1fr) 96px; column-gap: 14px; padding-left: 22px; padding-right: 26px; }
  .when .hora { font-size: 34px; }
  .when .mod-m { display: none; }
  .mod { display: block; font-family: var(--display); font-size: 34px; line-height: 1; text-align: right; text-transform: uppercase; }
  .team { font-size: clamp(14px, 1.7vw, 20px); }
  .sc { font-size: 44px; }
  .sets { font-size: 10px; bottom: 4px; }
  .tag { font-size: 9px; }
}

/* ---------- Torcidômetro ---------- */
.game { margin-bottom: 14px; }
.torcida { margin-top: 5px; margin-right: 18px; }
.t-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.t-title { font-family: var(--display); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.t-info { font-size: 10px; font-weight: 700; text-align: right; opacity: .9; }
.t-bar { display: flex; height: 30px; border-radius: 999px; overflow: hidden; background: var(--blue-ink); box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.t-side {
  display: flex; align-items: center; gap: 6px; min-width: 0; border: 0; padding: 0 12px;
  font-family: var(--names); font-weight: 800; font-size: 11px; text-transform: uppercase; white-space: nowrap;
  transition: width .5s ease;
}
.t-side.h { background: var(--white); color: var(--blue); justify-content: flex-start; }
.t-side.a { background: var(--blue-ink); color: var(--white); justify-content: flex-end; }
.t-side b { font-family: var(--display); font-weight: 400; font-size: 16px; }
.t-name { overflow: hidden; text-overflow: ellipsis; }
.t-side.narrow .t-name { display: none; }
.t-side:disabled { cursor: default; }
.t-side.chosen .t-name::after { content: " ✓"; }
.torcida.open .t-side:hover, .torcida.open .t-side:focus-visible { filter: brightness(1.08); }
.torcida.open .t-side:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; }
.torcida.open .t-bar { animation: nudge 2.4s ease-in-out 1s 2; }
@keyframes nudge { 50% { box-shadow: 0 0 0 3px var(--yellow); } }

@media (min-width: 720px) {
  .torcida { margin-left: 122px; margin-right: 26px; }
  .t-bar { height: 34px; }
  .t-side { font-size: 12px; }
  .t-title { font-size: 15px; }
  .t-info { font-size: 11px; }
}

/* ---------- Pop-up de aviso ---------- */
.popup {
  width: min(420px, calc(100% - 32px)); border: 0; padding: 28px 24px 22px; border-radius: 18px; text-align: center;
  background: var(--blue); color: var(--white); box-shadow: 0 20px 60px rgba(0, 20, 60, .45);
}
.popup::backdrop { background: rgba(0, 25, 70, .7); }
.popup-logo { width: 84px; height: auto; }
.popup h2 { margin: 14px 0 8px; font-family: var(--display); font-weight: 400; font-size: 28px; text-transform: uppercase; letter-spacing: .02em; }
.popup p { margin: 0 0 20px; font-size: 14px; font-weight: 600; line-height: 1.5; font-stretch: 100%; }
.popup button {
  width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--yellow); color: var(--ink);
  font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: .04em;
}
.popup button:focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }

/* ---------- Misc ---------- */
.aviso { margin: 28px 0 0; font-size: 11px; font-weight: 600; text-align: center; opacity: .85; line-height: 1.5; }
.share {
  display: block; margin: 20px auto 0; border: 0; padding: 13px 28px; background: var(--white); color: var(--blue);
  font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .04em;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.foot { padding: 20px 16px 32px; text-align: center; border-top: 1px solid rgba(255,255,255,.25); }
.legend-inline { display: flex; gap: 16px; justify-content: center; font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 16px; }
.legend-inline span { display: inline-flex; gap: 6px; align-items: center; }
.apoio { width: 100%; max-width: 620px; }

.side-legend { display: none; }
@media (min-width: 1100px) {
  .side-legend {
    display: flex; position: fixed; left: 28px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: left center;
    gap: 28px; font-family: var(--display); font-size: 15px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
    translate: 10px 120px;
  }
  .side-legend span { display: inline-flex; align-items: center; gap: 8px; }
}


.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 20px; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--white); padding: 10px 16px; font-size: 12px; font-weight: 700; transition: .2s;
}
.toast.show { opacity: 1; translate: -50% 0; }

@media (prefers-reduced-motion: reduce) { .toast, .t-side { transition: none; } .torcida.open .t-bar { animation: none; } }
