/* ==========================================================================
   HOME — unified console-dashboard landing (SC2 + Brood War).
   Token-driven (styles/tokens.css); raw rgba() only for one-off tints/glows.
   Animations sit under the global prefers-reduced-motion reset in style.css.
   ========================================================================== */

/* .home base layout now lives in css/home-redesign.css (July 2026 redesign,
   scoped under #page-home). The old grid block was removed — its
   `align-items:start` fought the redesign's flex column. The rest of this
   file keeps the still-used shared chrome: toast, modals, browse-all,
   changelog, vespene pill, backdrop controls. */

/* ---- shared atoms -------------------------------------------------------- */
.home-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--color-text);
}
.home-eyebrow i { font-style: normal; color: var(--accent, var(--color-accent)); }
.home-eyebrow--cyan { --accent: var(--color-accent); }
.home-eyebrow--red { --accent: var(--color-danger); }
.home-eyebrow--purple { --accent: var(--color-brand-2); }
.home-eyebrow--amber { --accent: #f5b94a; }
.home-eyebrow--chip {
  /* Accent-driven so the hero carousel's per-card-type modifiers (cyan / purple
     / amber) actually tint the chip. Default + --cyan resolve to the same cyan
     as before; color-mix keeps the translucent fill/border. */
  --chip-accent: var(--accent, var(--color-accent));
  padding: 7px 13px; border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--chip-accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-accent) 38%, transparent);
  color: color-mix(in srgb, var(--chip-accent) 70%, #ffffff);
  font-size: 11px; letter-spacing: .16em;
}

.home-link {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  color: var(--color-accent); cursor: pointer; background: none; border: 0; padding: 0;
}
.home-link:hover { color: var(--color-accent-hover); }

.home-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .04em;
  height: 36px; padding: 0 15px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong); background: rgba(255,255,255,.03);
  color: var(--color-text); cursor: pointer; transition: all var(--duration-fast) var(--ease-out);
}
.home-btn:hover { background: rgba(255,255,255,.07); transform: translateY(-1px); }
.home-btn--primary { border: 0; background: linear-gradient(135deg, var(--color-accent), var(--color-accent-pressed)); color: #06121e; }
/* Ghost = quiet utility (WHAT'S NEW / CUSTOMIZE / SIGN IN). Neutral by default
   so the cyan accent stays reserved for the active filter + the primary CTA. */
.home-btn--ghost { border-color: var(--color-border); background: transparent; color: var(--color-text-muted); }
.home-btn--ghost:hover { background: rgba(255,255,255,.05); border-color: var(--color-border-strong); color: var(--color-text); }
.home-btn--ghost svg { opacity: .85; }
/* Upload is the primary action — give the one filled button a soft accent lift. */
.home-btn--upload { box-shadow: 0 4px 14px rgba(86,194,255,.22); }
.home-btn--upload:hover { box-shadow: 0 6px 18px rgba(86,194,255,.32); }
.home-btn--customize.is-on { border-color: var(--color-accent); background: rgba(86,194,255,.12); color: var(--color-accent); }
/* Icon-only action buttons (Upload / Customize) — square, centered glyph. */
.home-btn--icon { width: 36px; padding: 0; gap: 0; justify-content: center; }
.home-btn--resume {
  padding: 13px 22px; font-size: 16px; border: 0;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-pressed)); color: #06121e;
  box-shadow: 0 8px 24px rgba(86,194,255,.3);
}
.home-btn--resume:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(86,194,255,.45); }

.home-chip {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; padding: 7px 13px; border-radius: var(--radius-md); cursor: pointer;
  white-space: nowrap; border: 1px solid var(--color-border); background: rgba(255,255,255,.02);
  color: var(--color-text-subtle); transition: all var(--duration-fast) var(--ease-out);
}
.home-chip.is-active { border-color: var(--color-accent); background: rgba(86,194,255,.13); color: var(--color-accent); }
.home-chips { display: flex; gap: 6px; }

/* Segmented control — the header game filter (ALL / SC2 / BW). One connected
   pill instead of three loose chips: a single bordered track with the active
   segment tinted. Height matches .home-btn (36px) so the action row sits on a
   clean baseline. */
