:root {
  color-scheme: dark;
  --bg: #111316;
  --panel: #1a1d21;
  --panel-strong: #22262c;
  --line: #343a43;
  --text: #f2f4f7;
  --muted: #a9b1bc;
  --accent: #60c18c;
  --accent-strong: #7ad9a5;
  --danger: #ef7b72;
  --gold: #e7bd5c;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(96, 193, 140, 0.13), transparent 280px),
    linear-gradient(180deg, rgba(231, 189, 92, 0.05), transparent 360px),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 16px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-button {
  border-color: transparent;
  background: var(--accent);
  color: #08120d;
  font-weight: 700;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.site-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 24px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.public-actions {
  align-self: center;
}

.site-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.site-summary a,
.site-footer a {
  color: var(--accent-strong);
  text-decoration: none;
}

.site-summary a {
  border: 1px solid rgba(96, 193, 140, 0.3);
  border-radius: 8px;
  padding: 8px 11px;
  background: rgba(96, 193, 140, 0.08);
  font-weight: 700;
}

.view-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  min-height: 44px;
  border-color: transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab-button.active {
  border-color: rgba(96, 193, 140, 0.5);
  background: rgba(96, 193, 140, 0.12);
  color: var(--text);
}

.controls,
.status-band,
.table-shell {
  border: 1px solid var(--line);
  background: rgba(26, 29, 33, 0.88);
  box-shadow: var(--shadow);
}

.controls {
  display: grid;
  grid-template-columns: 140px 140px 200px 115px 135px minmax(220px, 1fr);
  gap: 14px;
  padding: 16px;
  border-radius: 8px 8px 0 0;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

select,
input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121519;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.search-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.icon-button {
  width: 44px;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

select:focus,
input:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96, 193, 140, 0.18);
}

.status-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 16px;
  align-items: center;
  border-top: 0;
  padding: 14px 16px;
}

.metric-card {
  display: grid;
  gap: 4px;
  min-height: 68px;
  border: 1px solid rgba(52, 58, 67, 0.8);
  border-radius: 8px;
  padding: 12px;
  background: rgba(18, 21, 25, 0.58);
}

.metric-label {
  color: var(--muted);
  font-size: 0.75rem;
}

.status-band strong {
  font-size: 1.18rem;
}

#status-message {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.table-shell {
  min-height: 360px;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.table-header,
.game-row {
  display: grid;
  grid-template-columns: 42px minmax(260px, 1fr) 86px 142px 145px 145px 125px 120px;
  gap: 14px;
  align-items: center;
}

.table-header.new-games-header,
.game-row.new-game-row {
  grid-template-columns: 42px minmax(300px, 1fr) 110px 140px 130px 160px 150px;
}

.table-header {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 44px;
  padding: 0 18px;
  background: #15181c;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.game-list {
  display: grid;
}

.game-row {
  min-height: 92px;
  border-top: 1px solid rgba(52, 58, 67, 0.86);
  padding: 12px 18px;
  text-decoration: none;
  color: var(--text);
}

.game-row:hover {
  background: rgba(96, 193, 140, 0.09);
}

.rank-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(96, 193, 140, 0.32);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(96, 193, 140, 0.08);
  font-weight: 800;
}

.game-main {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.game-main img {
  width: 132px;
  aspect-ratio: 231 / 87;
  border-radius: 6px;
  background: #0b0d10;
  object-fit: cover;
}

.title-line {
  display: grid;
  gap: 7px;
}

.game-title {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release {
  color: var(--muted);
  font-size: 0.86rem;
}

.discount {
  color: var(--accent-strong);
  font-size: 1.2rem;
  font-weight: 800;
}

.price {
  display: grid;
  gap: 4px;
}

.original-price {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: line-through;
}

.final-price {
  color: var(--gold);
  font-weight: 800;
}

.review,
.platforms,
.date-cell,
.trend-cell {
  color: var(--muted);
  line-height: 1.35;
}

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

.trend-cell strong {
  color: var(--text);
}

.trend-up {
  color: var(--accent-strong);
}

.trend-down {
  color: var(--danger);
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 6px;
  border: 1px solid rgba(231, 189, 92, 0.45);
  border-radius: 6px;
  padding: 0 7px;
  color: #ffe09c;
  background: rgba(231, 189, 92, 0.12);
  font-size: 0.75rem;
  font-weight: 800;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(96, 193, 140, 0.42);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--accent-strong);
  background: rgba(96, 193, 140, 0.1);
  font-size: 0.78rem;
  font-weight: 800;
}

.history-low {
  color: var(--muted);
  font-size: 0.78rem;
}

.empty-state {
  padding: 56px 18px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.site-footer p {
  max-width: 720px;
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.content-page {
  max-width: 920px;
}

.content-page h1 {
  margin-top: 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(96, 193, 140, 0.3);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: rgba(96, 193, 140, 0.08);
  font-weight: 700;
  text-decoration: none;
}

.content-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(26, 29, 33, 0.88);
  box-shadow: var(--shadow);
}

.content-panel h2 {
  margin: 22px 0 8px;
  color: var(--text);
  font-size: 1.15rem;
}

.content-panel h2:first-child {
  margin-top: 0;
}

.content-panel p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.content-panel a {
  color: var(--accent-strong);
}

.error {
  color: var(--danger);
}

@media (max-width: 920px) {
  .site-hero,
  .actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .controls,
  .status-band {
    grid-template-columns: 1fr 1fr;
  }

  .search-box,
  #status-message {
    grid-column: 1 / -1;
  }

  .table-header {
    display: none;
  }

  .game-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .game-row.new-game-row {
    grid-template-columns: 1fr;
  }

  .discount,
  .price,
  .review,
  .trend-cell,
  .date-cell,
  .platforms {
    padding-left: 146px;
  }

  .new-game-row .price,
  .new-game-row .review,
  .new-game-row .date-cell,
  .new-game-row .platforms {
    padding-left: 146px;
  }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 20px, 1280px);
    padding: 18px 0;
  }

  .controls,
  .status-band {
    grid-template-columns: 1fr;
  }

  .view-tabs {
    overflow-x: auto;
  }

  .game-main {
    grid-template-columns: 1fr;
  }

  .game-main img {
    width: 100%;
  }

  .game-title {
    white-space: normal;
  }

  .discount,
  .price,
  .review,
  .trend-cell,
  .date-cell,
  .platforms {
    padding-left: 0;
  }

  .new-game-row .price,
  .new-game-row .review,
  .new-game-row .date-cell,
  .new-game-row .platforms {
    padding-left: 0;
  }
}
