/* ==========================================================================
   VZR Ladder page. Built on the gaming layer's frames and tokens (g2-base.css); the winter dress comes from
   xmas2-base.css automatically (body.xmas2). Rules under body.xmas2 below only add the few Ladder-specific winter touches.
   ========================================================================== */
body.lad-page {
  --lad-human: #6cb8ff;
  --lad-vamp: #c58cff;
  --lad-up: #5fe08f;
  --lad-down: #ff7d7d;
  --lad-gold: #ffd23f;
  --lad-silver: #d9e0ee;
  --lad-bronze: #e0a06a;
  --lad-line: rgba(201, 163, 106, .22);
}

.lad-main { width: min(1550px, 100%); max-width: 1550px; min-width: 0; box-sizing: border-box; padding-bottom: 28px; }
.lad-title, .lad-podiums, .lad-spots, .lad-board, .lad-rules { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.lad-main > * + *, #ladContent > * + * { margin-top: 14px; }
.lad-title .lad-summary { min-width: 190px; text-align: right; align-items: flex-end; }
.lad-title .lad-summary strong { font-variant-numeric: tabular-nums; }
.lad-updated { margin-top: 6px; max-width: 26ch; font: 11.5px/1.4 var(--g2-ui); color: var(--g2-dim); letter-spacing: .02em; }
.lad-updated.is-stale { color: #ffcf8a; }

/* ---------- loading / error ---------- */
.lad-loading-card { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 46px 16px; color: var(--g2-muted); font: 14px var(--g2-ui); }
.lad-loading-card i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 226, 170, .25); border-top-color: var(--g2-gold-hi); animation: lad-spin .9s linear infinite; }
.lad-loading-card p { margin: 0; }
@keyframes lad-spin { to { transform: rotate(360deg); } }
.lad-error { padding: 28px 22px; text-align: center; }
.lad-error h2 { margin: 0 0 8px; font: 800 22px var(--g2-serif); color: var(--g2-gold); }
.lad-error p { margin: 0 0 14px; color: var(--g2-muted); }

