/* Shell/card/hero styles ported from ~/roblox-playtime-extension/stats.html's
   inline <style> block — same class names/visual language, trimmed to just
   what the web dashboard's Overview + Activity views actually use (no
   friends/badges/recap/customize here). Kept as a separate file (not
   shared across projects) since these are independently deployed. */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
svg { display: block; }
a { color: inherit; }

.app-shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 240px;
  flex: none;
  background:
    radial-gradient(480px 260px at 0% 0%, color-mix(in oklab, var(--series-1) 8%, transparent), transparent 70%),
    var(--surface-1);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--series-1), var(--series-7));
}
img.brand-mark { background: none; object-fit: cover; }
.brand-name { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.brand-tag { font-size: 11.5px; color: var(--muted); }
.brand-version { font-size: 11.5px; color: var(--muted); }

.nav-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin: 14px 10px 6px;
}
.nav-label:first-of-type { margin-top: 2px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 8px; background: none; border: none;
  cursor: pointer; font: inherit; font-size: 14.5px; font-weight: 500;
  color: var(--text-secondary); text-align: left; text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}
.nav-item[hidden] { display: none; }
/* Same purple pill as the homepage's .ext-tag (marketing.css), reused here
   next to sidebar/card features that only work with the browser extension
   installed — hardcoded to the same #c04fef rather than a theme variable
   since the point is visual continuity with the homepage's own "Extension"
   tag, not adapting to the dashboard's own theme presets. */
.ext-tag {
  display: inline-block; margin-left: auto; font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 7px; border-radius: 999px; flex: none;
  background: color-mix(in oklab, #c04fef 16%, transparent); color: #c04fef;
}
.card-title-block .ext-tag { margin-left: 10px; }
.nav-item svg { width: 19px; height: 19px; flex: none; transition: transform 0.15s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-item:hover svg { transform: scale(1.08); }
.nav-item[aria-selected="true"] {
  background: color-mix(in oklab, var(--series-1) 16%, transparent);
  color: var(--series-1); font-weight: 600;
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; background: var(--surface-2);
  margin-bottom: 18px; transition: box-shadow 0.2s ease;
}
.user-card:hover {
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--series-1) 25%, transparent), 0 0 16px -4px color-mix(in oklab, var(--series-1) 40%, transparent);
}
.user-card .user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; background: var(--surface-1); flex: none;
  box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 3.5px color-mix(in oklab, var(--series-1) 45%, transparent);
  transition: box-shadow 0.2s ease;
}
.user-card:hover .user-avatar {
  box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 3.5px var(--series-1), 0 0 12px -2px var(--series-1);
}
.user-card .user-info { min-width: 0; }
.user-card .user-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card .user-handle { font-size: 12px; color: var(--text-secondary); }


.main { flex: 1; min-width: 0; padding: 30px 36px 60px; }
.main-inner { max-width: 1400px; margin: 0 auto; }

.breadcrumb { font-size: 12px; color: var(--text-secondary); margin-bottom: 18px; display: flex; align-items: center; gap: 6px; }
.breadcrumb .current { color: var(--text-primary); font-weight: 600; }

h1, h2, .brand-name { font-family: var(--font-display, inherit); }
h1 { margin: 0 0 22px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px 14px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 16px -10px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: color-mix(in oklab, var(--series-1) 35%, var(--border));
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.05),
    0 10px 24px -12px rgba(0, 0, 0, 0.16),
    0 0 0 1px color-mix(in oklab, var(--series-1) 12%, transparent),
    0 0 28px -6px color-mix(in oklab, var(--series-1) 30%, transparent);
}
.card-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-title-block h2 { font-size: 14.5px; font-weight: 600; margin: 0 0 3px; }
.card-title-block .card-subtitle { margin: 0; font-size: 11.5px; color: var(--text-secondary); }
.card-total {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary); white-space: nowrap; flex: none;
}
.card-total svg { width: 14px; height: 14px; color: var(--muted); }
.view-select {
  font: inherit; font-size: 12px; color: var(--text-primary);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px; cursor: pointer;
}
.search-input {
  font: inherit; font-size: 12px; color: var(--text-primary);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; width: 200px;
}
.search-input::placeholder { color: var(--muted); }
.game-library-controls { display: flex; gap: 8px; align-items: center; }
.game-library-controls .search-input { width: 170px; }
.load-more-btn {
  display: block; margin: 10px auto 4px; padding: 6px 14px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-secondary); font-size: 12px; font-weight: 600; cursor: pointer;
}
.load-more-btn[hidden] { display: none; }
.load-more-btn:hover { color: var(--text-primary); }

.welcome-header { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.welcome-header .welcome-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  object-fit: cover; background: var(--surface-2); flex: none;
  box-shadow: 0 0 0 3px var(--page), 0 0 0 5px color-mix(in oklab, var(--series-1) 45%, transparent);
}
.welcome-header h1 { margin: 0; font-size: 26px; font-weight: 700; }
.welcome-header .welcome-handle { color: var(--text-secondary); font-size: 15px; }

.now-playing-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: color-mix(in oklab, var(--status-good, #0ca30c) 10%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--status-good, #0ca30c) 25%, transparent);
  margin-bottom: 18px; font-size: 12.5px; flex-wrap: wrap;
}
.now-playing-banner[hidden] { display: none; }
.now-playing-banner .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--status-good, #0ca30c); flex: none;
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--status-good, #0ca30c) 60%, transparent);
  animation: livePulse 1.8s ease-out infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--status-good, #0ca30c) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--status-good, #0ca30c) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--status-good, #0ca30c) 0%, transparent); }
}
.now-playing-banner .now-playing-icon { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex: none; }
.now-playing-banner .label { color: var(--text-secondary); }
.now-playing-banner .value { font-weight: 600; }

