/* ScrimMate v2.3.0 — compact Honours on the profile, one Command Center glow language for every screen,
 * and the layout fixes from the v2.3.0 audit. Loaded last (after v220.css). Vanilla CSS only.
 *
 * Glow language (from the Super Admin Command Center, v200.css .admc-*):
 *   hero  = tone radial from the top-left corner + a soft blob in the opposite corner + a faint top sheen
 *   card  = faint 170deg sheen (white 4.5% → 1.2%) with a hairline border, 20px radius
 *   tile  = faint 160deg sheen (white 5% → 1.5%), 16–18px radius
 *   in    = cards rise in (10px, .45s) with a short stagger
 * Everything is a background layer (no new ::before/::after), so it never fights existing pseudo elements. */

:root {
  --v230-tone: var(--sm-accent, #f6c445);
  --v230-line: rgb(255 255 255 / .07);
  --v230-sheen-card: linear-gradient(170deg, rgb(255 255 255 / .045), rgb(255 255 255 / .012));
  --v230-sheen-tile: linear-gradient(160deg, rgb(255 255 255 / .05), rgb(255 255 255 / .015));
}
:root[data-theme="light"] {
  --v230-line: rgb(0 0 0 / .07);
  --v230-sheen-card: linear-gradient(170deg, rgb(255 255 255 / .9), rgb(255 255 255 / .55));
  --v230-sheen-tile: linear-gradient(160deg, rgb(255 255 255 / .95), rgb(255 255 255 / .6));
}

/* ---------- 1. Honours: compact on the Stats tab, full on the Badges tab ---------- */
.v230-ach { display: grid; gap: 10px; }
.v230-ach .v230-ach-head { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.v230-ach .v230-ach-honour { padding: 8px 10px; gap: 10px; border-radius: 16px; min-width: 0; width: auto; }
.v230-ach .v230-ach-honour .v210-ach-honour__ring { width: 50px; height: 50px; }
.v230-ach .v230-ach-honour .v210-ach-honour__ring b { font-size: .92rem; }
.v230-ach .v230-ach-honour .v210-ach-honour__ring small { font-size: .52rem; }
.v230-ach .v230-ach-honour .v210-ach-honour__txt b { font-size: 1rem; line-height: 1.1; }
.v230-ach .v230-ach-honour .v210-ach-honour__txt small { font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v230-ach .v230-ach-tabs { display: grid !important; grid-template-columns: 1fr; gap: 4px; width: auto !important; margin: 0 !important; padding: 3px; border-radius: 14px !important; }
.v230-ach .v230-ach-tabs button { min-height: 30px; padding: 0 10px; font-size: .74rem; border-radius: 10px !important; justify-content: space-between !important; gap: 8px; }
.v230-ach .v230-ach-tabs button small { font-size: .66rem; font-variant-numeric: tabular-nums; }

/* Slim 9-tier track: one segment per tier, filled by how many of that tier you own. */
.v230-ach-track { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
.v230-ach-track span { height: 6px; border-radius: 99px; overflow: hidden; background: rgb(255 255 255 / .07); }
.v230-ach-track span i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--d, #8a8aa0); box-shadow: 0 0 8px color-mix(in srgb, var(--d, #8a8aa0) 60%, transparent); transform-origin: left; animation: v230-grow .9s cubic-bezier(.2, 1, .3, 1) both; }
:root[data-theme="light"] .v230-ach-track span { background: rgb(0 0 0 / .07); }

.v230-ach-cap { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px -4px; }
.v230-ach-cap b { font-size: .84rem; }
.v230-ach-cap .text-btn { min-height: 32px; padding: 0 4px; font-size: .78rem; font-weight: 800; color: var(--v230-tone); }

/* One swipeable row of small medals instead of a 6-row grid. */
.ach2-row.v230-ach-strip { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 2px 2px 4px; margin: 0 -2px;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.v230-ach-strip .ach2-chip { flex: 0 0 70px; width: 70px; padding: 6px 2px 4px; gap: 3px; border-radius: 14px; }
.v230-ach-strip .ach2-chip:last-child { margin-right: 18px; }
.v230-ach-strip .ach2-medal { width: 44px; height: 44px; }
.v230-ach-strip .ach2-chip b { font-size: .64rem; line-height: 1.15; max-width: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.3em; }
.v230-ach-strip .ach2-chip small, .v230-ach-strip .v210-ach-pct { display: none; }
.v230-ach-strip .ach2-chip:not(.is-on) { opacity: .62; }

.v230-ach .v230-ach-next { padding: 8px 10px; gap: 10px; border-radius: 14px; }
.v230-ach .v230-ach-next .ach2-medal { width: 38px; height: 38px; }
.v230-ach .v230-ach-next b { font-size: .86rem; }

/* Showcase badge: a slimmer banner when it sits above the compact block. */
.v230-ach.is-compact .ach2-feat { padding: 10px 12px; }
.v230-ach.is-compact .ach2-feat .ach2-medal.ach2-big { width: 64px; height: 64px; }

/* Full collection (Badges tab). */
.v230-ach.is-full .ach2-sheet { display: grid; gap: 12px; padding: 0; background: none; border: 0; }
.v230-ach.is-full .ach2-sec { padding: 10px; border-radius: 16px; border: 1px solid var(--v230-line); background: var(--v230-sheen-card); }
.v230-ach.is-full .ach2-sec h4 { margin: 0 0 8px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.v230-ach.is-full .ach2-sec h4 small { font-size: .66rem; }
.v230-ach.is-full .ach2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 4px; }
.v230-ach.is-full .ach2-grid .ach2-chip small { display: none; }
.v230-ach.is-full .ach2-grid .ach2-chip { padding: 8px 2px 6px; border-radius: 14px; min-width: 0; }
.v230-ach.is-full .ach2-grid .ach2-medal { width: 46px; height: 46px; }
.v230-ach.is-full .ach2-grid .ach2-chip b { font-size: .64rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v230-ach.is-full .ach2-grid .ach2-chip:not(.is-on) { opacity: .6; }
.v230-ach-card .sm-pf-card__head { margin-bottom: 8px; }

@keyframes v230-grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes v230-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .v230-ach-track span i, .v230-glow-in > * { animation: none !important; } }

/* ---------- 2. Command Center glow, everywhere ---------- */
/* 2a. Page headings: same recipe as the Platform health hero (tone from the top-left, blob bottom-right). */
.sm-screen > .sm-screen__heading:not(.v220-plain), header.sm-sqm-head, .v18-page__top, .pse-head, .v230-hero {
  border-color: color-mix(in srgb, var(--v230-tone) 22%, var(--v230-line)) !important;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--v230-tone) 20%, transparent), transparent 60%),
              radial-gradient(70% 90% at 100% 100%, color-mix(in srgb, var(--v230-tone) 10%, transparent), transparent 70%),
              linear-gradient(160deg, rgb(255 255 255 / .05), rgb(255 255 255 / .01)), var(--sm-surface, #141418) !important;
  box-shadow: 0 18px 40px -30px color-mix(in srgb, var(--v230-tone) 60%, transparent); }
.sm-screen > .sm-screen__heading:not(.v220-plain)::after, header.sm-sqm-head::after, .v18-page__top::after {
  inset: auto -40px -60px auto !important; top: auto !important; width: 180px !important; height: 180px !important; }
:root[data-theme="light"] .sm-screen > .sm-screen__heading:not(.v220-plain), :root[data-theme="light"] header.sm-sqm-head,
:root[data-theme="light"] .v18-page__top, :root[data-theme="light"] .pse-head, :root[data-theme="light"] .v230-hero {
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--v230-tone) 22%, transparent), transparent 60%),
              radial-gradient(70% 90% at 100% 100%, color-mix(in srgb, var(--v230-tone) 10%, transparent), transparent 70%), #fff !important;
  border-color: rgb(0 0 0 / .07) !important; box-shadow: 0 10px 30px rgb(20 20 40 / .07); }