.home-seg {
  display: inline-flex; align-items: stretch; gap: 2px;
  height: 36px; padding: 3px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: rgba(255,255,255,.03);
}
.home-seg__btn {
  display: inline-flex; align-items: center; white-space: nowrap; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; padding: 0 13px; border: 0; border-radius: calc(var(--radius-md) - 3px);
  background: transparent; color: var(--color-text-subtle);
  transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.home-seg__btn:hover { color: var(--color-text); }
.home-seg__btn.is-active {
  background: rgba(86,194,255,.14); color: var(--color-accent);
  box-shadow: inset 0 0 0 1px rgba(86,194,255,.3);
}
.home-seg__btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
/* Icon segments (SC2 / BW) — official game-mark crest instead of text. */
.home-seg__btn--mark { padding: 0 12px; }
.home-seg__mark { display: block; height: 18px; width: auto; }
/* The logo's own colors can't take the accent tint, so opacity carries the
   on-state: inactive marks sit back, the active segment's mark is full-strength. */
.home-seg__btn--mark .home-seg__mark { opacity: .55; transition: opacity var(--duration-fast) var(--ease-out); }
.home-seg__btn--mark:hover .home-seg__mark { opacity: .8; }
.home-seg__btn--mark.is-active .home-seg__mark { opacity: 1; }

/* Action group — keeps the buttons tightly grouped (8px) so the larger row
   gap (14px) reads as separation from the filter beside them. */
.home-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.home-accent { color: var(--color-accent); }

/* Keyboard focus ring for the card divs (made focusable in home.js) + buttons. */
.home [data-act]:focus-visible,
.home-modal [data-act]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.home-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em;
}
.home-pill--live { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3); color: #fca5a5; }
.home-pill--win { background: var(--color-success-soft); border: 1px solid rgba(74,222,128,.3); color: var(--color-success); }
.home-pill--loss { background: var(--color-danger-soft); border: 1px solid rgba(248,113,113,.3); color: var(--color-danger); }
.home-pill--vod { background: rgba(167,139,250,.14); border: 1px solid rgba(167,139,250,.34); color: #c4b5fd; }
.home-livepill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-sm);
  background: rgba(248,113,113,.92); color: #fff; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em;
}
.home-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: home-glow 1.2s infinite; }
.home-livepill .home-dot, .home-pill--live .home-dot { background: #fff; }
.home-pill--live .home-dot { background: var(--color-danger); }
.home-dot--abs { position: absolute; top: 4px; left: 4px; background: var(--color-danger); }
/* Featured/upcoming pill variants (admin-pinned events that aren't live) */
.home-livepill--soon { background: rgba(96,165,250,.92); }
.home-livepill--done { background: var(--color-accent, rgba(250,204,21,.92)); color: #1a1a1a; }
.home-livepill--soon .home-dot, .home-livepill--done .home-dot { display: none; }
/* Admin "Feature on Home" control on the tournament rail cards */
.home-tourn--featured { outline: 1px solid var(--color-accent, #facc15); outline-offset: -1px; }
.home-hero__live--pinned { box-shadow: inset 0 0 0 1px var(--color-accent, #facc15); }
.home-tourn__admin { margin-top: 8px; }
.home-tourn__featbtn {
  width: 100%; cursor: pointer; padding: 5px 8px; border-radius: var(--radius-sm);
  background: var(--bg-2, rgba(255,255,255,.05)); border: 1px solid var(--border, rgba(255,255,255,.12));
  color: var(--text-2, #aaa); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .05em;
}
.home-tourn__featbtn:hover { color: var(--text-1, #fff); border-color: var(--color-accent, #facc15); }
.home-tourn__featbtn.is-on { background: var(--color-accent, #facc15); color: #1a1a1a; border-color: transparent; }

/* race emblem + matchup ---------------------------------------------------- */
.home-race-ico { display: inline-flex; width: var(--ico, 18px); height: var(--ico, 18px); }
.home-race-ico img, .home-race-ico svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.home-mu { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; }
.home-mu__v { color: var(--color-text-subtle); }
/* Game badge = just the official client crest (no wordmark, no text label). */
.home-gbadge { display: inline-flex; align-items: center; }
.home-game-crest { display: inline-flex; width: var(--crest, 16px); height: var(--crest, 16px); }
.home-game-crest img, .home-game-crest svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.home-game-logo { display: inline-flex; height: var(--logo-h, 18px); }
.home-game-logo img, .home-game-logo svg { height: 100%; width: auto; display: block; }

/* ---- header -------------------------------------------------------------- */
.home-header { order: -2; grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
/* The greeting wraps instead of running on a single line. With white-space:nowrap
   a longer localized greeting (e.g. ko/zh "Daniel님, 다시 오신 걸 환영해요") overran
   its column and overlapped the centered stat chips. overflow-wrap:anywhere also
   keeps a very long handle from overflowing; min-width:0 on the lead lets the
   flex/grid item actually shrink so the wrap can happen. */
.home-h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.08; letter-spacing: .01em; margin: 4px 0 0; overflow-wrap: anywhere; }
.home-header__lead { min-width: 0; }
.home-dateline { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-subtle); margin-top: 10px; letter-spacing: .04em; }
.home-header__aside { display: flex; flex-direction: column; align-items: flex-end; gap: 13px; }
.home-header__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.home-stat-chips, .home-feature-chips { gap: 9px; }

/* Stat-pill cluster — lifted out of the aside into its own slot so the header
   collapses to a single row on desktop (centered by the grid below). */
.home-header__stats { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: center; }

/* Mobile-only cog that collapses the header filter/stats/action cluster.
   Hidden on desktop — the cluster shows inline there. */
.home-header__tools-toggle { display: none; }

/* Widescreen: one-row header — greeting left, stat pills centered, filter +
   actions right. The 1fr / auto / 1fr grid keeps the centre column truly
   centered regardless of the side columns' widths. Gated at 1200px: below that
   the three zones can't share a row without colliding, so they fall back to two
   rows (greeting + actions on top, pills beneath). */
@media (min-width: 1280px) {
  .home-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px 24px;
  }
  .home-header__lead  { grid-column: 1; justify-self: start; min-width: 0; }
  .home-header__stats { grid-column: 2; justify-self: center; }
  .home-header__aside { grid-column: 3; justify-self: end; }
}

/* Narrow desktop / landscape tablet: two rows — greeting + filter/actions on
   the first line, stat pills on their own line below (full width, left). */
@media (min-width: 768px) and (max-width: 1279px) {
  .home-header { align-items: flex-start; }
  .home-header__lead  { order: 1; }
  .home-header__aside { order: 2; }
  .home-header__stats { order: 3; flex-basis: 100%; justify-content: flex-start; }
}

.home-stat {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: var(--radius-lg);
  background: rgba(255,255,255,.03); border: 1px solid var(--color-border); font-family: var(--font-mono); font-size: 11px;
}
.home-stat--rank { background: rgba(86,194,255,.06); border-color: rgba(86,194,255,.18); }
.home-stat--streak { background: rgba(251,146,60,.06); border-color: rgba(251,146,60,.18); }
.home-stat__rank { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: #bfe6ff; }
.home-stat__sep { width: 1px; height: 14px; background: var(--color-border-strong); }
.home-stat__mmr { font-weight: 700; font-size: 13px; color: var(--color-text); }
.home-stat__up { color: var(--color-success); font-weight: 600; }
.home-stat__down { color: var(--color-danger); font-weight: 600; }
.home-stat__big { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--color-text); line-height: 1; }
.home-stat--streak .home-stat__big { color: #fb923c; font-size: 16px; }
.home-stat__big small { color: var(--color-text-subtle); font-size: 12px; }
.home-stat__lbl { color: var(--color-text-subtle); letter-spacing: .06em; font-size: 10px; }
/* Combined stat pill — streak · win rate · weekly in one pill (icons + numbers,
   no word labels). Padding moves onto the segments so the dividers span full
   height; clicking anywhere opens the single combined detail modal. */
.home-stat--combo { gap: 0; padding: 0; }
.home-stat__seg { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; }
.home-stat__big--flame { color: #fb923c; font-size: 16px; }
.home-flame { animation: home-flame 1.4s ease-in-out infinite alternate; transform-origin: bottom center; }
.home-week { display: flex; gap: 3px; }
.home-week__cell { width: 8px; height: 8px; border-radius: 2px; background: rgba(255,255,255,.08); }
.home-week__cell.is-on { background: var(--color-accent); }
.home-week__cell.is-next { background: rgba(86,194,255,.3); animation: home-glow 1.4s infinite; }
.home-feat {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius-lg);
  font-family: var(--font-mono); font-size: 11px; color: #cdd4df; letter-spacing: .04em;
}
.home-feat--cyan { background: rgba(86,194,255,.06); border: 1px solid rgba(86,194,255,.18); }
.home-feat--purple { background: rgba(167,139,250,.06); border: 1px solid rgba(167,139,250,.18); }
.home-feat--gold { background: rgba(247,201,72,.06); border: 1px solid rgba(247,201,72,.18); }

/* ---- customize hint bar -------------------------------------------------- */
.home-hintbar {
  order: -2; grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--radius-lg); background: rgba(86,194,255,.07);
  border: 1px solid rgba(86,194,255,.28); animation: home-rise .3s var(--ease-out);
}
.home-hintbar__txt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: #bfe6ff; text-transform: uppercase; }
.home-hintbar__spacer { flex: 1; }
.home-hintbar__lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--color-text-subtle); text-transform: uppercase; }
.home-restore { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 11px; border-radius: 7px; border: 1px dashed var(--color-border-strong); background: transparent; color: var(--color-text-muted); cursor: pointer; }
.home-restore:hover { border-color: var(--color-accent); color: #bfe6ff; }
/* Restore-only variant: shown OUTSIDE customize mode whenever sections are
   hidden, so the hidden state is always recoverable. Quieter than the cyan
   customize bar so it reads as a passive affordance, not an active mode. */
.home-hintbar--restore { background: rgba(255,255,255,.03); border-color: var(--color-border-strong); border-style: dashed; padding: 10px 16px; }
.home-hintbar--restore .home-hintbar__txt { color: var(--color-text-muted); }

/* ---- hero ---------------------------------------------------------------- */
.home-hero { order: -1; grid-column: 1 / -1; display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; }
.home-hero__continue { position: relative; min-height: 268px; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--color-border-strong); cursor: pointer; }
.home-hero__continue:hover { border-color: rgba(86,194,255,.4); }
.home-hero__bg { position: absolute; inset: 0; background: radial-gradient(120% 95% at 78% 12%, rgba(86,194,255,.28), transparent 55%), radial-gradient(110% 110% at 12% 92%, rgba(167,139,250,.22), transparent 55%), linear-gradient(135deg, #141b29, var(--color-bg)); }
.home-hero__grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 26px 26px; mix-blend-mode: overlay; }
.home-hero__art { opacity: .6; filter: saturate(1.05); z-index: 0; }
.home-hero__scrim { position: absolute; inset: 0; background: linear-gradient(95deg, rgba(10,13,20,.94) 0%, rgba(10,13,20,.72) 42%, rgba(10,13,20,.18) 100%); }
.home-hero__inner { position: relative; height: 100%; padding: 22px 28px; display: flex; flex-direction: column; min-height: 268px; }
.home-hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.home-hero__map { text-align: right; }
.home-hero__mapname { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .04em; white-space: nowrap; text-shadow: 0 1px 4px rgba(5,8,13,.7); }
/* Brighter than --color-text-subtle + a shadow: this meta line sits top-right
   where the scrim is most transparent, so it has to stay legible over bright
   map art (the old subtle grey washed out on light maps). */
.home-hero__mapmeta { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); text-shadow: 0 1px 3px rgba(5,8,13,.85); }
.home-hero__vs { flex: 1; display: flex; align-items: center; gap: 16px; margin: 10px 0; flex-wrap: wrap; }
.home-hp { display: flex; align-items: center; gap: 13px; }
.home-hp__ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-lg); border: 1.5px solid currentColor; background: rgba(255,255,255,.05); }
.home-hp__name { font-family: var(--font-display); font-weight: 700; font-size: 23px; line-height: 1.05; color: var(--color-text); }
.home-hp__mmr { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.home-vs { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--color-border-strong); background: rgba(255,255,255,.03); font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--color-text-muted); }
.home-hero__foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- hero carousel ------------------------------------------------------- */
/* Wraps the deck of hero cards in grid column 1 (so the aside stays in col 2).
   The track lays cards out in a row; translateX(-idx*100%) slides between them.
   Each card keeps the same 268px footprint as the old static hero. */
.home-hero__carousel { position: relative; overflow: hidden; border-radius: var(--radius-xl); }
/* height:100% makes the track + its slides fill the grid-stretched carousel so
   each card matches the aside's height exactly (as the old single card did) —
   no dead gap below the card with the dots floating in it. */
.home-hero__track { display: flex; flex-wrap: nowrap; height: 100%; transition: transform .5s cubic-bezier(.4, 0, .2, 1); will-change: transform; touch-action: pan-y; }
.home-hero__track > .home-hero__continue { flex: 0 0 100%; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .home-hero__track { transition: none; } }
/* Dot indicators (bottom-right, clear of the left-aligned foot button row). */
.home-hero__dots { position: absolute; right: 16px; bottom: 14px; z-index: 3; display: flex; gap: 7px; }
.home-hero__dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,.28); transition: background var(--duration-fast), width var(--duration-fast); }
.home-hero__dot:hover { background: rgba(255,255,255,.5); }
.home-hero__dot.is-active { width: 18px; border-radius: 4px; background: var(--color-accent); }
/* Prev/next arrows — revealed on hover/focus (always shown on touch, below). */
.home-hero__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--color-border-strong); background: rgba(10,13,20,.6); color: var(--color-text); cursor: pointer; opacity: 0; transition: opacity var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast); }
.home-hero__nav:hover { background: rgba(10,13,20,.85); border-color: rgba(86,194,255,.5); }
.home-hero__nav--prev { left: 10px; }
.home-hero__nav--next { right: 10px; }
.home-hero__carousel:hover .home-hero__nav,
.home-hero__carousel:focus-within .home-hero__nav,
.home-hero__nav:focus-visible { opacity: 1; }

