/* HORSE.BIZ experience layer — home with live race, animated balance card and running-horse plan cards. */
.button-soft { color: var(--gold-deep); border-color: var(--line-strong); background: var(--gold-soft); box-shadow: none; }
.button-soft:hover { border-color: var(--gold); background: #e7f2eb; }

/* ---------- Home ---------- */
.hx-home { display: grid; gap: 16px; width: 100%; max-width: 760px; margin: 0 auto; }
.hx-home > * { min-width: 0; }
.hx-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hx-section-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.hx-section-head small { color: var(--muted); font-size: 11px; font-weight: 600; text-align: right; }
.hx-panel, .hx-stats { padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm); }

/* Race hero */
.campaign-hero.hx-hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 0; height: 196px; padding: 0 18px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 24px; color: var(--text); background: linear-gradient(180deg, #fffdf8, #f4e6c8); box-shadow: var(--shadow); text-decoration: none; }
.hx-hero-scene { position: absolute; z-index: 0; inset: 0; }
.campaign-hero.hx-hero::after { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(255,253,248,.95) 0%, rgba(255,253,248,.82) 34%, rgba(255,253,248,0) 60%); pointer-events: none; }
.hx-hero .rotating-banner-image { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.campaign-hero.hx-hero .hx-hero-copy { position: relative; z-index: 2; display: grid; justify-items: start; gap: 6px; max-width: 58%; }
.hx-tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--gold-deep); background: rgba(255,255,255,.92); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.hx-tag .icon { width: 12px; height: 12px; }
.hx-hero h2 { display: -webkit-box; margin: 2px 0 0; overflow: hidden; font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -.015em; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hx-hero p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--text-2); font-size: 12.5px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hx-hero-cta { display: inline-flex; align-items: center; gap: 6px; height: 34px; margin-top: 4px; padding: 0 14px; border-radius: 11px; color: #fff; background: #17181b; font-size: 12.5px; font-weight: 700; box-shadow: 0 8px 18px rgba(23,24,27,.22); }
.hx-hero-cta .icon { width: 14px; height: 14px; }

/* Balance card with the galloping horse */
.hx-balance { position: relative; isolation: isolate; display: grid; gap: 12px; padding: 18px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 24px; background: radial-gradient(120% 90% at 100% 0%, #fbf1dc 0%, rgba(251,241,220,0) 55%), var(--surface); box-shadow: var(--shadow); }
.hx-balance::before { content: ""; position: absolute; z-index: -1; right: -70px; top: -90px; width: 260px; height: 260px; border: 1px solid rgba(18,100,72,.18); border-radius: 50%; box-shadow: 0 0 0 34px rgba(18,100,72,.05); }
.hx-balance-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 50%); align-items: center; gap: 4px; }
.hx-balance-info { display: grid; gap: 4px; min-width: 0; }
.hx-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.hx-balance .balance-number { margin: 2px 0 4px; overflow: hidden; font-size: clamp(28px, 8.4vw, 40px); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.hx-balance .bal-live { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; font-weight: 700; }
.hx-balance .bal-live b { color: var(--success); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hx-balance-horse { position: relative; height: 128px; margin: -10px -10px -6px 0; }
.hx-balance-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.hx-balance-meta span:first-child { flex: 0 0 auto; }
.hx-balance-meta .mining-bar { flex: 1; margin: 0; background: rgba(18,100,72,.16); }
.hx-balance-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hx-balance-actions .button { min-height: 46px; }

/* Quick actions */
.hx-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 8px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm); }
.hx-tile { display: grid; justify-items: center; gap: 7px; min-width: 0; color: var(--text-2); text-align: center; text-decoration: none; }
.hx-tile-icon { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid #d7e5d7; border-radius: 16px; color: var(--gold-deep); background: linear-gradient(180deg, #f6fbf2, #e3efdf); transition: transform .16s ease, box-shadow .16s ease; }
.hx-tile-icon .icon { width: 22px; height: 22px; }
.hx-tile:active .hx-tile-icon { transform: scale(.94); }
.hx-tile:hover .hx-tile-icon { box-shadow: 0 8px 16px rgba(18,100,72,.18); }
.hx-tile-label { max-width: 100%; overflow: hidden; font-size: 12px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

/* Stats */
.hx-stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hx-stats-grid > div { min-width: 0; padding: 12px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.hx-stats-grid span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.hx-stats-grid strong { display: block; margin-top: 3px; overflow: hidden; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.is-positive { color: var(--success) !important; }

/* ---------- Horse cards (plans, owned) ---------- */
.hx-plan-row { display: grid; grid-auto-columns: 80%; grid-auto-flow: column; gap: 12px; margin-inline: -16px; padding: 2px 16px 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-padding-inline: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hx-plan-row::-webkit-scrollbar { display: none; }
.hx-plan-row > * { scroll-snap-align: start; }
.hx-plan-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hx-plan { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
a.hx-plan:hover, .hx-plan:hover { box-shadow: 0 2px 4px rgba(23,24,27,.05), 0 16px 36px rgba(23,24,27,.1); }
.hx-plan-media { position: relative; aspect-ratio: 16 / 8.4; overflow: hidden; background: linear-gradient(180deg, #fffdf8 0%, #f4e6c8 46%, #ecd8ae 47%, #d9b981 100%); }
.hx-stage { position: absolute; inset: 0; }
.hx-stage.is-photo img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.hx-plan-cat { position: absolute; z-index: 2; top: 12px; left: 12px; display: inline-flex; align-items: center; height: 24px; max-width: 46%; padding: 0 10px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--gold-deep); background: rgba(255,255,255,.92); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.hx-breed { position: absolute; z-index: 2; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; height: 24px; max-width: 50%; padding: 0 10px 0 8px; overflow: hidden; border-radius: 99px; color: #fff; background: rgba(23,24,27,.78); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hx-breed i { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.hx-plan-body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 16px; }
.hx-plan-body h3 { display: -webkit-box; margin: 0; overflow: hidden; font-size: 17px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hx-plan-price { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hx-plan-price span { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.hx-plan-price strong { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hx-plan-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.hx-plan-stats > div { min-width: 0; padding: 10px 6px; text-align: center; }
.hx-plan-stats > div + div { border-left: 1px solid var(--line); }
.hx-plan-stats dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.hx-plan-stats dd { margin: 3px 0 0; overflow: hidden; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.hx-plan-desc { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hx-plan-body > .button { margin-top: auto; }
.hx-plan.is-compact .hx-plan-body { gap: 10px; padding: 14px; }
.hx-plan.is-compact .hx-plan-body h3 { font-size: 16px; -webkit-line-clamp: 1; }
.hx-plan.is-compact .hx-plan-price strong { font-size: 20px; }
.hx-plan.is-compact .hx-plan-body > .button { min-height: 44px; }
.hx-owned-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hx-owned .progress-line { margin-top: 0; }
.hx-owned .progress-caption { margin-top: -6px; color: var(--muted); font-size: 12px; }

/* Mini rows (home "Meus cavalos") */
.hx-mini-list { display: grid; gap: 10px; }
.hx-mini { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: var(--surface-2); text-decoration: none; }
.hx-stage.hx-mini-stage { position: relative; inset: auto; width: 96px; height: 62px; overflow: hidden; border-radius: 12px; background: linear-gradient(180deg, #fffdf8, #f2e2c0); }
.hx-mini-copy { display: grid; gap: 2px; min-width: 0; }
.hx-mini-copy strong { overflow: hidden; font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.hx-mini-copy small { color: var(--muted); font-size: 12px; }
.hx-mini-copy .progress-line { margin-top: 4px; }
.hx-mini > b { color: var(--success); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Horse detail */
.detail-hero.hx-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.hx-detail .detail-image.hx-detail-media { position: relative; min-height: 0; max-height: none; aspect-ratio: 16 / 8; margin: 0; border-radius: 0; background: linear-gradient(180deg, #fffdf8, #f4e6c8); }
.hx-detail .detail-copy { padding: 18px; }
.hx-detail .detail-copy h2, .hx-detail .detail-copy p, .hx-detail .detail-metrics strong { color: var(--text); }

/* Check-in strip on home */
.hx-checkin.checkin-strip { border-radius: 22px; }

@media (min-width: 560px) {
  .hx-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .campaign-hero.hx-hero { height: 220px; padding: 0 26px; }
  .hx-hero h2 { font-size: 23px; }
  .hx-hero p { font-size: 14px; }
  .hx-balance-horse { height: 150px; }
  .hx-plan-row { grid-auto-columns: calc((100% - 12px) / 2); margin-inline: 0; padding-inline: 0; }
  .hx-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .hx-home { max-width: 1120px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .hx-home > .hx-hero, .hx-home > .hx-stats, .hx-home > .hx-section, .hx-home > .hx-checkin, .hx-home > .hx-panel:last-child { grid-column: 1 / -1; }
  .campaign-hero.hx-hero { height: 260px; }
  .hx-hero h2 { font-size: 28px; }
  .hx-quick { align-self: stretch; align-content: center; }
  .hx-plan-row { grid-auto-columns: calc((100% - 36px) / 4); }
  .hx-plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-hero.hx-detail { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
  .hx-detail .detail-image.hx-detail-media { aspect-ratio: auto; height: 100%; min-height: 300px; }
}
@media (max-width: 380px) {
  .campaign-hero.hx-hero { height: 184px; padding: 0 14px; }
  .campaign-hero.hx-hero .hx-hero-copy { max-width: 62%; }
  .hx-hero h2 { font-size: 17px; }
  .hx-balance { padding: 16px; }
  .hx-balance-main { grid-template-columns: minmax(0, 1fr) 46%; }
  .hx-balance-horse { height: 112px; }
  .hx-tile-icon { width: 46px; height: 46px; border-radius: 14px; }
  .hx-tile-label { font-size: 11px; }
  .hx-plan-price strong { font-size: 20px; }
  .hx-plan-stats dd { font-size: 13px; }
}

/* Temporary home and responsive balance fixes. */
.hx-home > .hx-hero { display: none !important; }
.hx-balance-main { grid-template-columns: minmax(0, 1fr) minmax(120px, 38%); }
.hx-balance .balance-number { max-width: 100%; overflow: visible; font-size: clamp(18px, 6vw, 34px); line-height: 1.15; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
@media (max-width: 520px) {
  .hx-balance-main { grid-template-columns: minmax(0, 1fr) minmax(150px, 48%); gap: 8px; align-items: center; }
  .hx-balance-horse { display: block; width: 100%; min-width: 150px; height: 112px; overflow: visible; }
  .hx-balance .balance-number { font-size: clamp(14px, 4.6vw, 20px); overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
}
@media (max-width: 360px) {
  .hx-balance-main { grid-template-columns: minmax(0, 1fr) minmax(150px, 48%); gap: 6px; }
  .hx-balance-horse { height: 112px; }
  .hx-balance .balance-number { font-size: clamp(13px, 4.3vw, 16px); }
}
.payment-qr-dialog { width: min(460px, calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin: auto; padding: 20px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 22px; color: var(--text); background: var(--surface); box-shadow: var(--shadow-lg); }
.payment-qr-dialog[open] { display: grid; align-content: start; gap: 14px; }
.payment-qr-dialog::backdrop { background: rgba(12, 18, 14, .72); backdrop-filter: blur(4px); }
.payment-qr-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.payment-qr-dialog__head h2 { margin: 2px 0 0; font-size: 20px; }
.payment-qr-dialog__body { display: grid; justify-items: center; gap: 12px; text-align: center; }
.payment-qr-dialog .qr-wrap { display: grid; place-items: center; width: min(300px, 68vw); aspect-ratio: 1; margin: 0 auto; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.payment-qr-dialog .qr-wrap img { width: 100%; height: 100%; object-fit: contain; }
.payment-qr-dialog .copy-field { width: 100%; text-align: left; }
.payment-qr-dialog .muted { margin: 0; }
.payment-qr-missing { margin-top: 12px; }