/* 2b. Section cards: the Command Center card sheen + a faint warm corner. Only background-image changes,
 * so every card keeps its own colour, border and state colours. Variants with their own art are skipped. */
:is(.v18-section, .sm-surface, .sm-org-section-card, .sm-team-panel, .tm-panel, .v1-group, .v1-card, .sm-pf-card, .sm-admin-section,
    .wizard-section-card, .hb-card, .sm-rk-coach, .sm-season-recap-card, .sm-si-card, .sm-sq-manage, .pse-card, .sm-convo-list,
    .v210-ask, .v210-coach__cmp, .v210-cmp__score, .v210-cmp__sec, .rs-sec, .v210-hub-insight, .v170-hub__owner, .sm-release,
    .sm-legal__sec, .admi-card, .m14-summary, .rv-evidence, .sm-dsc-card, .sm-dsc-invite, .sm-match-detail__panel, .md-result,
    .sm-hx-card, .sm-match-card, .ph-session, .sm-team-card, .sm-moderation-item, .sm-squad-hero, .sm-coach-quota):not(.is-current, .is-gold, .is-ghost, .is-fav, .sm-state, .hm-hero, .ph-hero, .hb-ai, .sm-adm-crown, [class*="hero"]) {
  background-image: radial-gradient(130% 100% at 0% 0%, color-mix(in srgb, var(--v230-tone) 7%, transparent), transparent 55%), var(--v230-sheen-card) !important; }
