:root {
  --bg: #0E1029;
  --bg-1: #14163A;
  --bg-2: #1B1D44;
  --bg-3: #232753;
  --bg-elev: #1F2247;
  --ink: #F4F4F8;
  --ink-soft: #C9CBE0;
  --ink-muted: #8B8FA8;
  --ink-dim: #5F6385;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #8B5CF6;
  --accent-soft: #A78BFA;
  --accent-deep: #7C3AED;
  --accent-glow: rgba(139, 92, 246, 0.18);
  --success: #34D399;
  --success-soft: rgba(52, 211, 153, 0.16);
  --warn: #F59E0B;
  --warn-soft: rgba(245, 158, 11, 0.16);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.16);
  --info: #60A5FA;
  --ring-track: rgba(255, 255, 255, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@supports (font-variation-settings: normal) {
  html, body { font-family: 'InterVariable', 'Inter', sans-serif; }
}

button { font-family: inherit; }

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* Typography */

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; }
h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }
h4 { font-size: 0.875rem; }
h5 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); font-weight: 600; }

p { margin: 0; }

.muted { color: var(--ink-muted); }
.soft { color: var(--ink-soft); }
.dim { color: var(--ink-dim); }
.small { font-size: 0.78rem; }
.tabular { font-variant-numeric: tabular-nums; }

/* App shell */

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 100vh;
  height: 100vh;
  overflow: hidden;
}
.app-shell.detail-open { grid-template-columns: 248px minmax(0, 1fr) 380px; }

@media (max-width: 1100px) {
  .app-shell, .app-shell.detail-open { grid-template-columns: 248px minmax(0, 1fr); }
  .detail-panel { display: none; }
}

/* Sidebar */

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: block;
}
.sidebar-brand-text { line-height: 1.1; }
.sidebar-brand-name { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.sidebar-brand-sub { font-size: 0.7rem; color: var(--ink-muted); }

.sidebar-cta {
  margin: 0.85rem 1rem 0.35rem;
}

.sidebar-section-label {
  padding: 0.85rem 1.1rem 0.4rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  font-weight: 600;
}

.sidebar-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 0.55rem 1rem;
}

.sidebar-empty {
  padding: 0.5rem 1.1rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.nav-game {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  margin-bottom: 0.15rem;
  position: relative;
}
.nav-game:hover { background: var(--bg-2); color: var(--ink); }
.nav-game.active {
  background: var(--bg-2);
  color: var(--ink);
}
.nav-game.active::before {
  content: '';
  position: absolute;
  left: -0.55rem;
  top: 0.55rem; bottom: 0.55rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-game-tile {
  width: 28px; height: 28px;
  border-radius: 7px;
  background-size: cover; background-position: center;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.04em;
}
.nav-game-tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.nav-game-meta {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
}
.nav-game-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-game-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Avatars */

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  user-select: none;
}
.avatar-xs { width: 24px; height: 24px; font-size: 0.65rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-md { width: 44px; height: 44px; font-size: 0.85rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.05rem; }
.avatar-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.avatar-platform {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--bg-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem;
  border: 2px solid var(--bg-1);
}
.avatar-md .avatar-platform { width: 18px; height: 18px; font-size: 0.6rem; }
.avatar-lg .avatar-platform { width: 22px; height: 22px; font-size: 0.7rem; }

.platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}
.platform-youtube { background: #FF0033; color: #fff; }
.platform-twitch { background: #9146FF; color: #fff; }
.platform-tiktok { background: #000; color: #fff; border: 1px solid rgba(255,255,255,0.2); }

/* Top bar */

.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.top-bar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}
.top-bar.has-hero {
  padding: 1.4rem 2rem 1.5rem;
}

.top-bar-hero {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  z-index: 0;
  opacity: 0.55;
  filter: saturate(1.05);
}
.top-bar-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14,16,41,0.45) 0%, rgba(14,16,41,0.92) 90%),
    linear-gradient(90deg, rgba(14,16,41,0.85) 0%, rgba(14,16,41,0.30) 60%, rgba(14,16,41,0.0) 100%);
}

