/* ==========================================================================
   components.css — компоненты страниц Jockey Club de São Paulo
   ========================================================================== */

/* ---- Header search ------------------------------------------------------ */
.header-search { border-top: 1px solid var(--hairline); background: var(--surface); }
.search-form { display: flex; align-items: center; gap: .6rem; padding: .85rem 0; }
.search-form .ic { width: 20px; height: 20px; color: var(--text-soft); flex: none; }
.search-form input { flex: 1; border: none; background: none; font-size: var(--fs-md); padding: .3rem 0; }
.search-form input:focus-visible { outline: none; }
.search-results { border-top: 1px solid var(--hairline); max-height: 56vh; overflow-y: auto; padding-bottom: .4rem; }
.search-hit { display: flex; align-items: center; gap: .75rem; padding: .65rem .2rem; border-bottom: 1px solid var(--hairline); }
.search-hit:last-child { border-bottom: 0; }
.search-hit .ic { width: 20px; height: 20px; color: var(--emerald-700); flex: none; }
.search-hit span { display: flex; flex-direction: column; line-height: 1.3; }
.search-hit b { font-size: var(--fs-sm); color: var(--text); }
.search-hit small { font-size: var(--fs-xs); color: var(--text-soft); }
.search-hit:hover { background: var(--surface-2); }
.search-hit:hover b { color: var(--emerald-700); }
.search-empty { padding: 1rem .2rem; font-size: var(--fs-sm); color: var(--text-soft); }

/* ---- Silks (cores dos jóqueis) ------------------------------------------ */
.silk { display: inline-block; width: 22px; height: 22px; border-radius: 5px; overflow: hidden; border: 1px solid var(--hairline-strong); box-shadow: var(--sh-sm); flex: none; vertical-align: middle; }
.silk svg { display: block; width: 100%; height: 100%; }
.silk--sm { width: 18px; height: 18px; border-radius: 4px; }
.silk--lg { width: 28px; height: 28px; border-radius: 6px; }
/* на тёмном фоне — светлый контур */
.section--dark .silk, .live-lane .silk, .slip .silk { border-color: rgba(244, 246, 241, .35); }

/* ---- Glifos de forma (últimas atuações) --------------------------------- */
.form-glyphs { display: inline-flex; gap: 3px; }
.fg { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.fg--win { background: var(--emerald-600); }
.fg--place { background: var(--gold-600); }
.fg--out { background: var(--surface-3); color: var(--text-soft); }

/* count-up bump */
@keyframes bumppulse { 0% { transform: scale(1); } 40% { transform: scale(1.09); } 100% { transform: scale(1); } }
.bb-estimate .est b.is-bump { animation: bumppulse .34s var(--ease); }

/* ---- Breadcrumb --------------------------------------------------------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: var(--fs-sm); color: var(--text-soft); padding-block: 1rem; }
.breadcrumb a:hover { color: var(--emerald-700); }
.breadcrumb .sep { opacity: .5; }

/* ---- HERO (home) -------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 80% 0%, var(--emerald-700) 0%, var(--emerald-800) 42%, var(--emerald-900) 100%);
  color: var(--text-invert);
  isolation: isolate;
}
.hero::before { /* subtle turf grid + noise */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image:
    radial-gradient(60% 80% at 15% 100%, rgba(212,175,55,.14), transparent 60%),
    linear-gradient(transparent 96%, rgba(255,255,255,.05) 96%),
    linear-gradient(90deg, transparent 96%, rgba(255,255,255,.05) 96%);
  background-size: auto, 100% 34px, 34px 100%;
}
/* Фото-герой: фотография + изумрудный скрим для читаемости текста */
.hero__art { position: absolute; inset: 0; z-index: -3; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 32%; }
.hero__scrim { position: absolute; inset: 0; z-index: -2; }
.hero__scrim::before { /* изумрудный градиент: темнее слева (под заголовком) */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(95deg, var(--emerald-900) 4%, rgba(6,61,46,.82) 38%, rgba(5,46,34,.5) 72%, rgba(5,46,34,.62) 100%),
    radial-gradient(75% 90% at 88% 8%, rgba(212,175,55,.14), transparent 60%);
}
.hero__scrim::after { /* тонкое editorial-зерно */
  content: ""; position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
/* когда есть фото — приглушаем декоративную сетку/свечение градиентного фона */
.hero--photo::before { opacity: .16; }
.hero__inner { position: relative; padding-block: clamp(3rem, 8vw, 6rem); display: grid; gap: 2.5rem; }
.hero__tag { display: inline-flex; align-items: center; gap: .5rem; align-self: start; padding: .35rem .85rem; border: 1px solid var(--hairline-gold); border-radius: var(--r-pill); color: var(--gold); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; }
.hero h1 { font-size: var(--fs-3xl); max-width: 16ch; color: var(--text-invert); }
.hero h1 .accent { color: var(--gold); }
.hero__lead { font-size: var(--fs-md); max-width: 52ch; color: var(--text-invert-muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .5rem; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1rem; font-size: var(--fs-sm); color: var(--text-invert-muted); }
.hero__meta span { display: inline-flex; align-items: center; gap: .45rem; }
.hero__meta .ic { width: 16px; height: 16px; color: var(--gold); }

@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.15fr .85fr; align-items: center; }
}