/* 2c. List rows and stat tiles: the KPI tile sheen. */
:is(.v18-row, .sm-match-player, .sm-sq-player, .v1-row, .sm-adm-row, .sm-adm-check, .sm-result-row, .sm-friend-card, .sm-notif-card,
    .v18-lb__row, .v1-ds__rating, .sm-state, .hm-tile, .v220-pf-tile, .sm-pf-stat, .sm-dsc-bar, .hb-best):not(.is-top1, .is-gold, [class*="hero"]) {
  background-image: var(--v230-sheen-tile); }

/* 2d. Headings that only hold a Back pill (host page) stay bare — no empty glowing box. */
.sm-screen > .sm-screen__heading:not(:has(> :not(.sm-backpill, .sm-back-btn))) {
  background: none !important; border-color: transparent !important; box-shadow: none !important; padding: 0 !important; min-height: 0 !important; }
.sm-screen > .sm-screen__heading:not(:has(> :not(.sm-backpill, .sm-back-btn)))::after,
.sm-screen > .sm-screen__heading:not(:has(> :not(.sm-backpill, .sm-back-btn)))::before { display: none !important; }
/* 2e. Legal and What's New title blocks get the same Command Center hero. */
.sm-legal > header, .sm-whats-new-page > header {
  position: relative; overflow: hidden; isolation: isolate; padding: 16px 18px; margin: 10px 0 14px; border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--v230-tone) 22%, var(--v230-line));
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--v230-tone) 20%, transparent), transparent 60%),
              radial-gradient(70% 90% at 100% 100%, color-mix(in srgb, var(--v230-tone) 10%, transparent), transparent 70%),
              linear-gradient(160deg, rgb(255 255 255 / .05), rgb(255 255 255 / .01)), var(--sm-surface, #141418);
  box-shadow: 0 18px 40px -30px color-mix(in srgb, var(--v230-tone) 60%, transparent); }
.sm-legal > header > :last-child, .sm-whats-new-page > header > :last-child { margin-bottom: 0; }
:root[data-theme="light"] .sm-legal > header, :root[data-theme="light"] .sm-whats-new-page > header {
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--v230-tone) 22%, transparent), transparent 60%), #fff;
  border-color: rgb(0 0 0 / .07); box-shadow: 0 10px 30px rgb(20 20 40 / .07); }