.top-bar > .top-bar-left,
.top-bar > .top-bar-actions {
  position: relative;
  z-index: 1;
}

.top-bar-left { min-width: 0; flex: 1; }
.breadcrumb {
  font-size: 0.78rem;
  color: var(--ink-dim);
  margin-bottom: 0.55rem;
}
.breadcrumb .crumb-active { color: var(--ink-soft); }

.top-bar-title-row {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}
.top-bar-icon {
  width: 56px; height: 56px;
  border-radius: 12px;
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.02em;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.06);
}
.top-bar-icon img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.top-bar-title-text { min-width: 0; flex: 1 1 auto; }

.top-bar-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.3rem;
}
.top-bar-title h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.top-bar-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
}
.top-bar-meta span + span::before {
  content: '•';
  margin-right: 0.65rem;
  color: var(--ink-dim);
}
.top-bar.has-hero .top-bar-meta { color: var(--ink-soft); }

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 0 auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.5rem 0.3rem 0.3rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-soft);
  font: inherit;
}
.user-chip:hover { background: var(--bg-3); }
.user-chip-name { font-size: 0.82rem; font-weight: 500; }
.user-chip-caret { color: var(--ink-muted); }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { background: var(--bg-3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--bg-elev); color: var(--ink); }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
}
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
.btn-block { width: 100%; }

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.btn-pill:hover { background: var(--accent-deep); }

/* Content area */

.content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.5rem 2rem 4rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  padding-bottom: 0;
}
.tab {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.65rem 0.4rem;
  margin-right: 1rem;
  cursor: pointer;
  position: relative;
}
.tab:hover { color: var(--ink-soft); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.tab-count {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  background: var(--bg-elev);
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--ink-muted);
}
.empty-state-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--accent-soft);
}
.empty-state h2 { color: var(--ink); margin-bottom: 0.5rem; font-size: 1.1rem; }
.empty-state p { max-width: 380px; }

/* Recommendation cards */

.rec-list { display: flex; flex-direction: column; gap: 0.6rem; }

.rec-card {
  display: grid;
  grid-template-columns: 32px 56px 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.1rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.rec-card:hover { border-color: var(--line-strong); background: var(--bg-2); }
.rec-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
  background: var(--bg-2);
}

.rec-rank {
  font-size: 0.95rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: center;
}

.rec-identity { min-width: 0; }
.rec-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.rec-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.verified-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  flex: 0 0 auto;
}

.rec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag-positive { background: rgba(52,211,153,0.12); color: var(--success); border-color: rgba(52,211,153,0.25); }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(245,158,11,0.25); }
.tag-neutral { background: var(--bg-elev); color: var(--ink-muted); }
.tag-platform-youtube { color: #FF6B81; border-color: rgba(255,0,51,0.25); }
.tag-platform-twitch { color: #B392FF; border-color: rgba(145,70,255,0.25); }
.tag-platform-tiktok { color: var(--ink-soft); }

.rec-platform {
  font-size: 0.74rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rec-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, auto));
  gap: 0.85rem 1.4rem;
  text-align: left;
}
.rec-metrics .metric { min-width: 0; }
.metric-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-dim); }
.metric-value { font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }

.rec-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}
.score-ring {
  --score: 0;
  --ring-size: 48px;
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    conic-gradient(var(--ring-color, var(--accent)) calc(var(--score) * 1%), var(--ring-track) 0);
  position: relative;
}
.score-ring::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--bg-1);
}
.rec-card .score-ring::after { background: var(--bg-1); }
.rec-card.selected .score-ring::after { background: var(--bg-2); }
.score-ring-value {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.score-ring-large {
  --ring-size: 96px;
}
.score-ring-large .score-ring-value { font-size: 1.6rem; }
.score-ring[data-tier="excellent"] { --ring-color: var(--success); }
.score-ring[data-tier="strong"] { --ring-color: var(--success); }
.score-ring[data-tier="partial"] { --ring-color: var(--accent); }
.score-ring[data-tier="questionable"] { --ring-color: var(--warn); }
.score-ring[data-tier="unsuitable"] { --ring-color: var(--danger); }

.score-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin-top: 0.35rem;
}