.thumb-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-bottom: 1px solid var(--gridline);
  border-radius: 8px; margin: 0 -8px; transition: background 0.15s ease;
}
.thumb-row:hover { background: var(--surface-2); }
.thumb-row:hover .thumb { box-shadow: 0 0 0 3px color-mix(in oklab, var(--series-1) 30%, transparent); }
.thumb-row:last-child { border-bottom: none; }
.thumb-row .thumb {
  width: 40px; height: 40px; border-radius: 9px;
  object-fit: cover; background: var(--surface-2); flex: none;
  transition: box-shadow 0.15s ease;
}
.thumb-row .thumb-fallback { display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--muted); font-weight: 700; }
.thumb-row .info { flex: 1; min-width: 0; }
.thumb-row .info .name { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-row .track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.thumb-row .track .fill { height: 100%; background: var(--series-1); border-radius: 3px; }
.thumb-row .amount { flex: none; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.thumb-row .amount .last-played-at { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; font-weight: 400; }

.stat-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-tile {
  flex: 1; min-width: 150px; padding: 12px 14px; border-radius: 10px;
  background: var(--surface-1); border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 12px -8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.stat-tile:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--series-1) 30%, var(--border));
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.14), 0 0 18px -6px color-mix(in oklab, var(--series-1) 40%, transparent);
}
.stat-tile .label { color: var(--text-secondary); font-size: 11.5px; margin-bottom: 5px; }
.stat-tile .value { font-size: 20px; font-weight: 600; }
.stat-tile .delta { font-size: 11.5px; margin-top: 3px; font-weight: 600; color: var(--text-secondary); }

/* ---------- SVG charts + tooltip ---------- */
svg text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; fill: var(--muted); }
@keyframes barGrowIn {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
.bar, .bar-compare {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: barGrowIn 0.45s cubic-bezier(0.22, 1.4, 0.36, 1) both;
  animation-delay: var(--bar-delay, 0s);
}
.bar { fill: var(--series-1); cursor: pointer; }
.bar:hover, .bar.hovered { fill: var(--series-1); filter: brightness(1.15); }
.bar-compare { fill: var(--series-2); cursor: pointer; }
.bar-compare:hover, .bar-compare.hovered { fill: var(--series-2); filter: brightness(1.15); }
.axis-line { stroke: var(--baseline); stroke-width: 1; }
.gridline { stroke: var(--gridline); stroke-width: 1; }
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}
.line-path {
  stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  animation: drawLine 0.7s ease-out both;
}
.line-path.compare { stroke: var(--series-2); }
.line-dot { fill: var(--series-1); cursor: pointer; opacity: 0; transition: opacity 0.1s, r 0.1s ease; }
.line-dot.compare { fill: var(--series-2); }
.line-dot:hover, .line-dot.hovered, .line-dot:focus { opacity: 1; }
.crosshair-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; transition: opacity 0.08s ease; }
.crosshair-line.visible { opacity: 1; }
.hover-capture { fill: transparent; cursor: crosshair; }

.tooltip {
  position: fixed; pointer-events: none;
  background: var(--text-primary); color: var(--surface-1);
  font-size: 11.5px; padding: 5px 8px; border-radius: 6px; z-index: 10;
  opacity: 0; transform: translate(-50%, -100%); white-space: nowrap;
  transition: opacity 0.08s ease;
}
.tooltip.visible { opacity: 1; }
.tooltip .tt-value { font-weight: 700; }

/* ---------- Heatmap (daily calendar + hourly/weekly flat row) ---------- */
/* --num-weeks (set inline from JS) drives both the cell grid and the month
   labels above it — columns are fluid (minmax(.., 1fr)) so a 30-day range
   (~5 columns) actually fills the card instead of sitting in a small
   fixed-12px-cell cluster in the corner, while a 365-day range (~53
   columns) still degrades gracefully: columns shrink toward the 6px floor
   before .heatmap-scroll's overflow-x: auto takes over as a fallback on
   very narrow screens, rather than breaking the page layout (same
   min-width: 0 class of fix as the mobile nav elsewhere in this file).
   The shared max-width formula on both .heatmap and .heatmap-months keeps
   their columns aligned — same --num-weeks, same track sizing, so a month
   label always lines up with the week it labels regardless of how wide a
   cell actually ends up. */
.heatmap-scroll { overflow-x: auto; padding-bottom: 4px; }
.heatmap-body { display: flex; gap: 6px; align-items: stretch; }
.heatmap-weekday-labels { display: flex; flex-direction: column; gap: 3px; width: 22px; flex: none; }
.heatmap-weekday-labels span { flex: 1; display: flex; align-items: center; font-size: 9px; color: var(--muted); }
.heatmap {
  display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column;
  grid-auto-columns: minmax(6px, 1fr); gap: 3px;
  flex: 1; min-width: 0;
  /* Explicit height — without one, the 7 rows had nothing driving their
     size and collapsed to ~5px each (confirmed live). This also caps how
     tall a short (few-column, wide-cell) range like 30 days can get, since
     width alone now flexes to fully fill the row's width. */
  height: 130px;
}
@keyframes heatmapCellIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}
.heatmap-cell {
  width: 12px; height: 12px; border-radius: 2px; background: var(--surface-2);
  animation: heatmapCellIn 0.3s ease both;
  animation-delay: var(--cell-delay, 0s);
  transition: background 0.2s ease, transform 0.15s ease;
}
.heatmap .heatmap-cell { width: 100%; height: 100%; }
.heatmap-cell[tabindex]:hover { transform: scale(1.15); }
.heatmap-cell[tabindex] { cursor: pointer; }
.heatmap-cell[tabindex]:hover, .heatmap-cell[tabindex]:focus-visible { outline: 2px solid var(--baseline); outline-offset: 1px; }
.heatmap-cell.empty-slot { visibility: hidden; }
.heatmap-months {
  display: grid; grid-template-columns: repeat(var(--num-weeks, 1), minmax(6px, 1fr));
  gap: 3px; height: 14px; margin-left: 25px; max-width: calc(var(--num-weeks, 1) * 34px);
}
.heatmap-month-label { font-size: 10px; color: var(--text-secondary); }
/* Calendar-rows heatmap (30/90-day ranges) — one row per week, in normal
   reading order, so it reads as the same "blocks filling a row" shape as
   the 7-day/Today views rather than the GitHub-style weeks-as-columns grid
   above (reserved for the 365-day range). Both header and rows share a
   label-column + 7-day-column track so day columns line up under the
   weekday header regardless of card width.

   Cell size is a fixed 20px, not a stretched fraction of the card's width
   — a `minmax(0, 1fr)` column paired with aspect-ratio: 1/1 (the previous
   rule) made each cell exactly as wide as 1/7th of the card, so on a
   normal-width dashboard card cells rendered 150-200px+ square. That
   applied identically at both 30 and 90 days (both use this same 7-column
   grid, just a different number of rows), so neither range ever looked
   like the compact grid the 7-day/365-day views show — confirmed live,
   this was the actual bug, not something specific to one range over the
   other. Fixed-size cells keep it visually consistent with those views
   regardless of how many weeks a given range happens to stack. */
