/* ==========================================================================
   Playable Hub — internal showcase
   Dark-only, committed. No external assets, no fonts, no CDN.
   ========================================================================== */

:root {
  --bg:        #0a0b0f;
  --bg-soft:   #0f1116;
  --surface:   #14161d;
  --surface-2: #1a1d26;
  --surface-3: #212530;
  --border:    #23262f;
  --border-2:  #30343f;
  --text:      #e8eaf0;
  --text-2:    #b6bbca;
  --dim:       #8b90a2;
  --dim-2:     #5d6272;

  --accent:    #7c5cff;
  --accent-2:  #a78bfa;
  --accent-dim:rgba(124, 92, 255, .14);

  --live:      #34d399;
  --paused:    #7dd3fc;
  --testing:   #fbbf24;
  --rejected:  #fb7185;
  --draft:     #94a3b8;
  --archived:  #6b7280;

  --r-sm: 8px;
  --r:    13px;
  --r-lg: 20px;

  --shadow:    0 12px 34px rgba(0, 0, 0, .5);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);

  --maxw: 1460px;
  --header-h: 62px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter,
          Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-y: scroll;
}

body.is-player { overflow: hidden; }

/* Ambient glow, purely decorative */
body::before {
  content: "";
  position: fixed;
  inset: -20% 0 auto 0;
  height: 60vh;
  background:
    radial-gradient(60% 60% at 20% 0%, rgba(124, 92, 255, .10), transparent 70%),
    radial-gradient(50% 50% at 85% 10%, rgba(52, 211, 153, .06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: rgba(124, 92, 255, .35); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: #262a35;
  border: 3px solid var(--bg);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: #343947; }

/* ==========================================================================
   Header
   ========================================================================== */

.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: rgba(10, 11, 15, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.hdr__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.hdr__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #4f46e5 60%, #06b6d4);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(124, 92, 255, .4);
  flex: none;
}
.hdr__mark svg { width: 15px; height: 15px; fill: #fff; }

.hdr__title {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.hdr__title span { color: var(--dim-2); font-weight: 500; }

.hdr__spacer { flex: 1; }

/* Search */
.search {
  position: relative;
  flex: 0 1 380px;
  min-width: 140px;
}
.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  fill: var(--dim-2);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 33px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.search input::placeholder { color: var(--dim-2); }
.search input:focus {
  outline: none;
  border-color: var(--border-2);
  background: var(--surface-2);
}
.search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font);
  font-size: 10.5px;
  color: var(--dim-2);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 1px 5px;
  pointer-events: none;
}
.search input:not(:placeholder-shown) + kbd,
.search input:focus + kbd { display: none; }

.hdr__stats {
  display: flex;
  gap: 16px;
  flex: none;
  color: var(--dim);
  font-size: 12px;
}
.hdr__stats b {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

/* --------------------------------------------------------- Update hub button */

.upd {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s;
}
.upd:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-2); }
.upd:disabled { cursor: default; color: var(--dim); }
.upd__icon { width: 14px; height: 14px; fill: currentColor; flex: none; }

/* Spin only while working, so the icon reads as state rather than decoration. */
.upd.is-busy .upd__icon { animation: upd-spin 1s linear infinite; }
@keyframes upd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .upd.is-busy .upd__icon { animation: none; }
}

/* Served without the sync endpoint: still clickable, but it explains itself
   rather than looking armed. */
.upd.is-off { color: var(--dim-2); border-style: dashed; }

/* --------------------------------------------------------- top playables */

.top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.top__card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 15px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .14s, background .14s, transform .14s;
}
.top__card:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.top__head { display: flex; align-items: center; gap: 9px; min-width: 0; }

