/* ==========================================================================
   PeakFrame v2 — Creator Dashboard
   Extends the ui-v2 token set (Discord-direction, periwinkle accent). Scoped
   under html.ui-v2 .pf-dash so nothing here can leak into the v1 editor, which
   non-admin sessions still use unchanged.

   Design read: game-client chrome (Discord / Riot / Steam library) rather than
   SaaS dashboard — the audience builds Roblox games. Numbers lead: the first
   thing on the Dashboard is how the game is doing, in tiles and charts, not a
   welcome message.

   Rules held from ui-v2: tonal layering not borders, flat solid buttons that
   darken rather than lift, 8/12/16 radii, no glass, background-tinted shadows.
   Rules added here: exactly one accent gradient (the meter fill) so it stays a
   signal, and chart series colours come only from SERIES in
   dashboard-data.js — the UI accents are too light for a dark plot surface and
   two of them collapse under deuteranopia.
   ========================================================================== */

html.ui-v2 .pf-dash {
  /* Near-black canvas with barely-lifted panels, pill navigation, one
     horizontal gradient reserved for primary action. Accent stays PeakFrame
     periwinkle; the cyan end of the CTA gradient is the only new hue. */
  --pf-canvas: #07080c;
  --pf-rail-bg: #0b0c12;
  --pf-panel: #101219;
  --pf-panel-2: #171a24;
  --pf-panel-3: #1e222e;

  --pf-bronze: #c08457;
  --pf-silver: #b9c2d4;
  --pf-gold: #e8c069;
  --pf-diamond: #7fd8e8;

  --pf-cta: linear-gradient(95deg, #8da2ff 0%, #7ec8f0 55%, #7fe3d8 100%);
  --pf-fill: linear-gradient(90deg, var(--v2-accent), var(--v2-accent-2));
  --pf-spectrum: linear-gradient(100deg, #8da2ff, #a779ff, #7ec8f0, #7fe3d8, #8da2ff);

  --pf-good: #56d79a;
  --pf-warn: #f5c26b;
  --pf-bad: #ff7a7a;
  --pf-queued: #b58cff;
  --pf-text: rgba(255, 255, 255, .95);
  --pf-dim: rgba(255, 255, 255, .58);
  --pf-dimmer: rgba(255, 255, 255, .36);
  --pf-rail: 268px;
  --pf-r-lg: 20px;
  --pf-r-pill: 999px;

  /* The shell owns the viewport: the rail and the section never scroll away,
     and a section marked `fit` sizes its panels to what is left instead of
     running off the bottom. */
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--pf-rail) minmax(0, 1fr);
  background: var(--pf-canvas);
  color: var(--pf-text);
}

/* ---------- rail ---------- */

html.ui-v2 .pf-rail {
  background: var(--pf-rail-bg);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 14px 14px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  scrollbar-width: thin;
}
/* the reference splits primary destinations from quick actions with a rule
   rather than a heading — quieter, and it gives the pills room to breathe */
html.ui-v2 .pf-rail-rule {
  height: 1px; background: rgba(255, 255, 255, .07);
  margin: 14px -14px 12px;
}

html.ui-v2 .pf-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 14px;
  font-weight: 800;
  letter-spacing: -.2px;
}
html.ui-v2 .pf-brand img { width: 26px; height: 26px; border-radius: 7px; }
html.ui-v2 .pf-brand + .pf-rail-rule { margin-top: 0; }
/* the wordmark is one flex item; without the wrapper the rail's gap lands
   between "Peak" and "Frame" and splits the brand in two */
html.ui-v2 .pf-brand b { font-weight: 800; }
html.ui-v2 .pf-brand span { color: var(--v2-accent); }

/* the game card — identity, role, and the three numbers worth a glance */
html.ui-v2 .pf-player {
  background: var(--pf-panel);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}
html.ui-v2 .pf-player-top { display: flex; align-items: center; gap: 10px; }
html.ui-v2 .pf-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 800;
  background: var(--pf-panel-2);
  box-shadow: inset 0 0 0 2px var(--tier, var(--v2-accent));
  color: var(--tier, var(--v2-accent));
  flex: 0 0 auto;
}
html.ui-v2 .pf-player-id { min-width: 0; }
html.ui-v2 .pf-player-name {
  font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.ui-v2 .pf-player-rank {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tier, var(--v2-accent));
}
/* ---------- progress meters ---------- */