@media (max-width: 1100px) {
  .rec-card { grid-template-columns: 28px 48px 1fr auto; }
  .rec-card .rec-metrics { display: none; }
}

/* Detail panel */

.detail-panel {
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.1rem;
}
.detail-header-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.detail-header-meta { flex: 1; min-width: 0; }
.detail-header-name { display: flex; align-items: center; gap: 0.4rem; }
.detail-header-name h2 { font-size: 1.05rem; font-weight: 700; }
.detail-header-sub { font-size: 0.78rem; color: var(--ink-muted); margin-top: 0.15rem; }
.detail-close {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  font-size: 1.1rem;
  line-height: 1;
}
.detail-close:hover { color: var(--ink); }

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.7rem;
}

.detail-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.85rem;
  align-items: center;
}
.detail-actions .btn { flex: 1; }
.detail-actions .btn-primary { flex: 1; }
.detail-actions .btn-icon { flex: 0 0 auto; }

.detail-body {
  padding: 1rem 1.1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.detail-section h5 { margin-bottom: 0.65rem; }

.match-score-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
}
.match-score-block .score-tier {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: 0.4rem;
  text-align: center;
}
.match-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.match-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}
.match-bar-track {
  position: relative;
  height: 6px;
  background: var(--ring-track);
  border-radius: 999px;
  overflow: hidden;
  grid-column: 1 / -1;
  margin-top: 0.15rem;
}
.match-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  border-radius: 999px;
}
.match-bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  font-size: 0.78rem;
}
.match-bar-name { color: var(--ink-soft); }
.match-bar-value { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.audience-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}
.audience-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.5rem;
}
.audience-stat-icon {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}
.audience-stat-pct { font-size: 0.95rem; font-weight: 700; }
.audience-stat-label { font-size: 0.7rem; color: var(--ink-muted); margin-top: 0.15rem; }