.top__rank {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.top__icon { flex: none; width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }

.top__who { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* Build names are long and underscore-heavy; let them wrap rather than
   truncate, but cap at two lines so the cards stay the same height. */
.top__name {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.top__game { font-size: 10.5px; color: var(--dim-2); }

.top__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}
.top__stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.top__val {
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.top__val.is-good { color: var(--live); }
.top__val.is-warn { color: var(--testing); }
.top__val.is-bad  { color: var(--rejected); }
.top__lbl {
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dim-2);
}

.top__note { margin: 9px 0 0; font-size: 11px; color: var(--dim-2); }

@media (max-width: 900px) {
  .top { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------- sync progress */

.synclog {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.synclog[hidden] { display: none; }
.synclog.is-bad { border-color: var(--rejected); }

.synclog__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 13px;
  border-bottom: 1px solid var(--border);
}
.synclog__title {
  flex: 1;
  font-size: 12px;
  font-weight: 640;
  letter-spacing: .02em;
}
.synclog.is-bad .synclog__title { color: var(--rejected); }
.synclog__x {
  flex: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  font-size: 11px;
  cursor: pointer;
}
.synclog__x:hover { background: var(--surface-2); color: var(--text); }

.synclog__body {
  margin: 0;
  max-height: 210px;
  overflow: auto;
  padding: 10px 13px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--dim);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Shell / layout
   ========================================================================== */

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 22px 80px;
}

.page-head { margin-bottom: 22px; }

.page-head h1 {
  margin: 0 0 5px;
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -.025em;
}
.page-head p { margin: 0; color: var(--dim); font-size: 13.5px; }

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 14px;
  font-size: 11px;
  font-weight: 640;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim-2);
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* Sits after the gradient rule, hard right */
.section-label__asof {
  order: 3;
  flex: none;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--dim-2);
  cursor: help;
  white-space: nowrap;
}
/* Delivery and ROAS carry different cutoffs, so there are two of these. Separate
   them, or "delivery through Aug 24ROAS as of Aug 23" runs together. */
.section-label__asof + .section-label__asof::before {
  content: "·";
  margin-right: 8px;
  color: var(--border);
}

/* Back link */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px 11px 5px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.back:hover { color: var(--text); border-color: var(--border-2); }
.back svg { width: 13px; height: 13px; fill: currentColor; flex: none; }

/* ==========================================================================
   Games grid
   ========================================================================== */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: 15px;
}

.game-card {
  display: block;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s, background .18s;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.game-card__top {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 14px;
}

.game-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  flex: none;
}
.game-icon--ph {
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: #fff;
}

.game-card__name {
  font-size: 14.5px;
  font-weight: 640;
  letter-spacing: -.015em;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-card__genre {
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mini thumbnail strip on the game card */
.strip {
  display: flex;
  gap: 5px;
  margin-bottom: 13px;
  min-height: 74px;
}
.strip__cell {
  position: relative;
  flex: none;
  width: calc(25% - 4px);
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  background: var(--surface-3) center / cover no-repeat;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Opening frame of the playable, for builds with no thumbnail. */
.strip__cell iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  transform-origin: top left;
  pointer-events: none;
  background: #000;
}
.strip--empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-2);
  border-radius: 9px;
  color: var(--dim-2);
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: .01em;
}
.strip__more {
  flex: none;
  align-self: stretch;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
}

.game-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--text-2);
}
.count svg { width: 13px; height: 13px; fill: var(--accent-2); }
.count--zero { color: var(--dim-2); }
.count--zero svg { fill: var(--dim-2); }

.dots { display: flex; gap: 4px; }
.dot { width: 6px; height: 6px; border-radius: 99px; }

/* ==========================================================================
   Game detail hero
   ========================================================================== */

.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  margin-bottom: 6px;
  background: linear-gradient(120deg, var(--surface), rgba(20, 22, 29, .4));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.hero__icon {
  width: 82px;
  height: 82px;
  border-radius: 20px;
  flex: none;
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-sm);
}
.hero__icon--ph { display: grid; place-items: center; font-size: 29px; font-weight: 700; color: #fff; }
.hero__body { min-width: 0; flex: 1; }
.hero__body h1 {
  margin: 0 0 5px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.03em;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--dim);
  font-size: 12.5px;
}
.hero__meta a { color: var(--accent-2); font-weight: 550; }
.hero__meta a:hover { text-decoration: underline; }