.home-hero__aside { display: flex; flex-direction: column; gap: 11px; }
.home-hero__live { position: relative; min-height: 96px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid rgba(248,113,113,.28); background: linear-gradient(150deg, rgba(248,113,113,.1), rgba(13,17,26,.55)); padding: 14px 15px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; cursor: pointer; }
.home-hero__live:hover { border-color: rgba(248,113,113,.5); transform: translateY(-2px); }
.home-hero__live-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-hero__live-toplead { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.home-hero__live-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.1; padding: 12px 0 0; }
.home-hero__live-sub { margin-top: 5px; font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted, #9ca3af); }
.home-hero__live-sep { margin: 0 6px; opacity: .5; }
.home-hero__live-prize { color: #93c5fd; font-weight: 700; }
.home-hero__live-caster { display: inline-flex; align-items: center; gap: 4px; color: var(--color-text-2, #cbd5e1); vertical-align: middle; }
.home-hero__live-caster svg { flex-shrink: 0; }
.home-hero__live-meta { font-family: var(--font-mono); font-size: 11px; color: #fca5a5; }
.home-hero__live-meta--end { display: flex; justify-content: flex-end; }
.home-watch { color: var(--color-accent); }
/* Featured VOD slot — same shell as the event card, purple-tinted, with the
   YouTube thumbnail as a dimmed full-bleed backdrop behind a scrim. */
.home-hero__live--vod { border-color: rgba(168,85,247,.34); background: linear-gradient(150deg, rgba(168,85,247,.13), rgba(13,17,26,.55)); }
.home-hero__live--vod:hover { border-color: rgba(168,85,247,.58); }
.home-hero__live-art { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .17; z-index: 0; }
.home-hero__live-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,17,26,.2), rgba(13,17,26,.78)); z-index: 0; }
/* Lift the text content above the absolute art/scrim layers. */
.home-hero__live--vod > *:not(.home-hero__live-art):not(.home-hero__live-scrim) { position: relative; z-index: 1; }
.home-hero__live-name--vod { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; padding-top: 8px; }
.home-hero__live--vod .home-watch { color: #d8b4fe; }
.home-hero__pro { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-lg); background: rgba(255,255,255,.025); border: 1px solid var(--color-border); cursor: pointer; transition: all var(--duration-fast); }
.home-hero__pro:hover { border-color: rgba(86,194,255,.3); background: rgba(86,194,255,.05); }
.home-hero__pro-main { flex: 1; min-width: 0; }
.home-hero__pro-names { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.home-hero__pro-meta { font-family: var(--font-mono); font-size: 9px; color: var(--color-text-subtle); margin-top: 1px; }
.home-chevron { color: var(--color-accent); flex-shrink: 0; }

/* ---- map thumb ----------------------------------------------------------- */
.home-thumb { position: relative; width: 50px; height: 32px; border-radius: 7px; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, hsl(var(--hue, 0) 38% 22%), hsl(var(--hue, 0) 30% 12%)); }
.home-thumb::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 11px 11px; }
.home-thumb__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-hero__pro .home-thumb { width: 46px; height: 30px; }

/* ---- section chrome ------------------------------------------------------ */
.home-sec { position: relative; grid-column: 1 / -1; }
.home-sec.is-draggable { cursor: grab; }
.home-sec.is-dragging { opacity: .35; }
.home-sec__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.home-sec__title { display: flex; align-items: center; gap: 12px; }
.home-sec__count { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-subtle); }
.home-sec__tools { display: flex; align-items: center; gap: 12px; }
.home-drag { font-family: var(--font-mono); font-size: 11px; color: var(--color-accent); letter-spacing: .1em; cursor: grab; }
.home-hide { background: none; border: 0; color: var(--color-text-subtle); cursor: pointer; padding: 0; display: inline-flex; }
.home-hide:hover { color: var(--color-danger); }