/* 2f. Error notices on detail pages read as a themed card instead of loose text. */
.scrim-detail-page > .notice.error, .sm-screen > .notice.error {
  display: grid; gap: 10px; justify-items: start; padding: 16px 18px; margin-top: 12px; border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--error, #ff6b6b) 30%, var(--v230-line));
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--error, #ff6b6b) 12%, transparent), transparent 60%), var(--v230-sheen-card), var(--sm-surface, #141418); }
.scrim-detail-page > .notice.error > p, .sm-screen > .notice.error > p { margin: 0; }
:root[data-theme="light"] .scrim-detail-page > .notice.error, :root[data-theme="light"] .sm-screen > .notice.error { background-color: #fff; }
/* 2g. Home hero with a single tile (Super Admin): one wide row instead of a lonely square. */
.hm-tiles:has(> .hm-tile:only-child) { grid-template-columns: 1fr !important; }
.hm-tiles > .hm-tile:only-child { grid-template-columns: auto auto 1fr; align-items: center; column-gap: 10px; min-height: 52px !important; }
.hm-tiles > .hm-tile:only-child > span:last-child { justify-self: end; }
/* 2h. Achievement head on very narrow phones or large text: honour on top, Practice/Public side by side. */
.v230-ach .v230-ach-honour, .v230-ach .v230-ach-honour .v210-ach-honour__txt { min-width: 0; overflow: hidden; }
.v230-ach .v230-ach-honour .v210-ach-honour__txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 340px) {
  .v230-ach .v230-ach-head { grid-template-columns: 1fr; }
  .v230-ach .v230-ach-tabs { grid-template-columns: 1fr 1fr; }
}
html[style*="font-size"] .v230-ach .v230-ach-head { grid-template-columns: 1fr; }
html[style*="font-size"] .v230-ach .v230-ach-tabs { grid-template-columns: 1fr 1fr; }
/* 2i. Large text on narrow phones: grid children may shrink instead of pushing past the screen edge. */
.v1-ds, .v1-ds > *, .v210-ask, .v210-ask > *, .sm-host-section, .sm-host-section > * { min-width: 0; max-width: 100%; }
.v1-ds__bar { flex-wrap: wrap; }
.v1-ds__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v1-kpi { min-width: 0; overflow-wrap: anywhere; }
/* 2j. Home hero greeting: the name gets its own full-width line, so it is never cut to "RCBx…" next to the role pill. */
.hm-hero__top { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 0; }
.hm-hero__top > div:first-child { display: contents; }
.hm-hero__top .hm-eyebrow { grid-column: 1; grid-row: 1; min-width: 0; line-height: 1.25; }
.hm-hero__top .hm-hero__side { grid-column: 2; grid-row: 1; min-width: 0; }
.hm-hero__top .hm-name { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; }
.hm-hero__side .hm-role { max-width: 46vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Organisation stat labels on large text. */
.sm-org-stat-label { overflow-wrap: anywhere; letter-spacing: .04em; }
/* Settings rows: long e-mails wrap instead of running under the status pill. */
.v1-row__main { min-width: 0; }
.v1-row__main small, .v1-row__main span { overflow-wrap: anywhere; }

/* ---------- 3. v2.3.0 deep-audit fixes ---------- */
/* Manage scrim › Teams: the four team actions sit in an even 2 × 2 grid, so "Reassign slot" is never clipped. */
.v18-row--stack > .v18-row__side:has(> [data-disqualify], > [data-accept], > .v20-ban-btn) {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.v18-row--stack > .v18-row__side > .btn { min-width: 0; width: 100%; padding-inline: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: center; }
/* Rankings podium: gamer names are one word — keep them on one line with an ellipsis instead of "F4xKamiKaze6 / 7". */
.sm-podium .sm-podium-card.v210-pod > b { display: block !important; -webkit-line-clamp: unset; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; max-width: 100%; font-size: .8rem !important; }

/* KPI labels: never split a word mid-way ("CONSISTEN CY"); shrink + ellipsis instead */
.v1-kpi small { overflow-wrap: normal; word-break: normal; hyphens: none; letter-spacing: .02em; font-size: clamp(.58rem, 2.6vw, .7rem); line-height: 1.2; white-space: normal; min-width: 0; }
.v1-kpi b { overflow-wrap: normal; word-break: normal; white-space: nowrap; font-size: clamp(.95rem, 4.4vw, 1.08rem); min-width: 0; }
.v1-kpi b small { white-space: normal; }

/* Admin AI card: label.sm-adm-switch collided with the 40px permission-toggle pill (v19) and squeezed its text */
label.sm-adm-switch { position: static; width: auto; height: auto; min-height: 44px; border-radius: 12px; background: none; display: flex; align-items: center; gap: 12px; flex: initial; padding: 0; }
label.sm-adm-switch::after { content: none; display: none; }
label.sm-adm-switch > span { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
label.sm-adm-switch > input { flex: none; }

/* Home "Coming up": countdown wraps into a compact 2-line chip so the scrim title keeps its space */
.li-btn > time[data-home-countdown] { flex: none; max-width: 86px; white-space: normal; text-align: center; line-height: 1.15; font-size: .72rem; padding: 4px 8px; }
.li-btn > .item-main { min-width: 0; flex: 1 1 auto; }
@media (max-width: 340px) { .v1-kpi small { letter-spacing: 0; } .v1-kpi { padding: 9px 8px; } }
.hm-row__end > .hm-count { display: inline-block; max-width: 84px; white-space: normal; text-align: right; line-height: 1.15; font-size: .8rem; }

/* Squad Lab: the global 44px button min-width made the 7 day buttons overlap and the Practice/Public/All pills shrink into each other */
.sm-si-days button { min-width: 0; width: auto; }
.sm-si-src button { flex: none; }
.sm-si-tools { flex-wrap: wrap; row-gap: 8px; }
.sm-si-tools > .sm-si-src { flex: 1 1 auto; }

/* Large text / 320px: grids sized by content pushed cards past the screen edge */
.admi { grid-template-columns: minmax(0, 1fr); }
.admi > * { min-width: 0; }
.ph-group { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.ph-session { grid-template-columns: minmax(0, 1fr); }
.ph-session__head { grid-template-columns: auto minmax(0, 1fr) minmax(0, max-content); }
.ph-match { grid-template-columns: 40px minmax(0, 1fr) minmax(0, max-content); }
.ph-session__head > :last-child, .ph-match .scrim-status-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Admin data browser: column labels ("DISPLAY NAME") ran into the next column */
.sm-adm-row > summary > span { flex: 1 1 0; overflow: hidden; }
.sm-adm-row > summary > span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-next__row { min-width: 0; } .hm-next__go { flex: none; } .hm-next { min-width: 0; overflow: hidden; }

@media (max-width: 380px) { .hm-hero__top .hm-eyebrow { letter-spacing: .04em; font-size: .66rem; overflow-wrap: normal; } }
@media (max-width: 340px) {
  .hm-hero__top .hm-hero__side { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
  .hm-hero__top .hm-eyebrow { grid-column: 1 / -1; grid-row: 2; margin-top: 8px; }
  .hm-hero__top .hm-name { grid-row: 3; margin-top: 2px; }
}