/* Toolbar above the playables grid */
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 15px;
}
.bar__spacer { flex: 1; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
  transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip[aria-pressed="true"] {
  background: var(--accent-dim);
  border-color: rgba(124, 92, 255, .5);
  color: var(--accent-2);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
  transition: .15s;
}
.switch:hover { color: var(--text); border-color: var(--border-2); }
.switch__track {
  width: 26px;
  height: 15px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  position: relative;
  transition: .18s;
  flex: none;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 1.5px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--dim);
  transition: .18s;
}
.switch[aria-pressed="true"] { color: var(--accent-2); border-color: rgba(124, 92, 255, .5); }
.switch[aria-pressed="true"] .switch__track {
  background: var(--accent);
  border-color: var(--accent);
}
.switch[aria-pressed="true"] .switch__track::after {
  left: 13px;
  background: #fff;
}

/* ---------- Game-page totals across the hub's playables ---------- */

.tot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 13px;
}

.tot__card {
  padding: 15px 17px 14px;
  background: linear-gradient(140deg, var(--surface), rgba(124, 92, 255, .06));
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.tot__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.tot__net {
  font-size: 13.5px;
  font-weight: 680;
  letter-spacing: -.01em;
  color: var(--accent-2);
}
.tot__mut { font-size: 11px; color: var(--dim-2); }

.tot__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.tot__cell { min-width: 0; }
.tot__val {
  display: block;
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tot__val.is-good { color: var(--live); }
.tot__val.is-warn { color: var(--testing); }
.tot__val.is-bad  { color: var(--rejected); }
.tot__lbl {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  font-weight: 550;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--dim-2);
}

.tot__foot {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.tot__sep { color: var(--dim-2); }

@media (max-width: 560px) {
  .tot__grid { grid-template-columns: repeat(3, 1fr); gap: 9px 8px; }
  .tot__val { font-size: 17px; }
}

/* ==========================================================================
   Playables grid (portrait previews)
   ========================================================================== */

.playables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(198px, 1fr));
  gap: 17px;
}

.pcard {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s;
}
.pcard:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}

.pcard__preview {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #05060a center / cover no-repeat;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* live-preview iframe, scaled down, non-interactive */
.pcard__preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  transform-origin: top left;
  pointer-events: none;
  background: #000;
}

.pcard__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .32);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pcard__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to top, rgba(5, 6, 10, .78), rgba(5, 6, 10, .06) 55%);
  opacity: 0;
  transition: opacity .18s;
}
.pcard:hover .pcard__play,
.pcard:focus-within .pcard__play { opacity: 1; }

.pcard__play span {
  width: 46px;
  height: 46px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .95);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
  transform: scale(.86);
  transition: transform .18s cubic-bezier(.2,.7,.3,1);
}
.pcard:hover .pcard__play span { transform: scale(1); }
.pcard__play svg { width: 17px; height: 17px; fill: #0a0b0f; margin-left: 2px; }

.pcard__body { padding: 11px 12px 12px; }
.pcard__name {
  font-size: 13px;
  font-weight: 620;
  letter-spacing: -.01em;
  line-height: 1.35;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Build names are often one long underscore_run with no break opportunity —
     without this they overflow on a single line instead of wrapping. */
  overflow-wrap: anywhere;
}
.pcard__tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.pcard__row {
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Performance block ---------- */

.perf {
  margin-top: auto;                      /* pin to the bottom of the card */
  padding: 10px 12px 11px;
  border-top: 1px solid var(--border);
  background: rgba(124, 92, 255, .05);
}

.perf__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.perf__net {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.perf__asof, .perf__none {
  font-size: 10px;
  color: var(--dim-2);
  white-space: nowrap;
}

.perf--none { background: none; }

.perf__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 6px;
  margin-bottom: 9px;
}
.perf__cell { min-width: 0; }
.perf__val {
  display: block;
  font-size: 14px;
  font-weight: 660;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perf__lbl {
  display: block;
  font-size: 9.5px;
  font-weight: 550;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--dim-2);
  margin-top: 1px;
}

.perf__val.is-good { color: var(--live); }
.perf__val.is-warn { color: var(--testing); }
.perf__val.is-bad  { color: var(--rejected); }

/* installs split: paired-with-video share */
.perf__bar {
  height: 4px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 7px;
}
.perf__bar-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.perf__split { display: grid; gap: 3px; }
.perf__srow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  line-height: 1.4;
}
.perf__skey { color: var(--dim); font-weight: 560; white-space: nowrap; }
.perf__sval {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.perf__sval b { font-weight: 650; color: var(--text); }
.perf__smut { color: var(--dim-2); }
.perf__srow--empty .perf__sval { color: var(--dim-2); }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .02em;
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.badge--net { text-transform: none; }

.badge__dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; flex: none; }

.st--live      { color: var(--live);     border-color: rgba(52, 211, 153, .4); }
.st--paused    { color: var(--paused);   border-color: rgba(125, 211, 252, .35); }
.st--testing   { color: var(--testing);  border-color: rgba(251, 191, 36, .4); }
.st--rejected  { color: var(--rejected); border-color: rgba(251, 113, 133, .4); }
.st--draft     { color: var(--draft);    border-color: rgba(148, 163, 184, .35); }
.st--archived  { color: var(--archived); border-color: rgba(107, 114, 128, .35); }

.bg--live     { background: var(--live); }
.bg--paused   { background: var(--paused); }
.bg--testing  { background: var(--testing); }
.bg--rejected { background: var(--rejected); }
.bg--draft    { background: var(--draft); }
.bg--archived { background: var(--archived); }

/* Worked out from spend rather than set by hand — dotted underline hints that
   it is inferred, and the tooltip says why. */
.badge--derived { border-style: dashed; }

/* ==========================================================================
   Player
   ========================================================================== */

.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #07080b;
}