.perf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}
.perf-stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
}
.perf-stat-value { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.perf-stat-label { font-size: 0.72rem; color: var(--ink-muted); margin-top: 0.1rem; }

.price-block {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
}
.price-headline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.price-amount {
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.price-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.price-tag-good { background: var(--success-soft); color: var(--success); }
.price-tag-warn { background: var(--warn-soft); color: var(--warn); }
.price-tag-bad { background: var(--danger-soft); color: var(--danger); }
.price-detail { font-size: 0.78rem; color: var(--ink-muted); }
.price-cpm { color: var(--ink-soft); margin-top: 0.2rem; font-size: 0.78rem; }

.sparkline-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
}
.sparkline-tabs { display: flex; gap: 0.25rem; margin-bottom: 0.5rem; }
.sparkline-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}
.sparkline-tab.active {
  background: var(--bg-3);
  color: var(--ink);
}
.sparkline-svg { width: 100%; height: 60px; display: block; }
.sparkline-svg path.line { fill: none; stroke: url(#sparkGrad); stroke-width: 2; }
.sparkline-svg path.area { fill: rgba(139,92,246,0.15); }
.sparkline-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.78rem;
}
.sparkline-stats .label { color: var(--ink-muted); display: block; font-size: 0.7rem; }
.sparkline-stats .value { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Inline bid form inside detail */

.bid-inline {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}
.bid-inline h5 { margin-bottom: 0.6rem; }
.bid-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.field-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.field-input-wrap .currency {
  position: absolute;
  left: 0.7rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  pointer-events: none;
}
.field-input-wrap input {
  width: 100%;
  padding: 0.55rem 0.7rem 0.55rem 1.55rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.field-input-wrap input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.field-hint { font-size: 0.7rem; color: var(--ink-muted); margin-top: 0.25rem; }
.bid-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.bid-summary-row .total {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.bid-actions { display: flex; gap: 0.4rem; margin-top: 0.7rem; }
.bid-actions .btn { flex: 1; }

.bid-confirm {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: 12px;
}
.bid-confirm[data-status="declined"] {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(248,113,113,0.3);
}
.bid-confirm[data-status="pending"] {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(245,158,11,0.3);
}
.bid-confirm-icon {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

/* Status badges */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}
.status-badge[data-status="pending"] { background: var(--warn-soft); color: var(--warn); }
.status-badge[data-status="accepted"] { background: var(--success-soft); color: var(--success); }
.status-badge[data-status="declined"] { background: var(--danger-soft); color: var(--danger); }
.status-badge[data-status="seeded"] { background: var(--bg-elev); color: var(--ink-muted); }
.status-badge[data-status="manual"], .status-badge[data-status="steam_enriched"] { background: var(--accent-glow); color: var(--accent-soft); }
.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.8;
}

/* Bids table */

.bids-table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.bids-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.bids-table th, .bids-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.bids-table tr:last-child td { border-bottom: none; }
.bids-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  font-weight: 600;
  background: var(--bg);
}
.bids-table td.amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bids-table .creator-cell {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.bids-table .creator-cell > span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal (new campaign) */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 24, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}
.modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.modal-header h3 { font-size: 1rem; }
.modal-body {
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.field label.field-label { margin-bottom: 0; }
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 0.55rem 0.7rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.error-banner {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.3);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
}

.app-error {
  margin: 1rem 2rem;
}

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent-soft);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* ====================================================================
   Dashboard (no-campaign overview)
   ==================================================================== */

.content-dashboard { padding: 1.25rem 2rem 4rem; }

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 1480px;
  margin: 0 auto;
}

.dash-greeting {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.dash-greeting-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dash-greeting-title .wave { display: inline-block; transform: translateY(-1px); }
.dash-greeting-sub {
  margin-top: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

/* KPI cards */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.kpi-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem 0.6rem;
  display: flex;
  flex-direction: column;
  min-height: 132px;
  position: relative;
  overflow: hidden;
}
.kpi-card-label {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.kpi-card-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}
.kpi-card-delta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.75rem;
  margin-top: 0.2rem;
}
.kpi-card-delta.up { color: var(--success); }
.kpi-card-delta.down { color: var(--danger); }
.kpi-card-delta .muted { color: var(--ink-muted); }
.kpi-spark {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: auto;
}

/* Generic dashboard card */

.dash-row {
  display: grid;
  gap: 0.85rem;
}
.dash-row-3 {
  grid-template-columns: 1.5fr 1.2fr 1fr;
}
@media (max-width: 1280px) {
  .dash-row-3 { grid-template-columns: 1fr 1fr; }
  .dash-row-3 > .dash-card-wide { grid-column: span 2; }
}
@media (max-width: 760px) {
  .dash-row-3, .dash-row-3 > .dash-card-wide { grid-template-columns: 1fr; grid-column: auto; }
}

.dash-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dash-card-header h3 { font-size: 0.9rem; }
.dash-card-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dash-pill {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.7rem;
}
.dash-link {
  font-size: 0.78rem;
  color: var(--accent-soft);
  cursor: pointer;
  user-select: none;
}
.dash-link:hover { color: var(--ink); }
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
}

/* Combo chart */

.dash-card-wide { flex: 1 1 auto; }
.combo-chart {
  width: 100%;
  flex: 1 1 auto;
  min-height: 200px;
  display: block;
}
.combo-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--ink-dim);
  padding: 0 0.25rem;
}

/* Top creators list */