/* ---- live now ------------------------------------------------------------ */
.home-live { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.home-feat-stream { position: relative; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--color-border-strong); min-height: 200px; cursor: pointer; }
.home-feat-stream:hover { border-color: rgba(86,194,255,.4); transform: translateY(-2px); }
.home-feat-stream__bg { position: absolute; inset: 0; background: radial-gradient(120% 95% at 78% 14%, rgba(86,194,255,.28), transparent 55%), linear-gradient(135deg, #141b29, var(--color-bg)); background-size: cover; background-position: center; }
.home-feat-stream__scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,13,20,.95) 4%, rgba(10,13,20,.25) 60%, rgba(10,13,20,.5) 100%); }
.home-feat-stream__tags { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; }
.home-feat-stream__foot { position: absolute; bottom: 0; left: 0; right: 0; padding: 18px; }
.home-feat-stream__name { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 24px; margin-bottom: 6px; }
.home-rtile { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid currentColor; background: rgba(255,255,255,.04); }
.home-rtile--sm { width: 18px; height: 18px; border-radius: 5px; }
.home-feat-stream__title { font-size: 14px; color: #cdd4df; }
.home-stream-rail { display: flex; flex-direction: column; gap: 9px; }
.home-stream { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-lg); background: rgba(255,255,255,.025); border: 1px solid var(--color-border); cursor: pointer; transition: all var(--duration-fast); }
.home-stream:hover { background: rgba(86,194,255,.06); border-color: rgba(86,194,255,.3); transform: translateX(3px); }
.home-stream__thumb { position: relative; width: 72px; height: 44px; border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, #1a2233, var(--color-bg)); background-size: cover; background-position: center; }
.home-stream__main { flex: 1; min-width: 0; }
.home-stream__top { display: flex; align-items: center; gap: 7px; }
.home-stream__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.home-stream__title { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ---- tournaments rail ---------------------------------------------------- */
.home-tourn-rail { display: flex; gap: 14px; margin-top: 14px; padding-bottom: 8px; }
.home-tourn { position: relative; flex-shrink: 0; width: 264px; padding: 16px; border-radius: var(--radius-lg); background: linear-gradient(150deg, rgba(167,139,250,.06), rgba(13,17,26,.4)); border: 1px solid var(--color-border); cursor: pointer; transition: all var(--duration-fast); overflow: hidden; display: flex; flex-direction: column; }
.home-tourn:hover { border-color: rgba(167,139,250,.4); transform: translateY(-2px); }
.home-tourn::before { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--color-text-muted); }
.home-tourn--live::before { background: var(--color-danger); }
.home-tourn--soon::before { background: var(--color-warning); }
.home-tourn--done::before { background: var(--color-success); }
.home-tourn__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.home-tourn__toplead { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.home-tourn__status { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.home-tourn--live .home-tourn__status { color: var(--color-danger); }
.home-tourn--soon .home-tourn__status { color: var(--color-warning); }
.home-tourn--done .home-tourn__status { color: var(--color-success); }
/* Clamp to 2 lines AND reserve 2 lines of height so every card's title block
   is the same size — keeps card heights and the buttons below from wandering. */
.home-tourn__name { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.15; margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.3em; }
.home-tourn__detail { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); }
/* Push the action row (+ admin button) to the bottom so it aligns across cards.
   min-height reserves the follow-pill's height even for text feet (Completed /
   VODs / Live now) so upcoming and completed cards end up the same height. */
.home-tourn__foot { margin-top: auto; padding-top: 12px; min-height: 28px; box-sizing: content-box; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-tourn__foot--end { justify-content: flex-end; }
.home-tourn__meta { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); }

/* Tournament strip: wrap instead of an unstyled horizontal scrollbar. */
.home-tourn-rail { flex-wrap: wrap; padding-bottom: 0; }
/* Upcoming events — distinct blue branding (vs red live) + countdown + follow. */
.home-tourn--upcoming { background: linear-gradient(150deg, rgba(96,165,250,.08), rgba(13,17,26,.4)); }
.home-tourn--upcoming::before { background: #60a5fa; }
.home-tourn--upcoming .home-tourn__status { color: #60a5fa; }
.home-tourn__countdown { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: #93c5fd; letter-spacing: .03em; }
/* In the strip-card header row the countdown matches the status label's size
   and tracking so the header reads as one consistent line. */
.home-tourn__top .home-tourn__countdown { font-size: 10px; letter-spacing: .1em; }
.home-tourn__follow {
  cursor: pointer; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  background: rgba(96,165,250,.12); border: 1px solid rgba(96,165,250,.4); color: #93c5fd;
  font-family: var(--font-mono); font-weight: 700; transition: all var(--duration-fast);
}
.home-tourn__follow-star { font-size: 14px; line-height: 1; }
.home-tourn__follow:hover { background: rgba(96,165,250,.22); border-color: #60a5fa; color: #dbeafe; }
/* Followed: gold star (no green "Following" morph). */
.home-tourn__follow.is-on { background: rgba(250,204,21,.14); border-color: rgba(250,204,21,.5); color: #facc15; }
.home-tourn__follow.is-on:hover { background: rgba(250,204,21,.24); border-color: #facc15; color: #fde047; }

/* ---- replay panels (mine/pro) -------------------------------------------- */
.home-sec--panel .home-panel { border-radius: var(--radius-lg); background: linear-gradient(160deg, rgba(86,194,255,.05), rgba(13,17,26,.3)); border: 1px solid rgba(86,194,255,.16); overflow: hidden; padding: 10px; }
.home-sec[data-sec^="pro-"] .home-panel { background: linear-gradient(160deg, rgba(247,201,72,.05), rgba(13,17,26,.3)); border-color: rgba(247,201,72,.16); }
.home-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.home-rrow, .home-prow { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-md); cursor: pointer; transition: all .12s; background: rgba(255,255,255,.03); border: 1px solid var(--color-border); }
.home-rrow:hover { border-color: rgba(86,194,255,.35); }
.home-prow:hover { border-color: var(--color-border-strong); }
.home-result { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-md); font-family: var(--font-display); font-weight: 700; font-size: 14px; flex-shrink: 0; border: 1px solid transparent; }
.home-result--win { background: var(--color-success-soft); color: var(--color-success); border-color: rgba(74,222,128,.4); }
.home-result--loss { background: var(--color-danger-soft); color: var(--color-danger); border-color: rgba(248,113,113,.4); }
.home-rrow__main, .home-prow__main { flex: 1; min-width: 0; }
.home-rrow__top, .home-prow__names { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.home-rrow__opp { font-family: var(--font-ui); font-weight: 600; font-size: 13px; color: #cdd4df; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-rrow__meta, .home-prow__meta { font-family: var(--font-mono); font-size: 10px; color: var(--color-text-subtle); margin-top: 2px; }
.home-prow__rank { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-subtle); width: 22px; flex-shrink: 0; }
/* Pro replay rows: the map thumb IS the play button — a centered triangle on a
   soft scrim, always visible (lightens on row hover to reveal the map). Replaces
   the old rank cell + trailing play button, which together squeezed long player
   names into overflow. */
.home-thumb--play .home-thumb__play { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; color: #fff; background: rgba(0,0,0,.30); transition: background var(--duration-fast); }
.home-thumb--play .home-thumb__play svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.home-prow:hover .home-thumb--play .home-thumb__play { background: rgba(0,0,0,.12); }
.home-play { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-md); border: 1px solid rgba(247,201,72,.25); background: rgba(247,201,72,.08); color: var(--color-race-protoss); flex-shrink: 0; }
.home-sec[data-sec^="pro-sc2"] .home-play { border-color: rgba(86,194,255,.25); background: rgba(86,194,255,.08); color: var(--color-accent); }
/* Admin-only ★ on a VOD row → pin/unpin it into a Home featured slot. */
.home-prow__featbtn { display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: transparent; color: var(--color-text-subtle); font-size: 13px; line-height: 1; cursor: pointer; transition: all .12s; }
.home-prow__featbtn:hover { color: #facc15; border-color: rgba(250,204,21,.5); }
.home-prow__featbtn.is-on { color: #facc15; border-color: rgba(250,204,21,.6); background: rgba(250,204,21,.1); }

/* Pro section content-type toggle (SC2: All / Replays / VODs) */
.home-proseg { display: inline-flex; gap: 5px; }
.home-proseg .home-chip { padding: 5px 10px; font-size: 10px; letter-spacing: .08em; }

/* VOD rows — the replay-row shell with a red "video" accent (badge + thumb +
   play), so a VOD reads at a glance as watch-the-video vs load-the-canvas. */
.home-vodbadge { flex-shrink: 0; width: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 3px 0; line-height: 1; font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .06em; color: #fca5a5; border: 1px solid rgba(248,113,113,.32); background: rgba(248,113,113,.12); border-radius: 4px; }
.home-thumb--vod { background: linear-gradient(135deg, rgba(248,113,113,.22), rgba(248,113,113,.07)); }
.home-thumb--vod::after { display: none; }
/* Play overlay sits above the YouTube thumbnail (z-index 2); when the thumb
   404s and is removed, the red gradient + this glyph form the fallback tile. */
.home-thumb--vod .home-thumb__play { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; color: #fff; background: rgba(0,0,0,.22); }
.home-thumb--vod .home-thumb__play svg { opacity: .95; filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.home-sec[data-sec^="pro-sc2"] .home-prow--vod .home-play,
.home-browse-row--vod .home-play { border-color: rgba(248,113,113,.3); background: rgba(248,113,113,.1); color: #fca5a5; }
.home-browse-row--vod[data-row-open]:hover { border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.05); }

@media (max-width: 767px) {
  .home-sec__tools { flex-wrap: wrap; gap: 8px; }
  .home-proseg .home-chip { padding: 5px 8px; }
}
.home-empty, .home-empty-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 30px 16px; text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); letter-spacing: .04em; }
.home-empty-card { border: 1.5px dashed var(--color-border-strong); border-radius: var(--radius-md); }
.home-empty-card__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: rgba(86,194,255,.1); color: var(--color-accent); }

/* ---- training tiles ------------------------------------------------------ */
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(252px, 1fr)); gap: 16px; }
.home-tile { display: flex; flex-direction: column; gap: 12px; padding: 16px 17px; border-radius: var(--radius-lg); cursor: pointer; transition: all var(--duration-fast); background: linear-gradient(160deg, rgba(86,194,255,.07), rgba(13,17,26,.4)); border: 1px solid rgba(86,194,255,.2); }
.home-tile--lessons { background: linear-gradient(160deg, rgba(247,201,72,.07), rgba(13,17,26,.4)); border-color: rgba(247,201,72,.2); }
.home-tile--stardex { background: linear-gradient(160deg, rgba(74,222,128,.07), rgba(13,17,26,.4)); border-color: rgba(74,222,128,.2); }
.home-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.home-tile__head { display: flex; align-items: center; gap: 9px; }
.home-tile__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.home-tile__pill { margin-left: auto; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; padding: 3px 8px; border-radius: var(--radius-sm); background: rgba(86,194,255,.16); color: #bfe6ff; }
.home-tile--lessons .home-tile__pill { background: rgba(247,201,72,.16); color: #fbd36b; }
.home-tile--stardex .home-tile__pill { background: rgba(74,222,128,.16); color: #86efac; }
.home-tile__body { font-size: 12.5px; line-height: 1.5; color: var(--color-text-muted); flex: 1; }

/* ---- AI coach ------------------------------------------------------------ */
.home-coach { display: grid; grid-template-columns: 1fr 296px; gap: 16px; align-items: stretch; }
.home-coach__chat { display: flex; flex-direction: column; border-radius: var(--radius-xl); background: linear-gradient(165deg, rgba(167,139,250,.06), rgba(13,17,26,.55)); border: 1px solid rgba(167,139,250,.2); overflow: hidden; min-height: 316px; }
.home-coach__scroll { flex: 1; overflow-y: auto; max-height: 360px; padding: 16px; display: flex; flex-direction: column; gap: 13px; }
.home-coach__row { display: flex; gap: 9px; align-items: flex-end; }
.home-coach__row.is-user { flex-direction: row-reverse; }
.home-coach__ava { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-md); background: rgba(167,139,250,.18); color: var(--color-brand-2); flex-shrink: 0; }
.home-coach__bubble { max-width: 84%; padding: 9px 13px; border-radius: 13px 13px 13px 4px; background: rgba(255,255,255,.04); border: 1px solid var(--color-border); color: #d3d9e2; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.home-coach__bubble.is-user { border-radius: 13px 13px 4px 13px; background: rgba(86,194,255,.14); border-color: rgba(86,194,255,.25); color: var(--color-text); max-width: 80%; }
/* Assistant replies render markdown (headings / tables / lists / links / code).
   Drop the plain-text pre-wrap and give the block elements compact chat styling.
   Tables scroll horizontally so wide patch tables don't blow out the bubble on
   mobile. */
.home-coach__bubble.is-rich { white-space: normal; }
.home-coach__bubble.is-rich > :first-child { margin-top: 0; }
.home-coach__bubble.is-rich > :last-child { margin-bottom: 0; }
.home-coach__bubble.is-rich p { margin: 0 0 8px; }
.home-coach__bubble.is-rich h1,
.home-coach__bubble.is-rich h2,
.home-coach__bubble.is-rich h3,
.home-coach__bubble.is-rich h4,
.home-coach__bubble.is-rich h5,
.home-coach__bubble.is-rich h6 { margin: 10px 0 6px; font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--color-text); }
.home-coach__bubble.is-rich ul,
.home-coach__bubble.is-rich ol { margin: 4px 0 8px; padding-left: 18px; }
.home-coach__bubble.is-rich li { margin: 2px 0; }
.home-coach__bubble.is-rich a { color: #56c2ff; text-decoration: underline; }
.home-coach__bubble.is-rich strong { color: var(--color-text); }
.home-coach__bubble.is-rich code { background: rgba(255,255,255,.08); padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.home-coach__bubble.is-rich pre { background: rgba(0,0,0,.3); border: 1px solid var(--color-border); border-radius: 6px; padding: 8px; overflow-x: auto; margin: 6px 0; }
.home-coach__bubble.is-rich pre code { background: none; padding: 0; }
.home-coach__bubble.is-rich table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 12px; display: block; overflow-x: auto; }
.home-coach__bubble.is-rich th,
.home-coach__bubble.is-rich td { border: 1px solid var(--color-border); padding: 4px 8px; text-align: left; white-space: nowrap; }
.home-coach__bubble.is-rich th { background: rgba(255,255,255,.06); font-weight: 600; }
.home-coach__bubble.is-rich blockquote { margin: 6px 0; padding-left: 10px; border-left: 2px solid var(--color-border); color: #aab2c0; }
.home-coach__typing { display: flex; align-items: center; gap: 5px; padding: 12px 15px; border-radius: 13px 13px 13px 4px; background: rgba(255,255,255,.04); border: 1px solid var(--color-border); }
.home-coach__typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-brand-2); animation: home-glow 1s infinite; }
.home-coach__typing span:nth-child(2) { animation-delay: .2s; }
.home-coach__typing span:nth-child(3) { animation-delay: .4s; }
.home-coach__inputrow { border-top: 1px solid var(--color-border); padding: 11px 12px; display: flex; gap: 9px; align-items: center; }
.home-coach__input { flex: 1; background: rgba(255,255,255,.04); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); padding: 11px 14px; color: var(--color-text); font-family: var(--font-ui); font-size: 13px; outline: none; }
.home-coach__input:focus { border-color: rgba(167,139,250,.5); }
.home-coach__send { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-md); border: 0; background: linear-gradient(135deg, var(--color-brand-2), #7c5cf0); color: #fff; cursor: pointer; flex-shrink: 0; }
.home-coach__send:hover { filter: brightness(1.12); transform: translateY(-1px); }
.home-coach__kb { display: flex; flex-direction: column; gap: 14px; border-radius: var(--radius-xl); background: rgba(255,255,255,.02); border: 1px solid var(--color-border); padding: 16px 17px; }
.home-coach__kblist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.home-coach__kblist li { font-size: 12.5px; color: #cdd4df; line-height: 1.4; padding-left: 22px; position: relative; }
.home-coach__kblist li::before { content: "✓"; position: absolute; left: 0; color: var(--color-brand-2); font-weight: 700; }
.home-coach__sep { height: 1px; background: var(--color-border); }
.home-coach__suggest { display: flex; flex-direction: column; gap: 8px; }
.home-coach__chip { text-align: left; font-family: var(--font-ui); font-size: 12px; color: #bfc7d4; padding: 9px 11px; border-radius: var(--radius-md); border: 1px solid rgba(167,139,250,.22); background: rgba(167,139,250,.05); cursor: pointer; line-height: 1.35; transition: all var(--duration-fast); }
.home-coach__chip:hover { border-color: rgba(167,139,250,.55); background: rgba(167,139,250,.12); color: var(--color-text); }

/* ---- following ----------------------------------------------------------- */
.home-follow-rail { display: flex; gap: 12px; padding-bottom: 8px; }
.home-follow { flex-shrink: 0; width: 206px; padding: 14px; border-radius: var(--radius-lg); background: rgba(255,255,255,.025); border: 1px solid var(--color-border); cursor: pointer; transition: all var(--duration-fast); }
.home-follow:hover { border-color: rgba(167,139,250,.4); transform: translateY(-2px); background: rgba(167,139,250,.05); }
.home-follow__top { display: flex; align-items: center; gap: 11px; }
.home-follow__ava { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid currentColor; background: rgba(255,255,255,.04); }
.home-follow__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.home-follow__tags { display: flex; gap: 5px; font-family: var(--font-mono); font-size: 9px; color: var(--color-text-subtle); }

/* ---- favorites modal ----------------------------------------------------- */
.home-modal-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(5,7,11,.78); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px; animation: home-rise .25s var(--ease-out); }
.home-modal { width: 100%; max-width: 560px; max-height: 78vh; display: flex; flex-direction: column; border-radius: var(--radius-xl); background: var(--color-bg-elevated); border: 1px solid var(--color-border-strong); overflow: hidden; box-shadow: var(--shadow-xl); }
.home-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--color-border); }
.home-modal__title { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.home-modal__x { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-md); border: 1px solid var(--color-border-strong); background: transparent; color: var(--color-text-muted); cursor: pointer; }
.home-modal__x:hover { background: rgba(255,255,255,.06); color: #fff; }
.home-modal__body { padding: 14px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.home-fav-row { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: var(--radius-lg); border: 1px solid var(--color-border); background: rgba(255,255,255,.02); cursor: pointer; text-align: left; }
.home-fav-row.is-on { background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.4); }
.home-fav-row__ava { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid currentColor; background: rgba(255,255,255,.04); flex-shrink: 0; }
.home-fav-row__main { flex: 1; }
.home-fav-row__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--color-text); display: block; }
.home-fav-row__tags { font-family: var(--font-mono); font-size: 10px; color: var(--color-text-subtle); }
.home-fav-row__btn { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--color-text-subtle); }
.home-fav-row.is-on .home-fav-row__btn { color: var(--color-brand-2); }

/* ---- pro replay browser modal ------------------------------------------- */
.home-browse { max-width: 920px; max-height: 86vh; }
.home-browse__count { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-subtle); letter-spacing: .04em; margin-top: 4px; }
.home-browse__toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--color-border); }
.home-browse__search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; padding: 9px 13px; border-radius: var(--radius-md); background: rgba(255,255,255,.04); border: 1px solid var(--color-border-strong); color: var(--color-text-subtle); }
.home-browse__search:focus-within { border-color: rgba(86,194,255,.5); color: var(--color-text-muted); }
.home-browse__search input { flex: 1; background: none; border: 0; outline: none; color: var(--color-text); font-family: var(--font-ui); font-size: 13px; }
.home-browse__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.home-browse__chips .home-chip { padding: 6px 11px; font-size: 10px; }
/* Second toolbar row (BW): map / opening / length / MMR filters. */
.home-browse__filters { display: flex; align-items: flex-end; gap: 14px 18px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--color-border); }
.home-browse__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.home-browse__flabel { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-subtle); display: flex; align-items: center; gap: 6px; }
.home-browse__hint { font-style: normal; font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--color-text-muted); opacity: .8; }
.home-browse__select { appearance: none; -webkit-appearance: none; min-width: 150px; max-width: 230px; padding: 8px 28px 8px 11px; border-radius: var(--radius-md); background: rgba(255,255,255,.04); border: 1px solid var(--color-border-strong); color: var(--color-text); font-family: var(--font-ui); font-size: 12px; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a93a3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.home-browse__select:focus { border-color: rgba(167,139,250,.5); }
.home-browse__select option { background: var(--color-bg-elevated); color: var(--color-text); }
.home-browse__list { flex: 1; overflow-y: auto; padding: 12px 18px 18px; display: flex; flex-direction: column; gap: 7px; }
.home-browse-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-md); background: rgba(255,255,255,.025); border: 1px solid var(--color-border); cursor: pointer; transition: border-color .12s, background .12s; }
.home-browse-row[data-browse-id]:hover { border-color: rgba(86,194,255,.35); background: rgba(86,194,255,.05); }
.home-browse-row .home-thumb { width: 64px; height: 40px; }
.home-browse-row__main { flex: 1; min-width: 0; }
.home-browse-row__meta { font-family: var(--font-mono); font-size: 10px; color: var(--color-text-subtle); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* BW browse rows carry a right-aligned date + Blizzard-server column. */
.home-prow__when { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; font-family: var(--font-mono); }
.home-prow__date { font-size: 10px; color: var(--color-text-muted); white-space: nowrap; }
.home-prow__server { font-size: 9px; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-subtle); white-space: nowrap; }
.home-browse__more { display: block; margin: 6px auto 2px; padding: 9px 18px; border-radius: var(--radius-md); border: 1px solid var(--color-border-strong); background: rgba(255,255,255,.03); color: var(--color-text-muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; cursor: pointer; transition: all var(--duration-fast); }
.home-browse__more:hover { border-color: var(--color-accent); color: var(--color-accent); }
.home-browse__loading { text-align: center; padding: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--color-text-subtle); }

