:root {
  --bg: #f3efe6;
  --surface: rgba(255, 251, 246, 0.86);
  --surface-strong: rgba(255, 251, 246, 0.96);
  --ink: #172016;
  --muted: #5e685c;
  --line: rgba(23, 32, 22, 0.1);
  --accent: #b34e1f;
  --accent-soft: rgba(179, 78, 31, 0.12);
  --shadow: 0 24px 70px rgba(23, 32, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(179, 78, 31, 0.18), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(62, 112, 69, 0.16), transparent 24%),
    linear-gradient(180deg, #fbf8f2 0%, var(--bg) 100%);
}

code {
  font-family: "IBM Plex Sans", sans-serif;
  background: rgba(23, 32, 22, 0.06);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}

.page-shell {
  width: min(1280px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 1.5rem;
  align-items: stretch;
  min-height: calc(100svh - 6rem);
}

.hero-copy,
.search-stage,
.game-card,
.details-panel,
.message-banner {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 34px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.eyebrow,
.results-eyebrow {
  margin: 0 0 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--accent);
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.brand-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-stage {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.24rem 0.6rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-collage {
  width: min(260px, 34%);
  flex: 0 0 auto;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(23, 32, 22, 0.06);
}

.hero-collage img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.hero-copy h1 {
  margin: 0;
  max-width: 11ch;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 4.8vw, 4.25rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.hero-text {
  max-width: 44rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-facts > span,
.pill,
.meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  background: rgba(23, 32, 22, 0.06);
  font-size: 0.9rem;
}

.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.search-stage {
  border-radius: 34px;
  padding: 1.4rem;
  display: flex;
  align-items: stretch;
}

.search-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-label,
.stat-label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-form textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1rem 1.1rem;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
}

.search-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.primary-button,
.secondary-button {
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button {
  background: var(--ink);
  color: #f7f2ea;
}

.secondary-button {
  background: var(--accent-soft);
  color: var(--accent);
}

.primary-button:hover,
.secondary-button:hover,
.inline-link:hover {
  transform: translateY(-1px);
}

.search-note,
.subtitle,
.description,
.detail-block p,
.note-text {
  color: var(--muted);
  line-height: 1.6;
}

.results-zone {
  margin-top: 2rem;
}

.results-header h2 {
  margin: 0 0 1.2rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-banner {
  border-radius: 24px;
  padding: 1rem 1.2rem;
}

.error-banner {
  color: #7b2d14;
  background: rgba(225, 131, 94, 0.12);
}

.empty-banner,
.hint-banner {
  color: var(--muted);
}

.compact {
  margin-top: 0.9rem;
}

.game-card {
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  align-items: start;
}

.game-card-media {
  min-height: 100%;
  padding: 1.15rem 0 1.15rem 1.15rem;
  background: rgba(23, 32, 22, 0.03);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.game-card-media img {
  width: 100%;
  max-height: 244px;
  aspect-ratio: 460 / 215;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 24px;
  background: rgba(23, 32, 22, 0.06);
}

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

.image-fallback {
  height: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.game-card-body {
  padding: 1.35rem 1.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.card-topline,
.title-row,
.meta-row,
.stats-grid,
.card-actions,
.details-header,
.detail-columns,
.meta-grid {
  display: flex;
  gap: 0.8rem;
}

.card-topline,
.card-actions {
  flex-wrap: wrap;
}

.title-row,
.details-header {
  justify-content: space-between;
  align-items: flex-start;
}

.title-row h3,
.details-header h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.platform-badge,
.meta-chip,
.stat-head {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(23, 32, 22, 0.06);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  color: var(--ink);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

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

.ui-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex: 0 0 auto;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stats-grid,
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 0;
}

.stats-grid > div,
.meta-grid > div,
.detail-block {
  padding: 0.9rem 1rem;
  border-radius: 20px;
  background: rgba(23, 32, 22, 0.04);
}

.stats-grid strong,
.meta-grid strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.05rem;
}

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

.description {
  margin: 0;
}

.subtitle {
  margin: 0;
}

.quote-stack {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.quote-stack blockquote {
  margin: 0;
  padding: 0.95rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 18px;
  background: rgba(23, 32, 22, 0.04);
  color: var(--ink);
  line-height: 1.55;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.details-slot {
  min-height: 0;
}

.details-panel {
  margin-top: 1rem;
  border-radius: 24px;
  padding: 1rem;
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.screenshot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.screenshot-strip img {
  aspect-ratio: 16 / 9;
  border-radius: 18px;
}

@media (max-width: 980px) {
  .hero-grid,
  .game-card,
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
  }

  .hero-topline {
    flex-direction: column;
  }

  .hero-collage {
    width: 100%;
    max-width: 320px;
  }

  .game-card-media {
    padding: 1rem 1rem 0;
  }

  .game-card-media img {
    max-height: none;
  }

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 1rem, 100%);
    padding-top: 0.5rem;
  }

  .hero-copy,
  .search-stage,
  .game-card-body {
    padding: 1rem;
  }

  .hero-copy h1 {
    font-size: 2.2rem;
  }

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

  .meta-row,
  .platform-row,
  .card-topline,
  .card-actions {
    gap: 0.55rem;
  }

  .title-row h3,
  .details-header h4 {
    font-size: 1.6rem;
  }
}
