:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #05080a;
  color: #f6f7f2;
  --panel: rgba(10, 16, 20, 0.88);
  --panel-strong: rgba(15, 23, 28, 0.96);
  --line: rgba(190, 218, 223, 0.16);
  --gold: #f5c84b;
  --gold-strong: #ffd96a;
  --cyan: #16d9f5;
  --green: #18ef72;
  --text-soft: #bac8c9;
  --text-muted: #7f9296;
  --red: #ff5c6c;
  --orange: #ffad42;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(22, 217, 245, 0.18), transparent 28rem),
    linear-gradient(245deg, rgba(24, 239, 114, 0.16), transparent 30rem),
    linear-gradient(180deg, #071014 0%, #05080a 48%, #090c0f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 96px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 75%);
}

main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: stretch;
  min-height: 310px;
  padding: 24px 0 18px;
}

.brand-lockup,
.hero-panel,
.stats-grid article,
.toolbar,
.game-card,
.result-card,
.split article,
.table-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
}

.brand-lockup {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: end;
  padding: 28px;
}

.brand-lockup::after {
  content: "";
  position: absolute;
  inset: auto -20% -42% -20%;
  height: 72%;
  background: linear-gradient(90deg, rgba(22, 217, 245, 0.28), rgba(245, 200, 75, 0.2), rgba(24, 239, 114, 0.28));
  filter: blur(32px);
}

.brand-lockup img {
  position: absolute;
  top: 18px;
  right: 18px;
  width: min(42vw, 230px);
  opacity: 0.92;
  filter: drop-shadow(0 0 24px rgba(22, 217, 245, 0.32));
}

.brand-lockup > div {
  position: relative;
  z-index: 1;
}

.eyebrow,
.label {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
}

h2 {
  margin-bottom: 16px;
  font-size: 24px;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.hero-panel {
  display: grid;
  align-content: space-between;
  gap: 26px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(245, 200, 75, 0.09), transparent 44%),
    var(--panel-strong);
}

#summary {
  max-width: 820px;
  margin-bottom: 0;
  color: #dce6e3;
  font-size: 20px;
  line-height: 1.55;
}

.scan-meta,
.legend,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scan-meta span,
.legend span,
.filter,
.risk-pill,
.rank-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: #eaf4f1;
  font-weight: 800;
  white-space: nowrap;
}

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

.stats-grid article {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.stats-grid span {
  font-size: 24px;
}

.stats-grid strong {
  min-height: 31px;
  color: #fff;
  font-size: 24px;
  line-height: 1.2;
}

.stats-grid small,
.game-card small,
td small {
  color: var(--text-muted);
  font-weight: 800;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  backdrop-filter: blur(16px);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(22, 217, 245, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.26);
}

.search-wrap span {
  color: var(--cyan);
  font-size: 22px;
}

input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
}

input::placeholder {
  color: var(--text-muted);
}

button {
  font: inherit;
}

.filter {
  cursor: pointer;
}

.filter.active {
  border-color: rgba(245, 200, 75, 0.65);
  background: rgba(245, 200, 75, 0.18);
  color: var(--gold-strong);
}

.search-results {
  padding-top: 18px;
}

.search-results[hidden] {
  display: none;
}

.result-count {
  color: var(--gold-strong);
  font-weight: 900;
}

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

.result-card {
  display: grid;
  gap: 10px;
  min-height: 210px;
  padding: 14px;
  border-color: rgba(24, 239, 114, 0.2);
}

.result-card > div,
.result-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.result-card h3 {
  margin-bottom: 0;
  font-size: 19px;
}

.result-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.42;
}

.result-card footer {
  margin-top: auto;
  color: var(--text-muted);
  font-weight: 800;
}

.result-card footer strong {
  color: #fff;
}

.empty-results {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(245, 200, 75, 0.42);
  border-radius: 8px;
  color: var(--text-soft);
  background: rgba(245, 200, 75, 0.07);
}

section {
  padding: 28px 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

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

.game-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 300px;
  padding: 16px;
  border-color: rgba(22, 217, 245, 0.2);
}

.game-card:nth-child(1) {
  border-color: rgba(245, 200, 75, 0.58);
  background: linear-gradient(180deg, rgba(245, 200, 75, 0.13), rgba(10, 16, 20, 0.88));
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rank {
  color: var(--gold-strong);
  font-weight: 1000;
}

.game-card p {
  color: var(--text-soft);
  line-height: 1.45;
}

.card-stats {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  margin-top: auto;
}

.card-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.card-stats strong {
  color: #fff;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.card-stats span:nth-child(2) {
  justify-items: end;
  text-align: right;
}

.card-stats span:nth-child(2) strong {
  font-size: 16px;
}

a {
  color: var(--cyan);
  font-weight: 900;
  text-decoration: none;
}

a:hover {
  color: var(--gold-strong);
}

.action-link,
.mini-link {
  justify-self: start;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid rgba(22, 217, 245, 0.35);
  border-radius: 8px;
  background: rgba(22, 217, 245, 0.12);
}

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

.split article,
.explain-grid article {
  padding: 20px;
}

.featured-grid:empty::before {
  content: "No FairCore games selected yet. Staff can add them from the Scout Admin panel in Discord.";
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed rgba(245, 200, 75, 0.42);
  border-radius: 8px;
  color: var(--text-soft);
  background: rgba(245, 200, 75, 0.07);
}

.featured-grid .game-card {
  border-color: rgba(245, 200, 75, 0.5);
}

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

.score-model {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.score-model span {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(22, 217, 245, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
  font-weight: 800;
}

.score-model strong {
  color: var(--gold-strong);
  font-size: 24px;
}

.note {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.mission-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mission-list li {
  padding: 12px 12px 12px 36px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #dce6e3;
  line-height: 1.45;
}

.mission-list li::before {
  content: "◆";
  position: absolute;
  margin-left: -22px;
  color: var(--green);
}

.mission-list.danger li::before {
  color: var(--orange);
}

.table-title {
  margin-bottom: 12px;
}

.table-shell {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.04);
}

td {
  color: #d7e2e0;
}

td strong,
.score {
  display: block;
  color: #fff;
  font-weight: 950;
}

tr:hover td {
  background: rgba(22, 217, 245, 0.055);
}

.risk-high {
  border-color: rgba(255, 92, 108, 0.42);
  color: #ffc5cb;
}

.risk-mid {
  border-color: rgba(255, 173, 66, 0.42);
  color: #ffd6a3;
}

.risk-low {
  border-color: rgba(24, 239, 114, 0.42);
  color: #b8ffd3;
}

@media (max-width: 1100px) {
  .hero,
  .split,
  .explain-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 680px) {
  main {
    width: min(100% - 20px, 1280px);
    padding-top: 14px;
  }

  .brand-lockup {
    min-height: 290px;
    padding: 20px;
  }

  .brand-lockup img {
    width: min(68vw, 220px);
  }

  .hero-panel,
  .split article {
    padding: 16px;
  }

  #summary {
    font-size: 16px;
  }

  .card-grid,
  .result-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 0;
  }

  .score-model {
    grid-template-columns: 1fr;
  }
}