/* next-race panel inside hero */
.next-race {
  background: rgba(255,255,255,.06); border: 1px solid var(--hairline-invert);
  border-radius: var(--r-lg); padding: 1.5rem; backdrop-filter: blur(4px);
}
.next-race__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.next-race__head h3 { font-size: var(--fs-md); color: var(--text-invert); }
.countdown { display: flex; gap: .5rem; margin: 1rem 0; }
.countdown .cd-unit { flex: 1; text-align: center; background: rgba(0,0,0,.25); border: 1px solid var(--hairline-invert); border-radius: var(--r-sm); padding: .7rem .3rem; }
.countdown .cd-num { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; color: var(--gold); line-height: 1; }
.countdown .cd-lbl { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-invert-muted); }
.next-race__foot { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-sm); color: var(--text-invert-muted); margin-top: 1rem; }

/* ---- Trust row ---------------------------------------------------------- */
.trust-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: center; padding-block: 1.25rem; }
.trust-item { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--fs-sm); color: var(--text-muted); }
.trust-item .ic { width: 18px; height: 18px; color: var(--emerald-600); }
.trust-item strong { color: var(--text); }

/* Заявление о соответствии (главная, ТЗ §3.2) */
.compliance-note { max-width: 72ch; margin: .5rem auto 0; text-align: center; font-size: var(--fs-xs); color: var(--text-soft); }

/* ---- Page hero (inner pages) -------------------------------------------- */
.page-hero { background: var(--surface-dark); color: var(--text-invert); position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; right: -4%; top: -30%; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(212,175,55,.16), transparent 68%); }
.page-hero__inner { position: relative; z-index: 2; padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.page-hero h1 { font-size: var(--fs-2xl); max-width: 20ch; color: var(--text-invert); }
.page-hero p { color: var(--text-invert-muted); max-width: 60ch; margin-top: .75rem; }
/* опциональное фоновое фото page-hero (drop-in через media_bg) */
.page-hero__art { position: absolute; inset: 0; z-index: 0; }
.page-hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 34%; }
.page-hero__scrim { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(95deg, var(--emerald-900) 8%, rgba(6,61,46,.86) 46%, rgba(5,46,34,.62) 100%); }

/* ---- Product tiles ------------------------------------------------------ */
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
.tile { position: relative; display: flex; flex-direction: column; gap: .6rem; padding: 1.4rem; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 0; background: var(--gold); transition: height var(--dur) var(--ease); }
.tile:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--hairline-gold); }
.tile:hover::before { height: 100%; }
.tile__ic { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: rgba(20,110,80,.1); color: var(--emerald-700); }
.tile__ic .ic { width: 22px; height: 22px; }
.tile h3 { font-size: var(--fs-md); }
.tile p { font-size: var(--fs-sm); }
.tile__link { margin-top: auto; display: inline-flex; align-items: center; gap: .4rem; font-size: var(--fs-sm); font-weight: 600; color: var(--emerald-700); }
.tile__link .ic { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.tile:hover .tile__link .ic { transform: translateX(4px); }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, 1fr); } }

