/* Page structure from mockup A3: floating pill header, ribbon, content + betslip.
 * Breakpoints: 768 tablet · 1100 full header search · 1280 slip becomes a column (ТЗ §6). */

body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(139, 63, 217, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(120, 219, 0, .10), transparent 60%),
    var(--bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -.02em; }

/* ── header (pill) ────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: var(--z-header); padding: 12px 16px 0; }
.top__in {
  max-width: var(--container); margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; gap: 12px; padding: 0 10px 0 14px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid rgba(203, 213, 222, .7); box-shadow: var(--shadow-2);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; min-width: 0; }
.logo__mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(140deg, #A45BEA, #6E2DBD); box-shadow: 0 8px 18px -8px rgba(139, 63, 217, .8);
}
.logo__mark .icon { width: 22px; height: 22px; }
.logo__word { font-weight: 800; font-size: 21px; letter-spacing: -.03em; white-space: nowrap; }
.logo__word b { color: var(--brand); font-weight: 800; }
.sp { flex: 1; }
.top .btn { border-radius: var(--r-pill); }

.show-md, .show-lg { display: none !important; }
@media (min-width: 768px) { .show-md { display: inline-flex !important; } }
@media (min-width: 1100px) {
  .show-lg { display: inline-flex !important; }
  .search.show-lg { display: block !important; }
  .hide-lg { display: none !important; }
}
@media (min-width: 1280px) { .hide-xl { display: none !important; } }
@media (max-width: 767px) {
  .top { padding: 8px 8px 0; }
  .top__in { height: 56px; padding: 0 6px 0 6px; gap: 6px; }
  .logo__word { font-size: 18px; }
  .logo__mark { width: 34px; height: 34px; }
  .top .btn { min-height: 40px; padding: 0 14px; }
}
@media (max-width: 389px) { .logo__word { display: none; } }
/* tablet: seg + two buttons + two icons do not fit the 12px rhythm at 768 */
@media (min-width: 768px) and (max-width: 1023px) {
  .top__in { gap: 6px; padding-inline: 6px 8px; }
  .top .btn { padding-inline: 16px; }
  /* signed in: balance + Deposit + account need the room; Racing/Sports stays in the drawer and ribbon */
  .top__in:has(.bal) .seg.show-md { display: none !important; }}
@media (max-width: 479px) {
  .top__in:has(.bal) .logo--hdr .bpl { display: none; }
  .top__in:has(.bal) .logo__mini { display: block; }
}

.demo-row { max-width: var(--container); margin: 10px auto 0; padding: 0 16px; display: flex; justify-content: center; }
@media (min-width: 1100px) { .demo-row { display: none; } }

/* ── ribbon (replaces the side menu, mockup A3) ───────────────────────── */
.ribbon {
  max-width: var(--container); margin: 12px auto 0; padding: 0 16px 4px; display: flex; gap: 8px;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none;
}
.ribbon::-webkit-scrollbar { display: none; }
/* the edge fades where more items are hidden (classes set by bp.js) */
.ribbon.has-more-end { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.ribbon.has-more-start { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px); mask-image: linear-gradient(90deg, transparent, #000 48px); }
.ribbon.has-more-start.has-more-end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.rib {
  position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 14px 0 8px;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px;
  white-space: nowrap; text-decoration: none; scroll-snap-align: start;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease), background var(--t);
}
.rib:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.rib .el { width: 28px; height: 28px; font-size: 12px; border-radius: var(--r-pill); }
.rib .el::before { display: none; }
.rib .ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--surface-2); }
.rib .ico .icon { width: 16px; height: 16px; }
.rib[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.rib[aria-current="page"] .ico { background: rgba(255, 255, 255, .14); }
.rib-sep { flex: none; width: 1px; margin: 8px 4px; background: var(--line-strong); }
@media (max-width: 767px) { .ribbon { padding-inline: 8px; scroll-padding-inline: 8px; } }

/* ── page grid ─────────────────────────────────────────────────────────── */
.page {
  max-width: var(--container); margin: 0 auto; padding: 16px 16px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom));
  display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 768px) { .page { padding-bottom: 48px; } }
@media (min-width: 1280px) { .page { grid-template-columns: minmax(0, 1fr) var(--slip-w); } }
@media (max-width: 767px) { .page { padding-inline: 12px; gap: 16px; } }      /* ТЗ §6.4: 12px gutters */
.main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start; container-type: inline-size; outline: none; }