html.ui-v2 .pf-meter {
  height: 6px; border-radius: 99px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden; position: relative;
}
html.ui-v2 .pf-meter i {
  display: block; height: 100%; border-radius: 99px;
  background: var(--pf-fill);
  transition: width .9s var(--v2-ease);
}
/* one shimmer, on a live meter only — a signal, not decoration */
html.ui-v2 .pf-meter.pf-live i::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .32), transparent);
  transform: translateX(-100%);
  animation: v2-shimmer 2.4s infinite;
}
html.ui-v2 .pf-meter.sm { height: 4px; }
html.ui-v2 .pf-meter.lg { height: 9px; }
html.ui-v2 .pf-meter.good i { background: var(--pf-good); }
html.ui-v2 .pf-meter.warn i { background: var(--pf-warn); }

/* ---------- nav ---------- */

html.ui-v2 .pf-navgroup {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--pf-dimmer); padding: 14px 10px 6px;
}
html.ui-v2 .pf-nav {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 14px; border-radius: var(--pf-r-pill);
  font-size: 15px; font-weight: 600; color: var(--pf-dim);
  cursor: pointer; user-select: none;
  transition: background-color .15s var(--v2-ease), color .15s var(--v2-ease);
}
html.ui-v2 .pf-nav:hover { background: rgba(255, 255, 255, .05); color: var(--pf-text); }
/* active is a solid accent pill filling the rail, not a tonal tint */
html.ui-v2 .pf-nav.on {
  background: color-mix(in srgb, var(--v2-accent) 20%, transparent);
  color: #fff;
}
html.ui-v2 .pf-nav.on .pf-nav-ico { color: var(--v2-accent); }
html.ui-v2 .pf-nav-ico {
  width: 22px; height: 22px; display: grid; place-items: center;
  font-size: 15px; flex: 0 0 auto;
}
/* the action group reads as circular buttons rather than bare glyphs */
html.ui-v2 .pf-nav.act .pf-nav-ico {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--pf-panel-2); font-size: 13px;
}
html.ui-v2 .pf-nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ui-v2 .pf-nav-count {
  font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 99px;
  background: var(--v2-accent); color: #0b0d14; font-variant-numeric: tabular-nums;
}
html.ui-v2 .pf-nav-count.quiet { background: rgba(255, 255, 255, .1); color: var(--pf-dim); }
html.ui-v2 .pf-nav-count.alert { background: var(--pf-queued); color: #14091f; }
html.ui-v2 .pf-rail-foot { margin-top: auto; padding-top: 12px; }
html.ui-v2 .pf-rail-extra { padding: 0 4px 8px; }
html.ui-v2 .pf-rail-extra select {
  width: 100%; appearance: none; cursor: pointer;
  border: 0; border-radius: var(--v2-r-control);
  background: var(--pf-panel-2); color: var(--pf-text);
  padding: 9px 12px; font: inherit; font-size: 12.5px;
}
html.ui-v2 .pf-rail-v {
  padding: 10px 14px 2px; font-size: 10.5px; color: var(--pf-dimmer);
  font-variant-numeric: tabular-nums;
}

/* ---------- main ---------- */

html.ui-v2 .pf-spacer { flex: 1; }
html.ui-v2 .pf-body {
  min-width: 0; min-height: 0;
  padding: 22px 26px 26px; width: 100%;
  overflow-y: auto; scrollbar-width: thin;
}
/* a `fit` section never scrolls the page — it is a grid the height of the
   viewport, and anything too tall scrolls inside its own panel */
html.ui-v2 .pf-body.fit {
  overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 16px;
}

html.ui-v2 .pf-h1 {
  font-size: 34px; font-weight: 800; letter-spacing: -.4px; margin: 14px 0 4px;
}
html.ui-v2 .pf-sub { color: var(--pf-dim); margin: 0 0 26px; font-size: 15px; max-width: 76ch; }
html.ui-v2 .pf-h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--pf-dimmer); margin: 30px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
html.ui-v2 .pf-h2::after { content: ''; flex: 1; height: 1px; background: var(--v2-line); }

/* ---------- panels + grid ---------- */

/* start-aligned: a short panel next to a tall one should size to its content
   rather than stretch and leave a void under its last row */
html.ui-v2 .pf-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}
/* every span, not just the ones used today — a missing rule collapses the
   panel into an auto track and overlaps its neighbour */