/* ---- Race cards (próximas corridas) ------------------------------------- */
.race-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.race-card { display: flex; flex-direction: column; gap: .9rem; padding: 1.4rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--sh-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.race-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.race-card__top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.race-card__date { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; color: var(--emerald-800); text-transform: capitalize; }
.race-card__info { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: var(--fs-sm); color: var(--text-muted); }
.race-card__info span { display: inline-flex; align-items: center; gap: .35rem; }
.race-card__info .ic { width: 15px; height: 15px; color: var(--gold-600); }
.mini-countdown { display: inline-flex; gap: .3rem; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--emerald-700); }

/* ---- Grande Prêmio spotlight -------------------------------------------- */
.gp-spot { display: grid; gap: 0; border-radius: var(--r-xl); overflow: hidden; background: var(--surface-dark); color: var(--text-invert); box-shadow: var(--sh-lg); }
.gp-spot__art { position: relative; overflow: hidden; min-height: 220px; background: radial-gradient(120% 120% at 20% 20%, var(--emerald-600), var(--emerald-900)); display: grid; place-items: center; padding: 2rem; }
/* опциональное фото за трофеем (drop-in через media_bg prefix "gpfoto") */
.gpfoto__art { position: absolute; inset: 0; z-index: 0; }
.gpfoto__art img { width: 100%; height: 100%; object-fit: cover; }
.gpfoto__scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(5,46,34,.4), rgba(5,46,34,.72)); }
.gp-spot__art .trophy-badge { position: relative; z-index: 2; }
.gp-spot__art .trophy-badge { width: 88px; height: 88px; border-radius: 50%; border: 2px solid var(--hairline-gold); display: grid; place-items: center; color: var(--gold); }
.gp-spot__art .trophy-badge .ic { width: 44px; height: 44px; }
.gp-spot__body { padding: clamp(1.5rem, 3vw, 2.5rem); display: flex; flex-direction: column; gap: 1rem; }
.gp-spot__body h3 { font-size: var(--fs-2xl); color: var(--text-invert); }
.gp-spot__stats { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.gp-spot__stats .st { display: flex; flex-direction: column; }
.gp-spot__stats .st b { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--gold); }
.gp-spot__stats .st span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--text-invert-muted); }
@media (min-width: 820px) { .gp-spot { grid-template-columns: .8fr 1.2fr; } }

/* ---- Results widget / table --------------------------------------------- */
.res-list { display: grid; gap: .5rem; }
.res-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: .9rem 1.1rem; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); transition: border-color var(--dur) var(--ease); }
.res-row:hover { border-color: var(--hairline-gold); }
.res-row__win { display: flex; flex-direction: column; }
.res-row__win b { color: var(--text); font-weight: 600; }
.res-row__win span { font-size: var(--fs-sm); color: var(--text-soft); }
.res-row__rateio { text-align: right; }
.res-row__rateio b { font-family: var(--font-display); color: var(--emerald-700); font-size: var(--fs-md); }
.res-row__rateio span { display: block; font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---- Family strip ------------------------------------------------------- */
.family-strip { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.family-item { display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--hairline); }
.family-item .ic { width: 26px; height: 26px; color: var(--gold-600); }
.family-item h4 { font-size: var(--fs-md); }
.family-item p { font-size: var(--fs-sm); }

/* ---- Data table (program / rateios / results) --------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-sm); }
table.data { min-width: 640px; font-size: var(--fs-sm); }
table.data thead th { background: var(--surface-3); text-align: left; padding: .85rem 1rem; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
table.data tbody td { padding: .85rem 1rem; border-top: 1px solid var(--hairline); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .cavalo { font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: .6rem; }
table.data .num-cell { text-align: center; width: 56px; }
.tabnum { font-variant-numeric: tabular-nums; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .95rem; min-height: 44px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--hairline-strong); font-size: var(--fs-sm); font-weight: 500;
  color: var(--text-muted); cursor: pointer; transition: all var(--dur) var(--ease);
}
.chip .ic { width: 15px; height: 15px; }
.chip:hover { border-color: var(--emerald-600); color: var(--emerald-700); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--emerald-800); border-color: var(--emerald-800); color: var(--text-invert); }
.chip[aria-pressed="true"] .ic { color: var(--gold); }

/* páreo block */
.pareo { border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-sm); overflow: hidden; margin-bottom: 1.5rem; }
.pareo__head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--surface-3); border-bottom: 1px solid var(--hairline); }
.pareo__head h3 { font-size: var(--fs-md); margin-right: auto; }
.pareo__head .meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: var(--fs-sm); color: var(--text-muted); }
.pareo__head .meta span { display: inline-flex; align-items: center; gap: .3rem; }
.pareo__head .meta .ic { width: 14px; height: 14px; color: var(--gold-600); }

