/* ScrimMate v1.0.5: team / organization / host stats, timed bans, no-shows, host profile, polish. */

/* ---------- Team stats module ---------- */
.sm-ts { animation: v105-rise var(--sm-motion-standard, 240ms) var(--sm-ease-out, ease-out) both; }
.sm-ts__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.sm-ts__head h3 { margin: 0; font-size: 1.05rem; }
.sm-ts__head small { color: var(--sm-muted); font-size: .78rem; }
.sm-ts__head .btn { white-space: nowrap; }
.sm-ts__org { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 420px) { .sm-ts__org { grid-template-columns: repeat(4, 1fr); } }
.sm-ts__src { display: inline-block; padding: 2px 7px; border-radius: 8px; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sm-ts__src--practice { background: rgb(122 167 255 / .15); color: #9dbdff; }
.sm-ts__src--public { background: rgb(246 196 69 / .15); color: #f6c445; }
:root[data-theme="light"] .sm-ts__src--practice { color: #2a55b8; }
:root[data-theme="light"] .sm-ts__src--public { color: #8a5d00; }
.sm-ts__past { opacity: .62; }
.sm-ts__months { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 16px; }
.sm-ts__month { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.sm-ts__month i { position: relative; width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--sm-accent), color-mix(in srgb, var(--sm-accent) 45%, transparent)); transform-origin: bottom; animation: v105-grow .5s var(--sm-ease-out, ease-out) both; }
.sm-ts__month i b { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: .68rem; font-style: normal; font-variant-numeric: tabular-nums; }
.sm-ts__month small { color: var(--sm-muted); font-size: .66rem; }
.sm-ts__recent { display: grid; gap: 6px; }
.sm-ts__scrim { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--sm-line); background: var(--sm-glass-raised); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform var(--sm-motion-fast, 140ms), border-color var(--sm-motion-fast, 140ms); }
.sm-ts__scrim:active { transform: scale(.985); }
.sm-ts__scrim:hover { border-color: color-mix(in srgb, var(--sm-accent) 45%, var(--sm-line)); }
.sm-ts__scrim > span { display: grid; gap: 2px; min-width: 0; }
.sm-ts__scrim b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-ts__scrim small { color: var(--sm-muted); font-size: .74rem; }
.sm-ts__scrim em { flex: none; display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: .76rem; font-weight: 700; color: var(--sm-accent); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-ts__scrim em svg { width: 15px; height: 15px; flex: none; }
.sm-ts__scrim em.is-open { color: var(--sm-success); text-transform: capitalize; }
:root[data-theme="light"] .sm-ts__scrim em { color: #8a5d00; }
:root[data-theme="light"] .sm-ts__scrim em.is-open { color: #137a4b; }
.v1-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Ban length picker ---------- */
.v105-days { display: flex; flex-wrap: wrap; gap: 6px; }
.v105-day { position: relative; }
.v105-day input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.v105-day span { display: inline-block; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--sm-line); background: var(--sm-glass); font-size: .82rem; font-weight: 600; transition: background var(--sm-motion-fast, 140ms), border-color var(--sm-motion-fast, 140ms); }
.v105-day input:checked + span { background: color-mix(in srgb, var(--sm-accent) 20%, transparent); border-color: var(--sm-accent); color: var(--sm-text); }
.v105-day input:focus-visible + span { outline: 2px solid var(--sm-accent); outline-offset: 2px; }
.v105-noshow .v18-row__main small { color: var(--sm-danger); }
.v20-ban-row.is-ended { opacity: .55; }
.v105-mybans { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }

/* ---------- Scrims Manager profile ---------- */
.v105-host-hero { position: relative; overflow: hidden; isolation: isolate; }
.v105-host-hero__art { position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 55% at 100% 0%, color-mix(in srgb, var(--sm-accent) 26%, transparent), transparent 70%),
              radial-gradient(70% 45% at 0% 0%, rgb(122 167 255 / .14), transparent 70%); }
.v105-host-hero .sm-host-main h2 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0; overflow-wrap: anywhere; }
.v105-host-badge { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; margin: 10px 0 4px; border-radius: 14px; border: 1px solid var(--sm-line); background: var(--sm-glass-raised); }
.v105-host-badge svg { width: 18px; height: 18px; flex: none; }
.v105-host-badge small { color: var(--sm-muted); font-size: .76rem; }
.v105-host-badge--top { border-color: rgb(246 196 69 / .5); } .v105-host-badge--top svg, .v105-host-badge--top b { color: #f6c445; }
.v105-host-badge--good svg, .v105-host-badge--good b { color: #3ccf8e; }
.v105-host-badge--mid svg, .v105-host-badge--mid b { color: #7aa7ff; }
.v105-host-badge--low svg, .v105-host-badge--low b { color: #ff8a7a; }
:root[data-theme="light"] .v105-host-badge--top svg, :root[data-theme="light"] .v105-host-badge--top b { color: #8a5d00; }
:root[data-theme="light"] .v105-host-badge--good svg, :root[data-theme="light"] .v105-host-badge--good b { color: #137a4b; }
:root[data-theme="light"] .v105-host-badge--mid svg, :root[data-theme="light"] .v105-host-badge--mid b { color: #2a55b8; }
:root[data-theme="light"] .v105-host-badge--low svg, :root[data-theme="light"] .v105-host-badge--low b { color: #b3261e; }
.v105-host-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.v105-host-quick span { display: grid; gap: 2px; text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--sm-glass); border: 1px solid var(--sm-line); min-width: 0; }
.v105-host-quick b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.v105-host-quick small { color: var(--sm-muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v105-host-hero .sm-host-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.v105-host-scrim { display: flex; align-items: center; gap: 10px; text-align: left; }
.v105-host-scrim .sm-host-main { flex: 1; min-width: 0; }
.v105-host-scrim .sm-host-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v105-host-scrim__cat { flex: none; writing-mode: vertical-rl; transform: rotate(180deg); padding: 6px 3px; border-radius: 8px; font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: rgb(246 196 69 / .16); color: #f6c445; }
.v105-cat--weekly_war { background: rgb(255 138 122 / .16); color: #ff8a7a; }
.v105-cat--tournament { background: rgb(122 167 255 / .16); color: #9dbdff; }
:root[data-theme="light"] .v105-host-scrim__cat { color: #8a5d00; }
:root[data-theme="light"] .v105-cat--weekly_war { color: #b3261e; }
:root[data-theme="light"] .v105-cat--tournament { color: #2a55b8; }
.v105-host-scrim__go { flex: none; color: var(--sm-muted); }
.v105-host-scrim__go svg { width: 18px; height: 18px; }

/* ---------- Motion ---------- */
@keyframes v105-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes v105-grow { from { transform: scaleY(.05); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sm-ts, .sm-ts__month i { animation: none; }
}

/* ---------- Scrims discovery: past lobbies ---------- */
.scrims-past-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 10px 2px 2px; color: var(--sm-muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.scrims-past-divider span { display: inline-flex; align-items: center; gap: 6px; }
.scrims-past-divider svg { width: 16px; height: 16px; }
.scrims-past-divider::after { content: ""; flex: 1; height: 1px; background: var(--sm-line); }
.scrims-past-divider em { order: 2; font-style: normal; padding: 1px 8px; border-radius: 999px; background: var(--sm-glass-raised); border: 1px solid var(--sm-line); font-size: .72rem; }
.scrim-card.is-past { opacity: .78; }
.scrim-card.is-past .scrim-host-avatar { filter: grayscale(.6); }
.scrim-past-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .8rem; color: var(--sm-muted); padding-top: 4px; }
.scrim-past-row b { color: var(--sm-accent); font-weight: 700; white-space: nowrap; }
.scrims-past-more { display: block; width: 100%; margin-top: 10px; }

/* ---------- Home: role chip never wraps, hosting snapshot ---------- */
.hm-hero__side { flex: none; }
.hm-role { white-space: nowrap; }
@media (max-width: 360px) { .hm-role { font-size: .66rem; padding: 5px 8px; } }
.hs-card { position: relative; overflow: hidden; display: grid; gap: 14px; padding: 16px; border-radius: 20px; border: 1px solid var(--sm-line); background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--sm-accent) 16%, transparent), transparent 60%), var(--sm-glass-raised); animation: v105-rise var(--sm-motion-standard, 240ms) var(--sm-ease-out, ease-out) both; }
.hs-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hs-score { position: relative; flex: none; width: 64px; height: 64px; display: grid; place-items: center; }
.hs-score b { position: relative; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.hs-ring { position: absolute; inset: 0; width: 64px; height: 64px; transform: rotate(-90deg); }
.hs-ring circle { fill: none; stroke-width: 6; }
.hs-ring__bg { stroke: var(--sm-line); }
.hs-ring__fg { stroke: var(--sm-accent); stroke-linecap: round; transition: stroke-dashoffset .9s var(--sm-ease-out, ease-out); }
.hs-card--top .hs-ring__fg, .hs-card--good .hs-ring__fg { stroke: #3ccf8e; }
.hs-card--low .hs-ring__fg { stroke: #ff6b6b; }
.hs-title { display: grid; gap: 2px; min-width: 0; }
.hs-title small { color: var(--sm-muted); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hs-title b { font-size: 1.05rem; }
.hs-title em { font-style: normal; color: var(--sm-muted); font-size: .78rem; line-height: 1.35; }
.hs-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 380px) { .hs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hs-tile { display: grid; gap: 2px; padding: 10px 8px; border-radius: 14px; border: 1px solid var(--sm-line); background: color-mix(in srgb, var(--sm-bg, #000) 30%, transparent); text-align: center; min-width: 0; }
.hs-tile b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hs-tile small { color: var(--sm-muted); font-size: .66rem; line-height: 1.2; }
.hs-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hs-actions .btn { flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.hs-actions svg { width: 16px; height: 16px; }
.hs-card--loading { min-height: 150px; }
.hs-card--loading i { display: block; height: 14px; border-radius: 8px; background: var(--sm-line); animation: v105-pulse 1.2s ease-in-out infinite; }
.hs-card--loading i:first-child { width: 60%; height: 40px; }
.hs-card--empty { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--sm-muted); }
@keyframes v105-pulse { 50% { opacity: .45; } }
:root[data-theme="light"] .hs-tile { background: rgb(255 255 255 / .6); }

/* ---------- Rankings: podium, rows, recap bars ---------- */
.sm-podium .sm-podium-card { position: relative; gap: 2px; padding: 12px 6px 10px; animation: v105-rise .36s var(--sm-ease-out, ease-out) both; }
.sm-podium .sm-podium-card.place-1 { animation-delay: .08s; }
.sm-podium .sm-podium-card.place-3 { animation-delay: .14s; }
.sm-podium-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1rem; color: #1a1406; background: linear-gradient(145deg, #e0e5ec, #9aa3ad); margin-bottom: 2px; box-shadow: 0 4px 12px rgb(0 0 0 / .35); }
.place-1 .sm-podium-avatar { width: 48px; height: 48px; background: linear-gradient(145deg, #ffe08a, #f6c445 55%, #b8860b); }
.place-3 .sm-podium-avatar { background: linear-gradient(145deg, #f0b27a, #cd7f32); }
.sm-podium-crown { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 22px; color: #f6c445; text-shadow: 0 0 10px rgb(246 196 69 / .7); animation: v105-bob 2.4s ease-in-out infinite; }
@keyframes v105-bob { 50% { transform: translate(-50%, -3px); } }
.sm-podium .sm-podium-card b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; word-break: break-word; font-size: 13px; }
.sm-rk-row .sm-rk-main b { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sm-rk-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-rk-wins { flex: none; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 800; color: #1a1406; background: #f6c445; }
.sm-rk-row .sm-rk-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-rk-row .sm-rk-stat { flex: none; max-width: 46%; }
.sm-rk-row .sm-rk-stat small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-rk-row .sm-rk-pos { display: grid; justify-items: center; gap: 2px; flex: none; }
.sm-rk-list .sm-rk-row { animation: v105-rise .3s var(--sm-ease-out, ease-out) both; }
.sm-rk-list .sm-rk-row:nth-child(2) { animation-delay: .03s; } .sm-rk-list .sm-rk-row:nth-child(3) { animation-delay: .06s; } .sm-rk-list .sm-rk-row:nth-child(4) { animation-delay: .09s; } .sm-rk-list .sm-rk-row:nth-child(n+5) { animation-delay: .12s; }
.sm-recap-bars { display: grid; gap: 7px; padding: 4px 0 2px; }
.sm-recap-bar { display: grid; grid-template-columns: minmax(0, 34%) 1fr auto; align-items: center; gap: 8px; font-size: .76rem; }
.sm-recap-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sm-muted); }
.sm-recap-bar i { display: block; height: 8px; width: var(--w); border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--sm-accent) 45%, transparent), var(--sm-accent)); transform-origin: left; animation: v105-growx .7s var(--sm-ease-out, ease-out) both; }
.sm-recap-bar.is-lead span { color: inherit; font-weight: 700; }
.sm-recap-bar b { font-variant-numeric: tabular-nums; font-size: .74rem; }
@keyframes v105-growx { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .sm-podium-crown, .sm-recap-bar i, .sm-rk-list .sm-rk-row, .sm-podium .sm-podium-card { animation: none; } }
:root[data-theme="light"] .sm-podium-avatar { color: #1a1406; }
.sm-rank-trend-chart:has(.sm-recap-bars) { height: auto; overflow: visible; }
.hs-score svg.hs-ring { width: 64px; height: 64px; max-width: none; }

/* ---------- Practice graphic ---------- */
.practice-art { margin: 0 auto 12px; max-width: 320px; display: grid; gap: 6px; justify-items: center; }
.practice-art svg { width: 100%; height: auto; display: block; }
.practice-art figcaption { color: var(--sm-muted); font-size: .76rem; font-weight: 600; text-align: center; }
.practice-art .pa-p { animation: v105-hop 2.8s ease-in-out infinite; animation-delay: var(--d); transform-box: fill-box; }
@keyframes v105-hop { 0%, 70%, 100% { translate: 0 0; } 80% { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) { .practice-art .pa-p { animation: none; } }

/* ---------- Stats tables fit a 360px phone (no clipped last column) ---------- */
.sm-ts .v1-table { width: 100%; font-size: .78rem; }
.sm-ts .v1-table th, .sm-ts .v1-table td { padding-left: 5px; padding-right: 5px; white-space: nowrap; }
.sm-ts .v1-table th:first-child, .sm-ts .v1-table td:first-child { max-width: 128px; overflow: hidden; text-overflow: ellipsis; padding-left: 0; }
.sm-ts .v1-table td:first-child .text-btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; display: inline-block; }
.sm-ts .v1-table th:not(:first-child), .sm-ts .v1-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

/* light theme contrast */
:root[data-theme="light"] .place-2 .sm-podium-rank { color: #5f6875; text-shadow: none; }
:root[data-theme="light"] .place-3 .sm-podium-rank { color: #a35f1c; }
:root[data-theme="light"] .place-1 .sm-podium-rank { color: #a87400; text-shadow: none; }
:root[data-theme="light"] .sm-podium-crown { color: #d9a400; text-shadow: none; }
:root[data-theme="light"] .practice-art .pa-p > circle, :root[data-theme="light"] .practice-art .pa-p > path:first-of-type { stroke: #2a55b8; stroke-width: 1.5; }
