/* =============================================================================
   SOF2 Stats Hub
   Uses the editorial-gaming redesign palette when present (--sof-*), with fallbacks.
   ============================================================================= */

.sof2s,
.sof2s-page,
.sof2s-embed {
  --sof2s-bg: var(--sof-bg, #0b1014);
  --sof2s-bg2: var(--sof-bg2, #10171c);
  --sof2s-panel: var(--sof-panel, #151d22);
  --sof2s-panel2: var(--sof-panel2, #192329);
  --sof2s-line: var(--sof-line, #2a363a);
  --sof2s-gold: var(--sof-gold, #d3a45d);
  --sof2s-gold2: var(--sof-gold2, #f2ce8d);
  --sof2s-text: var(--sof-text, #eef0ed);
  --sof2s-muted: var(--sof-muted, #a8b3b2);
  --sof2s-dim: var(--sof-dim, #758380);
  --sof2s-green: var(--sof-green, #83c690);
  --sof2s-red: #e0675c;
  --sof2s-blue: #6fa3dc;
  --sof2s-radius: var(--sof-radius, 13px);
}

.sof2s { color: var(--sof2s-text); }
.sof2s-block { margin: 0 0 1em; }
.sof2s a { color: var(--sof2s-gold2); text-decoration: none; }
.sof2s a:hover { color: #fff; }
.sof2s small { color: var(--sof2s-dim); font-size: .82em; }
.sof2s-muted, .sof2s .sof2s-muted { color: var(--sof2s-muted); }
.sof2s-empty { font-style: italic; margin: .4em 0; }
.sof2s strong { color: var(--sof2s-text); }
.sof2s-eyebrow { color: var(--sof2s-gold2); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .35em; }
.sof2s-headline { font-size: 1.05rem; margin: 0 0 .9em; }

.sof2s-verified { color: var(--sof2s-green); font-size: .85em; }
/* In-game names: uncoloured parts are white (as in game), never the link colour. */
.sof2s-name { color: #f1f3f1; }
a .sof2s-name, .sof2s a .sof2s-name { color: #f1f3f1; }
a:hover .sof2s-name { text-decoration: underline; text-decoration-color: var(--sof2s-gold, #d3a45d); text-underline-offset: 3px; }
.sof2s-red { color: var(--sof2s-red); }
.sof2s-blue { color: var(--sof2s-blue); }
.sof2s-flag { display: inline-block; vertical-align: -1px; border-radius: 2px; margin-right: 3px; }
.sof2s code, .sof2s-address { background: var(--sof2s-bg2); border: 1px solid var(--sof2s-line); border-radius: 5px; padding: 2px 6px; color: var(--sof2s-muted); font-size: .85em; }

/* Buttons */
.sof2s-btn,
.sof2s button.sof2s-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 7px; border: 1px solid #b98d52;
  background: var(--sof2s-gold); color: #141410 !important; font-weight: 800; font-size: .85rem; line-height: 1.2;
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.sof2s-btn:hover { background: var(--sof2s-gold2); color: #141410 !important; }
.sof2s-copy { background: #1a2428; color: var(--sof2s-text) !important; border-color: #4b5753; font-weight: 700; padding: 5px 10px; font-size: .78rem; }
.sof2s-copy:hover { border-color: var(--sof2s-gold); background: #233034; color: var(--sof2s-gold2) !important; }
.sof2s-copy.is-copied { border-color: var(--sof2s-green); color: var(--sof2s-green) !important; justify-content: center; overflow: hidden; box-sizing: border-box; }

/* "Copied /connect …" notice (appended to <body>, so no .sof2s variables here). */
.sof2s-toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 100001;
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box;
  padding: 12px 18px 12px 14px; border-radius: 12px;
  background: #151d22; border: 1px solid #3f6b47; box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  color: #eef0ed; font-size: 1rem; line-height: 1.35;
  opacity: 0; visibility: hidden; transform: translate(-50%, 16px);
  transition: opacity .2s, transform .2s, visibility 0s linear .2s;
  pointer-events: none;
}
.sof2s-toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .2s, transform .2s; }
.sof2s-toast-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(47, 91, 56, .4); border: 1px solid #4f8f5c; color: #83c690; font-weight: 800; font-size: 1.1rem; }
.sof2s-toast-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sof2s-toast-cmd { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 1rem; font-weight: 700; color: #f2ce8d; background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.sof2s-toast-msg { color: #a8b3b2; font-size: .92rem; }
@media (prefers-reduced-motion: reduce) {
  .sof2s-toast, .sof2s-toast.is-visible { transition: none; transform: translate(-50%, 0); }
}
.sof2s-btn-red { background: #8b332d; border-color: #b8463e; color: #fff !important; }
.sof2s-btn-blue { background: #284c74; border-color: #3f6f9f; color: #fff !important; }
.sof2s-btn-danger { background: #5a1f1b; border-color: #8b332d; color: #fff !important; }

/* Pills & status */
.sof2s-pill { display: inline-block; padding: 3px 8px; border: 1px solid var(--sof2s-line); border-radius: 5px; background: #202a2c; color: var(--sof2s-muted); font-size: .7rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.sof2s-pill.is-offline { color: var(--sof2s-red); border-color: #5a2a26; }
.sof2s-status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: .8rem; border: 1px solid var(--sof2s-line); background: var(--sof2s-bg2); }
.sof2s-status-on { color: var(--sof2s-green); border-color: #3f6b47; box-shadow: 0 0 14px rgba(131, 198, 144, .18); }
.sof2s-status-warming { color: var(--sof2s-gold2); border-color: #6b5530; }
.sof2s-status-quiet { color: var(--sof2s-muted); }

/* Layout */
.sof2s-grid { display: grid; gap: 18px; margin: 0 0 18px; }
.sof2s-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sof2s-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sof2s-grid > .sof2s-card { margin: 0; }

.sof2s-card { background: var(--sof2s-panel); border: 1px solid var(--sof2s-line); border-radius: var(--sof2s-radius); padding: 18px 20px; margin: 0 0 18px; min-width: 0; }
.sof2s-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--sof2s-line); padding-bottom: 9px; margin-bottom: 12px; }
.sof2s-card-title { margin: 0; font-size: 1.02rem; font-weight: 800; color: var(--sof2s-text); padding-left: 11px; position: relative; }
.sof2s-card-title::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px; border-radius: 2px; background: var(--sof2s-gold); }
.sof2s-more { font-size: .8rem; font-weight: 700; }
.sof2s-card-body > :last-child { margin-bottom: 0; }

/* Tiles */
.sof2s-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 18px; }
.sof2s-tile { background: linear-gradient(135deg, #202b2e, #151d21); border: 1px solid #36403e; border-radius: var(--sof2s-radius); padding: 14px 16px; }
.sof2s-tile-value { font-size: 1.9rem; font-weight: 850; line-height: 1.05; color: var(--sof2s-gold2); }
.sof2s-tile-label { color: var(--sof2s-muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-top: 4px; }
.sof2s-tile-sub { color: var(--sof2s-dim); font-size: .75rem; margin-top: 2px; }

/* Lists */
.sof2s-list { list-style: none; margin: 0; padding: 0; }
.sof2s-list li { padding: 7px 0; border-top: 1px solid var(--sof2s-line); }
.sof2s-list li:first-child { border-top: 0; padding-top: 0; }
.sof2s-list small { display: block; }
.sof2s-list li > small:first-of-type { display: inline; }

.sof2s-leaderboard { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.sof2s-leaderboard li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--sof2s-line); }
.sof2s-leaderboard li:first-child { border-top: 0; }
.sof2s-rank { width: 24px; flex: none; color: var(--sof2s-gold); font-weight: 900; font-size: .8rem; }
.sof2s-leaderboard li:nth-child(1) .sof2s-rank::before { content: "🥇"; }
.sof2s-leaderboard li:nth-child(2) .sof2s-rank::before { content: "🥈"; }
.sof2s-leaderboard li:nth-child(3) .sof2s-rank::before { content: "🥉"; }
.sof2s-leaderboard li:nth-child(-n+3) .sof2s-rank { font-size: 0; }
.sof2s-leaderboard li:nth-child(-n+3) .sof2s-rank::before { font-size: 1rem; }
.sof2s-lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sof2s-lvalue { font-weight: 800; color: var(--sof2s-gold2); white-space: nowrap; }

.sof2s-barlist { list-style: none; margin: 0; padding: 0; }
.sof2s-barlist li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto; align-items: center; gap: 10px; padding: 5px 0; }
.sof2s-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.sof2s-bar-track { height: 8px; border-radius: 4px; background: var(--sof2s-bg2); overflow: hidden; }
.sof2s-bar-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #896f4e, #e4bc79); }
.sof2s-bar-value { color: var(--sof2s-muted); font-size: .8rem; font-weight: 700; text-align: right; white-space: nowrap; }

/* Feed */
.sof2s-feed { list-style: none; margin: 0; padding: 0; }
.sof2s-event { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--sof2s-line); }
.sof2s-event:first-child { border-top: 0; padding-top: 0; }
.sof2s-event-icon { width: 22px; flex: none; text-align: center; }
.sof2s-event-text { min-width: 0; font-size: .9rem; }
.sof2s-event-text a { color: var(--sof2s-text); }
.sof2s-event-text a:hover { color: var(--sof2s-gold2); }
.sof2s-event-text small { display: block; }
.sof2s-event-game_on .sof2s-event-text, .sof2s-event-record .sof2s-event-text { font-weight: 700; }

/* Ticker */
.sof2s-ticker { position: relative; overflow: hidden; background: #11191d; border: 1px solid var(--sof2s-line); border-radius: 8px; margin: 0 0 18px; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.sof2s-ticker-track { display: inline-flex; white-space: nowrap; animation: sof2s-ticker 60s linear infinite; padding: 9px 0; }
.sof2s-ticker:hover .sof2s-ticker-track { animation-play-state: paused; }
.sof2s-ticker-item { padding: 0 26px; font-size: .88rem; color: #d7dedb; border-right: 1px solid var(--sof2s-line); }
@keyframes sof2s-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .sof2s-ticker-track { animation: none; flex-wrap: wrap; white-space: normal; } }

/* Split bar */
.sof2s-split { height: 10px; border-radius: 6px; background: #3a2f2c; overflow: hidden; margin: 4px 0; }
.sof2s-split-h { display: block; height: 100%; background: linear-gradient(90deg, #4f8f5c, var(--sof2s-green)); }
.sof2s-split-legend { font-size: .85rem; color: var(--sof2s-muted); }

/* Server list table */
.sof2s-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 12px; font-size: .88rem; }
.sof2s-controls input[type="search"], .sof2s-controls select { background: #10171a; border: 1px solid #495550; color: var(--sof2s-text); border-radius: 6px; padding: 6px 10px; min-width: 220px; }
.sof2s-controls select { min-width: 0; }
.sof2s-controls label { display: inline-flex; align-items: center; gap: 6px; color: var(--sof2s-muted); cursor: pointer; }
.sof2s-count-visible { margin-left: auto; color: var(--sof2s-dim); font-size: .8rem; }
.sof2s-table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--sof2s-line); border-radius: var(--sof2s-radius); }
.sof2s-table { width: 100%; border-collapse: collapse; margin: 0; background: var(--sof2s-panel); font-size: .88rem; }
.sof2s-table th { background: var(--sof2s-panel2); color: var(--sof2s-dim); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; text-align: left; padding: 0; border-bottom: 1px solid var(--sof2s-line); white-space: nowrap; }
.sof2s-table th button { all: unset; display: block; padding: 10px 12px; cursor: pointer; }
.sof2s-table th button:hover, .sof2s-table th.is-sorted button { color: var(--sof2s-gold2); }
.sof2s-table th:not([data-sort]) { padding: 10px 12px; }
.sof2s-table td { padding: 9px 12px; border-top: 1px solid var(--sof2s-line); vertical-align: middle; color: #d3dbd6; }
.sof2s-table .num { text-align: right; }
.sof2s-table th.num button { text-align: right; }
.sof2s-table tbody tr:hover td { background: #1b252a; }
.sof2s-table tr.is-home td { background: rgba(211, 164, 93, .08); }
.sof2s-table tr.is-offline td { opacity: .55; }
.sof2s-table tr.is-botonly .sof2s-humans { color: var(--sof2s-dim); }
.sof2s-table .sof2s-humans strong { color: var(--sof2s-green); font-size: 1.05em; }
.sof2s-col-name { min-width: 220px; }
.sof2s-col-spark { width: 96px; }
.sof2s-col-join { white-space: nowrap; }
.sof2s-col-join .sof2s-copy { margin: 1px 0; }
.sof2s-table tr.is-hidden { display: none; }

/* Server card */
.sof2s-server-card { display: grid; grid-template-columns: 200px minmax(0, 1fr); background: var(--sof2s-panel); border: 1px solid var(--sof2s-line); border-radius: var(--sof2s-radius); overflow: hidden; margin: 0 0 14px; }
.sof2s-server-card.is-offline { opacity: .7; }
.sof2s-server-map { position: relative; min-height: 150px; background: #142022 center/cover no-repeat; }
.sof2s-server-map::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15, 24, 24, .75), rgba(13, 21, 24, .05)); }
.sof2s-map-label { position: absolute; z-index: 1; bottom: 10px; left: 10px; background: rgba(16, 24, 28, .87); border: 1px solid rgba(120, 132, 116, .45); padding: 3px 8px; border-radius: 4px; font-size: .72rem; font-weight: 800; color: var(--sof2s-gold2); }
.sof2s-server-body { padding: 14px 18px; min-width: 0; }
.sof2s-server-name { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.25; }
.sof2s-server-name a { color: var(--sof2s-text); }
.sof2s-server-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sof2s-counts { display: flex; flex-wrap: wrap; gap: 16px; color: var(--sof2s-muted); font-size: .88rem; }
.sof2s-counts strong { color: var(--sof2s-gold2); font-size: 1.15rem; }
.sof2s-scoreline { margin-top: 6px; font-weight: 800; font-size: 1.05rem; }
.sof2s-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

/* Scoreboard */
.sof2s-scoreboard { display: grid; gap: 12px; margin: 0 0 12px; }
.sof2s-scoreboard.is-team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sof2s-team { border: 1px solid var(--sof2s-line); border-radius: 10px; overflow: hidden; background: var(--sof2s-bg2); }
.sof2s-team-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--sof2s-panel2); border-bottom: 1px solid var(--sof2s-line); font-weight: 800; }
.sof2s-team-red .sof2s-team-head { background: linear-gradient(90deg, #5a1f1b, #3a1714); border-color: #8b332d; }
.sof2s-team-blue .sof2s-team-head { background: linear-gradient(90deg, #1d3448, #162634); border-color: #3f6684; }
.sof2s-team-count { color: var(--sof2s-muted); font-size: .75rem; font-weight: 600; }
.sof2s-team-score { margin-left: auto; font-size: 1.3rem; color: #fff; }
.sof2s-plist { list-style: none; margin: 0; padding: 0; }
.sof2s-plist li { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--sof2s-line); font-size: .88rem; }
.sof2s-plist li:first-child { border-top: 0; }
.sof2s-plist li.is-bot { opacity: .6; }
.sof2s-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sof2s-pping { color: var(--sof2s-dim); font-size: .74rem; white-space: nowrap; }
.sof2s-pscore { min-width: 30px; text-align: right; font-weight: 850; color: var(--sof2s-gold2); }
.sof2s-specs { font-size: .85rem; color: var(--sof2s-muted); }

/* Matches */
.sof2s-matches { list-style: none; margin: 0; padding: 0; }
.sof2s-match a { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-top: 1px solid var(--sof2s-line); color: var(--sof2s-text); }
.sof2s-match:first-child a { border-top: 0; }
.sof2s-match a:hover .sof2s-match-info strong { color: var(--sof2s-gold2); }
.sof2s-match-score { min-width: 64px; text-align: center; font-weight: 900; font-size: 1.05rem; background: var(--sof2s-bg2); border: 1px solid var(--sof2s-line); border-radius: 7px; padding: 5px 8px; }
.sof2s-win-red .sof2s-match-score { border-color: #8b332d; }
.sof2s-win-blue .sof2s-match-score { border-color: #3f6684; }
.sof2s-match-info { min-width: 0; font-size: .9rem; }
.sof2s-match-info small { display: block; }

.sof2s-match-hero { text-align: center; padding: 36px 20px; border: 1px solid var(--sof2s-line); border-radius: var(--sof2s-radius); background: var(--sof2s-panel) center/cover; margin: 0 0 18px; }
.sof2s-big-score { font-size: clamp(3rem, 8vw, 5rem); font-weight: 900; line-height: 1; letter-spacing: -.03em; }
.sof2s-big-score .sof2s-sep { color: var(--sof2s-dim); margin: 0 .2em; font-weight: 300; }
.sof2s-result { margin-top: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--sof2s-gold2); }
.sof2s-team-points { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin: 8px 0; }
.sof2s-team-points strong { color: var(--sof2s-gold2); }
.sof2s-match-meta { margin-top: 10px; color: var(--sof2s-muted); font-size: .9rem; }

/* Players */
.sof2s-player-card .sof2s-player-name { font-size: 1.15rem; font-weight: 800; }
.sof2s-online { color: var(--sof2s-green); font-size: .9rem; }
.sof2s-mini-stats { display: flex; gap: 14px; margin: 8px 0; color: var(--sof2s-muted); font-size: .85rem; }
.sof2s-mini-stats strong { color: var(--sof2s-gold2); }
.sof2s-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.sof2s-badge { display: inline-flex; align-items: center; gap: 6px; background: #403220; border: 1px solid #876a42; border-radius: 6px; padding: 3px 8px; font-size: .9rem; cursor: help; }
.sof2s-badge span { font-size: .78rem; font-weight: 700; color: var(--sof2s-gold2); }
.sof2s-achievements { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sof2s-achievements li { display: flex; align-items: center; gap: 12px; background: var(--sof2s-bg2); border: 1px solid var(--sof2s-line); border-radius: 10px; padding: 10px 12px; }
.sof2s-ach-icon { font-size: 1.6rem; }
.sof2s-achievements small { display: block; }
.sof2s-ach-count { margin-left: auto; color: var(--sof2s-dim); font-size: .75rem; white-space: nowrap; }
.sof2s-player-status { font-size: 1rem; }

.sof2s-wrapped { background: radial-gradient(ellipse at top left, rgba(211, 164, 93, .18), transparent 60%), var(--sof2s-bg2); border: 1px solid #6b5530; border-radius: var(--sof2s-radius); padding: 20px; }
.sof2s-wrapped-name { font-size: 1.5rem; font-weight: 900; margin-bottom: 12px; }

/* Where to play / waiting */
.sof2s-where-name { font-size: 1.15rem; font-weight: 800; margin: 2px 0; }
/* Someone's waiting: a lone human vs bots. */
.sof2s-waiting {
  position: relative; overflow: hidden; margin: 0 0 18px; padding: 16px 18px 6px;
  background: linear-gradient(100deg, rgba(131, 198, 144, .09), rgba(131, 198, 144, 0) 45%), var(--sof2s-panel);
  border: 1px solid var(--sof2s-line); border-left: 4px solid var(--sof2s-green); border-radius: var(--sof2s-radius);
}
.sof2s-waiting-head { display: flex; align-items: center; gap: 10px; color: var(--sof2s-green); font-size: .92rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.sof2s-waiting-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sof2s-green); box-shadow: 0 0 0 0 rgba(131, 198, 144, .6); animation: sof2s-waiting-pulse 1.8s infinite; }
@keyframes sof2s-waiting-pulse { 70% { box-shadow: 0 0 0 10px rgba(131, 198, 144, 0); } 100% { box-shadow: 0 0 0 0 rgba(131, 198, 144, 0); } }
.sof2s-waiting-list { list-style: none; margin: 0; padding: 0; }
.sof2s-waiting-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 0; }
.sof2s-waiting-item + .sof2s-waiting-item { border-top: 1px solid var(--sof2s-line); }
.sof2s-waiting-map { width: 84px; height: 54px; border-radius: 8px; overflow: hidden; background: var(--sof2s-bg2); border: 1px solid var(--sof2s-line); display: grid; place-items: center; }
.sof2s-waiting-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sof2s-waiting-map span { color: var(--sof2s-dim); font-size: .72rem; font-weight: 700; padding: 0 4px; text-align: center; overflow-wrap: anywhere; }
.sof2s-waiting-who { font-size: 1.12rem; color: var(--sof2s-muted); line-height: 1.35; }
.sof2s-waiting-who .sof2s-player-link, .sof2s-waiting-who > .sof2s-name { font-weight: 800; font-size: 1.18rem; }
.sof2s-waiting-who strong { color: var(--sof2s-text); }
.sof2s-waiting-where { margin-top: 3px; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sof2s-waiting-join { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.sof2s-waiting .sof2s-waiting-join .sof2s-copy { background: var(--sof2s-green); border-color: #a5d9ae; color: #0d1a10 !important; font-weight: 800; font-size: .92rem; padding: 9px 15px; }
.sof2s-waiting .sof2s-waiting-join .sof2s-copy:hover { background: #a5d9ae; color: #0d1a10 !important; }
.sof2s-waiting .sof2s-waiting-join .sof2s-copy.is-copied { background: transparent; color: var(--sof2s-green) !important; }
@media (max-width: 640px) {
  .sof2s-waiting-item { grid-template-columns: auto minmax(0, 1fr); }
  .sof2s-waiting-map { width: 64px; height: 44px; }
  .sof2s-waiting-join { grid-column: 1 / -1; justify-content: stretch; }
  .sof2s-waiting .sof2s-waiting-join .sof2s-copy { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .sof2s-waiting-dot { animation: none; } }

/* Forms */
.sof2s-form { margin: 10px 0; }
.sof2s-form label { display: inline-flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--sof2s-muted); margin: 0 8px 8px 0; vertical-align: bottom; }
.sof2s-form input[type="text"], .sof2s-form input[type="url"], .sof2s-form select, .sof2s-form textarea, .sof2s-search input { background: #10171a; border: 1px solid #495550; color: var(--sof2s-text); border-radius: 6px; padding: 7px 10px; font: inherit; }
.sof2s-form textarea { width: 100%; }
.sof2s-form label:has(textarea) { display: flex; }
.sof2s-form-msg { margin-top: 8px; font-size: .88rem; }
.sof2s-form-msg.is-ok { color: var(--sof2s-green); }
.sof2s-form-msg.is-error { color: var(--sof2s-red); }
.sof2s-search { display: flex; gap: 8px; margin: 0 0 16px; }
.sof2s-search input { flex: 1; max-width: 420px; }
.sof2s-code { height: auto !important; min-height: 0 !important; resize: vertical; width: 100%; background: #10171a; color: var(--sof2s-muted); border: 1px solid #495550; border-radius: 6px; font: 12px/1.4 ui-monospace, monospace; padding: 8px; }

/* Play / My SoF2 */
.sof2s-server-map.no-image { display: grid; place-items: center; background: repeating-linear-gradient(135deg, #141c21 0 14px, #11181c 14px 28px); }
.sof2s-server-map.no-image::after { display: none; }
.sof2s-server-map.no-image .sof2s-map-label { position: static; font-size: .95rem; padding: 6px 12px; }
.sof2s-rsvp .sof2s-list small { display: block; }
.sof2s-steps { margin: 0; padding-left: 1.3em; }
.sof2s-steps li { margin: 0 0 .5em; }
.sof2s-inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 0 8px; }
.sof2s-you { color: var(--sof2s-green); font-weight: 800; font-size: .85rem; margin-left: 6px; }
.sof2s-list li.is-mine strong { color: var(--sof2s-green); }
.sof2s-big-line { font-size: 1.15rem; font-weight: 700; }
.sof2s-benefits li { padding: 9px 0; }
.sof2s-login-card input[type="text"], .sof2s-login-card input[type="password"] { width: 100%; background: #10171a; border: 1px solid #495550; color: var(--sof2s-text); border-radius: 6px; padding: 9px 12px; }
.sof2s-login-card .login-submit input { background: var(--sof2s-gold); border: 1px solid #b98d52; color: #141410; font-weight: 800; border-radius: 7px; padding: 9px 18px; cursor: pointer; }
.sof2s-live-games .sof2s-server-card { margin-bottom: 10px; }
.sof2s-live.is-updated { animation: sof2s-flash 1.2s ease; }
@keyframes sof2s-flash { 0% { color: #fff; text-shadow: 0 0 18px rgba(131, 198, 144, .9); } 100% { text-shadow: none; } }

/* Charts */
.sof2s-spark { display: inline-block; vertical-align: middle; overflow: visible; }
.sof2s-spark-area { fill: rgba(211, 164, 93, .18); }
.sof2s-spark-line { fill: none; stroke: #e4bc79; stroke-width: 1.6; stroke-linejoin: round; }
.sof2s-spark-dot { fill: var(--sof2s-gold2, #f2ce8d); }
.sof2s-chart { display: block; width: 100%; height: auto; }

.sof2s-chart line.sof2s-gridline { stroke: rgba(255, 255, 255, .07); }
.sof2s-axis { fill: var(--sof2s-dim, #758380); font-size: 10px; font-family: inherit; }
.sof2s-area-fill { fill: rgba(211, 164, 93, .16); }
.sof2s-area-line { fill: none; stroke: #e4bc79; stroke-width: 2; stroke-linejoin: round; }
.sof2s-peak { fill: var(--sof2s-gold2, #f2ce8d); stroke: #0b1014; stroke-width: 2; }
.sof2s-bar { fill: #c49a5c; }
.sof2s-bar:hover, .sof2s-heat:hover { fill: #f2ce8d; }
.sof2s-heat { fill: #d3a45d; }
.sof2s-heatmap { max-width: 720px; }

/* Replay */
.sof2s-replay-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sof2s-replay-time { font-weight: 800; color: var(--sof2s-gold2); font-variant-numeric: tabular-nums; }
.sof2s-replay-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 34px; align-items: center; gap: 10px; padding: 4px 0; font-size: .85rem; }
.sof2s-replay-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sof2s-replay-track { height: 14px; background: var(--sof2s-bg2); border-radius: 7px; overflow: hidden; }
.sof2s-replay-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4f8f5c, var(--sof2s-green)); border-radius: 7px; transition: width .25s ease; }
.sof2s-replay-n { text-align: right; font-weight: 800; }

/* Pages */
.sof2s-page-header { margin: 0 0 18px; }
.sof2s-page-title { margin: 4px 0 4px; font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 900; letter-spacing: -.02em; color: var(--sof2s-text, #eef0ed); }
.sof2s-page-sub { color: var(--sof2s-muted, #a8b3b2); margin: 0; }
.sof2s-crumbs { font-size: .8rem; color: var(--sof2s-dim, #758380); }
.sof2s-crumbs a { color: var(--sof2s-gold2, #f2ce8d); }
.sof2s-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid #947447; margin: 0 0 18px; }
.sof2s-tabs a { padding: 9px 14px; border-radius: 7px 7px 0 0; font-weight: 750; color: #e5e9e6; }
.sof2s-tabs a:hover, .sof2s-tabs a.is-current { background: #2d393b; color: var(--sof2s-gold2); }
.sof2s-pager { display: flex; gap: 8px; justify-content: center; }
.sof2s-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .9rem; }
.sof2s-dl dt { color: var(--sof2s-dim); }
.sof2s-dl dd { margin: 0; overflow-wrap: anywhere; }
.sof2s-fact { font-style: italic; color: var(--sof2s-muted); transition: opacity .3s; }
.sof2s-stats-page #primary { width: 100%; float: none; }

/* Embed */
.sof2s-embed .sof2s-server-card { grid-template-columns: 1fr; }
.sof2s-embed .sof2s-server-map { min-height: 110px; }
.sof2s-embed .sof2s-scoreboard.is-team { grid-template-columns: 1fr; }

/* Responsive */
@media (max-width: 1100px) {
  .sof2s-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 782px) {
  .sof2s-grid-2, .sof2s-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .sof2s-server-card { grid-template-columns: 1fr; }
  .sof2s-server-map { min-height: 120px; }
  .sof2s-scoreboard.is-team { grid-template-columns: 1fr; }
  .sof2s-controls input[type="search"] { min-width: 0; flex: 1 1 100%; }
  .sof2s-count-visible { margin-left: 0; }
  .sof2s-tile-value { font-size: 1.5rem; }
  .sof2s-replay-row { grid-template-columns: minmax(90px, 140px) 1fr 28px; }
  .sof2s-col-spark { display: none; }
}