/* ---- Tabs --------------------------------------------------------------- */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--hairline); margin-bottom: 1.5rem; overflow-x: auto; }
.tabs [role="tab"] { padding: .8rem 1.1rem; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.tabs [role="tab"][aria-selected="true"] { color: var(--emerald-800); border-color: var(--gold); }
.tabs [role="tab"]:hover { color: var(--emerald-700); }

/* ---- Accordion / FAQ ---------------------------------------------------- */
.acc { display: grid; gap: .75rem; }
.acc-item { border: 1px solid var(--hairline); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.acc-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; text-align: left; font-weight: 600; color: var(--text); font-size: var(--fs-md); }
.acc-trigger .ic { width: 20px; height: 20px; color: var(--emerald-700); flex: none; transition: transform var(--dur) var(--ease); }
.acc-item.is-open .acc-trigger .ic { transform: rotate(180deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur) var(--ease); }
.acc-item.is-open .acc-body { grid-template-rows: 1fr; }
.acc-body > div { overflow: hidden; }
.acc-body p { padding: 0 1.25rem 1.2rem; font-size: var(--fs-sm); }

/* ---- Forms -------------------------------------------------------------- */
.form-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-xl); box-shadow: var(--sh); padding: clamp(1.5rem, 3vw, 2.5rem); }
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
.form-grid.cols-2 { grid-template-columns: 1fr; }
@media (min-width: 620px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field.span-2 { grid-column: 1 / -1; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.field .hint { font-size: var(--fs-xs); color: var(--text-soft); }
.field input, .field select, .field textarea {
  padding: .8rem .9rem; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: var(--fs-base); color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--emerald-600); box-shadow: 0 0 0 3px rgba(20,110,80,.14); }
.field textarea { resize: vertical; min-height: 120px; }
.field .err-msg { font-size: var(--fs-xs); color: var(--danger); display: none; }
.field.is-invalid input, .field.is-invalid select { border-color: var(--danger); }
.field.is-invalid .err-msg { display: block; }
.field.is-valid input { border-color: var(--success); }
.check-row { display: flex; align-items: flex-start; gap: .65rem; font-size: var(--fs-sm); color: var(--text-muted); }
.check-row input { margin-top: .2rem; width: 18px; height: 18px; accent-color: var(--emerald-700); flex: none; }
.check-row a { color: var(--emerald-700); text-decoration: underline; }
.form-alert { padding: .9rem 1.1rem; border-radius: var(--r-sm); font-size: var(--fs-sm); display: none; }
.form-alert.is-show { display: block; }
.form-alert--ok { background: rgba(20,110,80,.12); color: var(--emerald-700); }
.form-alert--err { background: rgba(194,65,59,.1); color: var(--danger); }

/* password strength */
.pw-meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: .2rem; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--danger); transition: width var(--dur) var(--ease), background var(--dur) var(--ease); }

