@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@700;800;900&display=swap');

:root {
  color-scheme: dark;
  --color-bg: #090b10;
  --color-bg-elevated: #0d1016;
  --color-surface-1: #11151d;
  --color-surface-2: #171c26;
  --color-surface-3: #202735;
  --color-text: #f7f9fc;
  --color-text-soft: #d5dbe5;
  --color-muted: #9aa6b5;
  --color-subtle: #707c8d;
  --color-border: rgba(235, 241, 250, 0.1);
  --color-border-strong: rgba(235, 241, 250, 0.18);
  --color-primary: #71e6b3;
  --color-primary-strong: #43c990;
  --color-primary-ink: #07120d;
  --color-accent: #f4c95d;
  --color-info: #7c9cff;
  --color-danger: #ff6b72;
  --color-success: #71e6b3;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.34);
  --content-wide: 1280px;
  --content-home: 1180px;
  --header-height: 72px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #111111;
  color: #f8f5ef;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(17, 17, 17, 0.9);
  border-bottom: 1px solid rgba(248, 245, 239, 0.14);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(248, 245, 239, 0.16);
  border-radius: 8px;
  background: #1c1c1c;
  color: #f8f5ef;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  position: relative;
}

.nav-link:hover {
  border-color: rgba(248, 245, 239, 0.32);
  background: #242424;
  color: #ffffff;
}

.notification-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  background-color: #007aff;
  border-radius: 50%;
  border: 1.5px solid #111111;
  box-shadow: 0 0 8px rgba(0, 122, 255, 0.85);
  animation: pulse-blue 2.2s infinite ease-in-out;
}