html.ui-v2 .pf-c1 { grid-column: span 1; }
html.ui-v2 .pf-c2 { grid-column: span 2; }
html.ui-v2 .pf-c3 { grid-column: span 3; }
html.ui-v2 .pf-c4 { grid-column: span 4; }
html.ui-v2 .pf-c5 { grid-column: span 5; }
html.ui-v2 .pf-c6 { grid-column: span 6; }
html.ui-v2 .pf-c7 { grid-column: span 7; }
html.ui-v2 .pf-c8 { grid-column: span 8; }
html.ui-v2 .pf-c9 { grid-column: span 9; }
html.ui-v2 .pf-c10 { grid-column: span 10; }
html.ui-v2 .pf-c11 { grid-column: span 11; }
html.ui-v2 .pf-c12 { grid-column: span 12; }

html.ui-v2 .pf-panel {
  background: var(--pf-panel);
  border-radius: var(--pf-r-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  animation: v2-in .3s var(--v2-ease) both;
}
html.ui-v2 .pf-panel-head { display: flex; align-items: center; gap: 10px; }
html.ui-v2 .pf-panel-t { font-size: 16px; font-weight: 700; letter-spacing: -.1px; }
html.ui-v2 .pf-panel-d { font-size: 12.5px; color: var(--pf-dim); margin-top: -6px; line-height: 1.5; }
html.ui-v2 .pf-panel.pf-locked { opacity: .55; }

/* ---------- state chips ---------- */

html.ui-v2 .pf-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 8px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255, 255, 255, .07); color: var(--pf-dim);
  white-space: nowrap;
}
html.ui-v2 .pf-chip.ready { background: rgba(86, 215, 154, .15); color: var(--pf-good); }
html.ui-v2 .pf-chip.queued { background: rgba(181, 140, 255, .17); color: var(--pf-queued); }
html.ui-v2 .pf-chip.locked { background: rgba(255, 255, 255, .06); color: var(--pf-dimmer); }
html.ui-v2 .pf-chip.warn { background: rgba(245, 194, 107, .16); color: var(--pf-warn); }
html.ui-v2 .pf-chip.bad { background: rgba(255, 122, 122, .16); color: var(--pf-bad); }
html.ui-v2 .pf-chip.accent { background: var(--v2-tint); color: var(--v2-accent); }

/* the queued dot pulses — operator mode means most AI panels sit here, and a
   still indicator reads as "stuck" rather than "waiting on a person" */
html.ui-v2 .pf-chip.queued::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; animation: pf-pulse 1.7s ease-in-out infinite;
}
@keyframes pf-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .28; } }

/* ---------- stat tiles ---------- */

html.ui-v2 .pf-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
html.ui-v2 .pf-stat {
  background: var(--pf-panel); border-radius: var(--pf-r-lg);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 3px;
  animation: v2-in .3s var(--v2-ease) both;
}
html.ui-v2 .pf-stat-k {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--pf-dimmer);
}
html.ui-v2 .pf-stat-v {
  font-size: 30px; font-weight: 800; letter-spacing: -.6px; font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
html.ui-v2 .pf-stat-n { font-size: 11.5px; color: var(--pf-dim); }
html.ui-v2 .pf-up { color: var(--pf-good); font-weight: 700; }
html.ui-v2 .pf-down { color: var(--pf-bad); font-weight: 700; }

/* ---------- game header ---------- */
/* One compact row: identity and nothing else. The live-player readout that
   used to sit here moved into the chart, which is where it means something. */

html.ui-v2 .pf-gamehead {
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  min-width: 0;
}
html.ui-v2 .pf-gamehead .pf-logo { width: 38px; height: 38px; border-radius: 11px; }
html.ui-v2 .pf-gamehead .pf-logo b { font-size: 13px; }
html.ui-v2 .pf-gamehead-name {
  font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: min(46vw, 520px);
}
html.ui-v2 .pf-gamehead-meta {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--pf-dim);
}

/* ---------- the fit grid ---------- */
/* Two rows: the chart and the action list on top, three reference panels
   underneath. Rows are fr-based so the whole thing compresses on a short
   viewport rather than pushing a panel below the fold. */

html.ui-v2 .pf-dashgrid {
  display: grid; gap: 12px; min-height: 0;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(260px, 1.45fr) minmax(180px, 1fr);
}
html.ui-v2 .pf-dashgrid > .pf-panel { min-height: 0; overflow: hidden; }

/* a panel whose body is a list that may outgrow its cell */
html.ui-v2 .pf-scrollpanel { min-height: 0; }
html.ui-v2 .pf-scroll {
  min-height: 0; overflow-y: auto; scrollbar-width: thin;
  margin-right: -8px; padding-right: 8px;
}