/* auth layout */
.auth-wrap { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .auth-wrap { grid-template-columns: 1fr 1fr; } }
.auth-aside { background: var(--surface-dark); color: var(--text-invert); border-radius: var(--r-xl); padding: clamp(1.75rem, 3vw, 2.5rem); }
.auth-aside h2 { color: var(--text-invert); }
.auth-aside ul { display: grid; gap: 1rem; margin-top: 1.5rem; }
.auth-aside li { display: flex; gap: .75rem; font-size: var(--fs-sm); color: var(--text-invert-muted); }
.auth-aside li .ic { width: 20px; height: 20px; color: var(--gold); flex: none; }

/* payment methods */
.pay-methods { display: flex; flex-wrap: wrap; gap: .6rem; }
.pay-method { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; background: var(--surface-2); }
.pay-method .ic { width: 18px; height: 18px; color: var(--emerald-700); }

/* ---- Callout / note ----------------------------------------------------- */
.callout { display: flex; gap: .85rem; padding: 1.1rem 1.25rem; border-radius: var(--r); border: 1px solid var(--hairline); background: var(--surface-2); font-size: var(--fs-sm); }
.callout .ic { width: 22px; height: 22px; flex: none; }
.callout p { color: var(--text-muted); }
.callout--gold { background: var(--gold-050); border-color: var(--hairline-gold); }
.callout--gold .ic { color: var(--gold-600); }
.callout--info .ic { color: var(--emerald-700); }
.callout--warn { background: rgba(201,138,18,.08); border-color: rgba(201,138,18,.3); }
.callout--warn .ic { color: var(--warning); }

/* ---- KPI / stat --------------------------------------------------------- */
.kpi-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { padding: 1.25rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--sh-sm); }
.kpi b { display: block; font-family: var(--font-display); font-size: var(--fs-2xl); color: var(--emerald-800); line-height: 1; }
.kpi span { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---- Legal pages -------------------------------------------------------- */
.legal { display: grid; gap: 2.5rem; }
@media (min-width: 980px) { .legal { grid-template-columns: 240px 1fr; align-items: start; } }
.legal-toc { position: sticky; top: calc(var(--header-h) + 1rem); font-size: var(--fs-sm); }
.legal-toc h4 { font-family: var(--font-body); text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-xs); color: var(--text-soft); margin-bottom: .75rem; }
.legal-toc a { display: block; padding: .35rem 0; color: var(--text-muted); border-left: 2px solid var(--hairline); padding-left: .9rem; }
.legal-toc a:hover { color: var(--emerald-700); border-color: var(--gold); }
.legal-body { max-width: 72ch; }
.legal-body h2 { font-size: var(--fs-xl); margin-top: 2.5rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 { font-size: var(--fs-md); margin-top: 1.5rem; }
.legal-body p, .legal-body li { color: var(--text-muted); font-size: var(--fs-base); }
.legal-body p { margin-top: .9rem; }
.legal-body ul { margin-top: .9rem; display: grid; gap: .5rem; }
.legal-body ul li { position: relative; padding-left: 1.4rem; }
.legal-body ul li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; }
.legal-updated { font-size: var(--fs-sm); color: var(--text-soft); }

/* ---- Misc lists / support ----------------------------------------------- */
.support-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.support-card { padding: 1.25rem; border-radius: var(--r-lg); border: 1px solid var(--hairline); background: var(--surface); }
.support-card b { display: block; color: var(--text); }
.support-card a { color: var(--emerald-700); font-weight: 600; }

.warn-signs { display: grid; gap: .6rem; }
.warn-signs li { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--fs-sm); color: var(--text-muted); }
.warn-signs .ic { width: 18px; height: 18px; color: var(--warning); flex: none; margin-top: .1rem; }

/* ---- Bet builder (apostas) ---------------------------------------------- */
.bb-layout { display: grid; gap: 1.75rem; align-items: start; }
@media (min-width: 980px) { .bb-layout { grid-template-columns: 1fr 360px; } }

.bb-step { margin-bottom: 1.75rem; }
.bb-step__head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.bb-step__num { width: 28px; height: 28px; border-radius: 50%; background: var(--emerald-800); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); flex: none; }
.bb-step__head h3 { font-size: var(--fs-lg); }

