/* Shared CSS-only corner sizes and surface edge. */
/* Consistent, lightly softened personal avatars throughout profiles and leaderboards. */
.profile-avatar { border-radius:43%; }
:root {
  --radius-lg: 36px;
  --radius-md: 28px;
  --radius-sm: 10px;
  --radius-xs: 2px;
  --radius-pill: 9999px;
  --radius-segmented: 16px;
  --radius-segmented-active: 12px;
  --surface-edge: linear-gradient(135deg, rgba(255,255,255,.20), rgba(255,255,255,.10) 18%, transparent 42%, transparent 68%, rgba(255,255,255,.08) 85%, rgba(255,255,255,.15));
}
.dark { --surface-edge:linear-gradient(135deg,rgba(255,255,255,.17),rgba(255,255,255,.07) 18%,transparent 42%,transparent 68%,rgba(255,255,255,.06) 85%,rgba(255,255,255,.13)); }
.surface-card { border-radius:var(--radius-md); overflow:hidden; }
.surface-card--large { border-radius:var(--radius-lg); }
.dark :is(.surface-card,.hub-white-card,.hub-result-list,.hub-fixture-card,.hub-match-row-list,.hub-match-summary,.bg-card.rounded-xl,.bg-card.rounded-2xl,.bg-card.rounded-3xl) {
  --surface-fill:linear-gradient(hsl(var(--card)),hsl(var(--card)));
  border:1px solid transparent;
  background:var(--surface-fill) padding-box,var(--surface-edge) border-box !important;
  background-clip:padding-box,border-box;
}

/* Match the rest of the app's faint gradient edges in dark mode.
   Graded prediction borders pick up their own outcome colour: lime for
   exact, primary blue for correct and red for wrong. Light mode is untouched. */
.dark .match-card .match-prediction-box {
  --prediction-outcome-fill: hsl(var(--secondary));
  --prediction-outcome-edge: var(--surface-edge);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--prediction-outcome-fill), var(--prediction-outcome-fill)) padding-box,
    var(--prediction-outcome-edge) border-box !important;
}
.dark .match-card .match-prediction-graded[data-result-type="exact"] {
  --prediction-outcome-fill: #c3f812;
  /* A slightly darker lime is visible against the solid lime fill. */
  --prediction-outcome-edge: linear-gradient(135deg,
    rgba(70,105,0,.58), rgba(140,184,0,.24) 38%, transparent 66%, rgba(70,105,0,.42));
}
.dark .match-card .match-prediction-graded[data-result-type="correct"] {
  --prediction-outcome-fill: hsl(var(--primary) / .20);
  --prediction-outcome-edge: linear-gradient(135deg,
    hsl(var(--primary) / .55), hsl(var(--primary) / .15) 38%, transparent 66%, hsl(var(--primary) / .4));
}
.dark .match-card .match-prediction-graded[data-result-type="wrong"] {
  --prediction-outcome-fill: rgb(239 68 68 / .20);
  --prediction-outcome-edge: linear-gradient(135deg,
    rgb(239 68 68 / .55), rgb(239 68 68 / .15) 38%, transparent 66%, rgb(239 68 68 / .4));
}
/* Only dark-mode graded boxes need a brighter foreground against their
   translucent blue/red fills. Keep the outcome-colour gradient and light mode. */
.dark .match-card .match-prediction-graded[data-result-type="correct"] {
  color: #bfdbfe;
}
.dark .match-card .match-prediction-graded[data-result-type="wrong"] {
  color: #fecaca;
}
.dark .match-card .match-prediction-graded:is([data-result-type="correct"], [data-result-type="wrong"]) .opacity-70 {
  opacity: .9;
}

/* Micro marks stay crisp rectangles, while navigation stays a full pill. */
:where(.hub-match-page,.hub-story,.matches-page) :is(.rounded-full.h-2,.rounded-full.w-2,.rounded-full.h-1,.rounded-full.w-1) { border-radius:var(--radius-xs); }
.liquid-glass--mobile,.liquid-glass--mobile .liquid-glass-pill { border-radius:var(--radius-pill); }