@media (max-width: 767px) {
  .home-browse__search { min-width: 100%; }
  .home-browse-row .home-thumb { width: 52px; height: 32px; }
  .home-browse__filters { gap: 12px; }
  .home-browse__field { width: 100%; }
  .home-browse__select { max-width: none; width: 100%; }
}

/* ---- stat-chip detail popover ------------------------------------------- */
.home-stat--btn { cursor: pointer; font: inherit; text-align: left; transition: border-color var(--duration-fast), transform var(--duration-fast); }
.home-stat--btn:hover { border-color: var(--color-border-focus); transform: translateY(-1px); }
.home-stat--btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.home-statp {
  position: fixed; z-index: var(--z-popover); width: 296px; max-width: calc(100vw - 24px);
  border-radius: var(--radius-lg); background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong); box-shadow: var(--shadow-xl);
  opacity: 0; transform: translateY(-6px); transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.home-statp.is-in { opacity: 1; transform: translateY(0); }
.home-statp__inner { padding: 15px 16px; display: flex; flex-direction: column; gap: 9px; }
/* Combined modal — wider, scrollable, stacks the three stat sections divided
   by hairlines (replaces the three separate stat popovers). */
.home-statp--wide { width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow-y: auto; }
.home-statp__inner--combo { padding: 0; gap: 0; }
.home-statp__sect { padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--color-border); }
.home-statp__sect:first-child { border-top: 0; }
.home-statp__inner--combo .home-statp__link { padding: 12px 16px 15px; align-self: flex-start; }
.home-statp__title { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--color-text-subtle); }
.home-statp__big { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.home-statp__big small { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--color-text-subtle); }
.home-statp__sub { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); letter-spacing: .03em; margin-top: 2px; }
.home-statp__sub b { color: var(--color-text); }
.home-statp__hint { color: var(--color-text-subtle); }
.home-statp__empty { font-size: 12px; color: var(--color-text-subtle); padding: 8px 0; line-height: 1.4; }

