:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #181a1e;
  --panel-2: #20242a;
  --text: #f5f1e8;
  --muted: #aeb5bd;
  --line: rgba(255, 255, 255, 0.12);
  --rotten: #ff6258;
  --rotten-dark: #74302e;
  --steam: #58d69f;
  --steam-dark: #235946;
  --gold: #f5c95b;
  --blue: #7db7ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(140deg, rgba(255, 98, 88, 0.16), transparent 34%),
    linear-gradient(320deg, rgba(88, 214, 159, 0.14), transparent 38%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.search-panel,
.game-card,
.score-card,
.review-breakdown {
  background: rgba(24, 26, 30, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  position: sticky;
  top: 28px;
  padding: 24px;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 28px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #171513;
  font-weight: 800;
  background: linear-gradient(135deg, var(--rotten), var(--gold) 45%, var(--steam));
}

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

h1 {
  font-size: 1.7rem;
  letter-spacing: 0;
}

.brand-row p,
.section-heading p,
.game-summary {
  color: var(--muted);
}

.search-box label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.search-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search-input-row input {
  min-width: 0;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0f1114;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.search-input-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(125, 183, 255, 0.18);
}

.search-input-row button,
.quick-picks button {
  border: 0;
  border-radius: 8px;
  color: #121416;
  font-weight: 800;
}

.search-input-row button {
  height: 48px;
  padding: 0 16px;
  background: var(--gold);
}

.search-input-row button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.status-line {
  min-height: 38px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.status-line[data-type="loading"] {
  color: var(--blue);
}

.status-line[data-type="success"] {
  color: var(--steam);
}

.status-line[data-type="error"] {
  color: var(--rotten);
}

.search-results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

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

.search-result {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121418;
  color: var(--text);
  text-align: left;
}

.search-result:hover,
.search-result:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.search-result span {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.search-result small {
  color: var(--muted);
  white-space: nowrap;
}

.is-loading .score-card,
.is-loading .game-card,
.is-loading .review-breakdown {
  opacity: 0.72;
}

.quick-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 18px;
}

.quick-picks button {
  min-height: 40px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 700;
}

.result-layout {
  display: grid;
  gap: 20px;
}

.game-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 1.2fr;
}

.cover-art {
  min-height: 310px;
  --cover-image: url("./rottensteamers-hero.png");
  --cover-gradient:
    linear-gradient(150deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(45deg, rgba(93, 46, 50, 0.18), rgba(21, 24, 28, 0.12) 48%, rgba(36, 90, 72, 0.18));
  background-image: var(--cover-gradient), var(--cover-image);
  background-color: #0f1114;
  background-repeat: no-repeat;
  background-size: cover, cover, contain;
  background-position: center;
  position: relative;
}

.cover-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(16, 17, 19, 0.18));
  pointer-events: none;
}

.game-info {
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-kicker {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h2 {
  margin-top: 8px;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.game-info p {
  max-width: 58ch;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.meta-grid {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.meta-grid div {
  padding: 14px;
  border-radius: 8px;
  background: #121418;
  border: 1px solid var(--line);
}

.meta-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 5px;
}

.meta-grid dd {
  margin: 0;
  font-weight: 800;
  font-size: 0.95rem;
}

.ratings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.score-card {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  overflow: hidden;
  min-height: 360px;
}

.score-icon {
  width: 100%;
  max-width: 165px;
  margin-top: 46px;
  justify-self: center;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.36));
}

.rotten-icon {
  transform: translateX(-3px);
}

.steamer-icon {
  max-width: 178px;
  transform: translateX(-4px) rotate(-1deg);
}

.score-content {
  min-width: 0;
}

.score-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.score-topline span:first-child {
  color: var(--text);
}

.score-number {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 800;
  font-size: clamp(3.8rem, 8vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.score-number span:last-child {
  font-size: 0.36em;
}

.meter,
.stacked-bar {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.meter span,
.stacked-bar span {
  display: block;
  height: 100%;
}

.rotten .meter span {
  background: linear-gradient(90deg, var(--rotten-dark), var(--rotten));
}

.steamers .meter span {
  background: linear-gradient(90deg, var(--steam-dark), var(--steam));
}

.score-card p {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.55;
}

.review-highlight {
  margin: 18px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: rgba(15, 17, 20, 0.72);
  border: 1px solid var(--line);
}

.review-highlight figcaption {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-highlight blockquote {
  margin: 9px 0 0;
  color: var(--text);
  line-height: 1.45;
  font-size: 0.94rem;
}

.review-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.review-meta span:first-child {
  color: var(--text);
  font-weight: 800;
}

.review-breakdown {
  padding: 24px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.35rem;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 92px;
  gap: 14px;
  align-items: center;
}

.bar-label strong,
.bar-label span,
.bar-total {
  display: block;
}

.bar-label span,
.bar-total {
  color: var(--muted);
  font-size: 0.86rem;
}

.stacked-bar {
  display: flex;
  height: 18px;
}

.stacked-bar .positive {
  background: var(--steam);
}

.stacked-bar .negative {
  background: var(--rotten);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .search-panel {
    position: static;
  }
}

@media (max-width: 660px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .game-card,
  .ratings-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .cover-art {
    min-height: 210px;
  }

  .section-heading,
  .score-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-card {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 0;
    padding: 18px;
    gap: 14px;
  }

  .score-icon,
  .steamer-icon {
    max-width: 112px;
    margin-top: 42px;
  }

  .score-number {
    font-size: clamp(3.2rem, 18vw, 5rem);
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .search-input-row {
    grid-template-columns: 1fr;
  }
}