.liquid-glass--sidebar .liquid-glass-pill { border:0; box-shadow:none; }
.liquid-glass--sidebar :focus-visible { outline:2px solid #c3f812; outline-offset:2px; }

.pagination-mark { border-radius:var(--radius-xs); }
/* Active carousel lines have soft ends; inactive square markers keep their tiny corners. */
button[aria-current="true"] > .pagination-mark { border-radius:var(--radius-xs); }

/* Progress tracks and tiny marks are rounded rectangles, not circular dots. */
.rounded-full:is(.h-1,.h-1\.5,.h-2,[class*="h-[2px]"],[class*="h-[2.5px]"],[class*="h-[6px]"]) { border-radius:var(--radius-xs); }

/* Legacy card utility keeps the medium size; controls keep the crisp small size. */
.bg-card.rounded-xl { border-radius:var(--radius-md); }
.bg-card.rounded-xl:is(button,[role="button"]) { border-radius:var(--radius-sm); }

/* Text pills become compact canisters; equal-sized icons and avatars stay round. */
.rounded-full:is(img,svg,[class*="aspect-square"],[class*="size-"],
  .w-3.h-3,.w-4.h-4,.w-5.h-5,.w-6.h-6,.w-7.h-7,.w-8.h-8,
  .w-9.h-9,.w-10.h-10,.w-11.h-11,.w-12.h-12,.w-14.h-14,
  .w-16.h-16,.w-20.h-20,.w-24.h-24,.w-32.h-32,.w-40.h-40,
  .w-48.h-48,.w-56.h-56,.w-64.h-64,
  [class*="w-[58px]"][class*="h-[58px]"]) { border-radius:50%; }

/* Tiny status marks and legend swatches remain crisp boxes. */
.rounded-full:is(.w-3.h-3,[class*="w-[7px]"][class*="h-[7px]"]) { border-radius:var(--radius-xs); }

/* Shared segmented controls used by Matches, Hub and World League. */
.segmented-canister {
  border:0;
  border-radius:var(--radius-segmented);
  background:hsl(var(--card));
  overflow:hidden;
}
/* Keep the same faint corner accents as rank cards on this wide, short shape. */
.dark .segmented-canister {
  border:1px solid transparent;
  background:hsl(var(--card));
  border-color:hsl(var(--border) / .35);
}
.segmented-canister > button { border-radius:var(--radius-segmented-active); }

/* The full-bleed lead story needs only a fading lower edge in dark mode. */
.dark .news-lead-photo::after {
  content:'';
  position:absolute;
  inset:auto 0 0;
  height:1px;
  pointer-events:none;
  background:linear-gradient(90deg,rgba(184,209,170,.10),transparent 42%,transparent 68%,rgba(184,209,170,.08));
}

/* The rank toggle has individual tabs without a surrounding capsule. */
.world-rank-switch { border-radius:var(--radius-segmented); }
.world-rank-switch > button { border-radius:var(--radius-segmented-active); }
/* Group controls share the same fading edge used by dark cards. */
.dark .group-edge {
  border:1px solid transparent;
  background:linear-gradient(hsl(var(--secondary)),hsl(var(--secondary))) padding-box,var(--surface-edge) border-box;
}
.dark .group-edge--card {
  background:linear-gradient(hsl(var(--card)),hsl(var(--card))) padding-box,var(--surface-edge) border-box;
}

/* Profile stat tiles mirror Club's compact icon-and-number layout. */
.profile-stat-card { min-height:106px; padding:14px; }
.profile-stat-card > div { min-height:78px; }
.profile-stat-card > div > div { display:flex; flex-direction:column; justify-content:space-between; align-self:stretch; }
.profile-stat-label { color:hsl(var(--muted-foreground)); font:500 17px/1.1 var(--font-inter); }
.profile-stat-value { font-size:25px; font-weight:600; line-height:1; }
.profile-stat-icon { position:absolute; top:14px; right:14px; display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:hsl(var(--secondary)); }
.profile-stat-icon img { width:17px; height:17px; object-fit:contain; filter:brightness(0); }
.dark .profile-stat-icon img { filter:brightness(0) invert(1); }
@media(max-width:430px) { .profile-stat-card { min-height:100px; } .profile-stat-card > div { min-height:72px; } }

.prediction-history-list > div + div { border-top:1px solid hsl(var(--border) / .55); }

/* One red for live clocks, scores and badges within each theme. */
.live-accent { color:var(--live-red); }
.live-badge { color:var(--live-red); background:color-mix(in srgb,var(--live-red) 13%,transparent); }
.live-dot { background:var(--live-red); }

.hub-featured-card .live-accent { color:var(--live-red); }

/* Prediction results share the season surface and use quiet row separators. */
.prediction-history-matches > div + div { border-top:1px solid hsl(var(--border) / .55); }
.hub-calendar-date { border-radius:26px; border:1px solid transparent; }
.hub-calendar-date:not([aria-pressed="true"]) { border-color:hsl(var(--border) / .6); border-style:dashed; }
.world-stat-tile { border-radius:var(--radius-segmented-active) !important; }

/* Grey depth for featured jerseys; kit artwork remains legible. */
.hub-featured-jersey > div:first-child { background:#fff; }
.dark .hub-featured-jersey > div:first-child { background:linear-gradient(145deg,#343535,#242525 46%,#171818); }
.dark .hub-featured-jersey { background:#242525; }

/* A wide flowing lip joins each fixture to the next card.
   The bridge (bottom of the upper card) and the slot (top of the lower card) share one curve and
   both start the same 1px inside their card edge, so the two edges of the gap run parallel and the
   shoulders of the top curve ease into the flat edge exactly like the bottom curve does. */
.matches-fixtures {
  --lip-h:12px;       /* height of the curve */
  --lip-overlap:1px;  /* how far each curve starts inside its card, hides the seam */
  --lip-edge:0px;     /* border width of the card surface (dark cards have a 1px border) */
}
.dark .matches-fixtures { --lip-edge:1px; }
.matches-fixtures > .match-card { position:relative; overflow:visible; border-radius:var(--radius-lg); }
.match-card-bridge,.match-card-slot { display:none; }
.match-card-contour { stroke:transparent; }
.dark .match-card-contour { stroke:transparent; }
.matches-fixtures > .match-card:has(+ .match-card) > .match-card-bridge {
  display:block; position:absolute; z-index:3; left:0;
  bottom:calc(var(--lip-overlap) - var(--lip-h) - var(--lip-edge));
  width:100%; height:var(--lip-h); pointer-events:none; overflow:visible;
}
/* A lone Live/Upcoming card still needs its own inward top curve. */
.matches-fixtures > .match-card.match-card--standalone > .match-card-slot,
.matches-fixtures > .match-card.match-card--segment-start > .match-card-slot,
.matches-fixtures > .match-card + .match-card > .match-card-slot {
  display:block; position:absolute; z-index:2; left:0;
  top:calc(-1 * (var(--lip-overlap) + var(--lip-edge)));
  width:100%; height:var(--lip-h); pointer-events:none; overflow:visible;
}
@media(max-width:1023px) {
  .desktop-app-main .desktop-page-root { padding-left:12px; padding-right:12px; padding-bottom:24px; }
  .desktop-page-root.min-h-screen { min-height:0; }
}

/* Large cards share the featured card's 36px corner. */
.hub-white-card,.hub-result-list,.hub-fixture-card,.hub-match-row-list,.hub-stat-compare,
.hub-match-summary,.hub-featured-card { border-radius:var(--radius-lg); }

/* Featured match information retains the lime surface in both themes. */
.hub-featured-info,.dark .hub-featured-info { background:#c3f812 !important; }
.hub-featured-info :is(.text-foreground,.text-muted-foreground) { color:#151a13 !important; }
.hub-featured-info .live-accent { color:var(--live-red) !important; }
.hub-featured-meta-cell { border:1px dashed rgba(20,30,14,.5); background:rgba(255,255,255,.10); border-radius:var(--radius-segmented); }
@media(max-width:1023px) {
  .news-feed-main .desktop-page-root,.hub-story-main .desktop-page-root { padding-inline:0; }
}

.surface-card:not(.news-lead-photo) { border-radius:var(--radius-lg); }