/* ---------- panel headings ---------- */
.lad-podium, .lad-board, .lad-rules { padding: 18px 20px 18px; }
.lad-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.lad-head h2 {
  display: flex; align-items: center; gap: 10px; margin: 0; font: 800 15px/1.2 var(--g2-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--g2-gold); text-shadow: 0 2px 0 #000;
}
.lad-head h2::before { content: ""; width: 8px; height: 8px; flex: none; transform: rotate(45deg); background: linear-gradient(135deg, #fff0c4, #b8893a); box-shadow: 0 0 8px rgba(255, 220, 140, .6); }
.lad-head p { margin: 0; flex: 1 1 260px; font: 12.5px/1.5 var(--g2-ui); color: var(--g2-muted); }
.lad-count { margin-left: auto; font: 800 11px var(--g2-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--g2-dim); }
.lad-link { margin-left: auto; padding: 4px 2px; border: 0; background: none; color: var(--g2-gold-hi); font: 800 11px var(--g2-ui); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; border-bottom: 1px solid transparent; }
.lad-link:hover { border-bottom-color: currentColor; }

/* ---------- podiums ---------- */
.lad-podiums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lad-podium::before { /* keeps the gaming layer's corner ornaments; the colour strip below says which side this is */ z-index: 3; }
.lad-podium[data-side="b"] { --side: var(--lad-human); }
.lad-podium[data-side="v"] { --side: var(--lad-vamp); }
.lad-podium { background-image: radial-gradient(70% 55% at 50% 100%, color-mix(in srgb, var(--side) 22%, transparent), transparent 75%), var(--g2-frame); }
.lad-podium .lad-head h2 { color: var(--side); filter: brightness(1.25); }
.lad-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; min-height: 250px; }
.lad-step { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.lad-step-body {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 12px; text-align: center; min-height: 148px;
  border: 1px solid var(--lad-line); border-bottom: 0; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
}
.lad-step.p1 .lad-step-body { min-height: 176px; border-color: rgba(255, 226, 150, .55); background: linear-gradient(180deg, rgba(255, 226, 150, .16), rgba(255, 255, 255, .03)); box-shadow: 0 -10px 28px rgba(255, 210, 90, .12); }
.lad-medal { width: 40px; height: 47px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55)); }
.lad-step.p1 .lad-medal { width: 50px; height: 59px; }
.lad-step-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.lad-step.p1 .lad-step-name { font-size: 17px; }
.lad-step-pts { font: 800 28px/1 var(--g2-serif); color: #fff4d0; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; }
.lad-step.p1 .lad-step-pts { font-size: 36px; color: #ffe08a; }
.lad-step-pts small { margin-left: 4px; font: 800 11px var(--g2-ui); letter-spacing: .1em; color: var(--g2-dim); text-transform: uppercase; }
.lad-step-sub { font: 700 11.5px var(--g2-ui); color: var(--g2-muted); }
.lad-plinth { height: 38px; border-radius: 0 0 6px 6px; border: 1px solid rgba(0, 0, 0, .55); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 10px 18px rgba(0, 0, 0, .45); position: relative; }
.lad-step.p1 .lad-plinth { height: 62px; background: linear-gradient(180deg, #ffe9a6, #c99a2a 60%, #8c6416); }
.lad-step.p2 .lad-plinth { height: 46px; background: linear-gradient(180deg, #f1f4fa, #a8b3c8 60%, #727d94); }
.lad-step.p3 .lad-plinth { height: 34px; background: linear-gradient(180deg, #f4cfa6, #c08652 60%, #7f4f26); }
.lad-step.is-empty .lad-step-body { min-height: 96px; justify-content: center; opacity: .6; }
.lad-step.is-empty .lad-plinth { background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06)); box-shadow: none; }
.lad-step-empty { font: 700 12px var(--g2-ui); color: var(--g2-dim); }

/* ---------- player name button, tags, pips, moves ---------- */
.lad-name { padding: 2px 0; border: 0; background: none; color: var(--g2-gold-hi); font: 800 14px/1.2 var(--g2-ui); letter-spacing: .01em; text-align: left; cursor: pointer; border-bottom: 1px solid transparent; }
.lad-name:hover, .lad-name:focus-visible { color: #fff; border-bottom-color: currentColor; }
.lad-new {
  display: inline-block; margin-left: 6px; padding: 2px 6px 1px; border-radius: 999px; border: 1px solid rgba(110, 215, 255, .6); background: rgba(40, 140, 190, .22);
  color: #aee9ff; font: 800 9px/1.3 var(--g2-ui); letter-spacing: .14em; text-transform: uppercase; vertical-align: middle; cursor: help;
}
.lad-pips { display: inline-flex; align-items: center; gap: 4px; min-height: 12px; cursor: help; }
.lad-pips i { width: 9px; height: 9px; border-radius: 50%; box-sizing: border-box; }
.lad-pips .p-W { background: var(--lad-up); box-shadow: 0 0 5px rgba(95, 224, 143, .6); }
.lad-pips .p-L { background: var(--lad-down); }
.lad-pips .p-X { background: transparent; border: 2px solid var(--lad-down); }
.lad-pips.is-empty { color: var(--g2-dim); }
.lad-move { display: inline-block; min-width: 30px; font: 800 11.5px var(--g2-ui); color: var(--g2-dim); cursor: help; font-variant-numeric: tabular-nums; }
.lad-move.is-up { color: var(--lad-up); }
.lad-move.is-down { color: var(--lad-down); }
.lad-move.is-new { color: #aee9ff; text-transform: uppercase; font-size: 9.5px; letter-spacing: .1em; }
.lad-left { font-variant-numeric: tabular-nums; }
.lad-left.is-good { color: var(--lad-up); }
.lad-left.is-warn { color: #ffcf6a; }
.lad-left.is-bad { color: var(--lad-down); }

/* ---------- highlights ---------- */
.lad-spots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.lad-spot {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 13px; border: 1px solid rgba(201, 163, 106, .4); border-radius: 8px; cursor: default;
  background: linear-gradient(180deg, rgba(60, 40, 84, .75), rgba(20, 14, 30, .86)); box-shadow: inset 0 0 0 1px rgba(255, 226, 170, .06), 0 6px 14px rgba(0, 0, 0, .4);
}
.lad-spot.is-empty { opacity: .6; }
.lad-spot-ico { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--g2-gold-hi); background: radial-gradient(circle at 35% 30%, #4a3368, #170f24 72%); border: 2px solid #c9a36a; box-shadow: 0 0 14px rgba(var(--g2-glow), .45); }
.lad-spot-ico svg { width: 20px; height: 20px; }
.lad-spot h3 { margin: 0; font: 800 12px/1.2 var(--g2-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--g2-gold); }
.lad-spot-sub { margin: 2px 0 6px; font: 11.5px/1.3 var(--g2-ui); color: var(--g2-dim); }
.lad-spot-name { display: block; font-size: 16px; font-family: var(--g2-serif); }
.lad-spot-val { display: block; margin-top: 4px; font: 800 22px/1.1 var(--g2-serif); color: #fff4d0; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; }
.lad-spot-line { display: block; margin-top: 2px; font: 12px var(--g2-ui); color: var(--g2-muted); }
.lad-spot-none { font: 700 12px var(--g2-ui); color: var(--g2-dim); }

/* ---------- toolbar ---------- */
.lad-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 14px; padding: 10px 12px; border: 1px solid var(--lad-line); border-radius: 7px; background: linear-gradient(180deg, rgba(18, 12, 28, .9), rgba(10, 7, 16, .9)); }
.lad-toolbar .g2-seg button { padding: 8px 14px; }
.lad-search { position: relative; flex: 1 1 200px; min-width: 170px; max-width: 320px; }
.lad-search i { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); background: var(--g2-dim); -webkit-mask: var(--lad-ico-search) center / contain no-repeat; mask: var(--lad-ico-search) center / contain no-repeat; pointer-events: none; }
.lad-search input {
  width: 100%; box-sizing: border-box; padding: 9px 12px 9px 34px; border-radius: 6px; border: 1px solid rgba(201, 163, 106, .5); background: #09060f; color: #fff; font: 13.5px var(--g2-ui);
}
.lad-search input::placeholder { color: #8f849e; }
.lad-search input:focus-visible { outline: 2px solid var(--g2-gold-hi); outline-offset: 2px; }
.lad-sortbox { display: none; align-items: center; gap: 8px; }
.lad-sortbox label { font: 800 11px var(--g2-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--g2-dim); }
.lad-sortbox select { padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(201, 163, 106, .5); background: #09060f; color: #fff; font: 13px var(--g2-ui); }
.lad-dir { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; border: 1px solid rgba(201, 163, 106, .5); background: #09060f; color: var(--g2-gold-hi); cursor: pointer; }
.lad-dir i { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid currentColor; }
.lad-dir[data-dir="asc"] i { border-top: 0; border-bottom: 8px solid currentColor; }
.lad-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-left: auto; }
.lad-checks label { display: inline-flex; align-items: center; gap: 7px; font: 700 12.5px var(--g2-ui); color: var(--g2-muted); cursor: pointer; }
.lad-checks input { width: 16px; height: 16px; accent-color: #d9a638; }

/* ---------- table ---------- */
.lad-tablewrap { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--lad-line); border-radius: 7px; background: linear-gradient(180deg, rgba(12, 8, 18, .55), rgba(8, 5, 12, .7)); }
.lad-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font: 13.5px/1.3 var(--g2-ui); color: var(--g2-ink); }
.lad-table th {
  position: sticky; top: 0; padding: 10px 12px 10px 7px; background: linear-gradient(180deg, #2b1f3c, #1a1226); border-bottom: 1px solid rgba(201, 163, 106, .5);
  text-align: center; white-space: nowrap; color: var(--g2-muted); font: 800 10.5px/1 var(--g2-ui); letter-spacing: .12em; text-transform: uppercase;
}
.lad-table th.c-name, .lad-table th.c-rank, .lad-table th.c-form { text-align: left; }
/* All players / All games view: group names on top, a line where each group starts */
.lad-table th.lad-group { padding: 9px 12px 8px; text-align: center; font-size: 10.5px; letter-spacing: .16em; border-left: 1px solid rgba(201, 163, 106, .35); border-bottom: 1px solid rgba(201, 163, 106, .3); color: var(--g2-gold); cursor: help; }
.lad-table th.lad-group.is-all { background: linear-gradient(180deg, #33264a, #1d142b); }
.lad-table thead tr + tr th { top: auto; padding-top: 9px; padding-bottom: 10px; }
.lad-table th.c-first, .lad-table td.c-first { border-left: 1px solid rgba(201, 163, 106, .25); }
.lad-table td.c-g1 { color: #e9deff; }
.lad-table th.c-move { padding-left: 0; padding-right: 0; }
/* A heading may take two lines (Base / Focuser) so a column is only as wide as its number or its longest word.
   The sort mark hangs outside the word, so it never widens the column or pushes the word off the number. */
.lad-th {
  position: relative; left: 3px; display: inline-block; padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
  font: inherit; line-height: 1.3; letter-spacing: inherit; text-transform: inherit; text-align: inherit; white-space: nowrap;
}
.lad-th:hover, .lad-th:focus-visible { color: #fff; }
.lad-table th.is-sorted { color: var(--g2-gold-hi); }
.lad-caret { position: absolute; left: 100%; top: 50%; width: 0; height: 0; margin: -2px 0 0 4px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid rgba(255, 255, 255, .22); }
.lad-table th.c-name .lad-th { left: 0; }
.lad-table th.c-name .lad-caret { position: static; display: inline-block; margin: 0 0 2px 6px; vertical-align: middle; }
.lad-caret.is-desc { border-top-color: var(--g2-gold-hi); }
.lad-caret.is-asc { border-top: 0; border-bottom: 5px solid var(--g2-gold-hi); margin-top: -3px; }
.lad-table td { padding: 11px 12px 11px 7px; border-bottom: 1px solid rgba(201, 163, 106, .12); text-align: center; white-space: nowrap; }
.lad-table td.c-name, .lad-table td.c-rank { text-align: left; }
.lad-table td.num { font-variant-numeric: tabular-nums; }
.lad-table tbody tr { cursor: pointer; transition: background .12s ease; }
.lad-table tbody tr:hover { background: rgba(var(--g2-glow), .16); }
.lad-table tbody tr:last-child td { border-bottom: 0; }
.lad-table .c-rank { width: 56px; }
.lad-table .c-name { width: 28%; }
/* All games has many columns, so the name column takes only what a name needs and the numbers share the rest. */
.lad-table.is-grouped .c-name { width: 1%; }
.lad-table.is-grouped td.c-name { padding-right: 24px; }
.lad-table .c-move { width: 46px; padding-left: 0; padding-right: 0; text-align: center; }
.lad-table .c-points b { font: 800 16px var(--g2-serif); color: #ffe08a; text-shadow: 0 1px 0 #000; }
.lad-table .c-gain.is-up, .lad-card-gain.is-up { color: var(--lad-up); font-weight: 800; }
.lad-table .c-gain.is-down, .lad-card-gain.is-down { color: var(--lad-down); font-weight: 800; }
.lad-table .c-hum { color: var(--lad-human); font-weight: 800; }
.lad-table .c-vam { color: var(--lad-vamp); font-weight: 800; }
.lad-table .c-last { color: var(--g2-muted); }
.lad-table td.c-form { text-align: left; padding-left: 12px; width: 120px; }
.lad-ranknum { display: inline-block; min-width: 24px; text-align: center; font: 800 13px var(--g2-ui); color: var(--g2-muted); font-variant-numeric: tabular-nums; }
.lad-rankmedal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font: 800 13px var(--g2-serif); color: #2a1706; border: 1px solid rgba(0, 0, 0, .5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 4px rgba(0, 0, 0, .5); }
.lad-rankmedal.m1 { background: linear-gradient(145deg, #fff2b8, #e8b630 60%, #a56a10); }
.lad-rankmedal.m2 { background: linear-gradient(145deg, #ffffff, #bfc9dc 60%, #7e8aa3); }
.lad-rankmedal.m3 { background: linear-gradient(145deg, #ffe3c4, #d2895a 60%, #8a4d1d); }
.lad-row.is-top1 { background: linear-gradient(90deg, rgba(255, 215, 100, .13), transparent 55%); }
.lad-row.is-top2 { background: linear-gradient(90deg, rgba(210, 220, 240, .10), transparent 55%); }
.lad-row.is-top3 { background: linear-gradient(90deg, rgba(224, 160, 106, .10), transparent 55%); }
.lad-empty { padding: 34px 16px; text-align: center; color: var(--g2-muted); font: 14px var(--g2-ui); }
.lad-empty p { margin: 0; }
.lad-more { display: block; margin: 14px auto 0; min-height: 40px; padding: 0 22px; }

/* ---------- phone cards (shown instead of the table) ---------- */
.lad-cards { display: none; margin: 0; padding: 0; list-style: none; }
.lad-card {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 12px 10px; border: 0; border-bottom: 1px solid rgba(201, 163, 106, .15); background: none;
  color: var(--g2-ink); font: 13px var(--g2-ui); text-align: left; cursor: pointer;
}
.lad-cards li:last-child .lad-card { border-bottom: 0; }
.lad-card:hover, .lad-card:focus-visible { background: rgba(var(--g2-glow), .16); }
.lad-card-rank { font: 800 14px var(--g2-ui); color: var(--g2-muted); text-align: center; }
.lad-card-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lad-card-name { font: 800 15px var(--g2-ui); color: var(--g2-gold-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lad-card-line { font-size: 12px; color: var(--g2-muted); }
.lad-card-foot { display: flex; align-items: center; gap: 12px; }
.lad-card-last { font-size: 11.5px; color: var(--g2-dim); }
.lad-card-pts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.lad-card-pts b { font: 800 22px/1 var(--g2-serif); color: #ffe08a; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; }
.lad-card-pts small { font: 800 10px var(--g2-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--g2-dim); }

/* ---------- rules ---------- */
.lad-rules summary { cursor: pointer; font: 800 15px var(--g2-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--g2-gold); list-style: none; display: flex; align-items: center; gap: 10px; }
.lad-rules summary::-webkit-details-marker { display: none; }
.lad-rules summary::before { content: "\25B8"; color: var(--g2-gold-hi); transition: transform .15s ease; }
.lad-rules[open] summary::before { transform: rotate(90deg); }
.lad-rules ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.lad-rules li { position: relative; padding-left: 24px; font: 14px/1.55 var(--g2-ui); color: var(--g2-ink); }
.lad-rules li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; transform: rotate(45deg); background: linear-gradient(135deg, #fff0c4, #b8893a); }

/* ---------- profile drawer ---------- */
body.lad-lock { overflow: hidden; }
.lad-scrim { position: fixed; inset: 0; z-index: 1900; background: rgba(3, 5, 18, .66); opacity: 0; transition: opacity .2s ease; }
.lad-scrim.is-open { opacity: 1; }
.lad-profile {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2000; width: min(580px, 100vw); box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 22px 28px; border-left: 3px solid #cfae68; background: linear-gradient(180deg, #2a1d3f 0, #120b1d 38%, #0b0712 100%); box-shadow: -18px 0 50px rgba(0, 0, 0, .65);
  transform: translateX(105%); transition: transform .22s ease;
}
.lad-profile.is-open { transform: none; }
.lad-profile[hidden] { display: none; }
.lad-p-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer; color: var(--g2-gold-hi); border: 1px solid rgba(201, 163, 106, .6); background: #120b1c; }
.lad-p-close svg { width: 16px; height: 16px; }
.lad-p-close:hover { background: #2a1a3e; }
.lad-p-head { display: flex; align-items: center; gap: 16px; padding-right: 44px; margin-bottom: 18px; }
.lad-avatar { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; font: 800 28px var(--g2-serif); color: #2a1706; background: var(--g2-gold-btn); border: 3px solid #fff1c8; box-shadow: 0 0 22px rgba(var(--g2-glow), .6), 0 4px 10px rgba(0, 0, 0, .5); }
.lad-p-who { min-width: 0; }
.lad-p-who h2 { margin: 0 0 8px; font: 800 26px/1.15 var(--g2-serif); color: #ffe6ad; text-shadow: 0 2px 0 #000; overflow-wrap: anywhere; }
.lad-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.lad-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 8px; border-radius: 999px; border: 1px solid var(--bc); background: color-mix(in srgb, var(--bc) 18%, #0a0610); color: #fff; font: 800 12px var(--g2-ui); }
.lad-badge svg { width: 15px; height: 15px; color: var(--bc); }
.lad-badge em { font-style: normal; font-weight: 700; color: var(--g2-muted); }
.lad-badge.is-b { --bc: var(--lad-human); }
.lad-badge.is-v { --bc: var(--lad-vamp); }
.lad-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 16px 0 0; }
.lad-stat { min-width: 0; width: 100%; box-sizing: border-box; padding: 9px 10px 9px; border: 1px solid var(--lad-line); border-radius: 7px; background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015)); }
.lad-stat > span { display: block; min-height: 2.4em; overflow-wrap: anywhere; font: 800 10px/1.2 var(--g2-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--g2-dim); }
.lad-stat b { display: block; margin-top: 4px; font: 800 17px/1.15 var(--g2-serif); color: #fff4d0; font-variant-numeric: tabular-nums; }
.lad-stat small { display: block; margin-top: 2px; font: 700 11px/1.2 var(--g2-ui); letter-spacing: .04em; color: var(--g2-dim); }
.lad-chart-card { padding: 14px 14px 10px; border: 1px solid var(--lad-line); border-radius: 8px; background: linear-gradient(180deg, rgba(12, 8, 18, .75), rgba(8, 5, 12, .85)); }
.lad-chart-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.lad-chart-top h3 { margin: 0; font: 800 14px var(--g2-serif); letter-spacing: .06em; color: var(--g2-gold); }
.lad-chart-top h3 small { display: block; margin-top: 2px; font: 700 11.5px var(--g2-ui); letter-spacing: .02em; color: var(--g2-dim); }
.lad-chart-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.lad-chart-tools .g2-seg button { padding: 7px 11px; }
.lad-chart-tools .g2-seg button:disabled { opacity: .35; cursor: default; }
.lad-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.lad-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--lad-line); background: rgba(255, 255, 255, .05); font: 700 12px var(--g2-ui); color: var(--g2-muted); }
.lad-chip b { color: #fff; font-size: 13px; }
.lad-chip.is-up { border-color: rgba(95, 224, 143, .55); background: rgba(95, 224, 143, .12); }
.lad-chip.is-up b { color: var(--lad-up); }
.lad-chip.is-down { border-color: rgba(255, 125, 125, .55); background: rgba(255, 125, 125, .12); }
.lad-chip.is-down b { color: var(--lad-down); }
.lad-chart-note { margin: 6px 0; padding: 10px 12px; border-radius: 6px; border: 1px dashed var(--lad-line); color: var(--g2-muted); font: 13px/1.5 var(--g2-ui); }
.lad-chart-note b { color: #fff; }
.lad-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.lad-grid { stroke: rgba(205, 215, 255, .10); stroke-width: 1; }
.lad-vgrid { stroke: rgba(205, 215, 255, .07); stroke-width: 1; stroke-dasharray: 3 4; }
.lad-vgrid.is-major { stroke: rgba(205, 215, 255, .16); }
.lad-ylab, .lad-xlab { font: 700 11px var(--g2-ui); fill: #9d93ad; }
.lad-line { stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px color-mix(in srgb, currentColor 60%, transparent)); stroke-dasharray: 1; stroke-dashoffset: 0; animation: lad-draw 1s ease-out both; }
@keyframes lad-draw { from { stroke-dashoffset: 1; } }
.lad-dot { stroke: #0a0610; stroke-width: 1.5; transition: r .12s ease; }
.lad-dot.is-win { fill: var(--lad-up); }
.lad-dot.is-loss { fill: var(--lad-down); }
.lad-dot.is-left { fill: #0a0610; stroke: var(--lad-down); stroke-width: 2.2; }
.lad-hit { cursor: pointer; }
.lad-hit:hover .lad-dot { r: 7; }
.lad-now { filter: drop-shadow(0 0 6px currentColor); }
.lad-bar.is-up { fill: var(--lad-up); }
.lad-bar.is-down { fill: var(--lad-down); }
.lad-bar.is-zero { fill: rgba(190, 200, 230, .5); }
.lad-barval { font: 800 10.5px var(--g2-ui); fill: #cfd6ea; }
.lad-barval.is-up { fill: var(--lad-up); }
.lad-barval.is-down { fill: var(--lad-down); }
.lad-recent { margin-top: 16px; }
.lad-recent h3 { margin: 0 0 8px; font: 800 12px var(--g2-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--g2-gold); }
.lad-recent ul { margin: 0; padding: 0; list-style: none; border: 1px solid var(--lad-line); border-radius: 7px; overflow: hidden; }
.lad-recent li { display: block; margin: 0; padding: 0; border-bottom: 1px solid rgba(201, 163, 106, .12); font: 12.5px var(--g2-ui); color: var(--g2-muted); }
.lad-recent li:last-child { border-bottom: 0; }
.lad-rg { display: grid; grid-template-columns: minmax(0, 1.4fr) 86px 52px 42px 54px; gap: 8px; align-items: center; box-sizing: border-box; width: 100%; margin: 0; padding: 8px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
button.lad-rg { cursor: pointer; }
button.lad-rg:hover, .lad-rg.is-open { background: rgba(var(--g2-glow), .16); }
.lad-lobby { margin-top: 14px; padding: 12px; border: 1px solid var(--lad-line); border-radius: 7px; background: rgba(8, 5, 12, .45); }
.lad-lobby header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lad-lobby h3 { margin: 0; font: 800 12px var(--g2-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--g2-gold); }
.lad-lobby header button { border: 0; background: none; color: var(--g2-gold-hi); font: 800 11px var(--g2-ui); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.lad-lobby-cause { margin: 0 0 8px; font: 700 13px var(--g2-ui); color: #ffe08a; }
.lad-lobby-cause span { margin-right: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--lad-vamp); font-size: 11px; }
.lad-lobby-miss { margin: 0; color: var(--g2-dim); }
.lad-lobby ol { list-style: none; margin: 0; padding: 0; }
.lad-lobby li { display: grid; grid-template-columns: 22px 14px minmax(0, 1fr) auto 108px; gap: 8px; align-items: center; padding: 6px 2px; border-bottom: 1px solid rgba(201, 163, 106, .12); font: 13px var(--g2-ui); color: var(--g2-ink); }
.lad-lobby li:last-child { border-bottom: 0; }
.lad-lobby-num { color: var(--g2-dim); font-weight: 800; }
.lad-lobby i { width: 12px; height: 12px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45); }
.lad-lobby i.is-unknown { background: transparent; box-shadow: inset 0 0 0 1px rgba(201, 163, 106, .35); }
.lad-lobby.is-unknown li { grid-template-columns: 14px minmax(0, 1fr) auto 64px; }
.lad-lobby-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.lad-lobby-name.is-empty { font-weight: 700; color: var(--g2-dim); }
.lad-lobby-left { justify-self: end; min-width: 52px; box-sizing: border-box; text-align: center; font: 700 10px/1 var(--g2-ui); letter-spacing: .06em; text-transform: uppercase; color: #ffb4b4; }
.lad-lobby-left:not(:empty) { padding: 3px 8px; border: 1px solid rgba(255, 125, 125, .45); border-radius: 999px; background: rgba(255, 80, 80, .08); }
.lad-lobby-left.is-cause { color: #ffe08a; border-color: rgba(255, 214, 120, .55); background: rgba(255, 196, 70, .1); text-transform: none; letter-spacing: 0; white-space: normal; line-height: 1.25; max-width: 11rem; }
.lad-lobby-role { justify-self: end; text-align: right; font: 700 11px var(--g2-ui); letter-spacing: .04em; color: var(--g2-muted); }
.lad-lobby-role.is-v { color: var(--lad-vamp); }
.lad-recent-empty { display: block !important; color: var(--g2-dim); }
.lad-rg-side { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.lad-rg-side svg { width: 13px; height: 13px; }
.lad-rg-side.is-b { color: var(--lad-human); }
.lad-rg-side.is-v { color: var(--lad-vamp); }
.lad-rg-res { font-weight: 800; }
.lad-rg-res.is-win { color: var(--lad-up); }
.lad-rg-res.is-loss, .lad-rg-res.is-left { color: var(--lad-down); }
.lad-rg-pts { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.lad-rg-pts.is-up { color: var(--lad-up); }
.lad-rg-pts.is-down { color: var(--lad-down); }
.lad-rg-min { text-align: right; color: var(--g2-dim); }
.lad-copy { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; min-height: 40px; padding: 0 16px; }
.lad-copy svg { width: 16px; height: 16px; }

:root { --lad-ico-search: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='black' stroke-width='2.6'/%3E%3Cpath d='m15.500 15.500 5 5' stroke='black' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* ---------- winter touches (only when the winter layer is on) ---------- */
body.xmas2 .lad-plinth::before {
  content: ""; position: absolute; left: -2px; right: -2px; top: -9px; height: 14px; pointer-events: none;
  background: url("../xmas2/art/snowcap.svg") repeat-x 0 0 / 90px 14px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
}
body.xmas2 .lad-podium .lad-head h2 { filter: brightness(1.15); }
body.xmas2 .lad-spot-ico { border-color: #cde7ff; box-shadow: 0 0 14px rgba(150, 205, 255, .55); }
body.xmas2 .lad-toolbar, body.xmas2 .lad-chart-card { border-color: rgba(169, 214, 255, .28); background: linear-gradient(180deg, rgba(14, 22, 62, .92), rgba(8, 13, 38, .95)); }
body.xmas2 .lad-tablewrap { border-color: rgba(169, 214, 255, .28); background: linear-gradient(180deg, rgba(12, 18, 52, .72), rgba(8, 12, 34, .8)); }
body.xmas2 .lad-table th { background: linear-gradient(180deg, #243166, #131b45); border-bottom-color: rgba(190, 224, 255, .5); }
body.xmas2 .lad-table th.lad-group { border-left-color: rgba(190, 224, 255, .35); border-bottom-color: rgba(190, 224, 255, .3); color: #ffe9b5; }
body.xmas2 .lad-table th.lad-group.is-all { background: linear-gradient(180deg, #2c3b7c, #18214f); }
body.xmas2 .lad-table th.c-first, body.xmas2 .lad-table td.c-first { border-left-color: rgba(190, 224, 255, .25); }
body.xmas2 .lad-table td, body.xmas2 .lad-card, body.xmas2 .lad-recent li { border-bottom-color: rgba(169, 214, 255, .12); }
body.xmas2 .lad-spot { border-color: rgba(190, 224, 255, .38); background: linear-gradient(180deg, rgba(34, 46, 102, .9), rgba(12, 17, 44, .94)); }
body.xmas2 .lad-stat, body.xmas2 .lad-recent ul { border-color: rgba(169, 214, 255, .24); }
body.xmas2 .lad-search input, body.xmas2 .lad-sortbox select, body.xmas2 .lad-dir { background: #070b24; border-color: rgba(190, 224, 255, .45); }
body.xmas2 .lad-name, body.xmas2 .lad-card-name { color: #ffe9b5; }
body.xmas2 .lad-profile { border-left-color: #cde7ff; border-top-color: #cde7ff; background: linear-gradient(180deg, #1d2a66 0, #0e1540 38%, #070b24 100%); }
body.xmas2 .lad-avatar { box-shadow: 0 0 22px rgba(150, 205, 255, .6), 0 4px 10px rgba(0, 0, 0, .5); }

/* ---------- calm mode / reduced motion ---------- */
html.g2-calm .lad-line, html.g2-calm .lad-loading-card i { animation: none; }
html.g2-calm .lad-profile, html.g2-calm .lad-scrim { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .lad-line, .lad-loading-card i { animation: none; }
  .lad-profile, .lad-scrim { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .lad-spots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .lad-podiums { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .lad-tablewrap { display: none; }
  .lad-cards { display: block; border: 1px solid var(--lad-line); border-radius: 7px; background: rgba(8, 5, 12, .55); }
  .lad-sortbox { display: inline-flex; }
  .lad-checks { margin-left: 0; }
  .lad-toolbar .g2-seg { width: 100%; }
  .lad-toolbar .g2-seg button { flex: 1 1 0; padding: 10px 6px; }
  .lad-search { max-width: none; flex-basis: 100%; }
  .lad-spots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .lad-podium, .lad-board, .lad-rules { padding: 16px 12px 14px; }
  .lad-title .lad-summary { text-align: left; align-items: flex-start; min-width: 0; margin-top: 8px; }
  .lad-title { flex-direction: column; align-items: flex-start; }
  .lad-profile { top: auto; left: 0; width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; border-left: 0; border-top: 3px solid #cfae68; padding: 18px 14px 26px; transform: translateY(105%); }
  .lad-profile.is-open { transform: none; }
  .lad-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lad-rg { grid-template-columns: minmax(0, 1.5fr) 70px 44px 38px; }
  .lad-rg-min { display: none; }
}
@media (max-width: 560px) {
  .lad-spots { grid-template-columns: minmax(0, 1fr); }
  .lad-steps { gap: 6px; min-height: 0; }
  .lad-step-body { padding: 10px 4px; min-height: 134px; }
  .lad-step.p1 .lad-step-body { min-height: 158px; }
  .lad-step-pts { font-size: 22px; }
  .lad-step.p1 .lad-step-pts { font-size: 28px; }
  .lad-step-name { font-size: 13px; }
  .lad-step.p1 .lad-step-name { font-size: 15px; }
  .lad-p-who h2 { font-size: 22px; }
  .lad-avatar { width: 54px; height: 54px; font-size: 24px; }
  .lad-stat b { font-size: 15px; }
  .lad-stat { padding: 8px 8px; }
}

/* chart colours: the side sets currentColor, lines / dots / gradient follow it (SVG attributes cannot hold var()) */
.lad-chart-svg.is-b { color: var(--lad-human); }
.lad-chart-svg.is-v { color: var(--lad-vamp); }
.lad-chart-svg stop { stop-color: currentColor; }
.lad-line { stroke: currentColor; }
.lad-now { fill: currentColor; }
