/* ─── Reset & Variables ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d0d0d;
  --surface:     #181818;
  --surface-2:   #202020;
  --border:      #2c2c2c;
  --text:        #e6e6e6;
  --text-dim:    #777;
  --text-mid:    #aaa;
  --accent:      #c98a0a;
  --accent-dim:  rgba(201, 138, 10, 0.15);
  --nvidia:      #76b900;
  --ati:         #e8352a;
  --radius:      12px;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Layout ────────────────────────────────────────────────────────────── */
.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* ─── Card Header ───────────────────────────────────────────────────────── */
.card-header {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.card-maker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.card-maker.nvidia { color: var(--nvidia); }
.card-maker.ati    { color: var(--ati); }

.card-name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.card-era {
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-top: 10px;
}

/* ─── Comparison Block ──────────────────────────────────────────────────── */
.comparison {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.comparison::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.comparison-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.comparison-device {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.comparison-device .chip-name {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 2px;
}

.multiplier-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.multiplier-number {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
  transition: opacity 0.3s;
}

.multiplier-label {
  font-size: 14px;
  color: var(--text-mid);
  padding-bottom: 6px;
  line-height: 1.4;
}

.comparison-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}

.comparison-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.comparison-detail {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
}

.comparison-detail strong {
  color: var(--text-mid);
  font-weight: 500;
}

/* Loading state */
.comparison-loading {
  font-size: 14px;
  color: var(--text-dim);
  font-style: italic;
}

/* Desktop fallback */
.comparison-desktop {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ─── Specs ─────────────────────────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.specs {
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.spec-row:last-child { border-bottom: none; }
.spec-row:nth-child(even) { background: var(--surface-2); }

.spec-label { color: var(--text-dim); }
.spec-value { font-weight: 500; text-align: right; }

/* ─── Games ─────────────────────────────────────────────────────────────── */
.games {
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.game-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.game-row:last-child { border-bottom: none; }
.game-row:nth-child(even) { background: var(--surface-2); }

.game-name {
  font-size: 14px;
  font-weight: 600;
  grid-column: 1;
  grid-row: 1;
}

.game-year {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  grid-column: 2;
  grid-row: 1;
  text-align: right;
  align-self: center;
}

.game-link {
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.game-link:hover { color: var(--accent); }

.game-trailer-icon {
  font-size: 10px;
  color: var(--accent);
  opacity: 0.8;
}

.game-note {
  font-size: 12px;
  color: var(--text-dim);
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 2px;
  line-height: 1.4;
}

/* ─── Story ─────────────────────────────────────────────────────────────── */
.story {
  margin-bottom: 36px;
}

.story-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-mid);
}

.story-text p + p { margin-top: 14px; }

.story-text em {
  color: var(--text);
  font-style: normal;
  font-weight: 500;
}

/* ─── Collection Nav ─────────────────────────────────────────────────────── */
.collection {
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.collection-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.collection-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-dim);
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}

.collection-item:hover {
  border-color: #444;
  background: var(--surface);
  color: var(--text);
}

.collection-item.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
  pointer-events: none;
}

.collection-year {
  font-size: 11px;
  color: var(--text-dim);
  width: 36px;
  flex-shrink: 0;
}

.collection-name { flex: 1; font-weight: 500; }

.collection-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.collection-item.active .collection-dot { background: var(--accent); }

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-header   { animation: fadeUp 0.4s ease both; }
.comparison    { animation: fadeUp 0.4s ease 0.1s both; }
.specs         { animation: fadeUp 0.4s ease 0.2s both; }
.story         { animation: fadeUp 0.4s ease 0.3s both; }
.collection    { animation: fadeUp 0.4s ease 0.4s both; }

/* ─── Card photo ─────────────────────────────────────────────────────────── */
.card-photo {
  margin: 0 0 4px;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  animation: fadeUp 0.4s ease 0.05s both;
}

.card-photo img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
  opacity: 0.92;
}