.top-creator-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.top-creator-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.82rem;
}
.top-creator-row:last-child { border-bottom: none; }
.top-creator-meta { min-width: 0; }
.top-creator-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-creator-tags {
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-creator-stat { text-align: right; min-width: 56px; }
.top-creator-stat .metric-label {
  font-size: 0.65rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.top-creator-stat .metric-value {
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tag-positive-text { color: var(--success); }

/* Funnel */

.funnel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.funnel-step {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.funnel-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
}
.funnel-label { color: var(--ink-soft); }
.funnel-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.funnel-bar-track {
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.funnel-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-soft));
  border-radius: 999px;
}
.funnel-pct {
  font-size: 0.7rem;
  color: var(--ink-muted);
}
.funnel-footer {
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-muted);
}
.funnel-footer strong { color: var(--ink); font-weight: 700; }

/* Donut */

.donut-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 1.1fr);
  gap: 1rem;
  align-items: center;
  flex: 1 1 auto;
  min-height: 0;
}
@media (max-width: 460px) {
  .donut-row { grid-template-columns: 1fr; justify-items: center; }
}
.donut {
  width: 100%;
  height: auto;
  max-height: 220px;
  aspect-ratio: 1 / 1;
  display: block;
  margin: 0 auto;
}
.donut-total {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.donut-sub {
  fill: var(--ink-muted);
  font-size: 9px;
}
.donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.78rem;
}
.donut-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.55rem;
}
.donut-legend .legend-name { color: var(--ink-soft); }
.donut-legend .legend-value {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}
.donut-legend .legend-pct {
  color: var(--ink-muted);
  font-size: 0.72rem;
  min-width: 32px;
  text-align: right;
}

/* Scatter */

.scatter {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-height: 220px;
}
.scatter-plot {
  position: relative;
  flex: 1 1 auto;
  min-height: 200px;
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 100% 25% repeat-y,
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 25% 100% repeat-x;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  overflow: hidden;
}
.scatter-dot {
  position: absolute;
  border-radius: 999px;
  transform: translate(-50%, 50%);
  opacity: 0.7;
  transition: opacity 0.2s;
}
.scatter-dot:hover { opacity: 1; }
.scatter-y-label {
  position: absolute;
  left: -2px; top: 4px;
  font-size: 0.65rem;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scatter-x-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--ink-dim);
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}
.scatter-x-label {
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.scatter-caption {
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-align: center;
}

/* Insights */

.insight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.insight-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.83rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.insight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}
.insight-icon-good {
  background: var(--success-soft);
  color: var(--success);
}
.insight-icon-info {
  background: var(--accent-glow);
  color: var(--accent-soft);
}
.insight-icon-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

/* Recent campaigns table */

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.dash-table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.dash-table tbody td {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dash-table thead th.num { text-align: right; }

.game-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.game-cell-tile {
  position: relative;
  width: 28px; height: 28px;
  border-radius: 6px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  font-size: 0.65rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.game-cell-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Top-bar overview state */

.top-bar:not(.has-hero) { align-items: center; padding: 0.85rem 2rem; }
.btn-leading { margin-right: 0.35rem; opacity: 0.85; }
.btn-trailing { margin-left: 0.35rem; opacity: 0.65; }

.sidebar-fixed {
  padding: 0.4rem 0.55rem 0;
  display: flex;
  flex-direction: column;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  position: relative;
}
.nav-link:hover { background: var(--bg-2); color: var(--ink); }
.nav-link.active {
  background: var(--bg-2);
  color: var(--ink);
  border-color: var(--line-strong);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -0.55rem;
  top: 0.55rem; bottom: 0.55rem;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.nav-link-icon {
  width: 22px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 1rem;
}
.nav-link.active .nav-link-icon { color: var(--accent-soft); }
.top-bar-overview {
  display: flex;
  align-items: center;
}
.top-bar-overview .breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0;
}
