/* Maior Torcida 2026: the volume meter.
   A grito is a sound, so every club is a segmented level bar. Club colours carry the page;
   everything else is concrete grey, white and ink. */
:root {
  --ground: #EDEFF2;
  --surface: #FFFFFF;
  --ink: #0E1116;
  --ink-2: #4A5260;
  --track: #D6DAE0;
  --line: #DADEE4;
  --live: #E0301E;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --seg: 9px;   /* one meter segment */
  --gap: 3px;   /* space between segments */
  --r: 14px;
  --tap: 52px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: rgba(14, 17, 22, 0.08);
  touch-action: manipulation;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
h1, h2, p, ol, ul, dl, dd { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* Top */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.logo { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.logo span { color: var(--ink-2); font-weight: 500; }
.clock { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.clock strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.clock__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); }

/* Hero */
.hero { display: grid; gap: 20px; padding-top: 8px; padding-bottom: 32px; }
h1 {
  font-size: clamp(40px, 11.5vw, 84px);
  font-weight: 800;
  font-variation-settings: "opsz" 96, "wdth" 75;
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero__lead { margin-top: 12px; font-size: 16px; color: var(--ink-2); max-width: 36em; text-wrap: pretty; }
.hero__copy .btn { display: none; } /* phones use the dock; desktop shows it */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 22px;
  border: 0; border-radius: var(--r);
  font: inherit; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer;
  transition: transform 120ms ease, background-color 150ms ease;
}
.btn--main { background: var(--ink); color: #fff; width: 100%; }
.btn--main:hover { background: #2A303A; }
.btn--main:active { transform: scale(0.985); }
.btn[aria-disabled="true"] { background: var(--track); color: var(--ink-2); pointer-events: none; }

/* The meter */
.meter { background: var(--surface); border-radius: 20px; padding: 16px 14px 8px; box-shadow: 0 1px 0 var(--line); scroll-margin-top: 12px; }
.meter__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 6px 10px; flex-wrap: wrap; }
.meter__head h2, .block h2 { font-size: 22px; font-weight: 800; font-variation-settings: "opsz" 48, "wdth" 85; letter-spacing: -0.02em; }
.meter__hint { font-size: 14px; color: var(--ink-2); }
.meter__list { list-style: none; padding: 0; }
.meter__more { display: flex; align-items: center; justify-content: center; min-height: 48px; font-weight: 700; font-size: 15px; text-underline-offset: 4px; }

.lvl {
  display: grid;
  grid-template-columns: 22px 34px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  min-height: 64px;
  padding: 8px 6px;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 150ms ease;
}
.lvl:hover { background: var(--ground); }
.lvl:active { background: var(--line); }
.lvl__pos { font-weight: 800; font-size: 16px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
.lvl--1 .lvl__pos { color: var(--ink); }
.lvl__badge { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(14, 17, 22, 0.18); }
.feed__empty { display: block !important; color: var(--ink-2); padding: 8px 0; }
.status { font-size: 14px; color: var(--live); padding: 0 6px 8px; }
.status:empty { display: none; }
.lvl__main { min-width: 0; display: grid; gap: 6px; }
.lvl__name { font-weight: 700; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Segmented level bar: the track and the fill share one segment pattern */
.bar {
  display: block;
  height: 14px;
  background: repeating-linear-gradient(90deg, var(--track) 0 var(--seg), transparent var(--seg) calc(var(--seg) + var(--gap)));
}
.bar__fill {
  display: block;
  height: 100%;
  width: var(--w);
  background: repeating-linear-gradient(90deg, var(--c) 0 var(--seg), transparent var(--seg) calc(var(--seg) + var(--gap)));
  transform-origin: left center;
}
.lvl__score { text-align: right; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.lvl__today { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* Lower part */
.lower { display: grid; gap: 28px; padding-bottom: 40px; }
.block h2 { margin-bottom: 10px; }
#tabela { scroll-margin-top: 12px; }
.meter__list--all { background: var(--surface); border-radius: 20px; padding: 8px; }
.note { margin-top: 10px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.aside { display: grid; gap: 28px; align-content: start; }

.feed { list-style: none; padding: 0; display: grid; gap: 2px; }
.feed li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.feed__amt { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.feed strong { color: var(--ink); overflow-wrap: anywhere; }
.feed__when { white-space: nowrap; }

.faq dt { font-weight: 700; margin-top: 14px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { color: var(--ink-2); font-size: 15px; margin-top: 2px; }

.foot { padding-top: 8px; padding-bottom: 28px; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.foot a { color: var(--ink); text-underline-offset: 3px; }

/* Phone dock */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 10px max(20px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)); background: rgba(237, 239, 242, 0.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); }

/* The one moment: bars light up on load */
@keyframes level { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.is-loading .bar__fill { animation: level 700ms cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
@media (prefers-reduced-motion: reduce) {
  .is-loading .bar__fill { animation: none; }
  .btn, .lvl { transition: none; }
}

@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .dock { display: none; }
  .wrap { padding-left: 40px; padding-right: 40px; }
  .top { min-height: 76px; }
  .logo { font-size: 20px; }
  .clock { font-size: 15px; }
  .hero { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; padding-top: 32px; padding-bottom: 64px; }
  .hero__lead { font-size: 19px; margin-top: 18px; }
  .hero__copy .btn { display: inline-flex; width: auto; min-width: 280px; margin-top: 28px; }
  .meter { padding: 22px 20px 10px; }
  .meter__head h2, .block h2 { font-size: 26px; }
  :root { --seg: 11px; }
  .bar { height: 16px; }
  .lvl { grid-template-columns: 26px 38px minmax(0, 1fr) 110px; min-height: 68px; column-gap: 14px; }
  .lvl__badge { width: 38px; height: 38px; }
  .lvl__score { font-size: 20px; }
  .lower { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; align-items: start; padding-bottom: 64px; }
}

/* ---------- Form pages (gritar, obrigado, termos) ---------- */
.page-form { padding-bottom: 32px; }
.back { font-weight: 700; font-size: 15px; text-underline-offset: 4px; min-height: 44px; display: inline-flex; align-items: center; }
.form-wrap { max-width: 640px; padding-top: 8px; padding-bottom: 40px; }
.h1-small { font-size: clamp(34px, 9vw, 52px); font-weight: 800; font-variation-settings: "opsz" 96, "wdth" 80; line-height: 1; letter-spacing: -0.03em; text-wrap: balance; }
.form { display: grid; gap: 22px; margin-top: 24px; }
.field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 10px; }
.field legend, .legend { font-weight: 800; font-size: 18px; padding: 0; margin-bottom: 2px; }
.form input[type="text"], .form input[type="search"], .form input[type="number"] {
  width: 100%; min-height: 52px; padding: 0 14px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: var(--surface); border: 1px solid #C7CDD5; border-radius: 12px;
}
.form input:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.search { display: block; }

.clubs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.club-opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 10px; background: var(--surface); border: 2px solid transparent; border-radius: 12px; cursor: pointer; }
.club-opt input { position: absolute; opacity: 0; pointer-events: none; }
.club-opt .lvl__badge { width: 30px; height: 30px; flex: 0 0 auto; }
.club-opt__name { font-weight: 700; font-size: 15px; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.club-opt:hover { border-color: #C7CDD5; }
.club-opt:has(input:checked) { border-color: var(--ink); }
.club-opt:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }

.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; background: var(--surface); border: 2px solid transparent; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.chip:hover span { border-color: #C7CDD5; }
.chip input:checked + span { background: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.custom { display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.custom[hidden] { display: none; }

.help { font-size: 14px; color: var(--ink-2); }
.error { font-size: 14px; font-weight: 600; color: #B4231A; }
.error:empty { display: none; }
.summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px; background: var(--surface); border-radius: 14px; }
.summary span { color: var(--ink-2); }
.summary strong { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.form .btn--main { width: 100%; }
.btn:disabled { opacity: 0.7; cursor: progress; }
.fine { font-size: 13px; color: var(--ink-2); }
.fine a { color: var(--ink); text-underline-offset: 3px; }

.btn--ghost { background: var(--surface); color: var(--ink); width: 100%; }
.btn--ghost:hover { background: #fff; box-shadow: inset 0 0 0 1px #C7CDD5; }
.done-actions { display: grid; gap: 10px; margin-top: 24px; }
#slow { margin-top: 20px; display: grid; gap: 14px; }
#slow[hidden], #done[hidden], #waiting[hidden] { display: none; }

.prose h2 { font-size: 20px; font-weight: 800; margin: 26px 0 6px; }
.prose p { color: var(--ink-2); max-width: 62ch; }

@media (min-width: 640px) {
  .clubs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chips { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .done-actions { grid-template-columns: 1fr 1fr; }
}