/* ---------- chart panel controls ---------- */

html.ui-v2 .pf-chartpanel { min-height: 0; }
html.ui-v2 .pf-chartwrap { min-height: 0; flex: 1; display: flex; align-items: center; }
html.ui-v2 .pf-chartwrap .pf-chart { width: 100%; }
html.ui-v2 .pf-chartfoot {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 2px;
}
html.ui-v2 .pf-chartfoot-n { font-size: 11.5px; color: var(--pf-dimmer); }
html.ui-v2 .pf-mk-key { display: flex; gap: 14px; flex-wrap: wrap; }
html.ui-v2 .pf-mk-keyi {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--pf-dim);
}
html.ui-v2 .pf-mk-keyi i {
  width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
}
html.ui-v2 .pf-mk-keyi i svg { width: 10px; height: 10px; }

html.ui-v2 .pf-selwrap { position: relative; display: inline-flex; align-items: center; }
html.ui-v2 .pf-select {
  appearance: none; border: 0; cursor: pointer; font: inherit;
  font-size: 12.5px; font-weight: 600;
  background: var(--pf-panel-2); color: var(--pf-text);
  border-radius: var(--v2-r-control); padding: 6px 30px 6px 12px;
}
html.ui-v2 .pf-select:hover { background: var(--pf-panel-3); }
html.ui-v2 .pf-selwrap > svg {
  position: absolute; right: 10px; width: 13px; height: 13px;
  pointer-events: none; color: var(--pf-dim);
}
html.ui-v2 .pf-count {
  font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px;
  background: var(--pf-bad); color: #2a0808; font-variant-numeric: tabular-nums;
}

/* ---------- requires action ---------- */

html.ui-v2 .pf-todo {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 13px;
  background: var(--pf-canvas);
  border-left: 3px solid var(--pf-dimmer);
}
html.ui-v2 .pf-todo + .pf-todo { margin-top: 8px; }
html.ui-v2 .pf-todo.high { border-left-color: var(--pf-bad); }
html.ui-v2 .pf-todo.normal { border-left-color: var(--pf-warn); }
html.ui-v2 .pf-todo-main { flex: 1; min-width: 0; }
html.ui-v2 .pf-todo-t { font-size: 13px; font-weight: 650; line-height: 1.35; }
html.ui-v2 .pf-todo-d {
  font-size: 11.5px; color: var(--pf-dim); line-height: 1.45; margin-top: 3px;
}
html.ui-v2 .pf-todo .pf-btn { flex: 0 0 auto; }

/* ---------- charts ---------- */
/* Marks are thin, grid and axes recessive, text never wears a series colour.
   See dashboard-charts.js for why each of those is a rule. */

html.ui-v2 .pf-chart { margin: 4px 0 0; position: relative; }
/* Deep on purpose: `.pf-dash svg` sizes every icon at 1em and is declared
   later in this file, so an equal-specificity rule here would lose. And it is
   `> svg`, not ` svg` — the platform badges nest a second <svg> inside the
   chart, and a descendant selector stretched those to 100% of the plot. */
html.ui-v2 .pf-dash .pf-chart > svg { width: 100%; height: auto; display: block; overflow: visible; }
html.ui-v2 .pf-dash .pf-chart svg.pf-mk-glyph { width: 13px; height: 13px; }
html.ui-v2 .pf-chart .pf-grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
html.ui-v2 .pf-chart .pf-axis {
  fill: var(--pf-dimmer); font-size: 11px; font-variant-numeric: tabular-nums;
}
html.ui-v2 .pf-chart .pf-mark {
  fill: var(--pf-text); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* The crosshair and its dot are hidden by class, not by the `hidden`
   attribute: `hidden` is an HTML global, and inside an <svg> it does nothing —
   which shipped once as a stray blue dot parked at the chart's left edge. */
html.ui-v2 .pf-chart .pf-cross, html.ui-v2 .pf-chart .pf-dot { display: none; }
html.ui-v2 .pf-chart .pf-cross.on, html.ui-v2 .pf-chart .pf-dot.on { display: block; }
html.ui-v2 .pf-chart .pf-cross { stroke: rgba(255, 255, 255, .28); stroke-width: 1; stroke-dasharray: 3 3; }

/* `display: grid` below outranks the UA's `[hidden] { display: none }`, so the
   hidden state needs saying explicitly or the tooltip parks at the top-left */
html.ui-v2 .pf-tip[hidden] { display: none; }
html.ui-v2 .pf-tip {
  position: absolute; top: 0; transform: translateX(-50%);
  background: var(--pf-panel-3); border-radius: 11px; padding: 8px 11px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .07);
  pointer-events: none; white-space: nowrap; display: grid; gap: 1px;
}
html.ui-v2 .pf-tip-k { font-size: 11px; color: var(--pf-dim); }
html.ui-v2 .pf-tip-v { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
html.ui-v2 .pf-tip-l { font-size: 10.5px; color: var(--pf-dimmer); }

html.ui-v2 .pf-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
html.ui-v2 .pf-legend-i {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--pf-dim);
}
html.ui-v2 .pf-legend-i i { width: 10px; height: 10px; border-radius: 3px; }

