/* ScrimMate v1.0.6: standings tools, leaderboard movement, head-to-head, achievement badges. */

@keyframes v106-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes v106-ring { from { stroke-dashoffset: 213.6; } }
@keyframes v106-shine { 0%, 70% { transform: translateX(-120%) rotate(18deg); } 100% { transform: translateX(220%) rotate(18deg); } }
@media (prefers-reduced-motion: reduce) { .v106-badge, .v106-badge__ring, .v106-badge--t4::after, .v106-h2h__bar i, .v106-mv { animation: none !important; transition: none !important; } }

/* ---------- Tags ---------- */
.v106-tag { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 1px 6px; border-radius: 7px; font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.v106-tag--guest { background: rgb(122 167 255 / .16); color: #9dbdff; }
:root[data-theme="light"] .v106-tag--guest { color: #2a55b8; }

/* ---------- Leaderboard movement + gap ---------- */
.v106-rankcell { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.v106-mv { font-style: normal; font-size: .62rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; animation: v106-pop .4s var(--sm-ease-out, ease-out) both; }
.v106-mv--up { color: var(--sm-success, #3ccf8e); }
.v106-mv--down { color: var(--sm-danger, #ff6b6b); }
.v106-mv--same { color: var(--sm-muted); }
:root[data-theme="light"] .v106-mv--up { color: #137a4b; }
:root[data-theme="light"] .v106-mv--down { color: #b42318; }
.v106-gap { color: var(--sm-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.v106-excluded { margin-top: 12px; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--sm-line); background: var(--sm-glass); }
.v106-excluded h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .82rem; color: var(--sm-muted); }
.v106-excluded h4 svg { width: 16px; height: 16px; }
.v106-excluded p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 4px 0; font-size: .84rem; }
.v106-excluded p small { color: var(--sm-muted); font-size: .76rem; overflow-wrap: anywhere; }

/* ---------- Standings tools (manager) ---------- */
.v106-st h3 { display: flex; align-items: center; justify-content: flex-start; gap: 6px; }
.v106-st h3 svg { width: 18px; height: 18px; color: var(--sm-accent); }
.v106-st-sub { margin: 12px 0 6px; font-size: .84rem; }
.v106-st-sub small { color: var(--sm-muted); }
.v106-st-toggle { margin-top: 10px; }
.v106-st-list { margin-top: 8px; }
.v106-st-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; }
.v106-st-row .v18-row__main { min-width: 0; }
.v106-st-row .v18-row__main b { overflow-wrap: anywhere; }
.v106-st-row .v18-row__side { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.v106-st-row .btn svg { width: 16px; height: 16px; }
.v106-st-rank { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--sm-glass-raised); font-weight: 800; font-size: .8rem; font-variant-numeric: tabular-nums; }
.v106-st-row.is-excluded { opacity: .78; border-style: dashed; }
.v106-st-row.is-guest .v106-st-rank { color: #9dbdff; }
@media (max-width: 380px) { .v106-st-row:has([data-st-merge]) .v18-row__side { grid-column: 2 / -1; justify-content: flex-start; } }
.v106-form { display: grid; gap: 12px; }
.v106-switch { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--sm-line); background: var(--sm-glass); cursor: pointer; }
.v106-switch input { margin-top: 3px; accent-color: var(--sm-accent); width: 18px; height: 18px; flex: none; }
.v106-switch span { display: grid; gap: 2px; }
.v106-switch small { color: var(--sm-muted); font-size: .76rem; }
.v106-filter { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--sm-line); background: var(--sm-glass); color: inherit; font: inherit; }
.v106-filter input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; outline: none; }
.v106-filter svg { width: 18px; height: 18px; color: var(--sm-muted); flex: none; }
.v106-merge-list { max-height: 46vh; overflow-y: auto; display: grid; gap: 6px; }

/* ---------- Head-to-head ---------- */
.v106-h2h { display: grid; gap: 12px; }
.v106-h2h__picks { display: flex; flex-wrap: wrap; gap: 6px; }
.v106-h2h__pick { display: grid; gap: 1px; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--sm-line); background: var(--sm-glass-raised); color: inherit; font: inherit; cursor: pointer; max-width: 100%; transition: border-color var(--sm-motion-fast, 140ms), transform var(--sm-motion-fast, 140ms); }
.v106-h2h__pick:active { transform: scale(.97); }
.v106-h2h__pick b { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v106-h2h__pick small { color: var(--sm-muted); font-size: .72rem; }
.v106-h2h__pick.is-on { border-color: var(--sm-accent); background: color-mix(in srgb, var(--sm-accent) 14%, transparent); }
.v106-h2h__teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 14px 12px; border-radius: 18px; animation: v106-pop .35s var(--sm-ease-out, ease-out) both;
  background: linear-gradient(90deg, color-mix(in srgb, var(--sm-accent) 20%, transparent), transparent 45%, transparent 55%, rgb(122 167 255 / .2)); border: 1px solid var(--sm-line); }
.v106-h2h__teams span { display: grid; gap: 2px; min-width: 0; }
.v106-h2h__teams span.b { text-align: right; }
.v106-h2h__teams b { font-size: 1rem; overflow-wrap: anywhere; }
.v106-h2h__teams small { color: var(--sm-muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v106-h2h__teams em { font-style: normal; font-weight: 900; font-size: .8rem; letter-spacing: .08em; padding: 6px 8px; border-radius: 10px; background: var(--sm-glass-raised); }
.v106-h2h__verdict { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; font-size: .9rem; }
.v106-h2h__verdict svg { width: 18px; height: 18px; color: #f6c445; flex: none; }
.v106-h2h__stat { display: grid; gap: 5px; }
.v106-h2h__nums { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.v106-h2h__nums span { color: var(--sm-muted); font-size: .74rem; text-align: center; }
.v106-h2h__nums b:last-child { text-align: right; }
.v106-h2h__nums b.is-lead { color: var(--sm-accent); }
.v106-h2h__nums b:last-child.is-lead { color: #7aa7ff; }
:root[data-theme="light"] .v106-h2h__nums b:last-child.is-lead { color: #2a55b8; }
.v106-h2h__bar { display: flex; gap: 3px; height: 8px; }
.v106-h2h__bar i { display: block; height: 100%; border-radius: 6px; transition: width .6s var(--sm-ease-out, ease-out); }
.v106-h2h__bar i.a { background: linear-gradient(90deg, color-mix(in srgb, var(--sm-accent) 55%, transparent), var(--sm-accent)); }
.v106-h2h__bar i.b { background: linear-gradient(90deg, #7aa7ff, rgb(122 167 255 / .5)); }
.v106-h2h__sub { margin: 6px 0 0; font-size: .84rem; }
.v106-h2h__sub small { color: var(--sm-muted); font-weight: 500; }
.v106-h2h__recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.v106-h2h__recent li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--sm-line); background: var(--sm-glass); }
.v106-h2h__recent li > span:first-child { display: grid; gap: 2px; min-width: 0; }
.v106-h2h__recent b { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v106-h2h__recent small { color: var(--sm-muted); font-size: .72rem; }
.v106-h2h__pl { display: flex; gap: 4px; flex: none; }
.v106-h2h__pl i { font-style: normal; font-weight: 800; font-size: .76rem; min-width: 30px; text-align: center; padding: 3px 6px; border-radius: 8px; background: var(--sm-glass-raised); font-variant-numeric: tabular-nums; }
.v106-h2h__pl i:first-child.is-lead { background: color-mix(in srgb, var(--sm-accent) 26%, transparent); }
.v106-h2h__pl i:last-child.is-lead { background: rgb(122 167 255 / .28); }

/* ---------- Achievement badges ---------- */
.v106-ach { display: grid; gap: 12px; }
.v106-ach__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.v106-ach__head div { display: grid; gap: 2px; }
.v106-ach__head b { font-size: 1.6rem; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.v106-ach__head b small { font-size: .9rem; color: var(--sm-muted); font-weight: 700; }
.v106-ach__head span { color: var(--sm-muted); font-size: .74rem; }
.v106-ach__score { text-align: right; }
.v106-ach__score b { font-size: 1.1rem; color: #f6c445; }
:root[data-theme="light"] .v106-ach__score b { color: #8a5d00; }
.v106-ach__nudge { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--sm-accent) 12%, transparent); font-size: .8rem; }
.v106-ach__nudge svg { width: 16px; height: 16px; color: var(--sm-accent); flex: none; }
.v106-ach__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 360px) { .v106-ach__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.v106-badge { --tier: #6b7280; position: relative; overflow: hidden; display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 16px; border: 1px solid var(--sm-line); background: var(--sm-glass-raised); color: inherit; font: inherit; cursor: pointer; text-align: center;
  animation: v106-pop .42s var(--sm-ease-out, ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); transition: transform var(--sm-motion-fast, 140ms), border-color var(--sm-motion-fast, 140ms); }
.v106-badge:active { transform: scale(.95); }
.v106-badge b { font-size: .7rem; line-height: 1.15; overflow-wrap: anywhere; }
.v106-badge small { font-size: .6rem; line-height: 1.2; }
.v106-badge__tier { color: var(--tier); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.v106-badge__next { color: var(--sm-muted); }
.v106-badge--t0 { opacity: .62; }
.v106-badge--t0 .v106-badge__art { filter: grayscale(1); }
.v106-badge--t1 { --tier: #d08a4f; }
.v106-badge--t2 { --tier: #b8c4d6; }
.v106-badge--t3 { --tier: #f6c445; border-color: rgb(246 196 69 / .45); }
.v106-badge--t4 { --tier: #c084fc; border-color: rgb(192 132 252 / .55); background: linear-gradient(160deg, rgb(192 132 252 / .16), var(--sm-glass-raised) 60%); }
.v106-badge--t4::after { content: ''; position: absolute; top: -20%; left: 0; width: 30%; height: 140%; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .22), transparent); animation: v106-shine 4s ease-in-out infinite; pointer-events: none; }
:root[data-theme="light"] .v106-badge--t1 { --tier: #9a5a22; }
:root[data-theme="light"] .v106-badge--t2 { --tier: #5b6b82; }
:root[data-theme="light"] .v106-badge--t3 { --tier: #8a5d00; }
:root[data-theme="light"] .v106-badge--t4 { --tier: #7e22ce; }
.v106-badge__art { position: relative; display: grid; place-items: center; width: 56px; height: 56px; }
.v106-badge__art--big { width: 96px; height: 96px; margin: 0 auto; }
.v106-badge__hex { position: absolute; inset: 0; width: 100%; height: 100%; }
.v106-badge__shape { fill: color-mix(in srgb, var(--tier) 22%, transparent); stroke: var(--tier); stroke-width: 2; }
.v106-badge__track { fill: none; stroke: rgb(255 255 255 / .08); stroke-width: 2.5; }
:root[data-theme="light"] .v106-badge__track { stroke: rgb(0 0 0 / .08); }
.v106-badge__ring { fill: none; stroke: var(--tier); stroke-width: 2.5; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 36px 36px; animation: v106-ring .9s var(--sm-ease-out, ease-out) both; }
.v106-badge__ic { position: relative; display: grid; place-items: center; color: var(--tier); }
.v106-badge__ic svg { width: 22px; height: 22px; }
.v106-badge__art--big .v106-badge__ic svg { width: 40px; height: 40px; }
.v106-ach--loading { grid-template-columns: repeat(4, 1fr); }
.v106-ach--loading i { height: 96px; border-radius: 16px; background: var(--sm-glass-raised); animation: sm-pulse 1.2s ease-in-out infinite alternate; }
.v106-badge-detail { display: grid; gap: 8px; text-align: center; }
.v106-badge-detail p { margin: 0; }
.v106-tiers { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.v106-tiers li { display: grid; gap: 2px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--sm-line); font-size: .74rem; opacity: .6; }
.v106-tiers li.is-done { opacity: 1; border-color: var(--tier); }
.v106-tiers li b { font-variant-numeric: tabular-nums; }