@keyframes pulse-blue {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(0, 122, 255, 0);
  }
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
  }
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(248, 245, 239, 0.16);
  border-radius: 8px;
  background: #1c1c1c;
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  list-style: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav-dropdown summary:hover,
.nav-dropdown summary:focus-visible {
  border-color: rgba(43, 182, 115, 0.5);
  background: #222222;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #f2c94c;
  border-bottom: 2px solid #f2c94c;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.nav-dropdown[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  display: grid;
  gap: 4px;
  width: 195px;
  padding: 6px;
  background: rgba(24, 24, 24, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(248, 245, 239, 0.08);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 50;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-dropdown[open] .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown:first-of-type .dropdown-menu {
  left: 0;
  right: auto;
}

.nav-dropdown:last-of-type .dropdown-menu {
  right: 0;
  left: auto;
}

.dropdown-menu a {
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(248, 245, 239, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
  background: rgba(43, 182, 115, 0.14);
  color: #2bb673;
  outline: none;
}

.home {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(56px, 10vw, 112px) 0 64px;
}

.hero {
  min-height: 52vh;
  display: grid;
  align-content: center;
  gap: 20px;
}

.eyebrow {
  margin: 0;
  color: #f2c94c;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
.brand {
  font-family: 'Outfit', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  letter-spacing: -0.02em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 920px;
  color: #ffffff;
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-copy {
  max-width: 620px;
  color: #d8d1c4;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.placeholder-grid article {
  min-height: 160px;
  padding: 22px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.placeholder-grid h2 {
  color: #ffffff;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.placeholder-grid p {
  margin-top: 12px;
  color: #cfc8bc;
  line-height: 1.6;
}

.tool-page {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.tool-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.tool-hero h1 {
  max-width: 760px;
  margin-top: 6px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.tool-hero .hero-copy {
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.45;
}

.refresh-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(248, 245, 239, 0.22);
  border-radius: 8px;
  background: #f2c94c;
  color: #111111;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  background: #2bb673;
  outline: none;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  background: #1c1c1c;
  color: #f8f5ef;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.metric-card span {
  display: block;
  color: #aeb8ca;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: #ffffff;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.tool-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #181818;
}

.watcher-controls {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(140px, 180px) auto auto;
}

.stacked-controls {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.search-field,
.select-field {
  display: grid;
  gap: 8px;
}

.search-field span,
.select-field span {
  color: #aeb8ca;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-field input,
.select-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #0f0f0f;
  color: #ffffff;
  outline: none;
}

.search-field input {
  padding: 0 14px;
}

.select-field select {
  padding: 0 38px 0 14px;
}

.search-field input:focus,
.select-field select:focus {
  border-color: #2bb673;
  box-shadow: 0 0 0 3px rgba(43, 182, 115, 0.18);
}

.toggle-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #0f0f0f;
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 750;
  white-space: nowrap;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: #2bb673;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.section-heading h2 {
  color: #ffffff;
  font-size: 1.35rem;
}

.section-heading p {
  color: #aeb8ca;
  font-size: 0.95rem;
}

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

.game-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(248, 245, 239, 0.12);
  border-radius: 8px;
  background: #1a1a1a;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  border-color: rgba(43, 182, 115, 0.78);
  outline: none;
  transform: translateY(-2px);
}

.game-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(43, 182, 115, 0.36), transparent),
    #242424;
}

.game-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.game-thumb-empty::before {
  content: "s&";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  font-weight: 900;
}

.player-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(11, 12, 15, 0.86);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.ai-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 42px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(11, 12, 15, 0.88);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.ai-badge.clean,
.ai-inline-score.clean,
.ai-badge.pending,
.ai-inline-score.pending {
  color: #aeb8ca;
}

.ai-badge.low,
.ai-inline-score.low {
  color: #76d7a3;
}

.ai-badge.medium,
.ai-inline-score.medium {
  color: #f2c94c;
}

.ai-badge.high,
.ai-inline-score.high {
  color: #ff7b7b;
}

.game-body {
  min-height: 76px;
  padding: 11px 12px 13px;
}

.ai-card-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.ai-inline-score {
  flex: none;
  padding-top: 1px;
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

.game-body h3 {
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-body p {
  margin-top: 6px;
  color: #aeb8ca;
  font-size: 0.82rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-body .player-share {
  color: #8d998f;
  font-size: 0.76rem;
  font-weight: 750;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
  color: #cfc8bc;
  text-align: center;
}

.analytic-page {
  padding-bottom: 96px;
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(220px, 0.9fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #181818;
}

.admin-panel p {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: #aeb8ca;
  font-size: 0.95rem;
  line-height: 1.35;
}

.error-text {
  color: #ff7d7d !important;
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.analytics-column {
  min-width: 0;
}

.admin-game-list {
  display: grid;
  gap: 10px;
}

.admin-game-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.admin-game-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(43, 182, 115, 0.36), transparent),
    #242424;
}

.admin-game-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.admin-game-body {
  min-width: 0;
}

.admin-game-body h3 {
  color: #ffffff;
  font-size: 0.98rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-game-body p {
  margin-top: 6px;
  color: #aeb8ca;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-game-actions {
  display: flex;
  gap: 8px;
}

.text-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(248, 245, 239, 0.16);
  border-radius: 8px;
  background: #0f0f0f;
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.text-button:hover,
.text-button:focus-visible {
  border-color: #2bb673;
  outline: none;
}

.danger-button:hover,
.danger-button:focus-visible {
  border-color: #ff7d7d;
  color: #ffb3b3;
}

.daily-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 190px));
  gap: 16px;
  justify-content: start;
}

.daily-card {
  display: block;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.daily-card:hover,
.daily-card:focus-visible {
  border-color: rgba(43, 182, 115, 0.78);
  outline: none;
  transform: translateY(-2px);
}

.daily-card h3 {
  color: #ffffff;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-card p {
  margin-top: 7px;
  color: #aeb8ca;
  font-size: 0.84rem;
  line-height: 1.45;
}

.analytics-game-card {
  overflow: hidden;
  padding: 0;
}

.analytics-game-card.compare-selectable {
  cursor: pointer;
}

.analytics-game-card.selected-for-compare {
  border-color: #f2c94c;
  box-shadow: 0 0 0 2px rgba(242, 201, 76, 0.18);
}

.compare-checkmark {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(242, 201, 76, 0.92);
  color: #111111;
  font-size: 0.75rem;
  font-weight: 900;
}

.analytics-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(43, 182, 115, 0.36), transparent),
    #242424;
}

.analytics-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.analytics-card-body {
  min-height: 74px;
  padding: 11px 12px 13px;
}

.analytics-card-body .analytics-share-text {
  color: #91a2c9;
  font-size: 0.78rem;
  font-weight: 800;
}

.compact-empty {
  min-height: 96px;
}

.game-detail-page {
  width: min(1320px, calc(100% - 40px));
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 18px;
  color: #aeb8ca;
  font-size: 0.92rem;
  font-weight: 800;
}

.back-link:hover,
.back-link:focus-visible {
  color: #f2c94c;
  outline: none;
}

.game-detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 4vw, 42px);
  margin-bottom: 20px;
}

.detail-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(43, 182, 115, 0.36), transparent),
    #242424;
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.game-detail-hero h1 {
  max-width: 900px;
  margin-top: 8px;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.94;
}

.detail-stats {
  margin-bottom: 22px;
}

.chart-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.ai-scan-layout {
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
}

.ai-score-ring {
  --score: 0%;
  width: min(220px, 100%);
  aspect-ratio: 1;
  margin: 18px auto 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #171717 0 58%, transparent 59%),
    conic-gradient(#2bb673 var(--score), rgba(248, 245, 239, 0.12) 0);
  border: 1px solid rgba(248, 245, 239, 0.12);
}

.ai-score-ring[data-risk="medium"] {
  background:
    radial-gradient(circle at center, #171717 0 58%, transparent 59%),
    conic-gradient(#f2c94c var(--score), rgba(248, 245, 239, 0.12) 0);
}

.ai-score-ring[data-risk="high"] {
  background:
    radial-gradient(circle at center, #171717 0 58%, transparent 59%),
    conic-gradient(#ff7b7b var(--score), rgba(248, 245, 239, 0.12) 0);
}

.ai-score-ring[data-risk="clean"] {
  background:
    radial-gradient(circle at center, #171717 0 58%, transparent 59%),
    conic-gradient(#91a2c9 var(--score), rgba(248, 245, 239, 0.12) 0);
}

.ai-score-ring span {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 950;
}

.chart-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 380px;
  padding: 18px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.chart-heading-actions {
  align-items: end;
}

.chart-heading-actions > div {
  min-width: 0;
}

.compact-select {
  min-width: 150px;
}

.compact-select select {
  min-height: 38px;
  font-size: 0.9rem;
}

.wide-chart {
  grid-column: 1 / -1;
}

.chart-canvas-frame {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 300px;
}

.wide-canvas-frame {
  height: 340px;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: 100% !important;
}

.chart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.chart-floating-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(248, 245, 239, 0.12);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.84);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.chart-action-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #111111;
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.chart-action-button:hover,
.chart-action-button:focus-visible {
  border-color: #f2c94c;
  color: #f2c94c;
  outline: none;
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.chart-modal[hidden] {
  display: none;
}

.chart-modal-open {
  overflow: hidden;
}

.chart-modal-panel {
  width: min(1440px, 100%);
  height: min(860px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #111111;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
}

.chart-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.chart-modal-header h2 {
  color: #ffffff;
  font-size: 1.5rem;
}

.chart-modal-actions {
  flex: 0 0 auto;
}

.chart-modal-frame {
  position: relative;
  flex: 1;
  min-height: 0;
}

.chart-modal-frame canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.detail-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.detail-table th,
.detail-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(248, 245, 239, 0.1);
  text-align: left;
}

.detail-table th {
  color: #aeb8ca;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-table td {
  color: #f8f5ef;
  font-size: 0.94rem;
}

.detail-table tr:last-child td {
  border-bottom: 0;
}

.site-footer {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 34px;
  border-top: 1px solid rgba(248, 245, 239, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #aeb8ca;
}

.site-footer div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer strong {
  color: #ffffff;
}

.storage-usage {
  padding-left: 12px;
  border-left: 1px solid rgba(248, 245, 239, 0.14);
  color: #91a2c9;
  font-size: 0.86rem;
  font-weight: 750;
}

.site-footer nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-setting-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #aeb8ca;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 750;
  white-space: nowrap;
}

.footer-setting-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #f2c94c;
}

.footer-setting-toggle:hover,
.footer-setting-toggle:focus-within {
  color: #f2c94c;
}

.site-footer a,
.footer-admin-button {
  border: 0;
  background: transparent;
  color: #aeb8ca;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 750;
}

.site-footer a:hover,
.site-footer a:focus-visible,
.footer-admin-button:hover,
.footer-admin-button:focus-visible {
  color: #f2c94c;
  outline: none;
}

.admin-drawer {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 40;
  width: min(1120px, calc(100% - 40px));
  max-height: min(82vh, 760px);
  overflow: auto;
  transform: translateX(-50%);
  padding: 18px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #111111;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
}

.admin-drawer[hidden] {
  display: none;
}

.admin-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.admin-drawer-header h2 {
  color: #ffffff;
  font-size: 1.35rem;
}

.admin-drawer .admin-panel {
  grid-template-columns: minmax(220px, 1fr) auto auto minmax(220px, 0.8fr);
}

.compare-mode {
  padding-bottom: 118px;
}

.compare-toolbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 38;
  width: min(1280px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #111111;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.58);
  transform: translateX(-50%);
}

.compare-toolbar[hidden] {
  display: none;
}

.compare-toolbar-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.compare-toolbar-main strong {
  color: #ffffff;
}

.compare-toolbar-main > span {
  color: #aeb8ca;
  font-size: 0.88rem;
}

.compare-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compare-chip {
  max-width: 170px;
  overflow: hidden;
  padding: 6px 8px;
  border: 1px solid rgba(242, 201, 76, 0.34);
  border-radius: 8px;
  background: rgba(242, 201, 76, 0.12);
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.compare-toolbar-actions .refresh-button,
.compare-toolbar-actions .text-button {
  min-width: 112px;
}

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.compare-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(248, 245, 239, 0.12);
  border-radius: 8px;
  background: #1c1c1c;
  color: #aeb8ca;
}

.compare-legend-item span:first-child {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.compare-legend-item strong {
  max-width: 180px;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-legend-item span:last-child {
  font-size: 0.78rem;
  white-space: nowrap;
}

.skeleton {
  min-height: 186px;
  background:
    linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.08) 50%, transparent 65%),
    #1a1a1a;
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

.game-page {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.sbusiness-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.sbusiness-title-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.sbusiness-title-block img {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  object-fit: cover;
  background: #242424;
}

.sbusiness-title-block h1 {
  max-width: 760px;
  margin-top: 4px;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
}

.sbusiness-title-block p:last-child {
  margin-top: 8px;
  color: #cbd6f0;
  line-height: 1.45;
}

.sbusiness-actions {
  flex: 0 0 auto;
}

.sbusiness-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: start;
  gap: 24px;
}

.sbusiness-main {
  min-width: 0;
  display: grid;
  gap: 22px;
}

.media-stage,
.sbusiness-panel {
  min-width: 0;
}

.media-viewer {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #050505;
}

.media-viewer img,
.media-viewer video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.media-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(248, 245, 239, 0.16);
  border-radius: 6px;
  background: #111111;
  cursor: pointer;
}

.media-thumb.active,
.media-thumb:hover,
.media-thumb:focus-visible {
  border-color: #2f7cff;
  outline: none;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-thumb span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(11, 12, 15, 0.86);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 850;
}

.sbusiness-panel {
  padding: 18px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.sbusiness-panel h2 {
  color: #ffffff;
  font-size: 1.18rem;
}

.sbusiness-description {
  color: #d8d1c4;
  line-height: 1.58;
}

.sbusiness-description h1,
.sbusiness-description h2 {
  max-width: none;
  margin: 22px 0 10px;
  color: #ffffff;
  font-size: 1.45rem;
  line-height: 1.15;
}

.sbusiness-description div,
.sbusiness-description p,
.sbusiness-description ul {
  margin-top: 10px;
}

.sbusiness-description figure {
  margin: 18px 0;
}

.sbusiness-description img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.sbusiness-description figcaption {
  display: none;
}

.leaderboard-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, 170px) minmax(130px, 170px) auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.leaderboard-summary {
  min-height: 22px;
  margin-bottom: 10px;
  color: #aeb8ca;
  font-size: 0.92rem;
  font-weight: 750;
}

.leaderboard-table {
  min-width: 700px;
}

.leaderboard-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #111111;
  border: 1px solid rgba(248, 245, 239, 0.1);
  flex-shrink: 0;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.leaderboard-player strong {
  color: #ffffff;
  font-weight: 700;
}

.leaderboard-player small {
  color: #8090ad;
  font-size: 0.78rem;
}

/* Blocked/Restricted leaderboard entries */
.blocked-entry {
  opacity: 0.55;
  background: rgba(235, 94, 85, 0.03);
}

.blocked-entry .leaderboard-player strong {
  text-decoration: line-through;
  color: #aeb8ca;
}

.blocked-entry .leaderboard-player small {
  text-decoration: line-through;
  color: #8090ad;
}

.blocked-entry .leaderboard-value {
  text-decoration: line-through;
  color: #aeb8ca;
}

.leaderboard-value {
  color: #ffd34f;
  font-weight: 850;
}

.leaderboard-empty {
  color: #aeb8ca;
  text-align: center;
}

.sbusiness-sidebar {
  display: grid;
  gap: 12px;
}

.info-list {
  display: grid;
  gap: 11px;
  margin-top: 14px;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #aeb8ca;
  font-size: 0.88rem;
}

.info-list strong {
  color: #ffffff;
  text-align: right;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #27324b;
  color: #dce5ff;
  font-size: 0.78rem;
  font-weight: 750;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    align-items: stretch;
  }

  .nav-dropdown {
    flex: 1;
  }

  .nav-dropdown summary {
    justify-content: space-between;
    width: 100%;
  }

  .dropdown-menu {
    width: min(220px, 90vw);
  }

  .home {
    width: min(100% - 32px, 1120px);
    padding-top: 48px;
  }

  .game-page {
    width: min(100% - 32px, 1100px);
  }

  .placeholder-grid {
    grid-template-columns: 1fr;
  }

  .tool-page {
    width: min(100% - 32px, 1280px);
    padding-top: 36px;
  }

  .tool-hero,
  .section-heading,
  .sbusiness-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .refresh-button {
    width: 100%;
  }

  .stats-panel,
  .tool-controls,
  .admin-panel,
  .analytics-layout {
    grid-template-columns: 1fr;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .daily-stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .site-footer,
  .site-footer div,
  .site-footer nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer nav {
    gap: 10px;
  }

  .footer-setting-toggle {
    white-space: normal;
  }

  .storage-usage {
    padding-left: 0;
    border-left: 0;
  }

  .admin-drawer {
    bottom: 12px;
    width: min(100% - 24px, 1120px);
    padding: 14px;
  }

  .admin-drawer .admin-panel {
    grid-template-columns: 1fr;
  }

  .compare-mode {
    padding-bottom: 190px;
  }

  .compare-toolbar {
    bottom: 12px;
    align-items: stretch;
    flex-direction: column;
    width: min(100% - 24px, 1280px);
  }

  .compare-toolbar-actions {
    width: 100%;
  }

  .compare-toolbar-actions .refresh-button,
  .compare-toolbar-actions .text-button {
    flex: 1;
    width: 100%;
  }

  .game-detail-hero,
  .chart-layout,
  .sbusiness-layout {
    grid-template-columns: 1fr;
  }

  .leaderboard-controls {
    grid-template-columns: 1fr;
  }

  .sbusiness-title-block {
    align-items: flex-start;
  }

  .sbusiness-title-block img {
    width: 72px;
    height: 72px;
  }

  .chart-card,
  .wide-chart {
    grid-column: auto;
    min-height: 320px;
  }

  .chart-actions {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .chart-floating-actions {
    top: 6px;
    right: 6px;
    max-width: calc(100% - 12px);
    overflow-x: auto;
  }

  .chart-actions .chart-action-button {
    flex: 1 1 auto;
  }

  .chart-floating-actions .chart-action-button {
    flex: 0 0 auto;
  }

  .chart-modal {
    padding: 12px;
  }

  .chart-modal-panel {
    height: calc(100vh - 24px);
    padding: 14px;
  }

  .chart-modal-header {
    flex-direction: column;
  }

  .chart-modal-actions {
    width: 100%;
  }

  .chart-canvas-frame,
  .wide-canvas-frame {
    height: 250px;
  }

  .admin-game-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .admin-game-actions {
    grid-column: 1 / -1;
  }

  .admin-game-actions .text-button {
    flex: 1;
  }
}

/* Premium Portal Cards */
.modern-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  background: #1c1c1c;
  border: 1px solid rgba(248, 245, 239, 0.08);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.modern-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #2bb673, #2196f3);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modern-card:hover {
  transform: translateY(-4px);
}

.modern-card:hover::before {
  opacity: 1;
}

/* Custom Icon Badges with Gradient Backgrounds */
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  margin-bottom: 20px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-badge svg {
  width: 24px;
  height: 24px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modern-card:hover .icon-badge svg {
  transform: scale(1.1);
}

.watcher-badge {
  background: linear-gradient(135deg, rgba(43, 182, 115, 0.18), rgba(43, 182, 115, 0.03));
  border: 1px solid rgba(43, 182, 115, 0.3);
  color: #2bb673;
}

.analytics-badge {
  background: linear-gradient(135deg, rgba(111, 134, 255, 0.18), rgba(111, 134, 255, 0.03));
  border: 1px solid rgba(111, 134, 255, 0.3);
  color: #6f86ff;
}

.leaderboard-badge {
  background: linear-gradient(135deg, rgba(242, 201, 76, 0.18), rgba(242, 201, 76, 0.03));
  border: 1px solid rgba(242, 201, 76, 0.3);
  color: #f2c94c;
}

/* Individual Card Hover Effects (Theme specific glow and top line) */
.modern-card:nth-child(1)::before {
  background: #2bb673;
}
.modern-card:nth-child(1):hover {
  border-color: rgba(43, 182, 115, 0.45);
  box-shadow: 0 12px 30px -10px rgba(43, 182, 115, 0.22);
}

.modern-card:nth-child(2)::before {
  background: #6f86ff;
}
.modern-card:nth-child(2):hover {
  border-color: rgba(111, 134, 255, 0.45);
  box-shadow: 0 12px 30px -10px rgba(111, 134, 255, 0.22);
}

.modern-card:nth-child(3)::before {
  background: #f2c94c;
}
.modern-card:nth-child(3):hover {
  border-color: rgba(242, 201, 76, 0.45);
  box-shadow: 0 12px 30px -10px rgba(242, 201, 76, 0.22);
}

.modern-card h2 {
  font-size: 1.35rem;
  font-weight: 750;
  margin: 0 0 10px;
  color: #ffffff;
}

.modern-card p {
  color: #aeb8ca;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 20px;
  flex-grow: 1;
}

.card-link {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2bb673;
  transition: color 0.15s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.modern-card:hover .card-link {
  color: #5cd699;
}

/* Segmented Control for View Selection */
.view-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.view-selector > span {
  color: #aeb8ca;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.segmented-control {
  display: flex;
  background: #0f0f0f;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  padding: 2px;
  min-height: 44px;
}

.segment-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #aeb8ca;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  padding: 0 16px;
}

.segment-btn:hover {
  color: #ffffff;
}

.segment-btn.active {
  background: #2bb673;
  color: #111111;
}

/* SVG Bubble Chart Styles */
#bubbleChartSvg text {
  pointer-events: none;
  user-select: none;
}

.bubble-node circle {
  transition: stroke-width 0.2s ease, filter 0.2s ease, r 0.2s ease;
}

.bubble-node:hover circle {
  stroke-width: 4px;
}

.bubble-node .game-title {
  fill: #ffffff;
  font-weight: 750;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  text-anchor: middle;
}

.bubble-node .game-count {
  fill: #4ade80;
  font-weight: 800;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  text-anchor: middle;
}

.bubble-node .game-players-label {
  fill: #aeb8ca;
  font-weight: 600;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  text-anchor: middle;
  opacity: 0.8;
}

.detail-controls {
  grid-template-columns: minmax(200px, 320px) 1fr;
}

/* News Section Layout */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.news-card {
  background: rgba(22, 22, 28, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(248, 245, 239, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.25s ease, 
              box-shadow 0.25s ease;
}

.news-card-link-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.news-card-image {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  transition: transform 0.25s ease;
  border-bottom: 1px solid rgba(248, 245, 239, 0.06);
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 122, 255, 0.4);
  box-shadow: 0 12px 30px -10px rgba(0, 122, 255, 0.2);
}

.news-card:hover .news-card-image {
  transform: scale(1.03);
}

.news-card-content {
  display: flex;
  flex-direction: column;
  padding: 20px;
  flex-grow: 1;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #aeb8ca;
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.news-card-author {
  color: #007aff;
}

.news-card-dot {
  opacity: 0.5;
}

.news-card-title {
  font-family: 'Outfit', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}

.news-card:hover .news-card-title {
  color: #007aff;
}

.news-card-description {
  color: #aeb8ca;
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 20px 0;
  flex-grow: 1;
}

.news-card-action {
  font-size: 0.88rem;
  font-weight: 700;
  color: #007aff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease;
}

.news-card:hover .news-card-action {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Studio telemetry design system
   Shared overrides remain framework-free and preserve every existing page.
   -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--color-surface-3) var(--color-bg);
}

body {
  background:
    radial-gradient(circle at 12% -10%, rgba(113, 230, 179, 0.07), transparent 32rem),
    radial-gradient(circle at 92% 8%, rgba(124, 156, 255, 0.055), transparent 34rem),
    var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

body::selection,
body *::selection {
  background: rgba(113, 230, 179, 0.28);
  color: var(--color-text);
}

body *:focus-visible {
  outline: 3px solid rgba(113, 230, 179, 0.82) !important;
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-primary-ink);
  font-size: 0.88rem;
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: block;
  min-height: var(--header-height);
  padding: 0;
  background: rgba(9, 11, 16, 0.96);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: none;
}

.site-header-inner {
  position: relative;
  width: min(var(--content-wide), calc(100% - 32px));
  min-height: var(--header-height);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  justify-self: start;
  color: var(--color-text);
}

.brand.brand-simple {
  gap: 0;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(113, 230, 179, 0.42);
  border-radius: 11px;
  background: rgba(113, 230, 179, 0.09);
  color: var(--color-primary);
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  color: var(--color-text);
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-copy small {
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  align-content: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface-1);
  color: var(--color-text);
  cursor: pointer;
}

.nav-toggle span {
  width: 17px;
  height: 2px;
  display: block;
  border-radius: 99px;
  background: currentColor;
  transition: transform 180ms var(--ease-out), opacity 120ms ease;
}

.site-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.top-nav {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: 0;
  display: none;
  align-items: stretch;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
  box-shadow: var(--shadow-lg);
}

.site-header.nav-open .top-nav {
  display: grid;
}

.nav-link {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  font-size: 0.88rem;
  font-weight: 700;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.nav-link:hover {
  border-color: var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
}

.nav-link[aria-current="page"] {
  border-color: rgba(113, 230, 179, 0.22);
  background: rgba(113, 230, 179, 0.09);
  color: var(--color-primary);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 0;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(244, 201, 93, 0.1);
  animation: none;
}

.notification-dot[hidden] {
  display: none;
}

.eyebrow {
  color: var(--color-primary);
  font-size: 0.76rem;
  letter-spacing: 0.13em;
}

h1,
h2,
h3,
.brand {
  text-wrap: balance;
}

.hero-copy {
  color: var(--color-text-soft);
}

.tool-page,
.game-detail-page,
.game-page {
  width: min(var(--content-wide), calc(100% - 32px));
}

.tool-page {
  padding-top: clamp(28px, 4vw, 48px);
}

.tool-hero {
  margin-bottom: 24px;
}

.tool-hero h1 {
  color: var(--color-text);
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  letter-spacing: -0.045em;
}

.tool-hero .hero-copy {
  max-width: 700px;
  color: var(--color-muted);
}

.site-footer {
  width: min(var(--content-wide), calc(100% - 32px));
  min-height: 96px;
  margin-top: 24px;
  padding: 26px 0 30px;
  border-color: var(--color-border);
  color: var(--color-muted);
}

.footer-identity {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.footer-identity strong {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1rem;
}

.footer-identity span {
  font-size: 0.82rem;
}

.footer-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
}

.site-footer a,
.footer-admin-button {
  color: var(--color-muted);
  font-size: 0.84rem;
}

.site-footer a:hover,
.footer-admin-button:hover {
  color: var(--color-primary);
}

/* Shared surfaces and controls */
.metric-card,
.tool-controls,
.game-card,
.daily-card,
.chart-card,
.sbusiness-panel,
.admin-panel,
.admin-game-card,
.detail-table-wrap,
.compare-legend-item,
.blocked-id-card,
.empty-state {
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
}

.metric-card,
.chart-card,
.sbusiness-panel,
.tool-controls,
.admin-panel {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

.metric-card {
  min-height: 106px;
  padding: 17px 18px;
}

.metric-card span,
.search-field span,
.select-field span,
.view-selector > span {
  color: var(--color-muted);
  letter-spacing: 0.065em;
}

.metric-card strong {
  color: var(--color-text);
}

.section-heading h2,
.sbusiness-panel h2,
.admin-drawer-header h2 {
  color: var(--color-text);
}

.section-heading p,
.game-body p,
.daily-card p,
.leaderboard-summary,
.admin-panel p {
  color: var(--color-muted);
}

.tool-controls,
.admin-panel {
  padding: 14px;
  background: var(--color-bg-elevated);
}

.search-field input,
.select-field select,
.toggle-field,
.segmented-control {
  border-color: var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
}

.search-field input::placeholder {
  color: var(--color-subtle);
}

.search-field input:focus,
.select-field select:focus {
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 3px rgba(113, 230, 179, 0.12);
}

.toggle-field input,
.footer-setting-toggle input {
  accent-color: var(--color-primary);
}

.refresh-button,
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-primary-ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.refresh-button:hover,
.button-primary:hover {
  background: #8aefc4;
  color: var(--color-primary-ink);
  transform: translateY(-1px);
}

.button-secondary,
.secondary-button {
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
  color: var(--color-text);
}

.button-secondary:hover,
.secondary-button:hover {
  border-color: rgba(113, 230, 179, 0.42);
  background: var(--color-surface-3);
  color: var(--color-primary);
}

.button-tertiary {
  min-height: 42px;
  padding-inline: 4px;
  border-color: transparent;
  background: transparent;
  color: var(--color-text-soft);
}

.button-tertiary:hover {
  color: var(--color-primary);
}

.refresh-button:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.text-button,
.chart-action-button,
.compare-chip {
  border-color: var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-soft);
}

.text-button:hover,
.chart-action-button:hover {
  border-color: rgba(113, 230, 179, 0.46);
  color: var(--color-primary);
}

.game-card,
.daily-card,
.modern-card,
.news-card {
  transition: transform 180ms var(--ease-out), border-color 180ms ease, box-shadow 180ms ease;
}

.game-card:hover,
.daily-card:hover,
.modern-card:hover,
.news-card:hover {
  border-color: rgba(113, 230, 179, 0.32);
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

.game-thumb,
.analytics-thumb,
.admin-game-thumb,
.detail-thumb {
  background:
    linear-gradient(135deg, rgba(113, 230, 179, 0.13), rgba(124, 156, 255, 0.05)),
    var(--color-surface-2);
}

.player-badge,
.ai-badge {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(9, 11, 16, 0.9);
}

.chart-card {
  padding: 20px;
}

.chart-floating-actions {
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(9, 11, 16, 0.94);
}

.detail-table-wrap {
  scrollbar-color: var(--color-surface-3) var(--color-surface-1);
}

.detail-table th,
.detail-table td {
  border-color: var(--color-border);
}

.detail-table th {
  color: var(--color-muted);
  letter-spacing: 0.06em;
}

.detail-table tbody tr {
  transition: background-color 130ms ease;
}

.detail-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.leaderboard-value {
  color: var(--color-accent);
}

.admin-drawer,
.compare-toolbar,
.chart-modal-panel {
  border-color: var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-lg);
}

.storage-usage {
  border-color: var(--color-border);
  color: var(--color-info);
}

.segment-btn.active {
  background: var(--color-primary);
  color: var(--color-primary-ink);
}

.tag-list span,
.feature-chips span {
  background: rgba(124, 156, 255, 0.1);
  color: #cdd8ff;
}

.card-link {
  color: var(--color-primary);
}

.card-link:hover {
  color: #a1f4d0;
}

/* Reusable public UI patterns */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.live-status {
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-1);
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.live-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(244, 201, 93, 0.1);
}

.live-status[data-state="online"] {
  border-color: rgba(113, 230, 179, 0.22);
  color: #b8f5d9;
}

.live-status[data-state="online"] .live-status-dot {
  background: var(--color-success);
  box-shadow: 0 0 0 4px rgba(113, 230, 179, 0.1);
}

.live-status[data-state="offline"] {
  border-color: rgba(255, 107, 114, 0.24);
  color: #ffb5b9;
}

.live-status[data-state="offline"] .live-status-dot {
  background: var(--color-danger);
  box-shadow: 0 0 0 4px rgba(255, 107, 114, 0.1);
}

.favorite-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface-1);
  color: var(--color-muted);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, transform 150ms var(--ease-out);
}

.favorite-button:hover {
  border-color: rgba(244, 201, 93, 0.42);
  color: var(--color-accent);
  transform: translateY(-1px);
}

.favorite-button.is-active,
.favorite-button[aria-pressed="true"] {
  border-color: rgba(244, 201, 93, 0.38);
  background: rgba(244, 201, 93, 0.1);
  color: var(--color-accent);
}

.stat-tabs {
  display: flex;
  gap: 6px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  scrollbar-width: thin;
}

.stat-tabs button,
.stat-tabs a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 750;
  white-space: nowrap;
}

.stat-tabs button:hover,
.stat-tabs a:hover {
  color: var(--color-text);
}

.stat-tabs button.active,
.stat-tabs button[aria-selected="true"],
.stat-tabs a[aria-current="page"] {
  border-color: var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-primary);
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 12px;
  margin: 20px 0 24px;
}

.podium-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
  text-align: center;
}

.podium-card[data-rank="1"] {
  border-color: rgba(244, 201, 93, 0.32);
  background: linear-gradient(180deg, rgba(244, 201, 93, 0.08), var(--color-surface-1));
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.pagination-controls button,
.pagination-controls a {
  min-width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 11px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface-1);
  color: var(--color-text-soft);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 750;
}

.pagination-controls button:hover,
.pagination-controls a:hover,
.pagination-controls [aria-current="page"] {
  border-color: rgba(113, 230, 179, 0.36);
  background: rgba(113, 230, 179, 0.08);
  color: var(--color-primary);
}

.pagination-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* Home */
.studio-home {
  width: min(var(--content-home), calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 clamp(64px, 8vw, 104px);
}

.studio-hero {
  min-height: min(760px, calc(100vh - var(--header-height)));
  display: grid;
  align-items: center;
  gap: clamp(40px, 7vw, 88px);
  padding: clamp(64px, 10vw, 120px) 0;
}

.studio-hero-copy {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 22px;
}

.studio-hero h1 {
  max-width: 820px;
  color: var(--color-text);
  font-size: clamp(3.25rem, 12vw, 7.2rem);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.studio-hero .hero-copy {
  max-width: 690px;
  font-size: clamp(1.02rem, 2vw, 1.24rem);
  line-height: 1.65;
}

.studio-hero .hero-actions {
  margin-top: 4px;
}

.telemetry-console {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-md);
}

.console-header,
.console-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
}

.console-header {
  border-bottom: 1px solid var(--color-border);
}

.console-header > div {
  display: grid;
  gap: 3px;
}

.console-overline {
  color: var(--color-subtle);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.console-header strong {
  color: var(--color-text);
  font-size: 0.95rem;
}

.console-pulse {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 5px rgba(113, 230, 179, 0.1);
}

.service-list {
  display: grid;
  padding: 6px 12px;
}

.service-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 12px 7px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.service-row:last-child {
  border-bottom: 0;
}

.service-row:hover strong {
  color: var(--color-primary);
}

.service-index {
  width: 30px;
  color: var(--color-subtle);
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}

.service-row > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.service-row strong {
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  transition: color 140ms ease;
  white-space: nowrap;
}

.service-row small {
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-state {
  padding: 4px 7px;
  border: 1px solid rgba(113, 230, 179, 0.18);
  border-radius: 999px;
  background: rgba(113, 230, 179, 0.06);
  color: var(--color-primary);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.console-footer {
  border-top: 1px solid var(--color-border);
  color: var(--color-subtle);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-section {
  padding: clamp(64px, 9vw, 112px) 0;
  border-top: 1px solid var(--color-border);
}

.home-section-heading {
  display: grid;
  gap: 20px;
  margin-bottom: 34px;
}

.home-section-heading > div {
  display: grid;
  gap: 10px;
}

.home-section-heading h2,
.featured-game h2,
.home-callout h2 {
  max-width: 760px;
  color: var(--color-text);
  font-size: clamp(2rem, 5.5vw, 3.9rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.home-section-heading > p {
  max-width: 580px;
  color: var(--color-muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.public-tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.public-tool-card {
  --tool-accent: var(--color-primary);
  position: relative;
  min-width: 0;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
  transition: border-color 180ms ease, transform 180ms var(--ease-out), box-shadow 180ms ease;
}

.public-tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 2px;
  background: var(--tool-accent);
  opacity: 0.65;
}

.public-tool-card[data-tool="tracker"] {
  --tool-accent: var(--color-info);
}

.public-tool-card[data-tool="leaderboard"] {
  --tool-accent: var(--color-accent);
}

.public-tool-card[data-tool="roadmap"] {
  --tool-accent: #d795ff;
}

.public-tool-card:hover,
.public-tool-card:focus-within {
  border-color: color-mix(in srgb, var(--tool-accent) 36%, transparent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

.tool-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.tool-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--tool-accent) 28%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--tool-accent) 8%, transparent);
  color: var(--tool-accent);
}

.tool-icon svg {
  width: 22px;
  height: 22px;
}

.tool-number {
  color: var(--color-subtle);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-tool-card h3 {
  color: var(--color-text);
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

.public-tool-card > p {
  margin-top: 10px;
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.tool-feature-list {
  display: grid;
  gap: 7px;
  margin: 20px 0 24px;
  padding: 0;
  color: var(--color-text-soft);
  font-size: 0.8rem;
  list-style: none;
}

.tool-feature-list li {
  position: relative;
  padding-left: 15px;
}

.tool-feature-list li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tool-accent);
}

.public-tool-card .card-link {
  margin-top: auto;
  color: var(--tool-accent);
  font-size: 0.86rem;
}

.public-tool-card .card-link span {
  transition: transform 160ms var(--ease-out);
}

.public-tool-card .card-link:hover span {
  transform: translateX(3px);
}

.featured-game {
  display: grid;
  align-items: center;
  gap: clamp(36px, 7vw, 88px);
  padding: clamp(64px, 9vw, 112px) 0;
  border-top: 1px solid var(--color-border);
}

.featured-game-copy {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 18px;
}

.featured-game-copy > p:not(.eyebrow) {
  max-width: 590px;
  color: var(--color-muted);
  line-height: 1.7;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-chips span {
  padding: 7px 10px;
  border: 1px solid rgba(124, 156, 255, 0.16);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
}

.game-signal-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-md);
}

.game-signal-visual {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - 8px);
  background:
    linear-gradient(145deg, rgba(113, 230, 179, 0.09), transparent 50%),
    linear-gradient(30deg, rgba(124, 156, 255, 0.08), transparent 60%),
    var(--color-surface-1);
}

.game-signal-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent, black 28%, black 78%, transparent);
  opacity: 0.42;
}

.game-monogram {
  position: absolute;
  top: 26px;
  left: 26px;
  color: var(--color-text);
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: clamp(2.2rem, 8vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 1;
}

.market-bars {
  position: absolute;
  right: 28px;
  bottom: 38px;
  left: 28px;
  height: 130px;
  display: flex;
  align-items: end;
  gap: clamp(9px, 2vw, 18px);
}

.market-bars span {
  flex: 1;
  min-width: 8px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(to top, rgba(113, 230, 179, 0.22), var(--color-primary));
  opacity: 0.8;
}

.market-bars span:nth-child(1) { height: 32%; }
.market-bars span:nth-child(2) { height: 48%; }
.market-bars span:nth-child(3) { height: 42%; }
.market-bars span:nth-child(4) { height: 68%; }
.market-bars span:nth-child(5) { height: 58%; }
.market-bars span:nth-child(6) { height: 92%; }

.market-line {
  position: absolute;
  right: 24px;
  bottom: 102px;
  left: 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent) 20%, var(--color-accent) 72%, transparent);
  transform: rotate(-9deg);
  transform-origin: center;
  opacity: 0.9;
}

.game-signal-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  padding-top: 10px;
}

.game-signal-meta > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-1);
}

.game-signal-meta span {
  color: var(--color-subtle);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-signal-meta strong {
  overflow: hidden;
  color: var(--color-text-soft);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-signal-meta .signal-positive {
  color: var(--color-primary);
}

.home-callout {
  display: grid;
  align-items: center;
  gap: 26px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(100deg, rgba(124, 156, 255, 0.065), transparent 48%),
    var(--color-surface-1);
}

.home-callout > div {
  display: grid;
  gap: 10px;
}

.home-callout h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.home-callout p:not(.eyebrow) {
  max-width: 680px;
  color: var(--color-muted);
  line-height: 1.65;
}

/* 320px-first layout */
@media (max-width: 767px) {
  :root {
    --header-height: 64px;
  }

  body {
    overflow-x: clip;
  }

  .site-header-inner,
  .studio-home,
  .tool-page,
  .game-page,
  .game-detail-page,
  .site-footer {
    width: min(100% - 24px, var(--content-wide));
  }

  .brand-copy small {
    max-width: 150px;
  }

  .top-nav {
    max-height: calc(100vh - var(--header-height) - 24px);
    overflow-y: auto;
  }

  .studio-hero {
    min-height: 0;
    padding: 58px 0 68px;
  }

  .studio-hero h1 {
    font-size: clamp(3.15rem, 17vw, 5rem);
  }

  .hero-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }

  .live-status {
    width: 100%;
    justify-content: flex-start;
  }

  .console-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .home-section-heading,
  .featured-game,
  .home-callout {
    grid-template-columns: 1fr;
  }

  .public-tool-card {
    min-height: 320px;
  }

  .game-signal-visual {
    min-height: 270px;
  }

  .home-callout .button {
    width: 100%;
  }

  .stats-panel,
  .tool-controls,
  .watcher-controls,
  .stacked-controls,
  .admin-panel,
  .admin-drawer .admin-panel,
  .analytics-layout,
  .leaderboard-controls,
  .detail-controls {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .tool-hero,
  .section-heading,
  .chart-heading-actions,
  .sbusiness-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-hero > .refresh-button,
  .tool-hero > .button {
    width: 100%;
  }

  .chart-heading-actions .compact-select {
    width: 100%;
  }

  .games-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .news-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .news-card-image {
    height: 160px;
  }

  #chartCardWrapper {
    height: min(560px, 72vh) !important;
  }

  .detail-table-wrap {
    margin-inline: -2px;
  }

  .game-detail-hero h1,
  .sbusiness-title-block h1 {
    font-size: clamp(2.3rem, 12vw, 3.8rem);
  }

  .leaderboard-podium {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer,
  .site-footer div,
  .site-footer nav {
    align-items: flex-start;
  }

  .footer-nav {
    width: 100%;
    justify-content: flex-start;
  }
}

/* 768px: comfortable tablet layout */
@media (min-width: 768px) {
  .site-header-inner,
  .tool-page,
  .game-page,
  .game-detail-page,
  .site-footer {
    width: min(var(--content-wide), calc(100% - 48px));
  }

  .studio-home {
    width: min(var(--content-home), calc(100% - 48px));
  }

  .top-nav {
    right: 0;
    left: auto;
    width: min(420px, calc(100vw - 48px));
  }

  .studio-hero-copy {
    max-width: 780px;
  }

  .telemetry-console {
    width: min(100%, 640px);
  }

  .home-section-heading {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.58fr);
    align-items: end;
    justify-content: space-between;
  }

  .home-section-heading > p {
    justify-self: end;
  }

  .public-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-game {
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  }

  .game-signal-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-callout {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-controls,
  .watcher-controls,
  .stacked-controls,
  .leaderboard-controls,
  .detail-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .leaderboard-podium {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .podium-card[data-rank="1"] {
    order: 2;
    min-height: 210px;
  }

  .podium-card[data-rank="2"] {
    order: 1;
  }

  .podium-card[data-rank="3"] {
    order: 3;
  }
}

/* 1024px: full desktop navigation and data density */
@media (min-width: 1024px) {
  .site-header-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 28px;
  }

  .nav-toggle {
    display: none;
  }

  .top-nav,
  .site-header.nav-open .top-nav {
    position: static;
    width: auto;
    display: flex;
    justify-content: flex-end;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-link {
    min-height: 38px;
    padding: 0 11px;
    font-size: 0.82rem;
  }

  .notification-dot {
    top: 4px;
    right: 4px;
  }

  .studio-hero {
    grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr);
  }

  .studio-hero h1 {
    font-size: clamp(4.8rem, 8.2vw, 7.2rem);
  }

  .telemetry-console {
    width: 100%;
    justify-self: end;
  }

  .public-tools-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .public-tool-card {
    min-height: 390px;
  }

  .featured-game {
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.92fr);
  }

  .stats-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tool-controls {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto !important;
  }

  .watcher-controls {
    grid-template-columns: minmax(220px, 1fr) minmax(145px, 190px) minmax(140px, 170px) auto auto !important;
  }

  .stacked-controls {
    grid-template-columns: minmax(220px, 1fr) auto !important;
  }

  .detail-controls {
    grid-template-columns: minmax(200px, 320px) minmax(0, 1fr) !important;
  }

  .leaderboard-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .analytics-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-drawer .admin-panel {
    grid-template-columns: minmax(220px, 1fr) auto auto minmax(220px, 0.8fr);
  }
}

/* 1440px: preserve readable line lengths while increasing breathing room */
@media (min-width: 1440px) {
  .site-header-inner,
  .tool-page,
  .game-detail-page,
  .site-footer {
    width: min(var(--content-wide), calc(100% - 96px));
  }

  .studio-home {
    width: min(var(--content-home), calc(100% - 96px));
  }

  .studio-hero {
    min-height: 720px;
    padding-block: 112px;
  }

  .home-section,
  .featured-game {
    padding-block: 120px;
  }

  .public-tools-grid {
    gap: 18px;
  }

  .public-tool-card {
    padding: 25px;
  }

  .leaderboard-controls {
    grid-template-columns: minmax(130px, 1.2fr) minmax(130px, 1fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(180px, 1.4fr) auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .game-card:hover,
  .daily-card:hover,
  .modern-card:hover,
  .news-card:hover,
  .public-tool-card:hover,
  .refresh-button:hover,
  .button:hover,
  .favorite-button:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Product feature integration: Watcher, Tracker, Leaderboards and Roadmaps
   -------------------------------------------------------------------------- */

textarea {
  font: inherit;
}

/* Watcher */
.watcher-hero-actions {
  min-width: 132px;
  display: grid;
  justify-items: end;
  gap: 7px;
  justify-content: flex-end;
}

.watcher-update-status {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.watcher-update-status.is-paused {
  color: #efd991;
}

.watcher-update-status.has-error {
  color: #ffb5b9;
}

.live-status.is-paused {
  border-color: rgba(244, 201, 93, 0.24);
  color: #efd991;
}

.live-status.is-paused .live-status-dot {
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(244, 201, 93, 0.1);
}

.live-status.has-error {
  border-color: rgba(255, 107, 114, 0.28);
  color: #ffb5b9;
}

.live-status.has-error .live-status-dot {
  background: var(--color-danger);
  box-shadow: 0 0 0 4px rgba(255, 107, 114, 0.1);
}

.live-status.is-loading .live-status-dot {
  animation: pulse-blue 1.2s infinite ease-in-out;
}

.game-card {
  position: relative;
}

.game-card-link {
  display: block;
  min-height: 100%;
}

.game-card .favorite-button {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(9, 11, 16, 0.88);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.28);
  font-size: 1.15rem;
  line-height: 1;
}

.game-card-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.game-card-meta p {
  min-width: 0;
  margin: 0;
}

.trend-badge {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-elevated);
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.trend-badge.is-positive,
.analytics-card-stats .is-positive {
  color: var(--color-success);
}

.trend-badge.is-negative,
.analytics-card-stats .is-negative {
  color: #ff9ca1;
}

.bubble-chart-card {
  position: relative;
  height: clamp(480px, 66vh, 680px);
  margin-top: 16px;
  overflow: hidden;
  padding: 0;
  border-color: var(--color-border);
  background:
    radial-gradient(circle at 50% 46%, rgba(113, 230, 179, 0.06), transparent 38%),
    var(--color-bg-elevated);
}

.bubble-chart-card[hidden] {
  display: none !important;
}

.bubble-chart-card svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bubble-node:focus-visible circle:first-of-type {
  stroke: var(--color-primary);
  stroke-width: 4px;
}

/* Tracker */
.tracker-stats {
  margin-bottom: 18px;
}

.daily-stats-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.analytics-card-body {
  min-height: 136px;
}

.analytics-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.analytics-card-stats span {
  padding: 4px 7px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-elevated);
  color: var(--color-muted);
  font-size: 0.69rem;
  font-weight: 750;
  line-height: 1.2;
}

.analytics-card-stats .is-live {
  border-color: rgba(113, 230, 179, 0.18);
  color: var(--color-success);
}

.analytics-card-stats .is-paused {
  border-color: rgba(244, 201, 93, 0.2);
  color: var(--color-accent);
}

/* Leaderboards */
.leaderboard-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 8px;
}

.compact-metric {
  min-height: 88px;
}

.compact-metric strong {
  font-size: clamp(1.08rem, 2vw, 1.45rem);
}

.podium-card {
  position: relative;
  min-height: 190px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
}

.podium-card[data-rank="1"] {
  border-color: rgba(244, 201, 93, 0.34);
}

.podium-card[data-rank="2"] {
  border-color: rgba(204, 214, 231, 0.22);
}

.podium-card[data-rank="3"] {
  border-color: rgba(213, 145, 90, 0.25);
}

.podium-rank {
  min-width: 42px;
  padding: 5px 9px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-bg-elevated);
  color: var(--color-text-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.podium-card[data-rank="1"] .podium-rank,
.rank-badge.rank-1 {
  border-color: rgba(244, 201, 93, 0.36);
  background: rgba(244, 201, 93, 0.11);
  color: var(--color-accent);
}

.podium-player {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 9px;
  color: var(--color-text);
  text-align: center;
}

.podium-player .player-info {
  align-items: center;
  min-width: 0;
}

.podium-player .player-info strong {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-player .player-info small {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-card .player-avatar {
  width: 54px;
  height: 54px;
  border-radius: 15px;
}

.podium-card[data-rank="1"] .player-avatar {
  width: 66px;
  height: 66px;
}

.podium-value {
  color: var(--color-accent);
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.25rem;
}

.player-avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(113, 230, 179, 0.2), rgba(124, 156, 255, 0.16));
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 900;
}

a.leaderboard-player:hover strong,
a.podium-player:hover strong {
  color: var(--color-primary);
}

.rank-badge {
  min-width: 42px;
  display: inline-flex;
  justify-content: center;
  padding: 5px 7px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-elevated);
  color: var(--color-text-soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.rank-badge.rank-2 {
  color: #d9e0eb;
}

.rank-badge.rank-3 {
  color: #e6aa7b;
}

.pagination-controls > span {
  min-width: 110px;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
}

.block-id-form {
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.8fr) auto !important;
  margin-top: 10px;
}

.blocked-section {
  margin-top: 20px;
}

.blocked-id-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 11px 14px;
}

.blocked-id-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.blocked-id-info strong {
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92rem;
}

.blocked-id-info span {
  color: var(--color-muted);
  font-size: 0.78rem;
}

/* Roadmaps */
.roadmap-page {
  --roadmap-accent: var(--color-primary);
  padding-bottom: 84px;
}

.roadmap-hero {
  margin-bottom: 22px;
}

.roadmap-hero-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.roadmap-hero-copy {
  min-width: 0;
}

.roadmap-game-thumb {
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  object-fit: cover;
}

.roadmap-game-meta {
  margin-top: 10px;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.roadmap-hero-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.roadmap-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.roadmap-status {
  min-height: 24px;
  margin: -8px 0 16px;
  color: var(--color-muted);
  font-size: 0.86rem;
}

.roadmap-feedback {
  margin-top: 14px;
}

.roadmap-metrics small {
  display: block;
  margin-top: 6px;
  color: var(--color-subtle);
  font-size: 0.74rem;
  line-height: 1.3;
}

.roadmap-section {
  margin-top: 26px;
}

.roadmap-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.roadmap-column {
  --column-accent: var(--color-muted);
  min-height: 260px;
  padding: 14px;
  border-top: 3px solid var(--column-accent);
}

.roadmap-column-planned {
  --column-accent: var(--color-info);
}

.roadmap-column-in-progress {
  --column-accent: var(--roadmap-accent);
}

.roadmap-column-testing {
  --column-accent: var(--color-accent);
}

.roadmap-column-released {
  --column-accent: var(--color-success);
}

.roadmap-column-heading {
  align-items: flex-start;
  margin-bottom: 13px;
}

.roadmap-column-heading .eyebrow {
  margin-bottom: 4px;
  color: var(--column-accent);
  font-size: 0.68rem;
}

.roadmap-column-heading h2 {
  font-size: 1.02rem;
}

.roadmap-column-count {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-elevated);
  color: var(--color-text-soft);
  font-size: 0.76rem;
}

.roadmap-column-items {
  display: grid;
  gap: 10px;
}

.roadmap-card {
  min-height: 0;
  display: grid;
  gap: 11px;
  padding: 15px;
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
}

.roadmap-card:hover {
  border-color: color-mix(in srgb, var(--column-accent, var(--roadmap-accent)) 40%, transparent);
  transform: translateY(-2px);
}

.roadmap-card-heading,
.roadmap-card-footer,
.roadmap-card-progress-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.roadmap-category,
.roadmap-target {
  padding: 4px 7px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1;
}

.roadmap-target {
  border-color: color-mix(in srgb, var(--roadmap-accent) 25%, transparent);
  color: var(--roadmap-accent);
}

.roadmap-card .roadmap-card-title {
  overflow: visible;
  color: var(--color-text);
  font-size: 0.98rem;
  line-height: 1.3;
  text-overflow: initial;
  white-space: normal;
}

.roadmap-card .roadmap-card-description {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.81rem;
  line-height: 1.55;
}

.roadmap-card-progress {
  display: grid;
  gap: 6px;
}

.roadmap-card-progress-label {
  color: var(--color-subtle);
  font-size: 0.69rem;
}

.roadmap-card-progress-label strong {
  color: var(--color-text-soft);
}

.roadmap-card progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--color-surface-3);
  accent-color: var(--roadmap-accent);
}

.roadmap-card progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--color-surface-3);
}