/* ── footer ────────────────────────────────────────────────────────────── */
.footer { border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); padding: 24px; display: grid; gap: 20px; margin-top: 8px; }
.footer__cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.footer__about { margin-top: 10px; font-size: 14px; color: var(--ink-2); max-width: 36ch; }
.footer__h { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.footer li a { position: relative; display: inline-flex; min-height: 32px; align-items: center; font-size: 14px; text-decoration: none; }
.footer li a:hover { color: var(--brand-ink); }
.footer__strip { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; line-height: 18px; color: var(--ink-2); }
.footer__strip b { color: var(--ink); }
.footer__rg { display: flex; gap: 12px; }
.age { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); font-weight: 800; color: var(--ink); flex: none; }
.pending { display: inline-flex; padding: 2px 8px; margin: 4px 0; border-radius: var(--r-pill); border: 1px dashed #D9A400; color: var(--warn-ink); background: #FFF6DB; font-size: 12px; font-weight: 700; }
.pay { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.pay__lbl { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.pay__lbl span { margin-left: 8px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.pay__list { display: flex; flex-wrap: wrap; gap: 8px; }
.pay__list li { display: grid; place-items: center; width: 76px; height: 48px; border-radius: var(--r-s); background: #fff; border: 1px solid var(--line); }
.pay__list img { max-width: 56px; max-height: 28px; width: auto; height: auto; }

/* ── mobile tab bar (ТЗ §6.4: Home · Racing · Sports · Betslip · Account) ── */
.tabbar {
  position: fixed; z-index: var(--z-tabbar); left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr); border-radius: 22px; background: rgba(14, 28, 39, .94); backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px -16px rgba(14, 28, 39, .6);
}
@media (min-width: 768px) { .tabbar { display: none; } }
.tabbar a, .tabbar button {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; background: transparent;
  color: rgba(255, 255, 255, .7); font-size: 11px; font-weight: 600; text-decoration: none; transition: color var(--t);
}
.tabbar .icon { width: 22px; height: 22px; }
.tabbar [aria-current="page"] { color: var(--accent); }
.tabbar [aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tabbar .count { position: absolute; top: 6px; left: calc(50% + 6px); }
.el--tab { --c: #fff !important; width: 22px !important; height: 22px !important; font-size: 10px !important; background: transparent !important; color: currentColor !important; box-shadow: inset 0 0 0 1.5px currentColor !important; }
.el--tab::before { display: none; }

/* ── support and back to top ───────────────────────────────────────────── */
.support {
  position: fixed; z-index: var(--z-tabbar); right: 24px; bottom: 24px; display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: #fff; font-weight: 700; box-shadow: var(--shadow-2); cursor: pointer;
  transition: transform var(--t) var(--ease), box-shadow var(--t);
}
.support:hover { transform: translateY(-2px); }
.support .icon { width: 20px; height: 20px; }
@media (min-width: 768px) { .support { display: inline-flex; } }
@media (min-width: 1280px) { .support { right: max(24px, calc((100vw - var(--container)) / 2 + 16px)); } }
.to-top {
  position: fixed; z-index: var(--z-tabbar); left: 24px; bottom: 24px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--ink); box-shadow: var(--shadow-2); cursor: pointer;
}
.to-top .icon { width: 20px; height: 20px; }
@media (max-width: 767px) { .to-top { left: auto; right: 14px; bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom)); } }

/* header items share one height: a steady row and 44px targets */
.top__in > * { min-height: 44px; align-self: center; }
.top__in > .logo, .top__in > .sp { display: inline-flex; align-items: center; height: 44px; }
.top__in > .bal { display: grid; align-content: center; height: 44px; flex: none; }  /* label over amount, as in the mockup */
.top__in > .hdr-pill { display: none; align-items: center; height: 44px; }
.top__in > .sp { display: block; }
.hdr-pill { display: none; }
@media (min-width: 1100px) { .top__in > .hdr-pill { display: inline-flex; } }
@media (max-width: 767px) { .top .btn { min-height: 44px; } }
/* payment logos: a fixed 5-column grid, two even rows */
.pay__list { display: grid; grid-template-columns: repeat(5, minmax(0, 76px)); gap: 8px; }
.pay__list li { width: auto; }
@media (max-width: 479px) { .pay__list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; } .pay__list li { height: 40px; } .pay__list img { max-width: calc(100% - 8px); max-height: 22px; } }