.player__bar {
  flex: none;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: rgba(13, 14, 19, .92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.player__bar .back { flex: none; max-width: 190px; }
.player__bar .back span { overflow: hidden; text-overflow: ellipsis; }

.player__id { min-width: 0; flex: 1 1 auto; display: flex; align-items: baseline; gap: 9px; }
.player__game {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player__name {
  font-size: 14px;
  font-weight: 640;
  letter-spacing: -.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__tools { display: flex; align-items: center; gap: 7px; flex: none; }

.iconbtn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: .15s;
}
.iconbtn:hover { background: var(--surface-2); border-color: var(--border-2); }
.iconbtn svg { width: 15px; height: 15px; fill: var(--text-2); }
.iconbtn:hover svg { fill: var(--text); }
.iconbtn[aria-pressed="true"] {
  background: var(--accent-dim);
  border-color: rgba(124, 92, 255, .5);
}
.iconbtn[aria-pressed="true"] svg { fill: var(--accent-2); }

.selectwrap { position: relative; }
.selectwrap select {
  appearance: none;
  height: 34px;
  padding: 0 27px 0 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
}
.selectwrap select:hover { border-color: var(--border-2); }
.selectwrap svg {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  fill: var(--dim);
  pointer-events: none;
}

.player__body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.player__stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(70% 70% at 50% 0%, rgba(124, 92, 255, .07), transparent 70%),
    #07080b;
}

.device {
  position: relative;
  background: #000;
  border: 1px solid #262a33;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  transition: width .18s, height .18s;
}
.device--framed { padding: 9px; border-radius: 40px; }
.device--flat { padding: 0; border-radius: 4px; }

.device__screen {
  position: relative;
  overflow: hidden;
  background: #000;
  border-radius: inherit;
  height: 100%;
  width: 100%;
}
.device--framed .device__screen { border-radius: 32px; }

.device__screen iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  transform-origin: top left;
  background: #000;
}

/* ---------- Performance panel (player screen) ---------- */

.pnl {
  flex: none;
  width: 320px;
  overflow-y: auto;
  padding: 16px 16px 26px;
  background: var(--bg-soft);
  border-left: 1px solid var(--border);
}
body.no-panel .pnl { display: none; }

.pnl__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 680;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.pnl__asof {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--dim-2);
}

.pnl__mut { color: var(--dim-2); font-size: 11px; }

.pnl__launch {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-bottom: 14px;
}
.pnl__launch b { font-weight: 650; }

.pnl__empty p { margin: 0 0 7px; font-size: 12.5px; color: var(--text-2); }

