/* ==========================================================================
   Imporalia Team — public site stylesheet (static SSR pages only)
   Mobile-first: base rules are for phones (≥320 px); wider screens add rules
   in the min-width media queries at the end of each block.

   Brand: the «Imporalia TEAM» wordmark (white, heavy grotesque + brush) over
   the pink / cyan / yellow paint splash on black. Everything here derives from it:
   - Colors are sampled from the splash (img/brand/splash.webp).
   - Big titles use a heavy upright grotesque in mixed case, like «Imporalia»;
     small labels go in uppercase, like «TEAM».
   - The visual thread is the splash itself (hero, page heads, join band, login)
     and the three-colour brush bar, repeated under titles and in the footer.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink: #0a0a0c;        /* the splash image is flattened on this exact colour */
  --ink-2: #141418;
  --ink-3: #1c1c21;
  --line: #25252b;
  --line-strong: #34343c;
  --paper: #f4f4f2;
  --text: #f6f6f4;
  --text-soft: #c8c9cf;
  --muted: #a6a8b0;
  --faint: #7f818a;
  --text-on-paper: #0a0a0c;
  --muted-on-paper: #52545c;

  --pink: #f71d8a;       /* brand pink: accents on dark */
  --pink-btn: #d6006f;   /* backgrounds under white text (contrast ≥ 4.5:1) */
  --pink-hover: #e8007c;
  --pink-link: #ff4fa3;
  --cyan: #04bcd3;
  --yellow: #fce403;
  --strava: #fc4c02;

  --brush: linear-gradient(90deg, var(--pink) 0 54%, var(--cyan) 54% 80%, var(--yellow) 80% 100%);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --gutter: 16px;
  --section: 72px;
  --shadow: 0 18px 44px rgba(0, 0, 0, .45);
}