.heatmap-calendar { display: flex; flex-direction: column; gap: 4px; }
.heatmap-calendar-header,
.heatmap-calendar-row {
  display: grid; grid-template-columns: 30px repeat(7, 20px);
  gap: 4px; align-items: center;
}
.heatmap-calendar-header span { font-size: 9px; color: var(--muted); text-align: center; }
.heatmap-row-label {
  font-size: 10px; color: var(--text-secondary); text-align: right;
  padding-right: 2px; white-space: nowrap; overflow: hidden;
}
.heatmap-calendar-row .heatmap-cell { width: 20px; height: 20px; border-radius: 3px; }
.heatmap-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 10.5px; color: var(--text-secondary); }
.heatmap-legend .heatmap-cell { cursor: default; }
.hourly-heatmap-cells { display: flex; gap: 3px; height: 56px; }
.hourly-heatmap-cells .heatmap-cell { flex: 1; width: auto; height: 100%; border-radius: 4px; }
.hourly-heatmap-labels { display: flex; gap: 3px; margin-top: 6px; }
.hourly-heatmap-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--text-secondary); }

/* ---------- Top games breakdown ---------- */
.breakdown-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; margin: 0 -8px; transition: background 0.12s ease; }
.breakdown-row:hover { background: var(--surface-2); }
.breakdown-row .swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.breakdown-row .breakdown-thumb { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: var(--surface-2); flex: none; transition: transform 0.15s ease; }
.breakdown-row:hover .breakdown-thumb { transform: scale(1.1); }
.breakdown-row .breakdown-thumb.thumb-fallback { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.breakdown-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.breakdown-row .track { flex: 2; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.breakdown-row .fill { height: 100%; border-radius: 4px; }
.breakdown-row .amount { width: 64px; text-align: right; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ---------- data-table extras: icon column, month's top-game cell ---------- */
table.data-table td.icon-cell, table.data-table th.icon-cell { width: 30px; padding-right: 0; }
table.data-table tbody tr { transition: background 0.12s ease; }
table.data-table tbody tr:hover { background: var(--surface-2); }
.cell-icon { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; background: var(--surface-2); display: block; transition: transform 0.15s ease; }
table.data-table tbody tr:hover .cell-icon { transform: scale(1.12); }
.game { display: flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: 11.5px; min-width: 0; }
.game span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-thumb { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; background: var(--surface-2); flex: none; }
.game-thumb.thumb-fallback { display: flex; align-items: center; justify-content: center; font-size: 8px; color: var(--muted); }

/* ---------- clickable rows (Recently played, Game library, breakdown, etc.) ---------- */
.clickable-row { cursor: pointer; }
.clickable-row:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.clickable-sub { cursor: pointer; }

/* ---------- Card entrance animation ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
section:not([hidden]) > .card { animation: fadeInUp 0.35s ease both; }
section:not([hidden]) > .card:nth-of-type(1) { animation-delay: 0s; }
section:not([hidden]) > .card:nth-of-type(2) { animation-delay: 0.05s; }
section:not([hidden]) > .card:nth-of-type(3) { animation-delay: 0.1s; }
section:not([hidden]) > .card:nth-of-type(4) { animation-delay: 0.15s; }
section:not([hidden]) > .card:nth-of-type(n+5) { animation-delay: 0.2s; }

.hero-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.hero-tile {
  --glow: var(--series-1);
  flex: 1; min-width: 150px; padding: 16px 18px; border-radius: 12px;
  background: var(--surface-1); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 16px -10px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.hero-tile:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--glow) 40%, var(--border));
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.05),
    0 10px 24px -12px rgba(0, 0, 0, 0.18),
    0 0 30px -8px color-mix(in oklab, var(--glow) 55%, transparent);
}
.hero-tile .icon-chip {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  transition: transform 0.25s ease;
}
.hero-tile:hover .icon-chip { transform: scale(1.15) rotate(-6deg); }
.hero-tile.streak { --glow: var(--series-6); }
.hero-tile.alltime { --glow: var(--series-1); }
.hero-tile.games { --glow: var(--series-7); }
.hero-tile.studio { --glow: var(--series-5); }
.hero-tile.streak .icon-chip { background: color-mix(in oklab, var(--series-6) 18%, transparent); }
.hero-tile.alltime .icon-chip { background: color-mix(in oklab, var(--series-1) 18%, transparent); }
.hero-tile.games .icon-chip { background: color-mix(in oklab, var(--series-7) 18%, transparent); }
.hero-tile.studio .icon-chip { background: color-mix(in oklab, var(--series-5) 18%, transparent); }
.hero-tile .label { color: var(--text-secondary); font-size: 12px; margin-bottom: 3px; }
.hero-tile .value { font-size: 22px; font-weight: 700; line-height: 1.15; }
.streak-warn-badge[hidden] { display: none; }
.streak-warn-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
  background: #e0a72a; color: #1a1409; font-size: 10px; line-height: 1;
  vertical-align: middle; cursor: default;
  animation: rpt-streak-pulse 1.6s ease-in-out infinite;
}
@keyframes rpt-streak-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224,167,42,0.55); }
  50% { box-shadow: 0 0 0 4px rgba(224,167,42,0); }
}

.recently-played-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.recent-card { width: 132px; }
.recent-card .thumb-wrap { position: relative; width: 132px; height: 132px; margin-bottom: 8px; }
.recent-card .thumb {
  width: 132px; height: 132px; border-radius: 10px;
  object-fit: cover; background: var(--surface-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.recent-card:hover .thumb {
  transform: scale(1.035);
  box-shadow: 0 6px 20px -4px color-mix(in oklab, var(--series-1) 45%, transparent);
}
.recent-card .thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--muted);
}
.recent-card .play-badge {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; opacity: 0; transition: opacity 0.2s ease;
  background: color-mix(in oklab, black 28%, transparent);
  pointer-events: none; /* the whole card is already one clickable link */
}
.recent-card:hover .play-badge { opacity: 1; }
.recent-card .play-badge svg {
  width: 40px; height: 40px; color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.recent-card .name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-card .time, .recent-card .meta-line { font-size: 11px; color: var(--text-secondary); }

/* display: block (rather than a separate wrapper div) turns the table
   itself into a horizontal-scroll container on narrow screens — its
   thead/tbody/tr/td children keep their table-layout box types regardless,
   since those come from each element's own UA-stylesheet default, not
   inheritance from the table's display value. Every data-table on the
   site (admin's accounts table, game/session history, monthly summary)
   funnels through this one rule instead of each needing its own wrapper. */
table.data-table { display: block; overflow-x: auto; max-width: 100%; width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data-table th, table.data-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--gridline); }
table.data-table th { color: var(--text-secondary); font-weight: 600; font-size: 11.5px; }
table.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty-state { color: var(--text-secondary); font-size: 13px; padding: 20px 0; text-align: center; }

.leaderboard-list { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.leaderboard-row {
  display: flex; align-items: center; gap: 13px; padding: 10px; border: 1px solid transparent;
  border-radius: 10px; transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.leaderboard-row:not(.self):hover {
  background: var(--surface-2);
  border-color: var(--border);
  box-shadow: inset 3px 0 0 color-mix(in oklab, var(--series-1) 60%, transparent);
}
.leaderboard-row.self {
  background: color-mix(in oklab, var(--series-2) 12%, transparent);
  border-color: color-mix(in oklab, var(--series-2) 30%, transparent);
}
.leaderboard-row.self:hover { box-shadow: inset 3px 0 0 color-mix(in oklab, var(--series-2) 70%, transparent); }
.leaderboard-row.self .name { color: var(--series-2); }
.leaderboard-row .avatar-dot {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--surface-2); object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
}
.leaderboard-row .rank {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: var(--text-secondary);
}
.leaderboard-row .rank.medal { font-size: 16px; }
.leaderboard-row .rank.medal-1 { background: color-mix(in oklab, #eda100 24%, transparent); }
.leaderboard-row .rank.medal-2 { background: color-mix(in oklab, #b8bec8 26%, transparent); }
.leaderboard-row .rank.medal-3 { background: color-mix(in oklab, #cd7f32 24%, transparent); }
.leaderboard-row .info { flex: 1; min-width: 0; }
.leaderboard-row .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-row .sub { font-size: 11.5px; color: var(--text-secondary); }
.leaderboard-row .amount-block { flex: none; text-align: right; }
.leaderboard-row .amount { font-size: 13.5px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.leaderboard-row .session-count { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }
/* Global leaderboard's "Your ranking" card, when there's no tracked
   playtime for the period yet — reads as a normal row instead of looking
   broken next to the numbered/medal ranks above it. */
.leaderboard-row .rank.unranked { background: transparent; color: var(--text-secondary); font-size: 12px; }

.friend-row {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--gridline);
  border-radius: 8px; margin: 0 -8px; transition: background 0.15s ease, box-shadow 0.15s ease;
}
.friend-row:last-child { border-bottom: none; }
.friend-row:hover {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 color-mix(in oklab, var(--series-1) 60%, transparent);
}
.friend-row .avatar-dot {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--surface-2); object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.friend-row .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-good); flex: none; }
.friend-row .info { flex: 1; min-width: 0; }
.friend-row .name { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-row .game { display: flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: 11.5px; min-width: 0; }
.friend-row .game span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-row .amount { font-size: 11.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; flex: none; }

.friends-diagnostics { font-size: 11px; color: var(--text-secondary); margin-bottom: 10px; }
.friends-diagnostics.has-error { color: var(--status-critical); }

.invite-link-row { display: flex; align-items: center; gap: 10px; }
.invite-link-row .text-input { flex: 1; min-width: 0; margin: 0; }
.invite-link-row .recap-btn { width: auto; flex: none; padding: 9px 16px; }
@media (max-width: 480px) {
  .invite-link-row { flex-wrap: wrap; }
  .invite-link-row .text-input { width: 100%; }
  .invite-link-row .recap-btn { width: 100%; }
}

.badges-grid { display: flex; flex-direction: column; gap: 10px; }
.badge-card {
  display: flex; align-items: center; gap: 14px; padding: 10px 6px;
  border-bottom: 1px solid var(--gridline);
}
.badge-card:last-child { border-bottom: none; }
.badge-icon, .badge-icon-fallback {
  width: 48px; height: 48px; border-radius: 8px; flex: none;
  background: var(--surface-2); object-fit: cover;
}
.badge-icon-fallback { display: flex; align-items: center; justify-content: center; font-size: 20px; }
.badge-info { min-width: 0; flex: 1; }
.badge-name { font-size: 13px; font-weight: 600; }
.badge-desc {
  font-size: 12px; color: var(--text-secondary); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.badge-game-link { font-size: 11.5px; font-weight: 600; color: var(--series-1); text-decoration: none; margin-top: 3px; display: inline-block; }
.badge-game-link:hover { text-decoration: underline; }

/* ---------- Accounts tab (ported from stats.html's .account-* rules) ---------- */
.recap-btn {
  padding: 9px 16px; border-radius: 8px; border: none; font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; background: var(--surface-2); color: var(--text-primary);
  transition: filter 0.15s ease, transform 0.1s ease;
}
.recap-btn:active { transform: scale(0.97); }
.recap-btn.secondary { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border); }
.recap-btn.secondary:hover { background: var(--gridline); }
.recap-btn.danger {
  background: color-mix(in oklab, #e5484d 14%, var(--surface-2));
  color: #e5484d; border: 1px solid color-mix(in oklab, #e5484d 40%, transparent);
}
.recap-btn.danger:hover { background: color-mix(in oklab, #e5484d 22%, var(--surface-2)); }
.account-settings-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.account-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.account-card {
  width: 168px; padding: 18px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.account-card .avatar-lg {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--page); display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--text-secondary);
}
.account-card .username { font-weight: 700; font-size: 13.5px; }
.account-card .handle { font-size: 11.5px; color: var(--text-secondary); margin-top: -4px; }
.account-card .primary-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px;
  background: color-mix(in oklab, var(--series-2) 22%, transparent); color: var(--series-2);
}
.account-card .account-actions { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 4px; }
.account-card .recap-btn { width: 100%; }
.account-card .recap-btn.danger {
  background: color-mix(in oklab, #e5484d 14%, var(--surface-2));
  color: #e5484d; border: 1px solid color-mix(in oklab, #e5484d 40%, transparent);
}
.account-card .recap-btn.danger:hover { background: color-mix(in oklab, #e5484d 22%, var(--surface-2)); }
.account-card.add-card {
  justify-content: center; border-style: dashed; cursor: pointer; color: var(--text-secondary);
  background: transparent; transition: border-color 0.15s ease, color 0.15s ease; padding: 24px 14px;
}
.account-card.add-card:hover { border-color: var(--series-1); color: var(--series-1); }
.account-card.add-card .plus { font-size: 30px; line-height: 1; font-weight: 300; }

/* ---------- Customize tab (ported from stats.html's Appearance card) ---------- */
.customize-row { padding: 14px 0; border-bottom: 1px solid var(--gridline); }
.customize-row:first-of-type { padding-top: 4px; }
.customize-row.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.customize-label { font-size: 12.5px; font-weight: 600; margin-bottom: 10px; color: var(--text-primary); }

.filter-row { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.range-btn {
  padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-1); color: var(--text-secondary); font-size: 12.5px; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.range-btn:hover {
  border-color: var(--series-1); color: var(--text-primary);
  box-shadow: 0 0 10px -3px color-mix(in oklab, var(--series-1) 50%, transparent);
}
.range-btn:active { transform: scale(0.96); }
.range-btn[aria-pressed="true"] { background: var(--series-1); border-color: var(--series-1); color: #ffffff; font-weight: 600; }
.filter-row .filter-label { color: var(--text-secondary); font-size: 12px; margin-right: 4px; }

.compare-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.compare-toggle input { accent-color: var(--series-2); cursor: pointer; }

.chart-legend { display: flex; gap: 16px; margin: 4px 0 10px; font-size: 11.5px; color: var(--text-secondary); }
.chart-legend[hidden] { display: none; }
.chart-legend .legend-item { display: flex; align-items: center; gap: 6px; }
.chart-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chart-legend .dot-1 { background: var(--series-1); }
.chart-legend .dot-2 { background: var(--series-2); }

.friends-activity-controls { display: flex; gap: 8px; align-items: center; }

.leaderboard-header-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 4px; flex-wrap: wrap;
}
.leaderboard-reset {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-secondary); white-space: nowrap;
}

.heatmap-owner-label { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); margin: 14px 0 6px; }
#friendsActivityGraphSelfWrap .heatmap-owner-label,
#friendsHourlyGraphSelfWrap .heatmap-owner-label { color: var(--series-2); margin-top: 0; }

/* Percentile framing above the leaderboard — a personal-insight framing
   ("you beat X% of tracked friends") rather than only the raw ranked list,
   which reads friendlier than a bare hours leaderboard. */
.percentile-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px; margin: 10px 0 4px;
  background: color-mix(in oklab, var(--series-5) 14%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--series-5) 32%, transparent);
}
.percentile-banner[hidden] { display: none; }
.percentile-banner .percentile-figure {
  font-size: 22px; font-weight: 800; color: var(--series-5); flex: none;
  font-variant-numeric: tabular-nums;
}
.percentile-banner .percentile-text { font-size: 12.5px; color: var(--text-primary); line-height: 1.35; }

.theme-preset-row { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-preset-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 76px; padding: 8px; border-radius: 12px; border: 2px solid transparent;
  background: var(--surface-2); cursor: pointer; font: inherit;
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.theme-preset-btn .preview {
  width: 100%; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--preset-a), var(--preset-b));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.theme-preset-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px -8px var(--preset-a); color: var(--text-primary); }
@keyframes presetSelectPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.theme-preset-btn[aria-pressed="true"] {
  border-color: var(--preset-a); color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--preset-a), 0 8px 22px -8px var(--preset-a);
  animation: presetSelectPop 0.35s ease;
}

/* ---------- Recap tab (ported from stats.html's Recap section) ---------- */
.card-control { flex: none; }
.recap-preview-buttons { display: flex; gap: 8px; }
.recap-preview-buttons .recap-btn { padding: 7px 12px; font-size: 11.5px; white-space: nowrap; }
.badges-note { color: var(--text-secondary); font-size: 11.5px; margin: 0 0 10px; }
.badges-loading-note {
  padding: 10px 14px; border-radius: 9px; margin-bottom: 12px;
  background: color-mix(in oklab, var(--series-4) 16%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--series-4) 35%, transparent);
  font-size: 12.5px; color: var(--text-primary);
}

.recap-list { display: flex; flex-direction: column; gap: 2px; }
.recap-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px; border-radius: 9px;
  background: none; border: none; width: 100%; text-align: left;
  font: inherit; color: var(--text-primary); cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.recap-row:hover {
  background: var(--surface-2);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--series-1) 20%, transparent);
}
.recap-row[aria-current="true"] { background: color-mix(in oklab, var(--series-1) 14%, transparent); }
.recap-row .kind-pill {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 3px 8px; border-radius: 20px;
  background: var(--surface-2); color: var(--text-secondary); flex: none;
}
.recap-row .recap-label { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-row .recap-total { flex: none; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.recap-canvas-wrap { display: flex; justify-content: center; padding: 6px 0 4px; }
#recapCanvas { width: 320px; max-width: 100%; height: auto; aspect-ratio: 1080 / 1620; border-radius: 18px; box-shadow: 0 10px 34px rgba(0,0,0,0.35); background: var(--surface-2); }
.recap-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.recap-btn.primary {
  background: var(--series-1); color: #ffffff;
  box-shadow: 0 2px 8px -2px color-mix(in oklab, var(--series-1) 55%, transparent);
}
.recap-btn.primary:hover { filter: brightness(1.08); }
.recap-status { text-align: center; font-size: 11.5px; color: var(--text-secondary); margin-top: 8px; min-height: 1.4em; }

/* ---------- Wrapped story viewer ---------- */
.wrapped-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: #000; display: flex; align-items: center; justify-content: center;
  overscroll-behavior: contain;
}
.wrapped-overlay[hidden] { display: none; }
.wrapped-progress {
  position: absolute; top: 20px; left: 14px; right: 56px; z-index: 4;
  display: flex; gap: 6px;
}
.wrapped-progress-seg {
  flex: 1; height: 3px; border-radius: 999px; background: rgba(255,255,255,0.28); overflow: hidden;
}
.wrapped-progress-seg-fill {
  height: 100%; width: 0%; background: #fff; border-radius: 999px;
}
.wrapped-progress-seg-fill.filled { width: 100%; }
.wrapped-progress-seg-fill.animating { transition: width linear; }
.wrapped-close {
  position: absolute; top: 12px; right: 14px; z-index: 5;
  width: 34px; height: 34px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(0,0,0,0.35); color: #fff; font-size: 15px; line-height: 1;
}
.wrapped-close:hover { background: rgba(0,0,0,0.55); }
.wrapped-stage {
  width: 100%; max-width: 460px; height: 100%; max-height: 900px;
  position: relative; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-align: center;
}
.wrapped-stage button, .wrapped-stage a { cursor: pointer; }
@media (min-width: 540px) {
  .wrapped-stage { border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
}
.wrapped-slide {
  position: absolute; inset: 0; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; justify-content: safe center;
  gap: 14px; padding: 60px 34px 40px;
  animation: wrapped-in 0.35s ease;
}
.reduce-motion .wrapped-slide { animation: none; }
.wrapped-slide::before, .wrapped-slide::after {
  content: ""; position: absolute; z-index: -1; border-radius: 999px;
  background: rgba(255,255,255,0.08);
}
.wrapped-slide::before { width: 300px; height: 300px; top: -80px; right: -100px; }
.wrapped-slide::after { width: 220px; height: 220px; bottom: -70px; left: -70px; }
@keyframes wrapped-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
.wrapped-kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.wrapped-title { font-size: 26px; font-weight: 800; line-height: 1.2; }
.wrapped-hero-number { font-size: 64px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.wrapped-sub { font-size: 15px; opacity: 0.85; max-width: 320px; line-height: 1.5; }
.wrapped-avatar {
  width: clamp(260px, 85vw, 380px); height: clamp(260px, 85vw, 380px);
  border-radius: 999px; object-fit: cover;
  border: 7px solid rgba(255,255,255,0.55);
  box-shadow: 0 20px 50px -8px rgba(0,0,0,0.5);
}
.wrapped-intro-name { font-size: clamp(42px, 13vw, 60px); font-weight: 800; line-height: 1.15; max-width: 100%; overflow-wrap: break-word; }
.wrapped-intro-handle { font-size: 24px; opacity: 0.7; margin-top: 0; }
.wrapped-game-icon { width: 96px; height: 96px; border-radius: 18px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.wrapped-game-name { font-size: 20px; font-weight: 700; }
.wrapped-toplist { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.wrapped-toplist-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px;
  background: rgba(255,255,255,0.14); text-align: left;
}
.wrapped-toplist-rank { font-size: 20px; font-weight: 800; opacity: 0.6; width: 26px; flex: none; }
.wrapped-toplist-icon { width: 42px; height: 42px; border-radius: 9px; flex: none; object-fit: cover; }
.wrapped-toplist-info { flex: 1; min-width: 0; }
.wrapped-toplist-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrapped-toplist-time { font-size: 12.5px; opacity: 0.75; }
.wrapped-badges-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 340px; }
.wrapped-badge-icon { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,0.14); }
.wrapped-avatar-compare { display: flex; align-items: center; gap: clamp(10px, 4vw, 18px); }
.wrapped-avatar-compare img {
  width: clamp(80px, 26vw, 110px); height: clamp(80px, 26vw, 110px);
  border-radius: 16px; object-fit: cover; background: rgba(255,255,255,0.14);
}
.wrapped-avatar-arrow { font-size: 22px; opacity: 0.8; }
.wrapped-finale-canvas { width: 100%; max-width: 300px; height: auto; border-radius: 16px; box-shadow: 0 10px 34px rgba(0,0,0,0.4); }
.wrapped-finale-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.wrapped-finale-actions .recap-btn { width: auto; padding: 10px 16px; }
.wrapped-finale-status { font-size: 11.5px; opacity: 0.75; min-height: 1.4em; }
.wrapped-share-link-wrap {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  background: rgba(255,255,255,0.12); border-radius: 8px; padding: 8px 10px;
}
.wrapped-share-link-wrap a {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #fff; font-size: 12.5px; text-decoration: underline;
}
.wrapped-share-link-wrap .recap-btn { width: auto; padding: 6px 12px; font-size: 11.5px; flex: none; }
.wrapped-tap-hint { position: absolute; bottom: 22px; font-size: 11.5px; opacity: 0.55; }

/* ---------- Landing/verify page ---------- */
.verify-wrap { max-width: 420px; margin: 80px auto; padding: 0 20px; }
.verify-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 26px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 16px -10px rgba(0, 0, 0, 0.12);
}
.verify-card h1 { font-size: 19px; margin: 0 0 6px; }
.verify-card p { color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.text-input {
  font: inherit; font-size: 13px; color: var(--text-primary);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; width: 100%; margin: 10px 0;
}
.btn {
  padding: 10px 16px; border-radius: 8px; border: none; font-size: 13px; font-weight: 600;
  cursor: pointer; background: var(--series-1); color: #fff; width: 100%;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.code-box {
  display: block; padding: 12px; margin: 12px 0; border-radius: 8px;
  background: var(--surface-2); font-size: 16px; font-weight: 700; text-align: center;
  letter-spacing: 0.04em;
}
.verify-error {
  padding: 10px 12px; border-radius: 8px; margin: 10px 0; font-size: 12.5px;
  background: color-mix(in oklab, #e5484d 14%, var(--surface-2)); color: #e5484d;
}
.error-banner {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 12.5px;
  margin-bottom: 18px;
}
.demo-banner {
  padding: 10px 14px; border-radius: 9px; margin-bottom: 10px;
  background: color-mix(in oklab, var(--series-4) 16%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--series-4) 35%, transparent);
  font-size: 12.5px; color: var(--text-primary);
}

/* ---------- Setup tracking wizard ---------- */
.setup-step-head { text-align: center; margin-bottom: 20px; }
.setup-step-count { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.setup-step-head h1 { font-size: 22px; margin: 0 0 8px; }
.setup-step-sub { color: var(--text-secondary); font-size: 13.5px; margin: 0; }
.setup-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 22px 18px;
}
.setup-instr { display: flex; gap: 14px; margin-bottom: 18px; }
.setup-instr-num {
  flex: none; width: 26px; height: 26px; border-radius: 999px; background: var(--series-1); color: #fff;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.setup-instr-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.setup-instr-body { font-size: 13px; color: var(--text-secondary); }
.setup-instr-highlight { color: var(--series-1); font-weight: 600; }
.setup-shot {
  margin: 16px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
}
.setup-shot img { display: block; width: 100%; height: auto; }
.setup-continue { margin-top: 18px; }
.setup-back {
  display: block; text-align: center; margin-top: 14px; font-size: 13px;
  color: var(--text-secondary); text-decoration: none; cursor: pointer;
}
.setup-back:hover { color: var(--text-primary); }
.setup-mock {
  margin: 16px 0; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-1);
  padding: 16px 18px;
}
.setup-mock-title { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.setup-radio {
  display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; padding: 6px 0;
}
.setup-radio-dot { width: 15px; height: 15px; border-radius: 999px; border: 2px solid var(--muted); flex: none; }
.setup-radio-selected { color: var(--series-1); position: relative; }
.setup-radio-dot-selected { border-color: var(--series-1); background: var(--series-1); }
.setup-mock-arrow { color: #e5484d; font-weight: 700; font-size: 16px; }
.setup-mock-foot { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.setup-status {
  text-align: center; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-1);
  padding: 28px 22px; margin-top: 16px;
}
.setup-status-icon { font-size: 30px; margin-bottom: 12px; }
.setup-status-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.setup-status-sub { font-size: 13px; color: var(--text-secondary); }
.setup-status-timer { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.setup-status-done { border-color: color-mix(in oklab, var(--series-1) 40%, var(--border)); }
.setup-game-card {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 10px;
  background: color-mix(in oklab, var(--series-1) 12%, var(--surface-2)); text-align: left;
}
.setup-game-card img { width: 44px; height: 44px; border-radius: 8px; flex: none; }
.setup-game-name { font-size: 14px; font-weight: 600; }
#setupAnotherBtn { margin-top: 10px; }

/* ---------- OAuth-style buttons, dividers, hero landing ---------- */
.btn-outline {
  padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; width: 100%; margin-bottom: 10px;
  background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-outline:hover { background: var(--gridline); }
.btn-outline:disabled { opacity: 0.55; cursor: default; }
.btn-outline:disabled:hover { background: var(--surface-2); }
.btn-outline .badge-soon {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 999px; background: var(--gridline); color: var(--muted);
}
.auth-divider {
  display: flex; align-items: center; gap: 10px; margin: 16px 0;
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--gridline); }
.auth-switch { text-align: center; font-size: 12.5px; color: var(--text-secondary); margin-top: 14px; }
.auth-switch a { color: var(--series-1); font-weight: 600; text-decoration: none; }

.hero-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; text-align: center;
}
.hero-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 60px; }
.hero-brand .brand-mark { width: 26px; height: 26px; }
.hero-brand .brand-name { font-size: 15px; font-weight: 700; }
.hero-page h1 { font-size: 42px; font-weight: 800; line-height: 1.15; max-width: 640px; margin: 0 0 16px; }
.hero-page h1 .accent {
  background: linear-gradient(135deg, var(--series-1), var(--series-7)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-page .hero-sub { font-size: 15px; color: var(--text-secondary); max-width: 480px; margin: 0 0 28px; line-height: 1.5; }
.hero-page .btn { width: auto; padding: 13px 30px; font-size: 14px; }
.hero-page .auth-switch { margin-top: 14px; }
.hero-badges { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin-top: 34px; font-size: 12px; color: var(--text-secondary); }
.hero-badges span { display: flex; align-items: center; gap: 6px; }

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; min-width: 0; height: auto; position: static;
    flex-direction: row; align-items: center; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--border);
    gap: 14px;
  }
  .brand, .user-card { display: none; }
  /* min-width: 0 matters here too, not just on .sidebar — a row-flex nav
     is a flex item of .sidebar, and flex items default to min-width: auto
     (their content's intrinsic width), which overrides an ancestor's
     overflow-x: auto entirely. Without it, .sidebar-nav forced .sidebar
     (and the whole page, since nothing upstream clipped it either) wider
     than the viewport instead of actually scrolling — confirmed live: tabs
     past "Friends" (Badges, Leaderboard, Recommendations, Recap, Customize,
     Accounts) were unreachable, cut off with no scroll affordance, on a
     390px-wide viewport. */
  .sidebar-nav { flex-direction: row; flex: none; min-width: 0; }
  /* .nav-item's base rule sets width: 100% for the desktop vertical
     layout — flex: none alone doesn't cancel an explicit width, so every
     button was computing "100% of the row" simultaneously here, which is
     what actually produced the runaway ~10,300px total (each button
     ballooning to the same width as the whole nav, confirmed live via
     getBoundingClientRect on every child). width: auto is the fix. */
  .nav-item { flex: none; width: auto; white-space: nowrap; }
  .main { padding: 20px; min-width: 0; }

  /* card-header-row and the search+sort control rows (game library,
     friends activity) default to nowrap, sized for desktop — on a narrow
     card a fixed 170-200px search box plus a sort dropdown plus the card's
     own title routinely doesn't fit, and with no wrap they just pushed the
     whole page 40-90px past the viewport edge instead of clipping (same
     "nothing upstream actually constrains this" issue as the nav, just via
     overflow instead of a scroll container). Confirmed live: this was the
     entire remaining gap between document.documentElement.scrollWidth and
     window.innerWidth once the sidebar nav was fixed above.
     min-width: 0 is required on `.card` here too — flex/grid items along
     the way (its own children establish new formatting contexts) can
     otherwise still refuse to shrink below this row's intrinsic width. */
  .card-header-row { flex-wrap: wrap; }
  /* min-width: 0 again: as a flex item of .card-header-row, this row's
     default min-width: auto held it at its content's full natural width
     (its own internal flex-wrap never even triggered, since by its own
     measure "376px available for 361px of label+selects" never needed to
     wrap) — spilling ~28-70px past the card's actual right edge regardless
     of flex-wrap being set on it. Confirmed live on the Friends tab. */
  /* width: 100% (not just min-width: 0/flex-shrink) — a solo flex item
     wrapped onto its own line isn't forced down to the container's width
     by flex-shrink alone here, it still rendered at its content's natural
     size (confirmed live: stayed 377px wide inside a ~308-350px card even
     with min-width: 0 set). Explicit full width is also just the right
     mobile behavior anyway: once this row has wrapped below the card
     title onto its own line, it should span the card, with its own
     flex-wrap stacking the label/selects inside it as needed. */
  .game-library-controls, .friends-activity-controls { flex-wrap: wrap; width: 100%; }
  .game-library-controls .search-input, .friends-activity-controls .search-input {
    width: auto; flex: 1 1 140px;
  }
  /* The sidebar becomes a horizontal top bar at this width (see .sidebar
     above) — a fixed top-right button would sit directly on top of it.
     Hiding it here rather than repositioning it keeps this genuinely
     unobtrusive instead of finding somewhere else to wedge it in. */
  .kofi-btn { display: none; }
}
.hero-badges .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--status-good, #0ca30c); flex: none; }

.toast-stack {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  max-width: 320px; padding: 10px 14px; border-radius: 8px;
  background: var(--surface-2, #23232b); color: var(--text-primary, #fff);
  border: 1px solid rgba(224, 167, 42, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  font-size: 13px; line-height: 1.4;
  animation: toast-in 0.2s ease;
}
.toast.warn { border-color: #e0a72a; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Deliberately low-key: muted text color by default (not an accent color),
   small pill, no shadow/glow — only brightens a touch on hover so it reads
   as "there if you want it" rather than competing for attention with the
   actual dashboard. */
.kofi-btn {
  position: fixed; top: 16px; right: 16px; z-index: 900;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12.5px; font-weight: 600;
  text-decoration: none; transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.kofi-btn:hover { color: var(--text-primary); border-color: var(--series-1); transform: translateY(-1px); }