.home-statp__row { display: flex; align-items: center; gap: 9px; }
.home-statp__row-lbl { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); width: 64px; flex-shrink: 0; text-transform: capitalize; }
.home-statp__track { flex: 1; height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.home-statp__fill { display: block; height: 100%; border-radius: 99px; transition: width var(--duration-medium) var(--ease-out); }
.home-statp__row-val { font-family: var(--font-mono); font-size: 10px; color: var(--color-text-muted); white-space: nowrap; min-width: 56px; text-align: right; }

.home-statp__week { display: flex; gap: 6px; }
.home-statp__day { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.home-statp__dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.1); }
.home-statp__dot.is-on { background: var(--color-success); box-shadow: 0 0 8px rgba(74,222,128,.4); }
.home-statp__day-lbl { font-family: var(--font-mono); font-size: 9px; color: var(--color-text-subtle); }

.home-statp__bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.home-statp__bcol { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; height: 100%; }
.home-statp__bwrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.home-statp__bar { width: 70%; border-radius: 3px 3px 0 0; background: rgba(255,255,255,.12); transition: height var(--duration-medium) var(--ease-out); }
.home-statp__bar.is-on { background: linear-gradient(180deg, var(--color-accent), var(--color-accent-pressed)); }
.home-statp__week-goal { margin-top: 2px; }