@media (min-width: 681px) {
  :root { --gutter: 40px; --section: 104px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; /* app feel (§4.13); focus stays visible with :focus-visible */
}

[hidden] { display: none !important; }

img { max-width: 100%; display: block; }

a { color: var(--pink-link); }
a:hover { color: #ff8cc4; }

::selection { background: var(--pink); color: #fff; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.site { overflow-x: clip; min-height: 100vh; display: flex; flex-direction: column; }
.site > main { flex: 1; }

/* Side padding also clears the notch and rounded corners in the installed app (viewport-fit=cover, §4.13). */
.wrap {
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

.muted { color: var(--muted); }

.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Display type: tight like the wordmark for big titles, slightly tight for small headings. */
.h-title, .page-title, .sec-title, .profile-name, .article-title, .pdp-title,
.auth-card h1, .message-page h1, .join-box h2, .modal-box h2, .order-number b, .leader .big {
  letter-spacing: -.035em;
}
.card-h h2, .weeknav b, .empty h2, .seg-head h2, .seg > b, .leader b, .news.big h3,
.album-cap b, .ph-cap b, .product-b b, .checkout h2, .pay-box h2, .prose h2, .prose h3 {
  letter-spacing: -.015em;
}

/* Brush bar: the three splash colours as one skewed stroke. Closes every big title. */
.page-title::after, .sec-title::after, .auth-card h1::after, .message-page h1::after, .profile-name::after {
  content: ""; display: block; width: 92px; height: 6px; margin-top: 18px;
  background: var(--brush); border-radius: 2px; transform: skewX(-24deg); transform-origin: 0 100%;
}

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.logo:hover { color: var(--text); }
.logo-mark { display: block; width: auto; }
.logo-word { display: flex; flex-direction: column; line-height: .95; }
.logo-word b { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  font: 700 16px var(--font-body); text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn-pink { background: var(--pink-btn); color: #fff; box-shadow: 0 8px 22px rgba(247, 29, 138, .25); }
.btn-pink:hover { background: var(--pink-hover); color: #fff; box-shadow: 0 10px 26px rgba(247, 29, 138, .38); }
.btn-ghost { border-color: rgba(246, 246, 244, .7); color: var(--text); background: rgba(10, 10, 12, .35); }
.btn-ghost:hover { background: var(--text); border-color: var(--text); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #26262d; color: #fff; }
.btn-strava { border-color: var(--strava); color: #ff7a3d; background: transparent; }
.btn-strava:hover { background: var(--strava); color: #fff; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text); background: transparent;
  border: 1px solid var(--line-strong); cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--ink-3); border-color: #44444d; color: #fff; }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10, 10, 12, .9); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
}
.hdr-in { display: flex; align-items: center; gap: 12px; height: 64px; }
.hdr .logo-mark { height: 40px; }
.hdr-act { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hdr-act form { margin: 0; }
.hdr-act .btn span { display: none; }

.nav { display: none; }
.nav a, .mnav a { text-decoration: none; }
.nav a { color: var(--text-soft); font-weight: 600; font-size: 15px; padding: 12px; border-radius: 8px; position: relative; transition: color .15s; }
.nav a:hover { color: #fff; }
.nav a.on { color: #fff; }
.nav a.on::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px;
  background: var(--pink); border-radius: 2px; transform: skewX(-24deg);
}

.burger > summary { list-style: none; }
.burger > summary::-webkit-details-marker { display: none; }
.mnav {
  position: absolute; left: 0; right: 0; top: 100%;
  display: flex; flex-direction: column;
  padding: 8px max(var(--gutter), env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: var(--ink); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  /* Scrolls inside when it does not fit (phones in landscape), without scrolling the page behind. */
  max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain;
}
.mnav a {
  color: var(--text); font: 800 22px/1.2 var(--font-display); letter-spacing: -.02em;
  padding: 13px 4px; border-bottom: 1px solid var(--line);
}
.mnav a.on { color: var(--pink); }
.mnav a.mnav-install { display: flex; align-items: center; gap: 10px; color: var(--pink-link); border-bottom: 0; }

@media (min-width: 681px) {
  .hdr-act .btn span { display: inline; }
}

@media (min-width: 1081px) {
  .hdr-in { height: 76px; gap: 28px; }
  .hdr .logo-mark { height: 48px; }
  .nav { display: flex; gap: 2px; margin-left: auto; }
  .hdr-act { margin-left: 0; }
  .burger { display: none; }
}

/* ---------- Section titles ---------- */
.eyebrow {
  margin: 0; font: 700 13px var(--font-body); letter-spacing: .2em;
  text-transform: uppercase; color: var(--cyan);
}

.sec { padding-top: var(--section); }
.sec-h { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 24px; }
.sec-title { margin: 0; font: 800 34px/1 var(--font-display); }
/* Kicker above a section title. */
.sec-title .mk {
  display: block; margin: 0 0 12px; font: 700 13px var(--font-body); letter-spacing: .2em;
  text-transform: uppercase; color: var(--pink);
}
.sec-title-sm::after { width: 64px; height: 5px; margin-top: 12px; }
.sec-lead { margin: 0; color: var(--muted); max-width: 420px; }
.more {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--text); font-weight: 700; text-decoration: none;
}
.more:hover { color: var(--pink-link); }
.more .ic, .card-link .ic { transition: transform .15s; }
.more:hover .ic, .card-link:hover .ic { transform: translateX(3px); }

@media (min-width: 681px) {
  .sec-h { margin-bottom: 32px; }
  .sec-title { font-size: clamp(40px, 4.2vw, 56px); }
  .more { margin-left: auto; }
}

/* ---------- Hero ---------- */
/* The brand splash fills the hero; a shade keeps the text readable. */
.hero { position: relative; overflow: hidden; background: var(--ink) url("../img/brand/splash-sm.webp") 62% 50% / cover no-repeat; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(0deg, var(--ink) 0%, rgba(10, 10, 12, 0) 34%),
    linear-gradient(180deg, rgba(10, 10, 12, .5) 0%, rgba(10, 10, 12, .74) 55%, rgba(10, 10, 12, .9) 100%);
}
.hero-img { position: absolute; inset: 0; z-index: 1; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 40%; }
.hero-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, var(--ink) 8%, rgba(10, 10, 12, .82) 45%, rgba(10, 10, 12, .15) 100%);
}
.hero-txt { position: relative; z-index: 2; max-width: 600px; padding: 48px 0 96px; }
.hero-photo .hero-txt { padding-top: 220px; }
.h-title { margin: 14px 0 0; font: 800 54px/.95 var(--font-display); }
.h-title img { width: min(100%, 540px); height: auto; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .5)); }
.h-team { display: block; color: var(--pink); text-transform: uppercase; font-style: italic; font-weight: 900; letter-spacing: -.01em; }
.tagline {
  margin: 22px 0 0; font: 700 13px var(--font-body); letter-spacing: .26em;
  text-transform: uppercase; color: #fff;
}
.lead { margin: 12px 0 0; font-size: 17px; color: var(--text-soft); max-width: 460px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.cta .btn { flex: 1 1 100%; }

@media (min-width: 681px) {
  .hero { min-height: 640px; display: flex; align-items: center; background-image: url("../img/brand/splash.webp"); background-position: 70% 50%; }
  .hero::before {
    background:
      linear-gradient(0deg, var(--ink) 0%, rgba(10, 10, 12, 0) 30%),
      linear-gradient(90deg, rgba(10, 10, 12, .94) 0%, rgba(10, 10, 12, .78) 38%, rgba(10, 10, 12, .18) 72%, rgba(10, 10, 12, .08) 100%);
  }
  .hero-img { left: auto; width: 64%; }
  .hero-img img { clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%); object-position: 60% 40%; }
  .hero-shade { top: auto; height: 180px; background: linear-gradient(0deg, var(--ink) 0%, rgba(10, 10, 12, 0) 100%); }
  .hero-txt, .hero-photo .hero-txt { padding: 72px 0 150px; }
  .hero:not(.hero-photo) { min-height: 560px; }
  .hero:not(.hero-photo) .hero-txt { padding-bottom: 120px; }
  .h-title { font-size: clamp(64px, 8vw, 112px); }
  .tagline { letter-spacing: .32em; font-size: 14px; }
  .lead { font-size: 19px; }
  .cta .btn { flex: 0 0 auto; }
}

@media (min-width: 1081px) {
  .hero-img { width: 56%; }
}

/* ---------- Cards and rankings ---------- */
.board { position: relative; z-index: 3; margin-top: -56px; }
.board-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
  padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card-h { display: flex; align-items: center; gap: 14px; }
.card-h h2 { margin: 0; font: 800 22px/1.05 var(--font-display); text-transform: uppercase; }
.card-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.card-ico { width: 44px; height: 44px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; }
.card-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: auto;
  color: var(--text); font-weight: 700; text-decoration: none;
}
.card-link:hover { color: var(--pink-link); }
.card-paper { background: var(--paper); border-color: var(--paper); color: var(--text-on-paper); }
.card-paper .card-sub { color: var(--muted-on-paper); }

.rank { list-style: none; margin: 0; padding: 0; }
.rank li {
  display: grid; grid-template-columns: 34px 42px minmax(0, 1fr) auto;
  align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line);
}
.pos {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font: 800 15px var(--font-display); background: #26262d; color: var(--text);
}
.p1 { background: var(--yellow); color: var(--ink); }
.p2 { background: var(--cyan); color: var(--ink); }
.p3 { background: var(--pink); color: var(--ink); }
.av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; }
.av-ini {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink-3); color: var(--text-soft); font-weight: 700; font-size: 15px;
}
.who { display: flex; flex-direction: column; min-width: 0; }
.who b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pts { font: 800 20px var(--font-display); text-align: right; white-space: nowrap; }
.pts small { font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.pts-1 { color: var(--yellow); }

@media (min-width: 681px) {
  .board { margin-top: -96px; }
  /* Two or three cards (the shop card only shows during an open campaign) share the row evenly. */
  .board-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .card { padding: 24px; }
}

/* ---------- Forms (static pages: login, change password, join) ---------- */
.auth {
  position: relative; display: grid; place-items: center; padding: 48px var(--gutter) 72px;
  background: var(--ink) url("../img/brand/splash-sm.webp") 50% 50% / cover no-repeat;
}
.auth::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(10, 10, 12, .62) 0%, rgba(10, 10, 12, .9) 70%, var(--ink) 100%); }
.auth-card {
  position: relative; width: 100%; max-width: 440px; background: rgba(20, 20, 24, .94); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 28px 22px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.auth-card h1 { margin: 8px 0 22px; font: 800 40px/1 var(--font-display); }
.auth-help { margin: 20px 0 0; color: var(--muted); font-size: 15px; }

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 15px; }
.field input, .field textarea, .field select {
  min-height: 50px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #0e0e11; color: var(--text);
  font: 500 17px var(--font-body);
}
.field textarea { min-height: 140px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid rgba(247, 29, 138, .4); border-color: var(--pink); }
.field-hint { font-size: 14px; color: var(--muted); }
.field-error, .validation-message { color: #ff8a8a; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--pink-btn); }

.alert { margin: 0 0 18px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 15px; }
.alert-error { background: #3a1218; border: 1px solid #7a2733; color: #ffd0d6; }
.alert-info { background: #0f2a33; border: 1px solid #1d5566; color: #d2f3fb; }
.alert-ok { background: #122c1c; border: 1px solid #2c6a43; color: #d3f5df; }

@media (min-width: 681px) {
  .auth { padding-top: 88px; padding-bottom: 104px; background-image: url("../img/brand/splash.webp"); }
  .auth-card { padding: 36px 32px; }
}

/* ---------- Message pages (404, 403, error) ---------- */
.message-page { padding-top: 72px; padding-bottom: 72px; max-width: 680px; }
.message-page h1 { margin: 10px 0 14px; font: 800 44px/1 var(--font-display); }
.message-page p { color: var(--text-soft); margin: 0 0 24px; }

/* ---------- Footer ---------- */
/* The brush bar opens the footer; the bottom row carries the «powered by» credit. */
.ft { position: relative; margin-top: var(--section); background: #070708; border-top: 1px solid var(--line); }
.ft::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 4px; background: var(--brush); }
.ft-in { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; padding-top: 44px; padding-bottom: 28px; }
.ft .logo-mark { height: 52px; }
.ft-claim { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 280px; }
.ft-nav { display: flex; flex-wrap: wrap; gap: 0 20px; width: 100%; }
.ft-nav a { color: var(--text-soft); text-decoration: none; font-size: 15px; font-weight: 600; padding: 10px 0; }
.ft-nav a:hover { color: #fff; }
.ft-bottom { border-top: 1px solid var(--line); }
.ft-bottom-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding-top: 20px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.ft-install { gap: 8px; }
.ft-copy { margin: 0; color: var(--faint); font-size: 14px; }
.powered {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
}
.powered:hover { color: var(--text); }
.powered-logo {
  display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 8px; background: #fff;
  transition: transform .15s, box-shadow .15s;
}
.powered-logo img { height: 26px; width: auto; }
.powered:hover .powered-logo { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }

@media (min-width: 681px) {
  .ft-nav { width: auto; margin-left: auto; }
}

/* ==========================================================================
   R1 — page heads, rankings, members, profile, home sections
   ========================================================================== */

.hide-sm { display: none; }
@media (min-width: 681px) { .hide-sm { display: inline-flex; } }

.logo-img { display: block; border-radius: 8px; }

/* ---------- User menu (static <details> dropdown) ---------- */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text); cursor: pointer; font-weight: 700; font-size: 15px;
}
.user-chip:hover, .user-menu[open] .user-chip { background: var(--ink-3); border-color: var(--line-strong); }
.user-chip-name { display: none; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 240px; padding: 8px;
  background: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.user-pop-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-pop-head b { display: block; font-size: 16px; }
.user-pop-head span { font-size: 13px; color: var(--muted); }
.user-pop a, .user-pop button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 10px; border-radius: 10px;
  color: var(--text); text-decoration: none; font: 600 15px var(--font-body); background: none; border: 0; cursor: pointer; text-align: left;
}
.user-pop a:hover, .user-pop button:hover { background: var(--ink-3); color: #fff; }
.user-pop form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
.user-pop button { color: #ff8cc4; }
@media (min-width: 681px) { .user-chip-name { display: inline; } }
/* With a session the menu also has «Tablón» and «Carreras»: on narrower desktops the links tighten
   and the user chip shows only the avatar, so the header never overflows. */
@media (min-width: 1081px) and (max-width: 1359px) {
  .hdr-in { gap: 16px; }
  .nav a { padding: 12px 8px; }
  .nav a.on::after { left: 8px; right: 8px; }
  .user-chip-name { display: none; }
  .user-chip { padding-right: 8px; }
}

/* ---------- Page heads ---------- */
.page-head { position: relative; padding: 36px 0 24px; overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 70%; pointer-events: none;
  background: url("../img/brand/splash-sm.webp") 30% 50% / cover no-repeat; opacity: .5;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%), linear-gradient(0deg, transparent 0%, #000 45%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0%, #000 70%), linear-gradient(0deg, transparent 0%, #000 45%);
  mask-composite: intersect;
}
.page-head > .wrap { position: relative; }
.page-title { margin: 10px 0 0; font: 800 40px/1 var(--font-display); }
.page-sub { margin: 12px 0 0; color: var(--muted); max-width: 560px; }
.page-note { color: var(--muted); font-size: 15px; margin: 4px 0 16px; }

.season-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 18px; }
.season-form label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; width: 100%; }
.season-form select {
  flex: 1 1 220px; min-height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--ink-2); color: var(--text); font: 600 16px var(--font-body); padding: 0 14px;
}

.tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-top: 22px; padding: 4px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; max-width: 560px;
}
/* Five tabs: one row from 560 px up; on a phone they wrap into rows of three (about 90 px per tab at
   320 px), so «Segmentos» fits its cell and «Todas las ligas» takes two lines. */
.tab {
  min-height: 44px; display: grid; place-items: center; border-radius: 10px; text-decoration: none;
  color: var(--text-soft); font-weight: 700; font-size: clamp(13px, 3.6vw, 16px); padding: 0 4px; text-align: center; line-height: 1.15;
}
@media (max-width: 559px) {
  .tabs { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.tab:hover { color: #fff; }
.tab-on, .tab-on:hover { background: var(--pink-btn); color: #fff; box-shadow: 0 6px 16px rgba(247, 29, 138, .25); }

@media (min-width: 681px) {
  .page-head { padding: 64px 0 36px; }
  .page-head::before { width: 55%; opacity: .62; }
  .page-title { font-size: 64px; }
  .season-form label { width: auto; }
  .season-form select { flex: 0 1 320px; }
}

/* ---------- Rankings ---------- */
.rank-page { max-width: 860px; }

.weeknav { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; }
.weeknav div { flex: 1; text-align: center; }
.weeknav b { display: block; font: 800 22px/1.1 var(--font-display); text-transform: uppercase; }
.weeknav span { font-size: 14px; color: var(--muted); }
.icon-btn.is-disabled { opacity: .3; }

.rule {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 12px 14px;
  background: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-soft); line-height: 1.45;
}
.rule svg { color: var(--yellow); margin-top: 1px; }

.rank-lg li { padding: 12px 0; }
.rider-link { color: inherit; text-decoration: none; }
.rider-link:hover { color: #ff8cc4; }

.rank.general li { display: block; padding: 0; }
.rank.general details > summary {
  display: grid; grid-template-columns: 34px 42px minmax(0, 1fr) auto 20px; align-items: center; gap: 12px;
  padding: 12px 0; cursor: pointer; list-style: none;
}
.rank.general details > summary::-webkit-details-marker { display: none; }
.rank.general details[open] .chev { transform: rotate(180deg); }
.chev { color: var(--faint); transition: transform .15s; }
.gdet { padding: 4px 0 18px 46px; display: flex; flex-direction: column; gap: 12px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.hist-leagues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank .hist-leagues li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
}
.hist-leagues a { font-weight: 700; color: inherit; overflow-wrap: anywhere; }
.hist-leagues span { grid-column: 1; font-size: 13px; color: var(--muted); }
.hist-leagues b { grid-column: 2; grid-row: 1 / span 2; font: 800 20px var(--font-display); }
.hist-leagues b small { font: 600 12px var(--font-body); color: var(--muted); }
.split div { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.split span { display: block; font-size: 13px; color: var(--muted); }
.split b { font: 800 20px var(--font-display); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 72px; }
.bar { flex: 1; max-width: 40px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bar i { display: block; width: 100%; background: var(--cyan); border-radius: 4px 4px 2px 2px; }
.bar span { font-size: 11px; color: var(--faint); }

.empty {
  text-align: center; padding: 48px 20px; margin: 12px 0; border: 1px dashed var(--line-strong);
  border-radius: var(--radius); color: var(--text-soft);
}
.empty h2 { margin: 0 0 8px; font: 800 24px/1.1 var(--font-display); text-transform: uppercase; color: var(--text); }
.empty p { margin: 0 0 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.chip-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-soft); text-decoration: none; font-weight: 600;
}
.chip-link.on, .chip-link:hover { border-color: var(--pink); color: #fff; }

.seg-head { display: flex; align-items: flex-start; gap: 12px; margin: 8px 0 6px; }
.seg-head h2 { margin: 0; font: 800 22px/1.1 var(--font-display); text-transform: uppercase; }
.seg-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.seg-head .btn { margin-left: auto; flex: none; }

/* ---------- Leagues: history and per-level standings ---------- */
.league-season { margin: 8px 0 32px; }
.league-season-h {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 12px;
  font: 800 22px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: -.015em; overflow-wrap: anywhere;
}
.league-season-h small, .league-level-h small { font: 600 14px var(--font-body); color: var(--muted); text-transform: none; letter-spacing: 0; }
.league-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.league-card {
  display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 14px 16px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); text-decoration: none;
}
.league-card:hover { border-color: var(--pink); color: var(--text); }
.league-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.league-card-top b { min-width: 0; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.league-meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.league-status {
  flex: none; display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-soft); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.league-status.on { border-color: var(--cyan); color: var(--cyan); }
.league-head > div { min-width: 0; }
.league-head h2 { overflow-wrap: anywhere; }
.league-head .league-status { margin-left: auto; }
.league-level { margin-top: 24px; }
.league-level-h {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px;
  font: 800 18px/1.1 var(--font-display); text-transform: uppercase; color: var(--yellow); overflow-wrap: anywhere;
}
@media (min-width: 681px) {
  .league-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Member profile ---------- */
.back { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; min-height: 44px; color: var(--text-soft); text-decoration: none; font-weight: 600; }
.back:hover { color: #fff; }

.profile { position: relative; display: grid; grid-template-columns: 1fr; gap: 28px; padding: 20px 0 40px; }
.profile::before {
  content: ""; position: absolute; z-index: 0; top: -20px; right: calc(-1 * var(--gutter)); width: 80%; height: 340px; pointer-events: none;
  background: url("../img/brand/splash-sm.webp") 50% 50% / cover no-repeat; opacity: .45;
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%);
}
.profile-photo { position: relative; max-width: 300px; z-index: 1; }
.profile-photo img, .profile-photo .profile-ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 14%; border-radius: 22px; }
/* No photo: initials on the club ink, same box as a portrait. */
.profile-photo .profile-ph {
  display: grid; place-items: center; background: var(--ink-3); color: var(--faint);
  font: 800 44px var(--font-display);
}
.profile-photo .num {
  position: absolute; left: -12px; bottom: -12px; width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; border: 5px solid var(--ink); color: var(--ink);
  font: 800 26px var(--font-display);
}
.profile-body { position: relative; z-index: 1; }
.profile-name { margin: 10px 0 0; font: 800 48px/.95 var(--font-display); overflow-wrap: anywhere; }
.bio { margin: 20px 0 0; color: var(--text-soft); font-size: 18px; max-width: 480px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.stat span { display: block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; margin-top: 6px; font: 800 36px/1 var(--font-display); }
.stat b small { font-size: 18px; color: var(--muted); margin-left: 4px; }
.stat-hi { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.stat-hi span { color: #3b3200; }

.sec-sm { padding-top: 48px; }
.sec-title-sm { font-size: 30px; }
.table-box { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 0 10px; border-bottom: 1px solid var(--line-strong); }
.tbl td { padding: 12px 0; border-bottom: 1px solid var(--ink-3); vertical-align: middle; }
.tbl .r { text-align: right; }
.wk b { display: block; font-size: 16px; }
.wk span { font-size: 13px; color: var(--muted); }
.hrs { width: 42%; padding-right: 14px; }
.hbar { display: flex; align-items: center; gap: 10px; }
.hbar i { display: block; height: 10px; border-radius: 6px; background: var(--cyan); }
.hbar span { font-size: 14px; color: var(--text-soft); white-space: nowrap; }
.place { font-weight: 700; color: var(--text-soft); padding: 0 8px; }
@media (max-width: 520px) {
  .hrs { width: auto; }
  .hbar i { display: none; } /* on phones the hours text alone fits; the bar would crowd the place column */
}
.ptsc { font: 800 20px var(--font-display); }
.ptsc.top { color: var(--yellow); }

.segs { display: grid; grid-template-columns: 1fr; gap: 16px; }
.seg { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.seg > b { font: 800 20px/1.1 var(--font-display); text-transform: uppercase; }
.seg-row { display: flex; flex-wrap: wrap; gap: 20px; }
.seg-row span { display: block; font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.seg-row strong { font: 800 26px var(--font-display); }
.seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: #ff7a3d; font-weight: 700; text-decoration: none; align-self: flex-start; }
.seg a:hover { color: #fff; }

@media (min-width: 761px) {
  .profile { grid-template-columns: 300px minmax(0, 1fr); gap: 40px; align-items: center; }
  .profile-name { font-size: clamp(56px, 6.4vw, 92px); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .segs { grid-template-columns: 1fr 1fr; }
}

/* ---------- Home ---------- */
.ico-c { background: #0f3440; color: var(--cyan); }
.ico-y { background: #3d3307; color: var(--yellow); }
.leader { display: flex; align-items: center; gap: 16px; padding: 6px 0 12px; }
.leader .leader-av { border: 3px solid var(--yellow); }
.leader span { font-size: 14px; color: var(--muted); }
.leader b { display: block; font: 800 24px/1.05 var(--font-display); text-transform: uppercase; }
.leader .big { margin-left: auto; font: 800 44px/1 var(--font-display); color: var(--yellow); }
.leader .big small { font-size: 18px; font-style: normal; color: var(--muted); margin-left: 4px; }

/* Without a hero photo the cards need no overlap. */
.hero:not(.hero-photo) + .board { margin-top: 0; }

.prose { max-width: 760px; margin-top: 20px; color: var(--text-soft); font-size: 18px; line-height: 1.65; }
.prose h2, .prose h3 { color: var(--text); font-family: var(--font-display); line-height: 1.05; margin: 1.4em 0 .4em; }
.prose h2 { font-size: 28px; }
.prose h3 { font-size: 21px; }
.prose p { margin: 0 0 1em; }
.prose a { color: var(--pink-link); }
.prose blockquote { margin: 1em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--pink); color: var(--text); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }

.ig {
  display: flex; align-items: center; gap: 14px; padding: 18px 22px; border: 1px solid var(--line);
  border-radius: 16px; text-decoration: none; color: var(--text);
}
.ig:hover { color: var(--text); border-color: var(--pink); }
.ig b { font-size: 17px; }
.ig span span { color: var(--muted); font-size: 15px; }
.ig .go { margin-left: auto; }
.ig-ico { border-color: var(--pink); color: var(--pink); flex: none; }

/* ==========================================================================
   R2 — news, article, gallery, join band and «Únete» notice
   ========================================================================== */

/* ---------- News cards ---------- */
.news-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.news {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none;
}
.news { transition: border-color .15s, transform .15s; }
.news:hover { color: var(--text); border-color: #44444d; transform: translateY(-2px); }
.news img, .news-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.news-ph { background: var(--ink-2) url("../img/brand/splash-sm.webp") 50% 50% / cover no-repeat; position: relative; }
.news-ph::after { content: ""; position: absolute; inset: 0; background: rgba(10, 10, 12, .35); }
.news-b { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 24px; }
.meta { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.news h3 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; }
.news p { margin: 0; color: #b6b8bf; font-size: 16px; line-height: 1.5; }
.news.big h3 { font: 800 24px/1.1 var(--font-display); text-transform: uppercase; }
.by { font-size: 14px; color: var(--muted); font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 32px 0 0; color: var(--muted); }

@media (min-width: 681px) {
  .news-grid { grid-template-columns: 1fr 1fr; }
  .news.big { grid-column: span 2; }
  .news.big img { aspect-ratio: 21 / 9; }
}
@media (min-width: 1081px) {
  .news-grid { grid-template-columns: 1.45fr 1fr 1fr; }
  .news.big { grid-column: auto; }
  .news.big img { aspect-ratio: 16 / 10; }
  .news.big h3 { font-size: 27px; }
}

/* ---------- Article ---------- */
.article { max-width: 820px; }
.article-head { padding: 20px 0 24px; }
.article-title { margin: 10px 0 18px; font: 800 34px/1.05 var(--font-display); overflow-wrap: anywhere; }
.article-author { display: flex; align-items: center; gap: 12px; color: var(--text-soft); }
.article-author a { color: var(--text); font-weight: 700; text-decoration: none; }
.article-author a:hover { color: var(--pink-link); }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: 28px; }
.article-body { margin-top: 0; }
@media (min-width: 681px) { .article-title { font-size: 52px; } }

/* ---------- Gallery ---------- */
.albums { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 16px; }
.album { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; color: #fff; text-decoration: none; background: var(--ink-2); }
.album:hover { color: #fff; }
.album img, .album-ph { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.album:hover img { transform: scale(1.03); }
.album-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 18px 16px;
  background: linear-gradient(0deg, rgba(10, 10, 12, .9) 0%, rgba(10, 10, 12, 0) 100%);
}
.album-cap b { display: block; font: 800 20px/1.1 var(--font-display); text-transform: uppercase; }
.album-cap span { font-size: 14px; color: var(--text-soft); }
.album-lock {
  position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; background: rgba(10, 10, 12, .8); font-size: 13px; font-weight: 700; color: var(--yellow);
}
@media (min-width: 681px) { .albums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1081px) { .albums { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.album-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.album-grid a { display: block; border-radius: 12px; overflow: hidden; background: var(--ink-2); }
.album-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; transition: opacity .2s; }
.album-grid a:hover img { opacity: .85; }
@media (min-width: 681px) { .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1081px) { .album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pswp__caption { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #fff; font: 600 16px var(--font-body); padding: 0 16px; }

/* Home: featured photos */
.moments-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ph { position: relative; display: block; overflow: hidden; border-radius: 16px; aspect-ratio: 1 / 1; min-width: 0; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph:first-child { grid-column: span 2; aspect-ratio: 16 / 11; }
.ph-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 20px 18px; color: #fff;
  background: linear-gradient(0deg, rgba(10, 10, 12, .88) 0%, rgba(10, 10, 12, 0) 100%);
}
.ph-cap b { display: block; font: 800 20px/1.1 var(--font-display); text-transform: uppercase; }
.ph-cap span { font-size: 14px; color: var(--text-soft); }
@media (min-width: 1081px) {
  .moments-grid { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 230px 230px; gap: 12px; }
  .ph, .ph:first-child { aspect-ratio: auto; }
  .ph:first-child { grid-column: auto; grid-row: span 2; }
}

/* ---------- Join band ---------- */
.join {
  position: relative; margin-top: var(--section); padding: 64px 0; overflow: hidden;
  background: var(--ink) url("../img/brand/splash-sm.webp") 50% 50% / cover no-repeat;
}
.join::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, var(--ink) 0%, rgba(10, 10, 12, 0) 22%, rgba(10, 10, 12, 0) 78%, var(--ink) 100%),
    linear-gradient(180deg, rgba(10, 10, 12, .72), rgba(10, 10, 12, .86));
}
.join-box { position: relative; z-index: 1; max-width: 560px; }
.join-box h2 { margin: 0; font: 800 36px/1 var(--font-display); }
.join-box h2 span { color: var(--pink); }
.join-box p { margin: 16px 0 24px; color: var(--text-soft); font-size: 18px; }
@media (min-width: 681px) {
  .join { padding: 96px 0; background-image: url("../img/brand/splash.webp"); background-position: 70% 50%; }
  .join::before {
    background:
      linear-gradient(180deg, var(--ink) 0%, rgba(10, 10, 12, 0) 24%, rgba(10, 10, 12, 0) 76%, var(--ink) 100%),
      linear-gradient(90deg, rgba(10, 10, 12, .95) 0%, rgba(10, 10, 12, .82) 45%, rgba(10, 10, 12, .25) 100%);
  }
  .join-box h2 { font-size: clamp(40px, 4.4vw, 60px); }
}

/* ---------- «Únete» notice (CSS :target, no JavaScript) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: none; place-items: center;
  padding: max(var(--gutter), env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) max(var(--gutter), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}
.modal:target { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 6, 8, .75); }
.modal-box {
  position: relative; width: 100%; max-width: 440px; padding: 28px 24px; text-align: center;
  background: var(--ink-2); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.modal-box h2 { margin: 10px 0 10px; font: 800 36px/1 var(--font-display); }
.modal-box p { margin: 0 0 22px; color: var(--text-soft); }
.install-steps { margin: 0 0 22px; padding-left: 22px; text-align: left; color: var(--text-soft); }
.install-steps li + li { margin-top: 8px; }
.install-steps b { color: var(--text); }

/* ==========================================================================
   R3 — shop: catalog, product, cart, confirmation and the home card
   ========================================================================== */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Campaign chip (also on the home card) */
.shop-chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin: 0 0 18px;
  padding: 6px 12px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-weight: 700; font-size: 14px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }

/* Header cart button */
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; background: var(--pink-btn); color: #fff; font-size: 12px; font-weight: 700;
}

/* ---------- Catalog ---------- */
.products { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.product { display: flex; flex-direction: column; gap: 10px; color: var(--text); text-decoration: none; }
.product:hover { color: var(--text); }
.product img, .product .product-ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; }
.product img { background: var(--paper); }
.product:hover img { outline: 3px solid var(--pink); outline-offset: 2px; }
.product-ph { display: grid; place-items: center; background: var(--ink-3); color: var(--faint); }
.product-b { display: flex; flex-direction: column; gap: 2px; }
.product-b b { font: 800 17px/1.15 var(--font-display); text-transform: uppercase; }
.price { font-weight: 700; color: var(--text-soft); font-variant-numeric: tabular-nums; }
@media (min-width: 681px) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1081px) { .products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Product ---------- */
.pdp { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 16px 0 24px; }
.pdp-img img, .pdp-img .product-ph { width: 100%; max-width: 520px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 22px; }
.pdp-img img { background: var(--paper); }
.pdp-title { margin: 0; font: 800 38px/1 var(--font-display); overflow-wrap: anywhere; }
.pdp-price { margin: 12px 0 0; font: 800 30px var(--font-display); color: var(--yellow); }
.pdp-desc { margin: 12px 0 20px; color: var(--text-soft); white-space: pre-line; max-width: 520px; }
.pdp-body .shop-chip, .pdp-body .alert { margin-top: 18px; }
.sizes { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sizes legend { font-weight: 700; font-size: 15px; margin-bottom: 8px; padding: 0; }
.size { position: relative; cursor: pointer; }
.size input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.size span {
  display: grid; place-items: center; min-width: 56px; min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); font-weight: 700;
}
.size input:checked + span { background: var(--pink-btn); border-color: var(--pink-btn); color: #fff; }
.size input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }
.sizes .field-error { width: 100%; }
.qty select { max-width: 120px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (min-width: 681px) {
  .pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; padding-top: 24px; }
  .pdp-title { font-size: 52px; }
}

/* ---------- Cart ---------- */
.cart-page { max-width: 860px; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img info sub" "img qty qty";
  gap: 8px 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line);
}
.cart-line img, .cart-line .product-ph { grid-area: img; width: 64px; height: 80px; object-fit: cover; border-radius: 10px; }
.cart-line img { background: var(--paper); }
.cart-line.is-off { opacity: .7; }
.cart-info { grid-area: info; display: flex; flex-direction: column; min-width: 0; }
.cart-info b { font-size: 17px; }
.cart-info span { font-size: 14px; color: var(--muted); }
.cart-qty { grid-area: qty; display: flex; align-items: center; gap: 12px; }
.cart-qty select {
  min-height: 44px; min-width: 72px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #0e0e11; color: var(--text); font: 600 16px var(--font-body);
}
.cart-sub { grid-area: sub; font-variant-numeric: tabular-nums; }
.cart-line-plain { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info sub"; }
.link-btn { min-height: 44px; padding: 0 6px; background: none; border: 0; color: #ff8cc4; font: 600 15px var(--font-body); cursor: pointer; }
.link-btn:hover { color: #fff; }
.cart-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.cart-total { margin: 0 0 0 auto; font-size: 18px; color: var(--text-soft); }
.cart-total b { margin-left: 8px; font: 800 26px var(--font-display); color: var(--text); }
.checkout { margin-top: 28px; padding: 22px 20px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); }
.checkout h2 { margin: 0 0 6px; font: 800 24px/1.1 var(--font-display); text-transform: uppercase; }
.checkout > .muted { margin: 0 0 18px; }
.cart-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.cart-actions .btn { flex: 1 1 100%; }
.alert ul { margin: 6px 0; padding-left: 20px; }
@media (min-width: 681px) {
  .cart-line { grid-template-columns: 72px minmax(0, 1fr) auto 110px; grid-template-areas: "img info qty sub"; }
  .cart-line-plain { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info sub"; }
  .cart-line img, .cart-line .product-ph { width: 72px; height: 90px; }
  .cart-sub { text-align: right; }
  .checkout { padding: 28px; }
  .cart-actions .btn { flex: 0 0 auto; }
}

/* ---------- Confirmation ---------- */
.confirmed { max-width: 720px; padding-top: 40px; }
.order-number { margin: 14px 0 22px; font-size: 18px; color: var(--text-soft); }
.order-number b { display: block; margin-top: 4px; font: 800 40px/1 var(--font-display); color: var(--yellow); }
.pay-box { margin: 0 0 22px; padding: 18px 20px; border-radius: var(--radius); background: var(--paper); color: var(--text-on-paper); }
.pay-box h2 { margin: 0 0 6px; font: 800 20px/1.1 var(--font-display); text-transform: uppercase; }
.pay-box p { margin: 0; white-space: pre-line; }
.confirmed .cart-total { margin: 0 0 18px; text-align: right; }

/* ---------- Home: shop card ---------- */
.card-shop { position: relative; overflow: hidden; }
.card-shop .shop-chip { margin: 0; }
.ico-shop { background: var(--ink); color: var(--pink); }
.shop-body { display: flex; gap: 16px; align-items: center; }
.shop-body img { width: 44%; max-width: 170px; aspect-ratio: 290 / 410; object-fit: cover; border-radius: 12px; }
.shop-body ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 17px; }
.shop-body li { display: flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 14px; height: 6px; border-radius: 3px; transform: skewX(-20deg); }
.card-btn { align-self: flex-start; margin-top: auto; }

/* ---------- Home team section: the member pool ----------
   Every rider is a ball: the photo cut into a circle (or the initials on a jersey colour, with
   exactly the same geometry), the name written inside along the lower edge over a dark fade, and a
   thin ring in the rider's jersey colour. wwwroot/js/team.js makes the balls float like billiard
   balls in low gravity (a soft well per ball, a slow drift, soft collisions, bounces on the edges of
   the section) by writing only a transform on each cell and moving the class .is-lead. It holds
   still on hover, on keyboard focus, with the pause button, off screen and in a hidden tab.

   Degradation is the rule, not the fallback: the markup is a centred grid of round links in normal
   flow, so with no JavaScript or with prefers-reduced-motion the pool is a static, fully readable and
   fully linked set of members. The script reads each ball's home from that very grid, so switching
   the motion on moves nothing and the section keeps its height. */

/* The team band sits on the dark page like every other section, so its text uses the ink
   palette. */
.team .sec-lead { color: var(--muted); }

.pool {
  --ball: 96px;
  --ball-gap: 18px 14px;
  --ball-name: 12px;
  --ball-initials: 26px;
  position: relative;
  padding-top: 8px;
}

/* A centred, wrapping row of fixed-size balls: however many members the club has, every row is
   centred and no two balls ever overlap, with or without the motion. */
.pool-grid {
  list-style: none;
  position: relative;
  margin: 0;
  padding: 6px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ball-gap);
}

.pool-cell {
  flex: 0 0 auto;
  width: var(--ball);
  height: var(--ball);
}

/* Only while the balls really move. */
.pool.is-live .pool-cell { will-change: transform; }

.pool-cell.is-lead { z-index: 2; }
.pool-cell:hover,
.pool-cell:focus-within { z-index: 3; }

.ball {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ink-3);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .5);
  transition: box-shadow .3s ease;
}

.ball:hover { color: #fff; }
.ball:focus-visible { outline-offset: 3px; }

/* A sheen on the upper left and a ring in the jersey colour: what makes it read as a ball. The
   sheen stays far from the name; the ring only covers the rim. */
.ball::before,
.ball::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.ball::before {
  z-index: 1;
  background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 34%);
}

.ball::after {
  z-index: 3;
  box-shadow: inset 0 0 0 3px var(--ring, var(--pink));
}

.ring-0 { --ring: var(--pink); }
.ring-1 { --ring: var(--cyan); }
.ring-2 { --ring: var(--yellow); }

.ball-img,
.ball-ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ball-img {
  object-fit: cover;
  object-position: 50% 18%;
}

/* No photo: the initials on a jersey colour, raised above the name, in exactly the same circle. */
.ball-ph {
  display: grid;
  place-items: center;
  padding-bottom: 30%;
  background: var(--ink-2);
  color: var(--yellow);
  font: 800 var(--ball-initials)/1 var(--font-display);
  letter-spacing: .02em;
}

.ball[data-tone="tone-light"] .ball-ph { background: var(--cyan); color: var(--ink); }
.ball[data-tone="tone-mid"] .ball-ph { background: var(--pink-btn); color: #fff; }

/* The name, inside the ball along its lower edge. The text box is 70% of the diameter wide and
   starts 16% above the bottom, where the chord of the circle is already 73% wide, so two lines fit
   without touching the rim; anything longer is clamped, never spilled. Behind the text the fade is
   at least 88% ink, so white type stays above 14:1 even over a white jersey. */
.ball-name {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 62%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 15% 16%;
  background: linear-gradient(to top, rgba(10, 10, 12, .92) 0%, rgba(10, 10, 12, .88) 70%, rgba(10, 10, 12, 0) 100%);
  pointer-events: none;
}

.ball-name > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  max-width: 100%;
  color: #fff;
  font: 800 var(--ball-name)/1.08 var(--font-display);
  letter-spacing: .01em;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}

/* The protagonist and the ball under the pointer: a pink rim and a glow outside the ball, so the
   name is never covered. Nothing grows, so nothing shifts under the cursor. */
.pool-cell.is-lead .ball,
.ball:hover {
  box-shadow: 0 0 0 3px var(--pink), 0 14px 30px rgba(247, 29, 138, .35);
}

/* The jersey accents, shared with the /miembros wall. */
.cur-0 { background: var(--pink); }
.cur-1 { background: var(--cyan); }
.cur-2 { background: var(--yellow); }

.pool-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 22px;
}

.pool-count {
  margin: 0;
  font: 700 13px var(--font-body);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.pool-pause {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 700 14px var(--font-body);
  cursor: pointer;
}

.pool-pause[hidden] { display: none; }
.pool-pause:hover { border-color: var(--pink); }

/* Two bars for «pause», a triangle for «resume»: the icon follows aria-pressed, never the colour
   alone. */
.pool-pause-ico {
  width: 0;
  height: 0;
  border-left: 9px solid var(--pink);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.pool-pause[aria-pressed="false"] .pool-pause-ico {
  width: 8px;
  height: 11px;
  border: 0;
  border-left: 3px solid var(--pink);
  border-right: 3px solid var(--pink);
}

/* 360 px: 3 balls of 96 px in 328 px. 481 px: 3–4 of 112 px. 768 px: 4 of 124 px in 688 px.
   1280 px: 6 of 148 px in 1160 px. */
@media (min-width: 481px) {
  .pool { --ball: 112px; --ball-gap: 22px 18px; --ball-name: 12.5px; --ball-initials: 28px; }
}

@media (min-width: 681px) {
  .pool { --ball: 124px; --ball-gap: 26px 22px; --ball-name: 13px; --ball-initials: 30px; }
}

@media (min-width: 1081px) {
  .pool { --ball: 148px; --ball-gap: 30px 28px; --ball-name: 14.5px; --ball-initials: 34px; }
}

/* ---------- /miembros: the jersey wall ----------
   Every card is already in place; the pointer, the keyboard or a tap brings one of them to the front
   with a transform. The lean is a custom property per card, so the wall has movement without a byte
   of JavaScript. With no JavaScript the wall is a static, complete grid of links to each ficha. */

.mwall { position: relative; }

.mwall-grid {
  list-style: none;
  margin: 0;
  padding: 4px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  perspective: 900px;
}

.mwall-cell {
  position: relative; /* anchors the Strava icon, also when reduced motion removes the transform */
  min-width: 0;
  transform: rotate(var(--tilt, 0deg)) translateY(calc(var(--rise, 0px) * .4));
  transition: transform .28s cubic-bezier(.2, .7, .3, 1);
}

.mwall-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 10px 10px 12px;
  border-radius: 20px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  outline: 3px solid transparent;
  outline-offset: 3px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .35);
  transition: transform .28s cubic-bezier(.2, .7, .3, 1), box-shadow .28s ease, border-color .2s ease;
}

.mwall-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 14px;
  background: var(--ink-3);
}

.mwall-frame img,
.mwall-ph {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
}

/* No photo: initials, same box as a portrait so the wall never breaks. */
.mwall-ph {
  display: grid;
  place-items: center;
  font: 800 30px/1 var(--font-display);
  color: var(--yellow);
  background: var(--ink-3);
}

.mwall-cell:nth-child(3n + 1) .mwall-ph { color: var(--cyan); }
.mwall-cell:nth-child(3n + 2) .mwall-ph { color: var(--pink); }

/* A diagonal sheen that only shows on the rider at the front. */
.mwall-shine {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%,
    rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, 0) 62%);
  transition: opacity .28s ease;
  pointer-events: none;
}

.mwall-foot { display: block; min-width: 0; }

.mwall-foot b {
  display: block;
  font: 800 14px/1.15 var(--font-display);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.mwall-rule {
  display: block;
  width: 30px;
  height: 4px;
  margin-top: 7px;
  border-radius: 2px;
  transform: skewX(-20deg);
}

/* Strava icon, signed-in only. A sibling of the card link (a link cannot hold another link), laid over
   the top-right corner of the photo, far from the name at the foot. A solid Strava-orange disc with a
   white rim and a dark halo, so it reads on light and dark photos alike; the hover/focus state is
   the inverse, like .btn-strava. 40 px of target on phones, 44 px from tablets. */
.mwall-strava {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--strava);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 1px rgba(10, 10, 12, .45), 0 6px 14px rgba(0, 0, 0, .45);
  text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
}

.mwall-strava svg { display: block; fill: currentColor; }
.mwall-strava-low { opacity: .72; }

.mwall-strava:hover,
.mwall-strava:focus-visible { background: var(--ink); color: #ff7a3d; border-color: var(--strava); }

.mwall-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.mwall-hint .ic {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The front of the wall: pointer, keyboard and touch all land in the same place. */
@media (hover: hover) {
  .mwall-cell:hover { transform: rotate(0deg) translateY(-6px) translateZ(30px); z-index: 2; }
  .mwall-cell:hover .mwall-card { box-shadow: 0 22px 46px rgba(0, 0, 0, .5); border-color: var(--pink); }
  .mwall-cell:hover .mwall-shine { opacity: 1; }
}

.mwall-card:focus-visible { outline-color: var(--cyan); }
.mwall-cell:focus-within { transform: rotate(0deg) translateY(-6px) translateZ(30px); z-index: 2; }
.mwall-card:active { transform: scale(.98); }

@media (min-width: 481px) {
  .mwall-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
  .mwall-cell { transform: rotate(var(--tilt, 0deg)) translateY(var(--rise, 0px)); }
  .mwall-foot b { font-size: 15px; }
}

@media (min-width: 681px) {
  .mwall-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 20px; }
  .mwall-card { padding: 12px 12px 14px; }
  .mwall-strava { top: 18px; right: 18px; width: 44px; height: 44px; }
}

@media (min-width: 1081px) {
  .mwall-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ---------- /miembros page head counter ---------- */
.page-count {
  margin: 14px 0 0;
  font: 700 13px var(--font-body);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cyan);
}

/* Reduced motion: everything is static. The pool keeps every member visible and linked as a still
   grid of balls (team.js runs no physics and no spotlight, and the stylesheet would cancel any
   transform anyway), and the wall does not lean or lift; the pointer only changes the rim or the
   outline, which is not motion. */
@media (prefers-reduced-motion: reduce) {
  .ball,
  .mwall-cell,
  .mwall-card,
  .mwall-shine { transition: none; }
  .pool-cell { transform: none !important; will-change: auto; }
  .mwall-cell,
  .mwall-cell:hover,
  .mwall-cell:focus-within { transform: none; }
  .mwall-card:active { transform: none; }
}

/* ---------- Members' pages of the public site: board and race calendar (§4.12, §4.14) ---------- */
.club-page { padding-bottom: 56px; }
.club-head-act { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }

/* Board */
.board-list { display: grid; gap: 14px; max-width: 860px; }
.board-league {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; padding: 18px;
  background: var(--ink-2); border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: var(--radius-sm);
}
.board-league-on { border-left-color: var(--yellow); }
.board-league-ico {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 12px;
  background: rgba(4, 188, 211, .12); color: var(--cyan);
}
.board-league-on .board-league-ico { background: rgba(252, 228, 3, .12); color: var(--yellow); }
.board-league-b { flex: 1 1 200px; min-width: 0; }
.board-league-b h2 { margin: 4px 0 2px; font: 800 22px/1.15 var(--font-display); letter-spacing: -.015em; overflow-wrap: anywhere; }
.board-league-b p.muted { margin: 0; font-size: 15px; }
.board-league .btn { flex: 1 1 100%; }
.notice { padding: 20px 18px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.notice-pinned { border-color: rgba(247, 29, 138, .55); box-shadow: inset 4px 0 0 var(--pink); }
.notice-h { display: flex; align-items: flex-start; gap: 10px; }
.notice-h h2 { flex: 1 1 auto; min-width: 0; margin: 0; font: 800 22px/1.15 var(--font-display); letter-spacing: -.015em; overflow-wrap: anywhere; }
.notice-pin {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  background: var(--pink-btn); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.notice-meta { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.notice-text { margin-top: 12px; font-size: 17px; overflow-wrap: anywhere; }
.notice-text > :last-child { margin-bottom: 0; }
@media (min-width: 681px) {
  .board-league .btn { flex: none; }
  .notice { padding: 24px; }
}

/* Race calendar. Each kind takes a brand colour: --race, and --race-on for text drawn on it. */
.race-p { --race: var(--pink); --race-fill: var(--pink-btn); --race-on: #fff; }
.race-y { --race: var(--yellow); --race-fill: var(--yellow); --race-on: var(--ink); }
.race-c { --race: var(--cyan); --race-fill: var(--cyan); --race-on: var(--ink); }

.race-when {
  display: inline-flex; padding: 4px; margin: 0 0 14px; gap: 4px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px;
}
.race-when a {
  display: grid; place-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px;
  color: var(--text-soft); font-weight: 700; text-decoration: none;
}
.race-when a:hover { color: #fff; }
.race-when a.on { background: var(--text); color: var(--ink); }

/* One scrolling row on a phone (with the page gutter), wrapped in the form. */
.race-filters {
  display: flex; gap: 8px; margin: 0 calc(-1 * var(--gutter)) 18px; padding: 2px var(--gutter) 6px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.race-filters::-webkit-scrollbar { display: none; }
.race-filters-wrap { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
.race-filter {
  display: inline-flex; flex: none; align-items: center; gap: 7px; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--line-strong); border-radius: 999px; background: transparent;
  color: var(--text); font: 700 15px var(--font-body); text-decoration: none; cursor: pointer;
}
.race-filter .ic { color: var(--race); }
.race-filter:hover { border-color: var(--race); color: #fff; }
.race-filter.on, .race-filter:has(input:checked) { border-color: var(--race-fill); background: var(--race-fill); color: var(--race-on); }
.race-filter.on .ic, .race-filter:has(input:checked) .ic { color: inherit; }
.race-filter:has(input:focus-visible) { outline: 3px solid rgba(247, 29, 138, .4); outline-offset: 2px; }

.race-list { display: grid; gap: 12px; max-width: 860px; margin: 0; padding: 0; list-style: none; }
.race-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; scroll-margin-top: 84px;
  border: 1px solid var(--line); border-left: 5px solid var(--race); border-radius: 16px;
  background: radial-gradient(130% 150% at 100% 50%, color-mix(in srgb, var(--race) 20%, transparent) 0, transparent 55%), var(--ink-2);
}
.race-top { display: flex; min-height: 128px; }
.race-info { flex: 1 1 auto; min-width: 0; padding: 14px 10px 14px 16px; }
.race-title { margin: 0 0 8px; font: 800 20px/1.15 var(--font-display); letter-spacing: -.015em; overflow-wrap: anywhere; }
.race-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 6px; color: var(--text-soft); font-size: 15px; }
.race-line > span { display: inline-flex; align-items: center; gap: 6px; }
.race-line .ic { color: var(--muted); }
.race-stats { color: var(--text); font-weight: 600; }
.race-line .race-sport {
  gap: 5px; padding: 2px 10px 2px 8px; border: 1.5px solid var(--race); border-radius: 999px;
  color: var(--text); font-size: 13px; font-weight: 700;
}
.race-line .race-sport .ic { color: var(--race); }
.race-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 0; color: var(--faint); font-size: 13px; }
.race-edit {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); font-weight: 700; text-decoration: none;
}
.race-edit:hover { border-color: var(--race); color: #fff; }

/* Days left: a slanted brush stroke of the race's colour. */
.race-days {
  position: relative; isolation: isolate; flex: none; width: 96px; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 6px 8px 20px;
  color: var(--race-on); text-align: center; font-family: var(--font-display); font-style: italic; line-height: 1;
}
.race-days::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(0, 0, 0, .1) 6px 8px), var(--race-fill);
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%, 10% 72%, 3% 52%, 14% 30%);
}
.race-days b { font-size: 40px; font-weight: 900; letter-spacing: -.04em; }
.race-days span { font-size: 16px; font-weight: 800; }
.race-days-word b { font-size: 19px; letter-spacing: -.02em; }
@media (max-width: 379px) {
  .race-days { width: 80px; padding-left: 16px; }
  .race-days b { font-size: 32px; }
  .race-days-word b { font-size: 15px; }
  .race-info { padding-left: 12px; }
  .race-title { font-size: 18px; }
}

/* Race form */
.race-form { max-width: 640px; }
.race-pick { border: 0; margin: 0; padding: 0; min-width: 0; }
.race-pick legend { margin-bottom: 8px; padding: 0; font-weight: 700; font-size: 15px; }
.field input[type="date"] { color-scheme: dark; }
.race-nums { display: grid; gap: 18px; }
.race-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 6px 0 0; }
.race-actions .btn { flex: 1 1 140px; }
.race-delete { color: #ff8a8a; }
.modal-box .race-actions { justify-content: center; margin: 0; }
#borrar h2 { font-size: 26px; line-height: 1.1; overflow-wrap: anywhere; }
@media (min-width: 681px) {
  .race-nums { grid-template-columns: 1fr 1fr; }
  .race-actions .btn { flex: 0 0 auto; }
  .race-delete { margin-left: auto; }
}

/* Who is going: stacked photos and a count that opens the list (a <details>, no JavaScript). */
.race-people {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px 14px 16px;
  border-top: 1px solid var(--line); background: rgba(10, 10, 12, .35);
}
.race-who { flex: 1 1 100%; min-width: 0; }
.race-who > summary {
  display: flex; align-items: center; gap: 10px; min-height: 44px; list-style: none; cursor: pointer; border-radius: 12px;
}
.race-who > summary::-webkit-details-marker { display: none; }
.race-who > summary:focus-visible { outline: 3px solid rgba(247, 29, 138, .4); outline-offset: 2px; }
.race-stack { display: inline-flex; flex: none; padding-left: 8px; }
.race-stack .race-av, .race-more { margin-left: -8px; box-shadow: 0 0 0 2px var(--ink-2); }
.race-more {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink-3); color: var(--text); font-size: 12px; font-weight: 800;
}
.race-count { font-weight: 700; color: var(--text); }
.race-going {
  padding: 2px 9px; border-radius: 999px; background: var(--race-fill); color: var(--race-on);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.race-chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.race-who[open] .race-chev { transform: rotate(180deg); }
.race-who-h {
  display: inline-block; margin: 10px 0 10px; padding: 2px 12px; transform: skewX(-12deg);
  background: var(--race-fill); color: var(--race-on); font: italic 900 16px var(--font-display);
}
.race-who-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 14px;
  margin: 0 0 4px; padding: 0; list-style: none;
}
.race-who-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.race-who-list span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.race-av-lg { box-shadow: 0 0 0 2px var(--race); }
.race-who-none { flex: 1 1 auto; margin: 0; color: var(--muted); font-size: 15px; }
.race-join { flex: 1 1 100%; }
@media (min-width: 681px) {
  .race-who { flex: 1 1 0; }
  .race-who[open] { flex-basis: 100%; order: 1; }
  .race-join { flex: none; }
}

/* Admins: who is on a race's list (/carreras/{id}). */
.race-admin { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.race-admin h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font: 800 24px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: -.015em; }
.race-admin h2 small { font: 700 16px var(--font-body); color: var(--muted); }
.race-admin-list { display: grid; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.race-admin-list li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px 6px 6px; border-radius: var(--radius-sm); background: var(--ink-2); }
.race-admin-list li > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.race-admin-row { display: flex; flex-wrap: wrap; gap: 10px; }
.race-admin-row select { flex: 1 1 200px; min-width: 0; }
.race-admin-row .btn { flex: 1 1 120px; }
@media (min-width: 681px) { .race-admin-row .btn { flex: none; } }