.roadmap-card progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--roadmap-accent);
}

.roadmap-card progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--roadmap-accent);
}

.roadmap-card-footer {
  padding-top: 2px;
  color: var(--color-subtle);
  font-size: 0.69rem;
}

.roadmap-column-empty {
  min-height: 110px;
  padding: 16px;
  border-style: dashed;
  background: transparent;
  color: var(--color-subtle);
  font-size: 0.78rem;
}

.roadmap-disclaimer {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--color-subtle);
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: center;
}

body.admin-open {
  overflow: hidden;
}

.roadmap-admin-drawer {
  width: min(1320px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 20px;
}

.roadmap-admin-auth {
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1.2fr) auto minmax(180px, 0.8fr);
}

.roadmap-admin-auth .section-heading {
  margin: 0;
}

.roadmap-admin-auth-actions,
.roadmap-admin-form-actions {
  align-items: center;
  flex-wrap: wrap;
}

.roadmap-admin-workspace {
  display: grid;
  gap: 28px;
}

.roadmap-admin-workspace[hidden] {
  display: none !important;
}

.roadmap-admin-game-section,
.roadmap-admin-item-section {
  min-width: 0;
}

.roadmap-admin-drawer .roadmap-admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch;
  gap: 14px;
  margin-top: 14px;
}