.pnl__net {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.pnl__net:last-of-type { border-bottom: 0; }

.pnl__net-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.pnl__net-name {
  font-size: 13px;
  font-weight: 660;
  letter-spacing: -.01em;
  color: var(--accent-2);
}

.pnl__stats { display: grid; gap: 1px; margin-bottom: 12px; }
.pnl__stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(48, 52, 63, .55);
}
.pnl__stat:last-child { border-bottom: 0; }
.pnl__stat-lbl { font-size: 11.5px; color: var(--dim); }
.pnl__stat-val {
  font-size: 14px;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.pnl__stat-val.is-good { color: var(--live); }
.pnl__stat-val.is-warn { color: var(--testing); }
.pnl__stat-val.is-bad  { color: var(--rejected); }

.pnl__tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.pnl__tbl th {
  text-align: right;
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--dim-2);
  padding: 0 0 5px;
  border-bottom: 1px solid var(--border);
}
.pnl__tbl th:first-child, .pnl__tbl td:first-child { text-align: left; }
.pnl__tbl td {
  text-align: right;
  padding: 5px 0;
  color: var(--text-2);
  border-bottom: 1px solid rgba(35, 38, 47, .6);
}
.pnl__tbl tr:last-child td { border-bottom: 0; }
.pnl__tbl td:first-child { color: var(--dim); white-space: nowrap; padding-right: 6px; }
.pnl__tbl tr.is-empty td { color: var(--dim-2); }
.pnl__tbl td.is-thin { color: var(--dim-2); }
.pnl__thin { color: var(--testing); cursor: help; }

.pnl__note {
  margin: 9px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--dim-2);
}

/* How far warehouse attribution sits from the network's own count. Muted: it is
   a caveat on the ROAS above, not a number anyone is meant to act on. */
.pnl__drift {
  margin: 6px 0 0;
  padding-left: 8px;
  border-left: 2px solid var(--border);
  line-height: 1.45;
  cursor: help;
}

.pnl__ctx { border-top: 1px solid var(--border); padding-top: 14px; }

.player__foot {
  flex: none;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-top: 1px solid var(--border);
  background: rgba(13, 14, 19, .92);
  color: var(--dim-2);
  font-size: 11.5px;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
}
.player__foot .k { color: var(--dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.player__foot > span:first-child { flex: none; }

/* ==========================================================================
   Misc
   ========================================================================== */

.empty {
  padding: 70px 20px;
  text-align: center;
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
  background: rgba(20, 22, 29, .4);
}
.empty__icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  display: grid;
  place-items: center;
}
.empty__icon svg { width: 20px; height: 20px; fill: var(--dim-2); }
.empty h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 620; }
.empty p { margin: 0 auto; max-width: 460px; color: var(--dim); font-size: 13px; }
.empty code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 1.5px 5px;
  color: var(--accent-2);
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 14px);
  z-index: 300;
  padding: 9px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 99px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .hdr__stats { display: none; }
  .hero__icon { width: 62px; height: 62px; border-radius: 16px; }
  .hero__body h1 { font-size: 21px; }
}

/* Player chrome needs to shed parts earlier than the rest of the layout —
   the toolbar is dense and the stage must keep its height. */
@media (max-width: 900px) {
  .player__bar > .badge { display: none; }
  .player__game { display: none; }
  .player__foot .k:not(:last-child) { display: none; }
}

/* Not enough width for device + panel side by side — stack them and let the
   whole player scroll, so the numbers stay reachable on a laptop. */
@media (max-width: 1100px) {
  .player__body { flex-direction: column; overflow-y: auto; }
  /* Cap rather than floor the stage, so the top of the panel is on screen
     without scrolling — the numbers are half the point of this view. */
  .player__stage { flex: none; height: 58vh; min-height: 300px; }
  .pnl {
    width: auto;
    border-left: 0;
    border-top: 1px solid var(--border);
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .hdr { gap: 10px; padding: 0 14px; }
  .hdr__title { display: none; }
  /* Keep the button, drop its word — the icon carries it, and the search field
     needs the room more. */
  .upd { padding: 0 9px; }
  .upd__label { display: none; }
  .wrap { padding: 20px 14px 60px; }
  .games { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 11px; }
  .playables { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .player__foot { display: none; }
  .player__game { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