.home-statp__link { align-self: flex-start; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--color-accent); background: none; border: 0; padding: 4px 0 0; cursor: pointer; }
.home-statp__link:hover { color: var(--color-accent-hover); }

/* ---- toast --------------------------------------------------------------- */
.home-toast { position: fixed; left: 50%; bottom: 30px; z-index: var(--z-toast); transform: translate(-50%, 16px); opacity: 0; padding: 13px 20px; border-radius: var(--radius-lg); background: rgba(20,24,33,.96); border: 1px solid rgba(86,194,255,.35); box-shadow: var(--shadow-lg); font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: #bfe6ff; transition: transform var(--duration-medium) var(--ease-out), opacity var(--duration-medium) var(--ease-out); }
.home-toast.is-show { transform: translate(-50%, 0); opacity: 1; }
.home-toast { display: inline-flex; align-items: center; gap: 14px; }
.home-toast__action { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-accent); background: none; border: 0; border-left: 1px solid rgba(86,194,255,.3); padding: 2px 0 2px 14px; cursor: pointer; }
.home-toast__action:hover { color: var(--color-accent-hover); }

/* ---- header brand mark --------------------------------------------------- */
/* The brand logo reuses .game-toggle (position/size) + .nav-btn (click
   binding → HOME). Neutralize the inherited .nav-btn hover/active pill so the
   logo reads as a clean brand mark, not a highlighted tab. */
.app-brand.nav-btn,
.app-brand.nav-btn:hover,
.app-brand.nav-btn.active {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: inherit;
}
.app-brand img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* ---- keyframes ----------------------------------------------------------- */
/* Background-refresh swap — a changed tile fades in gently (carousel-like) so
   updated data never flashes or hard-reloads the page. Opacity-only (no
   transform) to avoid layout jumps on the header/hero. */
@keyframes home-soft-in { from { opacity: 0; } to { opacity: 1; } }
.home-soft-in { animation: home-soft-in .28s var(--ease-out); }
@keyframes home-glow { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes home-flame { 0% { transform: scaleY(1) scaleX(1); opacity: .9; } 100% { transform: scaleY(1.14) scaleX(.94); opacity: 1; } }
@keyframes home-rise { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 1023px) {
  .home-coach { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .home { grid-template-columns: 1fr; gap: 22px; padding: 16px 14px 80px; }
  /* Single-column grid items default to min-width:auto, so any section whose
     content has a wide min-content (the non-wrapping .home-follow-rail of
     206px cards, fixed-width tournament cards, replay-row min-300 grids…)
     forces the lone 1fr track — and the whole page — wider than the phone.
     The browser then renders the dashboard "zoomed in" / pinch-to-fit.
     min-width:0 lets each section honour the track width so inner scroll
     rails (overflow-x:auto) actually scroll instead of widening the page. */
  .home > * { min-width: 0; }
  .home-header { flex-direction: column; }
  .home-header__aside { align-items: flex-start; width: 100%; gap: 12px; }
  .home-header__row { justify-content: flex-start; width: 100%; }
  .home-header__stats { width: 100%; justify-content: flex-start; }

  /* Logged-in header (.home-header--tools): collapse the whole filter + stats +
     action cluster behind ONE cog at the top-right of the greeting row to free
     up vertical space (the default mobile view is just the greeting + cog).
     Tapping the cog (.tools-open) expands the cluster inline below the greeting. */
  .home-header--tools { position: relative; }
  .home-header--tools .home-header__lead { padding-right: 48px; }
  .home-header--tools .home-header__tools-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 0; right: 0; width: 44px; height: 44px;
    border-radius: var(--radius-md); border: 1px solid var(--color-border-strong);
    background: rgba(255,255,255,.03); color: var(--color-text-muted);
    cursor: pointer; transition: all var(--duration-fast) var(--ease-out);
  }
  .home-header--tools .home-header__tools-toggle:hover { background: rgba(255,255,255,.07); color: var(--color-text); }
  .home-header--tools.tools-open .home-header__tools-toggle { border-color: var(--color-accent); background: rgba(86,194,255,.12); color: var(--color-accent); }
  .home-header--tools .home-header__stats,
  .home-header--tools .home-header__aside { display: none; }
  .home-header--tools.tools-open .home-header__stats,
  .home-header--tools.tools-open .home-header__aside { display: flex; }
  /* CTA cluster: stop the seg toggle + action buttons from wrapping into a
     scattered right-aligned clump ("buttons all over the place"). Each row
     spans the full width and the buttons left-align in a tidy line; the
     primary CTA grows so it reads as the main action. Icon-only actions
     (upload / customize on the logged-in header) keep their square size. */
  .home-actions { width: 100%; justify-content: flex-start; }
  .home-actions .home-btn--primary:not(.home-btn--icon) { flex: 1 1 auto; justify-content: center; }
  .home-feature-chips { width: 100%; }
  .home-h1 { white-space: normal; }
  .home-hero { grid-template-columns: 1fr; }
  /* No hover on touch — keep the carousel arrows visible so they're reachable.
     Two-class selector outranks the base .home-hero__nav{opacity:0}. */
  .home-hero__carousel .home-hero__nav { opacity: 1; background: rgba(10,13,20,.72); }
  .home-live { grid-template-columns: 1fr; }
  /* The single 1fr track is minmax(auto,1fr): a grid item's default
     min-width:auto lets the live "feat stream" card + stream rail keep their
     ~830px min-content, blowing the lone track (and the whole page) wider than
     the phone — the "live now stretching past the screen" report. min-width:0
     lets the items honour the track so the section fits the viewport. */
  .home-live > * { min-width: 0; }
  .home-sec[data-sec^="mine-"], .home-sec[data-sec^="pro-"] { grid-column: 1 / -1 !important; }
  .home-rows { grid-template-columns: 1fr; }
}

/* ---- changelog ("What's new") ------------------------------------------- */
/* Styled as a neutral .home-btn--ghost in the header now; the old purple tint
   was retired so the accent stays reserved for the filter + primary CTA. */

.home-clog { max-width: 640px; max-height: 82vh; }
.home-clog__sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--color-text-subtle); margin-top: 4px; text-transform: uppercase; }
.home-clog__actions { display: flex; align-items: center; gap: 12px; }
.home-clog__body { flex: 1; overflow-y: auto; padding: 6px 20px 20px; display: flex; flex-direction: column; gap: 4px; }

.home-clog-rel { padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.home-clog-rel:last-child { border-bottom: 0; }
.home-clog-rel__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 11px; }
.home-clog-rel__date { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-subtle); }
.home-clog-rel__ver { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--color-accent); padding: 2px 7px; border-radius: 99px; border: 1px solid rgba(86,194,255,.35); background: var(--color-accent-soft); }
.home-clog-rel__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--color-text); flex: 1 1 100%; }