.bet-types { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.bet-type { text-align: left; padding: .9rem 1rem; border: 1.5px solid var(--hairline-strong); border-radius: var(--r); background: var(--surface); transition: all var(--dur) var(--ease); cursor: pointer; }
.bet-type:hover { border-color: var(--emerald-600); }
.bet-type.is-sel { border-color: var(--emerald-700); background: rgba(20,110,80,.06); box-shadow: 0 0 0 3px rgba(20,110,80,.1); }
.bet-type b { display: flex; align-items: center; justify-content: space-between; color: var(--text); font-size: var(--fs-md); }
.bet-type .req { font-size: var(--fs-xs); color: var(--gold-600); font-weight: 600; }
.bet-type p { font-size: var(--fs-xs); margin-top: .25rem; }

.horse-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.horse-pick { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; border: 1.5px solid var(--hairline-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: all var(--dur) var(--ease); text-align: left; width: 100%; }
.horse-pick:hover { border-color: var(--emerald-600); }
.horse-pick.is-sel { border-color: var(--emerald-700); background: rgba(20,110,80,.06); }
.horse-pick.is-disabled { opacity: .45; cursor: not-allowed; }
.horse-pick .pareo-num { width: 1.9rem; height: 1.9rem; font-size: var(--fs-xs); }
.horse-pick .hp-body { display: flex; flex-direction: column; line-height: 1.25; }
.horse-pick .hp-body b { font-size: var(--fs-sm); color: var(--text); }
.horse-pick .hp-body span { font-size: var(--fs-xs); color: var(--text-soft); }
.horse-pick .hp-order { margin-left: auto; font-family: var(--font-display); font-weight: 700; color: var(--gold-600); font-size: var(--fs-sm); }

.stake-controls { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.stake-input { display: inline-flex; align-items: center; border: 1.5px solid var(--hairline-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.stake-input button { width: 42px; height: 46px; display: grid; place-items: center; color: var(--emerald-700); }
.stake-input button:hover { background: var(--surface-3); }
.stake-input input { width: 90px; text-align: center; border: none; font-size: var(--fs-md); font-weight: 600; padding: .5rem 0; }
.stake-input input:focus-visible { outline: none; }
.stake-quick { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.stake-quick button { padding: .5rem .8rem; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.stake-quick button:hover { border-color: var(--emerald-600); color: var(--emerald-700); }

.bb-estimate { display: flex; flex-wrap: wrap; gap: 1.5rem; padding: 1.1rem 1.25rem; margin-top: 1.25rem; border-radius: var(--r); background: var(--surface-dark); color: var(--text-invert); }
.bb-estimate .est { display: flex; flex-direction: column; }
.bb-estimate .est span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .09em; color: var(--text-invert-muted); }
.bb-estimate .est b { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--gold); }

/* Pule slip */
.slip { position: sticky; top: calc(var(--header-h) + 1rem); background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh); overflow: hidden; }
.slip__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; background: var(--emerald-800); color: var(--text-invert); }
.slip__head h3 { color: var(--text-invert); font-size: var(--fs-md); display: flex; align-items: center; gap: .5rem; }
.slip__head h3 .ic { color: var(--gold); }
.slip__count { background: var(--gold); color: var(--ink); border-radius: var(--r-pill); padding: .1rem .55rem; font-size: var(--fs-xs); font-weight: 700; }
.slip__body { max-height: 46vh; overflow-y: auto; }
.slip__empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--text-soft); font-size: var(--fs-sm); }
.slip__empty .ic { width: 34px; height: 34px; margin: 0 auto .75rem; color: var(--hairline-strong); }
.slip-item { padding: .9rem 1.25rem; border-bottom: 1px solid var(--hairline); }
.slip-item__top { display: flex; justify-content: space-between; gap: .5rem; align-items: start; }
.slip-item__type { font-weight: 600; color: var(--text); font-size: var(--fs-sm); }
.slip-item__rm { color: var(--text-soft); }
.slip-item__rm:hover { color: var(--danger); }
.slip-item__horses { font-size: var(--fs-xs); color: var(--text-soft); margin-top: .2rem; }
.slip-item__foot { display: flex; justify-content: space-between; margin-top: .5rem; font-size: var(--fs-sm); }
.slip-item__foot .ret { color: var(--emerald-700); font-weight: 600; }
.slip__foot { padding: 1.1rem 1.25rem; border-top: 1px solid var(--hairline); background: var(--surface-2); }
.slip__row { display: flex; justify-content: space-between; font-size: var(--fs-sm); margin-bottom: .4rem; }
.slip__row.total { font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.slip__row.total b { font-family: var(--font-display); color: var(--emerald-800); }
.slip__actions { display: grid; gap: .5rem; margin-top: .9rem; }

/* ---- Ao Vivo (live race simulation) ------------------------------------- */
.live-stage { background: linear-gradient(160deg, var(--emerald-800), var(--emerald-900)); border-radius: var(--r-xl); padding: clamp(1.25rem, 3vw, 2rem); color: var(--text-invert); box-shadow: var(--sh-lg); }
.live-stage.is-night { background: linear-gradient(160deg, #0a0f14, #05080b); }
.live-hud { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.live-hud__info h3 { color: var(--text-invert); font-size: var(--fs-lg); }
.live-hud__info span { font-size: var(--fs-sm); color: var(--text-invert-muted); }
.live-flag { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--danger); color: #fff; }
.live-flag.is-idle { background: rgba(255,255,255,.14); color: var(--text-invert-muted); }
.live-flag.is-done { background: var(--gold); color: var(--ink); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: livepulse 1.1s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.live-timer { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--gold); font-variant-numeric: tabular-nums; }

.live-lanes { display: grid; gap: .55rem; }
.live-lane { display: grid; grid-template-columns: 2rem 1fr 2.4rem; align-items: center; gap: .7rem; }
.live-lane__num { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); color: var(--gold); font-weight: 700; font-size: var(--fs-sm); }
.live-lane__track { position: relative; height: 30px; background: rgba(255,255,255,.06); border-radius: var(--r-pill); overflow: hidden; border: 1px solid var(--hairline-invert); }
.live-lane__track::after { content: ""; position: absolute; right: 6px; top: 0; bottom: 0; width: 3px; background: repeating-linear-gradient(45deg, var(--gold), var(--gold) 3px, transparent 3px, transparent 6px); opacity: .8; }
.live-lane__horse { position: absolute; top: 50%; transform: translate(0, -50%); left: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; transition: left .25s linear; }
.live-lane__horse .ic { width: 15px; height: 15px; }
.live-lane__name { position: absolute; left: 34px; top: 50%; transform: translateY(-50%); font-size: var(--fs-xs); color: var(--text-invert); white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.5); pointer-events: none; }
.live-lane__pos { text-align: center; font-family: var(--font-display); font-weight: 700; color: var(--text-invert-muted); font-size: var(--fs-sm); }
.live-lane.is-leader .live-lane__num { background: var(--gold); color: var(--ink); }

.live-commentary { margin-top: 1.25rem; padding: .9rem 1.1rem; background: rgba(0,0,0,.25); border-radius: var(--r); font-size: var(--fs-sm); color: var(--text-invert-muted); min-height: 3rem; display: flex; align-items: center; gap: .6rem; }
.live-commentary .ic { width: 18px; height: 18px; color: var(--gold); flex: none; }
.live-controls { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }

/* mobile bottom-sheet toggle */
.slip-toggle { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 50; display: none; }
@media (max-width: 979px) {
  .slip { position: fixed; inset: auto 0 0 0; z-index: 75; border-radius: var(--r-lg) var(--r-lg) 0 0; transform: translateY(100%); transition: transform .34s var(--ease); max-height: 82vh; display: flex; flex-direction: column; }
  .slip.is-open { transform: translateY(0); }
  .slip__body { max-height: none; flex: 1; }
  .slip-toggle { display: flex; }
}