html.ui-v2 .pf-tableview { margin-top: 8px; }
html.ui-v2 .pf-tableview summary {
  font-size: 11.5px; color: var(--pf-dimmer); cursor: pointer; padding: 3px 0;
}
html.ui-v2 .pf-tableview summary:hover { color: var(--pf-dim); }
html.ui-v2 .pf-tableview table {
  width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
html.ui-v2 .pf-tableview th, html.ui-v2 .pf-tableview td {
  text-align: left; padding: 4px 8px 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
html.ui-v2 .pf-tableview th { color: var(--pf-dim); font-weight: 600; }

html.ui-v2 .pf-spark { width: 96px; height: 28px; flex: 0 0 auto; }
/* In a third-of-the-width panel on a laptop the sparkline eats the room the
   platform's name needs, and a row reading "YouT…" is worse than a row with
   no trend line — the signed percentage next to it still gives the direction. */
@media (max-width: 1560px) {
  html.ui-v2 .pf-scrollpanel .pf-spark { display: none; }
}

/* ---------- content badges on the chart ---------- */
/* A post pinned to the day it went out. Brand colours here name a platform
   and always carry that platform's logo and its name in the card — they are
   identity, not a data channel, so they sit outside SERIES on purpose. */

html.ui-v2 .pf-chart .pf-mkg { cursor: pointer; }
html.ui-v2 .pf-chart .pf-mk-face,
html.ui-v2 .pf-chart .pf-mk-back {
  stroke: var(--pf-panel); stroke-width: 2;
  transition: transform .12s var(--v2-ease);
}
html.ui-v2 .pf-chart .pf-mk-back { opacity: .82; }
html.ui-v2 .pf-chart .pf-mk-glyph { color: #fff; pointer-events: none; }
html.ui-v2 .pf-chart .pf-mk-stem {
  stroke: rgba(255, 255, 255, .22); stroke-width: 1.5; stroke-dasharray: 2 3;
}
html.ui-v2 .pf-chart .pf-mk-n {
  fill: var(--pf-text); font-size: 10px; font-weight: 800;
  paint-order: stroke; stroke: var(--pf-panel); stroke-width: 3px;
}
/* the real hit target: a 34px circle, because a 22px badge is not a button */
html.ui-v2 .pf-chart .pf-mk-hit { fill: transparent; }
html.ui-v2 .pf-chart .pf-mkg:hover .pf-mk-face,
html.ui-v2 .pf-chart .pf-mkg.on .pf-mk-face { stroke: var(--pf-text); }
html.ui-v2 .pf-chart .pf-mkg:focus-visible { outline: none; }
html.ui-v2 .pf-chart .pf-mkg:focus-visible .pf-mk-face { stroke: var(--v2-accent); stroke-width: 3; }

/* ---------- the post card ---------- */

html.ui-v2 .pf-post {
  position: absolute; top: 0; z-index: 30;
  transform: translateX(-50%);
  width: 320px; border-radius: 16px;
  background: var(--pf-panel-3);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .62), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
html.ui-v2 .pf-post[hidden] { display: none; }
html.ui-v2 .pf-post-in { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 12px; }
html.ui-v2 .pf-post-art {
  position: relative; border-radius: 11px; overflow: hidden;
  aspect-ratio: 9 / 14; background: var(--pf-panel-2);
}
html.ui-v2 .pf-post-art img { width: 100%; height: 100%; object-fit: cover; }
html.ui-v2 .pf-post-badge {
  position: absolute; left: 5px; top: 5px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px 3px 5px; border-radius: 99px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .3px;
  text-transform: uppercase; color: #fff;
}
html.ui-v2 .pf-post-badge svg { width: 11px; height: 11px; }
html.ui-v2 .pf-post-len {
  position: absolute; right: 5px; bottom: 5px;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, .72); font-size: 10px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
html.ui-v2 .pf-post-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
html.ui-v2 .pf-post-t { font-size: 13px; font-weight: 700; line-height: 1.35; }
html.ui-v2 .pf-post-when { font-size: 11px; color: var(--pf-dimmer); }
html.ui-v2 .pf-post-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin-top: 2px;
}
html.ui-v2 .pf-post-stats span {
  display: flex; gap: 5px; align-items: baseline;
  font-size: 11px; color: var(--pf-dim);
}
html.ui-v2 .pf-post-stats b {
  font-size: 12.5px; color: var(--pf-text); font-variant-numeric: tabular-nums;
}
html.ui-v2 .pf-post-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: auto; padding-top: 6px;
}
html.ui-v2 .pf-post-nav { display: inline-flex; align-items: center; gap: 2px; }
html.ui-v2 .pf-post-arrow {
  appearance: none; border: 0; cursor: pointer;
  width: 22px; height: 22px; border-radius: 7px; line-height: 1;
  background: var(--pf-panel-2); color: var(--pf-text); font-size: 15px;
}
html.ui-v2 .pf-post-arrow:hover { background: var(--pf-panel); }
html.ui-v2 .pf-post-count {
  font-size: 11px; color: var(--pf-dim); padding: 0 5px;
  font-variant-numeric: tabular-nums;
}

/* Ranked horizontal bars — every row direct-labelled, so no legend is needed. */
html.ui-v2 .pf-rank { display: grid; gap: 10px; margin-top: 4px; }
html.ui-v2 .pf-rank-r {
  display: grid; align-items: center; gap: 4px 12px;
  grid-template-columns: minmax(110px, 1.2fr) minmax(60px, 1.6fr) auto;
  grid-template-areas: 'l t v';
}
html.ui-v2 .pf-rank-l {
  grid-area: l; font-size: 12.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
html.ui-v2 .pf-rank-r.self .pf-rank-l { font-weight: 700; }
html.ui-v2 .pf-rank-l em {
  font-style: normal; font-size: 10px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--v2-accent);
}
html.ui-v2 .pf-rank-t {
  grid-area: t; height: 10px; border-radius: 5px;
  background: rgba(255, 255, 255, .05); overflow: hidden; display: block;
}
html.ui-v2 .pf-rank-t i { display: block; height: 100%; border-radius: 5px; }
html.ui-v2 .pf-rank-v {
  grid-area: v; font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; text-align: right;
}

html.ui-v2 .pf-h3 {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--pf-dim); margin: 18px 0 2px;
}