.home-clog-rel__entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.home-clog-entry { display: flex; align-items: flex-start; gap: 10px; }
.home-clog-entry__txt { font-size: 13.5px; line-height: 1.45; color: var(--color-text-secondary, var(--color-text)); }
.home-clog-badge { flex-shrink: 0; margin-top: 1px; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .08em; padding: 2px 7px; border-radius: 4px; min-width: 62px; text-align: center; }
.home-clog-badge--feature { color: #06121e; background: var(--color-accent); }
.home-clog-badge--improvement { color: var(--color-success); background: var(--color-success-soft); border: 1px solid rgba(74,222,128,.3); }
.home-clog-badge--fix { color: var(--color-warning); background: var(--color-warning-soft); border: 1px solid rgba(251,191,36,.3); }

/* admin editor */
.home-clog-edit { display: flex; flex-direction: column; gap: 4px; }
.home-clog-edit__bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; margin-bottom: 4px; background: var(--color-bg-elevated); border-bottom: 1px solid var(--color-border); }
.home-clog-edit__spacer { flex: 1; }
.home-clog-err { font-family: var(--font-mono); font-size: 11px; color: var(--color-danger, #f87171); }

.home-clog-ecard { padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: rgba(255,255,255,.02); margin-bottom: 10px; }
.home-clog-ecard__head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.home-clog-ecard__entries { display: flex; flex-direction: column; gap: 7px; padding-left: 4px; border-left: 2px solid var(--color-border); padding-top: 2px; }
.home-clog-erow { display: flex; gap: 8px; align-items: center; }

.home-clog-in { font-family: var(--font-mono); font-size: 12px; color: var(--color-text); background: var(--color-bg-base, rgba(0,0,0,.25)); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); padding: 7px 9px; }
.home-clog-in:focus { outline: none; border-color: var(--color-accent); }
.home-clog-in--date { width: 118px; flex-shrink: 0; }
.home-clog-in--ver { width: 110px; flex-shrink: 0; }
.home-clog-in--title { flex: 1; min-width: 140px; font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.home-clog-in--type { width: 104px; flex-shrink: 0; cursor: pointer; }
.home-clog-in--etext { flex: 1; min-width: 120px; }
.home-clog-add-entry { align-self: flex-start; margin-top: 3px; }
.home-clog-del { flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong); background: transparent; color: var(--color-text-subtle); cursor: pointer; font-size: 12px; line-height: 1; }
.home-clog-del:hover { border-color: var(--color-danger, #f87171); color: var(--color-danger, #f87171); }

@media (max-width: 767px) {
  .home-clog { max-height: 88vh; }
  .home-clog-rel__head { gap: 6px; }
  .home-clog-ecard__head { flex-direction: column; align-items: stretch; }
  .home-clog-in--date, .home-clog-in--ver, .home-clog-in--title { width: 100%; }
  .home-clog-erow { flex-wrap: wrap; }
  .home-clog-in--type { width: 100%; }
}

/* ==========================================================================
   Vespene-gas animated backdrop + balance pill + tweaks panel
   (modules/home/vespene-backdrop.js, home-backdrop.js)
   ========================================================================== */

/* The canvas is position:fixed full-viewport at z-index:-1 (set inline by the
   renderer). It lives inside #page-home, so it auto-hides when HOME isn't the
   active tab. The base paint is opaque #05070b — this just covers the gap
   before the first frame and gives a soft fade-in on (re)attach. */
.vespene-backdrop {
  background: #05070b;
  animation: vespene-bd-in 0.6s var(--ease-out, ease-out) both;
}
@keyframes vespene-bd-in { from { opacity: 0; } to { opacity: 1; } }

/* Vespene balance pill (design-handoff). A green-glow pill that leads the
   header stat chips; clicking opens the Support modal. */
.home-vsp {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px 8px 11px;
  border-radius: var(--radius-pill, 9999px);
  background: rgba(13, 26, 21, 0.6);
  border: 1px solid rgba(51, 232, 138, 0.32);
  box-shadow: 0 0 24px rgba(51, 232, 138, 0.16), inset 0 0 16px rgba(51, 232, 138, 0.05);
  cursor: pointer; font: inherit;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}
.home-vsp:hover {
  border-color: rgba(51, 232, 138, 0.55);
  box-shadow: 0 0 30px rgba(51, 232, 138, 0.26), inset 0 0 18px rgba(51, 232, 138, 0.08);
  transform: translateY(-1px);
}
.home-vsp:focus-visible { outline: 2px solid #46f29a; outline-offset: 2px; }
.home-vsp__drop { width: 22px; height: 22px; display: grid; place-items: center; }
.home-vsp__val { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: #9bffce; letter-spacing: 0.03em; }
.home-vsp__lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: #4ea882; text-transform: uppercase; }

/* ---- Animated-background tweaks, folded into the customize/settings bar ---
   The customize hint bar stacks its instruction row (.home-hintbar__main) over
   the inline backdrop controls (.home-bdctl) when in customize mode. */
.home-hintbar--customize { flex-direction: column; align-items: stretch; gap: 12px; }
.home-hintbar__main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; width: 100%; }

.home-bdctl {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; width: 100%;
  padding-top: 12px; border-top: 1px solid rgba(86,194,255,.22);
}
.home-bdctl__group { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.home-bdctl__group--toggle { justify-content: center; }
.home-bdctl__group--slider { flex: 1 1 160px; min-width: 140px; }
.home-bdctl__group--reset { margin-left: auto; align-self: center; }
/* Dim the look controls (not the master toggle / reset) when the effect is off. */
.home-bdctl.is-off .home-bdctl__group:not(.home-bdctl__group--toggle):not(.home-bdctl__group--reset) {
  opacity: .45; transition: opacity var(--duration-fast);
}
.home-bdctl__lbl {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--color-text-subtle);
}

/* Master on/off switch */
.home-bdctl__switch {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  background: none; border: 0; padding: 0; font: inherit; color: var(--color-text-muted);
}
.home-bdctl__switch-track {
  width: 34px; height: 18px; border-radius: 9999px; flex-shrink: 0;
  background: rgba(255,255,255,.12); border: 1px solid var(--color-border-strong);
  position: relative; transition: background var(--duration-fast), border-color var(--duration-fast);
}
.home-bdctl__switch-thumb {
  position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-text-subtle); transition: transform var(--duration-fast), background var(--duration-fast);
}
.home-bdctl__switch.is-on .home-bdctl__switch-track { background: rgba(51,232,138,.28); border-color: rgba(51,232,138,.5); }
.home-bdctl__switch.is-on .home-bdctl__switch-thumb { transform: translateX(16px); background: #46f29a; }
.home-bdctl__switch-lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.home-bdctl__switch.is-on .home-bdctl__switch-lbl { color: #bfffd9; }
.home-bdctl__switch:focus-visible { outline: 2px solid #46f29a; outline-offset: 3px; border-radius: 4px; }

/* Glow swatches */
.home-bdctl__swatches { display: inline-flex; gap: 9px; }
.home-bdctl__sw {
  width: 24px; height: 24px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid transparent; background: none; display: grid; place-items: center;
  transition: transform var(--duration-fast), border-color var(--duration-fast);
}
.home-bdctl__sw span {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--sw); box-shadow: 0 0 10px color-mix(in srgb, var(--sw) 60%, transparent);
}
.home-bdctl__sw:hover { transform: scale(1.08); }
.home-bdctl__sw.is-on { border-color: #fff; }
.home-bdctl__sw:focus-visible { outline: 2px solid var(--sw); outline-offset: 2px; }

/* Range sliders — themed track + thumb */
.home-bdctl__range { width: 100%; height: 4px; -webkit-appearance: none; appearance: none; background: rgba(255,255,255,.14); border-radius: 4px; outline: none; }
.home-bdctl__range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%; background: #46f29a; border: 2px solid #0a0f0d; cursor: pointer; box-shadow: 0 0 8px rgba(70,242,154,.5); }
.home-bdctl__range::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #46f29a; border: 2px solid #0a0f0d; cursor: pointer; box-shadow: 0 0 8px rgba(70,242,154,.5); }
.home-bdctl__range:focus-visible { box-shadow: 0 0 0 2px rgba(70,242,154,.5); }
.home-bdctl__scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-subtle); margin-top: 2px; }

/* Reset to defaults */
.home-bdctl__reset {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 13px; border-radius: 8px; cursor: pointer;
  border: 1px dashed var(--color-border-strong); background: transparent; color: var(--color-text-muted);
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.home-bdctl__reset:hover { border-color: var(--color-accent); color: #bfe6ff; }
.home-bdctl__reset:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

@media (max-width: 767px) {
  .home-bdctl { gap: 14px 16px; }
  .home-bdctl__group--reset { margin-left: 0; align-self: stretch; }
  .home-bdctl__reset { width: 100%; }
}
