:root {
  --bg: #12141a;
  --panel: #1a1d26;
  --panel-border: #2b2f3c;
  --text: #e7e9f0;
  --muted: #8a8fa3;
  --accent: #c6ff5e;
  --accent-dim: #7fae3a;
  --sale: #ff6b57;
  --mono: 'JetBrains Mono', monospace;
  --display: 'Space Grotesk', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  min-height: 100vh;
}

/* --- Ticker signature element --- */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  background: var(--accent);
  color: #101208;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 6px 0;
}
.ticker span { padding: 0 10px; }
.ticker .dot { opacity: 0.5; }

.board-header {
  padding: 48px 24px 32px;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  margin: 24px 0 8px;
  letter-spacing: -0.02em;
}
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.subtitle {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto 28px;
}

.search-form {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
}

#steamid-input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.95rem;
  outline: none;
}
#steamid-input:focus { border-color: var(--accent); }

.search-form button {
  background: var(--accent);
  color: #101208;
  border: none;
  border-radius: 8px;
  padding: 0 24px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-form button:hover { background: #d9ffa0; }
.search-form button:disabled { opacity: 0.5; cursor: wait; }

.hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 10px;
  font-family: var(--mono);
}

.results {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.status {
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
  margin: 12px 0 28px;
  min-height: 1.2em;
}
.status.error { color: var(--sale); }

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

.game-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rise 0.35s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-card img {
  width: 100%;
  aspect-ratio: 460 / 215;
  object-fit: cover;
  display: block;
  background: #0d0f14;
}

.game-card .body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.discount-badge {
  display: inline-flex;
  align-self: flex-start;
  background: var(--sale);
  color: #1a0500;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 5px;
}

.price-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  background: #14161d;
  border: 1px solid var(--panel-border);
}

.price-row .label { color: var(--muted); }
.price-row .value { font-weight: 700; }
.price-row.best { border-color: var(--accent); }
.price-row.best .value { color: var(--accent); }
.price-row .value.strike { text-decoration: line-through; color: var(--muted); font-weight: 400; margin-right: 6px; }
.price-row .demo-tag { font-size: 0.68rem; color: var(--muted); font-style: italic; }

.empty-state, .no-sales {
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  padding: 48px 0;
  grid-column: 1 / -1;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: var(--mono);
  padding: 24px;
  border-top: 1px solid var(--panel-border);
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  .game-card { animation: none; }
}