.roadmap-admin-form > * {
  min-width: 0;
}

.roadmap-admin-form > .toggle-field {
  width: fit-content;
  max-width: 100%;
  white-space: normal;
}

.roadmap-admin-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.roadmap-textarea-field textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  outline: 0;
}

.roadmap-textarea-field textarea:focus {
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 3px rgba(113, 230, 179, 0.12);
}

.roadmap-admin-fieldset {
  min-width: 0;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
}

.roadmap-admin-fieldset:disabled {
  opacity: 0.55;
}

.roadmap-admin-item-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.roadmap-admin-item-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.roadmap-admin-item-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  white-space: normal !important;
}

@media (max-width: 767px) {
  .watcher-hero-actions,
  .roadmap-hero-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .watcher-hero-actions .refresh-button,
  .roadmap-hero-actions .refresh-button,
  .roadmap-hero-actions .button {
    width: 100%;
  }

  .watcher-hero-actions {
    justify-items: stretch;
  }

  .watcher-update-status {
    text-align: left;
  }

  .bubble-chart-card {
    height: min(560px, 72vh);
  }

  .leaderboard-overview,
  .roadmap-controls,
  .roadmap-admin-fields,
  .roadmap-admin-item-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .roadmap-hero-identity {
    align-items: flex-start;
  }

  .roadmap-game-thumb {
    width: 68px;
    height: 68px;
  }

  .roadmap-admin-drawer {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .roadmap-admin-auth,
  .roadmap-admin-item-card,
  .block-id-form {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .roadmap-admin-form-actions .refresh-button,
  .roadmap-admin-form-actions .text-button,
  .roadmap-admin-auth-actions .refresh-button,
  .roadmap-admin-auth-actions .text-button {
    width: 100%;
  }

  .leaderboard-table {
    min-width: 0;
  }

  .leaderboard-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .leaderboard-table,
  .leaderboard-table tbody,
  .leaderboard-table tr,
  .leaderboard-table td {
    display: block;
    width: 100%;
  }

  .leaderboard-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .leaderboard-table tr {
    padding: 11px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-elevated);
  }

  .leaderboard-table td {
    min-height: 34px;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border: 0;
  }

  .leaderboard-table td::before {
    color: var(--color-subtle);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .leaderboard-table td:nth-child(1)::before { content: "Rank"; }
  .leaderboard-table td:nth-child(2)::before { content: "Player"; }
  .leaderboard-table td:nth-child(3)::before { content: "Value"; }
  .leaderboard-table td:nth-child(4)::before { content: "From"; }
  .leaderboard-table td:nth-child(5)::before { content: "Updated"; }

  .leaderboard-table td.leaderboard-empty {
    display: block;
    padding: 24px 12px;
  }

  .leaderboard-table td.leaderboard-empty::before {
    content: none;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .roadmap-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .roadmap-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .leaderboard-overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .roadmap-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .watcher-controls {
    grid-template-columns: minmax(220px, 1.55fr) minmax(140px, 0.8fr) minmax(132px, 0.75fr) repeat(4, auto) !important;
  }
}

/* Game tracker detail */
.game-detail-page {
  --tracker-green: #71e6b3;
  --tracker-blue: #7c9cff;
  --tracker-yellow: #f2c94c;
}

.game-detail-page .back-link {
  gap: 7px;
  margin-bottom: 14px;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.game-detail-page .back-link::before {
  content: "←";
}

.game-detail-hero {
  grid-template-columns: 156px minmax(0, 1fr) minmax(190px, 230px);
  gap: 22px;
  margin-bottom: 34px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 70% 0%, rgba(124, 156, 255, 0.08), transparent 38%),
    var(--color-surface-1);
}

.game-detail-hero .detail-thumb {
  width: 156px;
  border-radius: var(--radius-md);
}

.game-detail-copy {
  min-width: 0;
}

.game-detail-hero h1 {
  max-width: none;
  margin: 5px 0 7px;
  overflow: hidden;
  color: var(--color-text);
  font-size: clamp(1.75rem, 3.2vw, 3rem);
  line-height: 1.04;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-detail-hero .hero-copy {
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-detail-range {
  width: 100%;
  align-self: center;
}

.tracker-section {
  margin: 0 0 38px;
}

.tracker-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.tracker-section-heading .eyebrow {
  margin: 0 0 4px;
  color: var(--tracker-green);
  font-size: 0.65rem;
}

.tracker-section-heading h2 {
  color: var(--color-text);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
}

.tracker-section-heading > p,
.tracker-section-heading > div + p {
  max-width: 520px;
  margin: 0;
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: right;
}

.game-detail-page .detail-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.game-detail-page .metric-card {
  min-height: 118px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
}

.game-detail-page .metric-card strong {
  margin: 6px 0 3px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1;
}

.game-detail-page .metric-card small {
  color: var(--color-subtle);
  font-size: 0.7rem;
}

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

.usage-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
}

.usage-panel-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(124, 156, 255, 0.055);
}

.usage-panel-heading span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(113, 230, 179, 0.28);
  border-radius: 7px;
  background: rgba(113, 230, 179, 0.09);
  color: var(--tracker-green);
  font-size: 0.67rem;
  font-weight: 900;
}

.usage-panel-heading h3 {
  color: var(--color-text);
  font-size: 0.92rem;
}

.usage-list {
  margin: 0;
}

.usage-list > div {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-border);
}

.usage-list > div:last-child {
  border-bottom: 0;
}

.usage-list dt {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.usage-list dd {
  margin: 0;
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.tracker-data-note {
  margin: 10px 2px 0;
  color: var(--color-subtle);
  font-size: 0.7rem;
  line-height: 1.5;
}

.tracker-chart-layout {
  gap: 12px;
  margin: 0;
}

.tracker-chart-layout .chart-card {
  min-height: 350px;
  padding: 17px;
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
}

.tracker-chart-layout .section-heading {
  margin-bottom: 12px;
}

.tracker-chart-layout .section-heading h2 {
  font-size: 1rem;
}

.tracker-chart-layout .section-heading p {
  margin-top: 3px;
  font-size: 0.72rem;
}

.tracker-chart-layout .chart-canvas-frame {
  height: 270px;
}

.tracker-chart-layout .wide-canvas-frame {
  height: 310px;
}

.tracker-table-section .detail-table-wrap {
  background: var(--color-surface-1);
}

.table-heading-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.table-heading-actions p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.75rem;
}

.table-row-select {
  min-width: 94px;
}

.table-row-select span {
  font-size: 0.63rem;
}

.table-row-select select {
  min-height: 34px;
  padding-block: 0;
  font-size: 0.78rem;
}

@media (min-width: 1180px) {
  .game-detail-page .detail-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .game-detail-hero {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .game-detail-hero .detail-thumb {
    width: 112px;
  }

  .game-detail-range {
    grid-column: 1 / -1;
  }

  .usage-overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tracker-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .tracker-section-heading > p,
  .tracker-section-heading > div + p {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .game-detail-hero {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
    padding: 13px;
  }

  .game-detail-hero .detail-thumb {
    width: 82px;
  }

  .game-detail-hero h1 {
    font-size: 1.55rem;
  }

  .game-detail-page .detail-stats,
  .tracker-chart-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-detail-page .metric-card {
    min-height: 102px;
  }

  .tracker-chart-layout .wide-chart {
    grid-column: auto;
  }

  .tracker-chart-layout .chart-card {
    min-height: 330px;
  }

  .table-heading-actions {
    width: 100%;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.heading-with-info {
  display: flex;
  align-items: center;
  gap: 7px;
}

.info-tooltip {
  position: relative;
  z-index: 3;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(174, 184, 202, 0.38);
  border-radius: 50%;
  background: rgba(124, 156, 255, 0.08);
  color: var(--color-muted);
  cursor: help;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  vertical-align: middle;
}

.info-tooltip:hover,
.info-tooltip:focus-visible {
  border-color: rgba(113, 230, 179, 0.65);
  color: var(--tracker-green, var(--color-primary));
  outline: none;
}

.info-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: 80;
  width: max-content;
  max-width: min(300px, calc(100vw - 40px));
  padding: 9px 11px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: #090d14;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  color: var(--color-text-soft);
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: 0;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-transform: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: normal;
}

.info-tooltip:hover::after,
.info-tooltip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.metric-card > span,
.usage-panel-heading h3 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.update-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.game-detail-page .update-stats .metric-card {
  min-height: 112px;
}

.game-detail-page .update-stats .metric-card strong {
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
}

.update-chart-card {
  min-height: 380px;
  padding: 17px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
}

.update-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.update-chart-card .chart-canvas-frame {
  height: 300px;
}

.update-table-wrap {
  margin-top: 12px;
}

.update-table {
  min-width: 980px;
}

.retention-explainer {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 10px 16px;
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(124, 156, 255, 0.045);
  color: var(--color-muted);
  font-size: 0.73rem;
}

.retention-explainer > strong {
  color: var(--color-text);
  font-size: 0.78rem;
}

.retention-explainer b {
  color: var(--color-text-soft);
}

.retention-explainer-note {
  grid-column: 1 / -1;
  padding-top: 9px;
  border-top: 1px solid var(--color-border);
  color: var(--color-subtle);
}

.trend-badge {
  min-width: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
}

.trend-up {
  border-color: rgba(113, 230, 179, 0.25);
  background: rgba(113, 230, 179, 0.1);
  color: var(--tracker-green);
}

.trend-down {
  border-color: rgba(255, 139, 118, 0.25);
  background: rgba(255, 139, 118, 0.1);
  color: #ff9f8e;
}

.trend-flat {
  border-color: rgba(174, 184, 202, 0.24);
  background: rgba(174, 184, 202, 0.08);
  color: var(--color-text-soft);
}

.trend-collecting {
  color: var(--color-subtle) !important;
  font-size: 0.78rem !important;
}

@media (min-width: 900px) {
  .update-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .update-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .heading-with-info {
    align-items: flex-start;
  }
}

@media (max-width: 900px) {
  .update-chart-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .retention-explainer {
    grid-template-columns: minmax(0, 1fr);
  }

  .retention-explainer-note {
    grid-column: auto;
  }
}