/* ---------- rows / lists ---------- */

html.ui-v2 .pf-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--v2-r-control);
  transition: background-color .14s var(--v2-ease);
}
html.ui-v2 .pf-row:hover { background: var(--pf-panel-2); }
html.ui-v2 .pf-row-main { flex: 1; min-width: 0; }
html.ui-v2 .pf-row-t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ui-v2 .pf-row-d { font-size: 11.5px; color: var(--pf-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* rows whose subtitle carries the actual content — an event log, say — wrap
   instead of truncating, because "64% above the 30-da…" is not an event */
html.ui-v2 .pf-row.pf-wrap { align-items: flex-start; }
html.ui-v2 .pf-row.pf-wrap .pf-row-d { white-space: normal; line-height: 1.45; }
html.ui-v2 .pf-row.pf-wrap .pf-thumb { margin-top: 2px; }
html.ui-v2 .pf-row-n { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--pf-dim); flex: 0 0 auto; }
html.ui-v2 .pf-thumb {
  width: 46px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  background: var(--pf-panel-2); display: grid; place-items: center;
  font-size: 13px; color: var(--pf-dimmer);
}
html.ui-v2 .pf-thumb.tall { width: 30px; height: 44px; }

/* ---------- buttons ---------- */

html.ui-v2 .pf-btn {
  border: 0; border-radius: var(--pf-r-pill);
  padding: 10px 18px; font: inherit; font-size: 13.5px; font-weight: 700;
  background: var(--pf-panel-2); color: var(--pf-text);
  cursor: pointer; transition: background-color .14s var(--v2-ease);
  white-space: nowrap;
}
html.ui-v2 .pf-btn:hover { background: var(--pf-panel-3); }
html.ui-v2 .pf-btn.primary { background: var(--v2-accent); color: #0b0d14; }
html.ui-v2 .pf-btn.primary:hover { background: var(--v2-accent-down); }
html.ui-v2 .pf-btn.ghost { background: transparent; color: var(--pf-dim); }
html.ui-v2 .pf-btn.ghost:hover { background: var(--v2-surface-2); color: var(--pf-text); }
html.ui-v2 .pf-btn.sm { padding: 6px 11px; font-size: 12px; }
html.ui-v2 .pf-btn:disabled { opacity: .4; cursor: not-allowed; }
html.ui-v2 .pf-btn:active:not(:disabled) { transform: translateY(.5px); }

/* ---------- calendar ---------- */

html.ui-v2 .pf-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
html.ui-v2 .pf-cal-h {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--pf-dimmer); text-align: center; padding-bottom: 3px;
}
html.ui-v2 .pf-cal-d {
  aspect-ratio: 1; border-radius: 10px; background: var(--pf-canvas);
  padding: 5px; font-size: 10.5px; color: var(--pf-dim);
  display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; transition: background-color .14s var(--v2-ease);
}
html.ui-v2 .pf-cal-d:hover { background: var(--pf-panel-2); }
html.ui-v2 .pf-cal-d.out { opacity: .3; }
html.ui-v2 .pf-cal-d.today { box-shadow: inset 0 0 0 1.5px var(--v2-accent); color: #fff; font-weight: 700; }
html.ui-v2 .pf-cal-dot { height: 3px; border-radius: 99px; background: var(--v2-accent); }
html.ui-v2 .pf-cal-dot.tiktok { background: #56d7c4; }
html.ui-v2 .pf-cal-dot.youtube { background: #ff7a7a; }
html.ui-v2 .pf-cal-dot.reels { background: #d17aff; }
html.ui-v2 .pf-cal-dot.ghost { background: rgba(255, 255, 255, .16); }

/* ---------- misc ---------- */

html.ui-v2 .pf-empty {
  padding: 30px 16px; text-align: center; color: var(--pf-dimmer); font-size: 13px;
  background: var(--pf-canvas); border-radius: var(--pf-r-lg);
}
html.ui-v2 .pf-note {
  font-size: 12px; color: var(--pf-dimmer); line-height: 1.55;
  padding: 9px 11px; border-radius: var(--v2-r-control);
  background: var(--pf-canvas);
}
html.ui-v2 .pf-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 5px 0; }
html.ui-v2 .pf-kv span:first-child { color: var(--pf-dim); }
html.ui-v2 .pf-kv span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
html.ui-v2 .pf-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
html.ui-v2 .pf-tab {
  /* these are <button>s: without an explicit reset they arrive wearing the
     UA's white chrome, which on a near-black panel reads as a text input */
  appearance: none; border: 0; background: transparent; font: inherit;
  padding: 6px 12px; border-radius: var(--v2-r-control);
  font-size: 12.5px; font-weight: 600; color: var(--pf-dim); cursor: pointer;
  transition: background-color .13s var(--v2-ease), color .13s var(--v2-ease);
}
html.ui-v2 .pf-tab:hover { background: var(--pf-panel-2); color: var(--pf-text); }
html.ui-v2 .pf-tab.on { background: var(--pf-panel-2); color: #fff; }
html.ui-v2 .pf-input {
  width: 100%; border: 0; border-radius: 14px;
  background: var(--pf-canvas); color: var(--pf-text);
  padding: 9px 12px; font: inherit; font-size: 13px;
}
html.ui-v2 .pf-input:focus-visible { outline: 2px solid var(--v2-accent); outline-offset: 0; }
html.ui-v2 textarea.pf-input { resize: vertical; min-height: 74px; line-height: 1.5; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  html.ui-v2 .pf-c3, html.ui-v2 .pf-c4 { grid-column: span 6; }
  html.ui-v2 .pf-c8 { grid-column: span 12; }
}
@media (max-width: 820px) {
  html.ui-v2 .pf-dash { grid-template-columns: 1fr; }
  html.ui-v2 .pf-rail {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 4px; padding: 10px;
  }
  html.ui-v2 .pf-player, html.ui-v2 .pf-navgroup, html.ui-v2 .pf-rail-foot { display: none; }
  html.ui-v2 .pf-nav-label { display: none; }
  html.ui-v2 .pf-nav { padding: 9px 11px; }
  html.ui-v2 .pf-body, html.ui-v2 .pf-topbar { padding-left: 14px; padding-right: 14px; }
  html.ui-v2 .pf-c6, html.ui-v2 .pf-c3, html.ui-v2 .pf-c4 { grid-column: span 12; }
}

@media (prefers-reduced-motion: reduce) {
  html.ui-v2 .pf-panel, html.ui-v2 .pf-stat { animation: none; }
  html.ui-v2 .pf-meter i { transition: none; }
  html.ui-v2 .pf-meter.pf-live i::after,
  html.ui-v2 .pf-chip.queued::before { animation: none; }
}

/* ==========================================================================
   Game identity, team avatars, and the icon system.
   ========================================================================== */

/* every icon is an inline SVG inheriting `color`, so a nav row's hue is set
   once on the container rather than baked into the artwork */
html.ui-v2 .pf-dash svg { width: 1em; height: 1em; display: block; }
html.ui-v2 .pf-nav-ico svg { width: 21px; height: 21px; }
/* the colour lives on the container, not the artwork, so a row can tint its
   own glyph inline — a rule on the <svg> itself would beat that inline style */
html.ui-v2 .pf-thumb { color: var(--pf-dim); }
html.ui-v2 .pf-thumb svg { width: 19px; height: 19px; }
html.ui-v2 .pf-row-n svg { display: inline-block; vertical-align: -2px; }
/* a sparkline is a chart, not an icon — it must not inherit the 1em sizing */
html.ui-v2 .pf-row-n svg.pf-spark { width: 108px; height: 30px; vertical-align: middle; }

/* the game logo: real art when the file exists, initials tile until then */
html.ui-v2 .pf-logo {
  position: relative; flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 13px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--pf-panel-2);
  box-shadow: inset 0 0 0 2px var(--tier, var(--v2-accent));
}
html.ui-v2 .pf-logo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}
html.ui-v2 .pf-logo b {
  font-size: 15px; font-weight: 800; letter-spacing: .5px;
  color: var(--tier, var(--v2-accent));
}
html.ui-v2 .pf-logo.sm { width: 34px; height: 34px; border-radius: 10px; }
html.ui-v2 .pf-logo.sm b { font-size: 12px; }
html.ui-v2 .pf-logo.lg { width: 54px; height: 54px; border-radius: 16px; }
html.ui-v2 .pf-logo.lg b { font-size: 18px; }

/* team avatars */
html.ui-v2 .pf-avatar.sm {
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; flex: 0 0 auto; position: relative;
  background: var(--pf-panel-2); color: var(--pf-dim);
  box-shadow: none;
}
html.ui-v2 .pf-avatar.sm { width: 38px; height: 38px; font-size: 14px; }
html.ui-v2 .pf-avatar.online::after {
  content: ''; position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--pf-good); outline: 2.5px solid var(--pf-panel);
}

html.ui-v2 .pf-row-h { font-size: 11.5px; color: var(--pf-dimmer); font-weight: 500; }
html.ui-v2 .pf-row-n { display: flex; align-items: center; gap: 9px; }

html.ui-v2 .pf-role { padding: 9px 0; }
html.ui-v2 .pf-role + .pf-role { border-top: 1px solid rgba(255, 255, 255, .05); }
html.ui-v2 .pf-role-t { font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
html.ui-v2 .pf-role-d { font-size: 12px; color: var(--pf-dim); line-height: 1.5; margin-top: 2px; }

html.ui-v2 select.pf-input { appearance: none; cursor: pointer; }


/* the rail is 268px wide and game names are long: one line, ellipsis, full
   name on the title attribute — a name that rewraps the rail whenever the
   workspace changes is worse than one that ends in dots */
html.ui-v2 .pf-player-name {
  font-size: 13.5px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* the hero's art panel is where the game's key art lives */
html.ui-v2 .pf-logo.hero {
  position: relative; width: 168px; height: 168px; border-radius: 34px;
  box-shadow: inset 0 0 0 3px var(--tier, var(--v2-accent)), 0 22px 60px rgba(0, 0, 0, .5);
}
html.ui-v2 .pf-logo.hero b { font-size: 54px; letter-spacing: 1px; }
@media (max-width: 1080px) {
  html.ui-v2 .pf-logo.hero { width: 116px; height: 116px; border-radius: 26px; }
  html.ui-v2 .pf-logo.hero b { font-size: 38px; }
}

/* a tile with real key art shows it full-bleed; the icon underneath is the
   fallback for games that have no art yet */
html.ui-v2 .pf-tile-art { position: relative; }
html.ui-v2 .pf-tile-art img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}
