@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  --paper: #fcfbf7;
  --ink: #20241f;
  --muted: #5e675e;
  --line: #d8dcd3;
  --accent: #245845;
  --pale: #eef1e9;
  --max: 1440px;
  --gutter: clamp(20px, 4vw, 64px);
  --display: "Instrument Serif", Georgia, serif;
  color-scheme: light;
  font: 16px/1.55 "DM Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap, .header-inner, .browse-section, .faq-section, .game-page, .simple-hero, footer {
  width: min(100%, var(--max));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 66px;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: .7rem;
  line-height: 1.18;
  letter-spacing: .085em;
  text-transform: uppercase;
}

.brand strong { font-size: .76rem; font-weight: 700; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
}

.site-header nav { display: flex; align-items: center; gap: clamp(20px, 4vw, 60px); }
.site-header nav a { padding: 4px 0; }
.site-header nav a:hover, .site-header nav [aria-current] {
  text-decoration: underline;
  text-underline-offset: .45em;
}
.site-header nav, .kicker, .index-row h2, .card-label {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.header-search {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.header-search:hover { background: var(--pale); }

.catalog-intro { padding-top: clamp(34px, 5vw, 72px); }
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
}

h1, h2, h3, p { margin-top: 0; }
.catalog-heading h1, .simple-hero h1, .game-hero h1 {
  font: 400 clamp(3.25rem, 6.2vw, 6rem)/.95 var(--display);
  letter-spacing: -.025em;
  margin: 0;
}
.catalog-heading p { margin: 0; padding-bottom: 2px; max-width: 270px; color: var(--muted); }

.genre-showcase {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(12px, 1.55vw, 23px);
  padding-block: 26px 36px;
}
.genre-cover {
  position: relative;
  isolation: isolate;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(12px, 1.35vw, 20px);
  border-radius: 7px;
  color: white;
  background: var(--cover-color);
}
.genre-cover img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .81;
  transition: transform .3s ease, opacity .3s ease;
}
.genre-cover::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgb(12 17 13 / 87%), rgb(12 17 13 / 12%) 41%, transparent 50%, rgb(12 17 13 / 96%));
}
.genre-cover:hover img, .genre-cover:focus-visible img { transform: scale(1.05); opacity: 1; }
.genre-cover-title { font: 400 clamp(1.55rem, 2.45vw, 2.35rem)/1 var(--display); }
.genre-cover-caption {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  font-size: .75rem;
  line-height: 1.25;
}
.genre-cover-count { font: 400 1.55rem/.9 var(--display); font-variant-numeric: tabular-nums; }

.directory-index { border-top: 1px solid var(--line); }
.index-row {
  display: grid;
  grid-template-columns: minmax(95px, 15%) 1fr;
  gap: 16px 24px;
  padding-block: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.index-row h2 { color: var(--muted); margin: 4px 0 0; }
.index-row ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.index-row a { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.index-row a:hover span:first-child { color: var(--accent); text-decoration: underline; }
.index-row a > span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

.browse-section { padding-top: 58px; padding-bottom: 52px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px 28px; margin-bottom: 20px; }
.section-heading h2, .faq-section h2, .detail-section h2, .prose h2 {
  font: 400 clamp(2.2rem, 4vw, 3.65rem)/1 var(--display);
  margin: 0;
}
.section-heading p, .muted { color: var(--muted); margin-bottom: 0; }
.filter-bar {
  display: grid;
  grid-template-columns: minmax(215px, 2fr) repeat(3, minmax(125px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.filter-bar label { position: relative; }
.filter-bar input, .filter-bar select, #review-form input:not([type]), #review-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: var(--paper);
  color: var(--ink);
}
.filter-bar select {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.search-field svg { position: absolute; left: 13px; top: 13px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 42px; scroll-margin-top: 24px; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 22px; }
.game-card { display: flex; flex-direction: column; min-width: 0; border-bottom: 1px solid var(--line); }
.card-image { position: relative; display: block; aspect-ratio: 460 / 215; background: var(--pale); overflow: hidden; border-radius: 5px; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.card-image:hover img { transform: scale(1.035); }
.free-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--paper);
  color: var(--accent);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.card-body { display: flex; flex: 1; flex-direction: column; padding: 16px 0; }
.card-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-heading h3 { margin: 0; font: 400 1.85rem/1.05 var(--display); overflow-wrap: anywhere; }
.card-heading a:hover, .card-meta a:hover { text-decoration: underline; }
.score { color: var(--accent); font-weight: 700; white-space: nowrap; }
.card-body p { color: var(--muted); margin: 9px 0 12px; font-size: .94rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-row span { color: var(--accent); background: var(--pale); padding: 3px 8px; border-radius: 3px; font-size: .77rem; }
.card-meta { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .82rem; }
.card-meta a, .back-link { color: var(--accent); font-weight: 700; }
.empty-state { margin-top: 24px; padding: 28px; border: 1px dashed var(--line); }
.empty-state span { display: block; color: var(--muted); }

.faq-section { display: grid; grid-template-columns: 1fr 2fr; gap: 22px 55px; padding-block: 28px 48px; }
.faq-section h2 { font-size: 2.55rem; }
.faq-list details { padding: 14px 0; border-top: 1px solid var(--line); }
.faq-list summary { cursor: pointer; font-weight: 600; }
.faq-list p { margin: 8px 0 0; color: var(--muted); }
.simple-hero { padding-top: 64px; }
.simple-hero > p { max-width: 640px; margin: 20px 0 0; color: var(--muted); }
.kicker { display: block; margin-bottom: 12px; color: var(--accent); }
.back-link { display: block; width: fit-content; margin-bottom: 24px; font-size: .88rem; }
.back-link:hover { text-decoration: underline; }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  color: white;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
.primary-button:hover { background: #183f30; }
.game-page { padding-top: 36px; }
.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
  padding-block: 24px 32px;
  border-top: 1px solid var(--ink);
}
.game-hero > img { width: 100%; border-radius: 6px; background: var(--pale); }
.game-hero-copy .free-pill { position: static; display: inline-block; margin-bottom: 12px; background: var(--pale); }
.game-hero h1 { font-size: clamp(2.8rem, 5vw, 5.1rem); overflow-wrap: anywhere; }
.game-hero p { margin: 18px 0 12px; color: var(--muted); }
.steam-button { margin-top: 20px; }
.game-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.game-facts article { display: flex; flex-direction: column; padding: 18px 22px; border-right: 1px solid var(--line); }
.game-facts article:first-child { padding-left: 0; }
.game-facts article:last-child { border-right: 0; }
.game-facts strong { margin-block: 4px; font-size: 1.1rem; }
.game-facts span, .game-facts small { color: var(--muted); }
.detail-nav { display: flex; flex-wrap: wrap; gap: 4px 24px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.detail-nav a { padding-block: 6px; font-size: .9rem; font-weight: 600; color: var(--accent); }
.detail-nav a:hover, .text-link { text-decoration: underline; text-underline-offset: .18em; }
.detail-section { padding: 33px 0; display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 2fr); gap: 16px 48px; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.detail-section h2 { font-size: clamp(2rem, 3.2vw, 3rem); }
.detail-copy > p { max-width: 76ch; margin: 0; color: var(--muted); }
.detail-list, .spec-grid ul { margin: 0; padding-inline-start: 1.15em; }
.detail-list li + li, .spec-grid li + li { margin-top: 5px; }
.platform-list details { border: 1px solid var(--line); border-radius: 4px; }
.platform-list details + details { margin-top: 8px; }
.platform-list summary { cursor: pointer; font-weight: 700; padding: 11px 15px; }
.platform-list details[open] summary { background: var(--pale); }
.platform-list details > p { margin: 0; padding: 14px 15px; color: var(--muted); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 20px; padding: 15px; }
.spec-grid h3 { font-size: .95rem; margin: 0 0 8px; }
.spec-grid li { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.detail-copy > .source-note { margin-top: 12px; font-size: .85rem; }
.text-link { color: var(--accent); }
.social-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.social-links a { display: block; padding: 8px 13px; border: 1px solid var(--line); border-radius: 4px; color: var(--accent); font-size: .9rem; font-weight: 600; }
.social-links a:hover { background: var(--pale); border-color: var(--accent); }
.reviews-section { padding-block: 48px; }
.community-score { flex: 0 0 auto; display: flex; flex-direction: column; text-align: right; }
.community-score strong { color: var(--accent); font-size: 1.35rem; }
.community-score span { color: var(--muted); font-size: .82rem; }
.review-layout { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; align-items: start; gap: 22px; }
#review-form { padding: 22px; background: var(--pale); border-radius: 5px; }
#review-form h3 { margin-bottom: 12px; }
#review-form label, #review-form legend { font-size: .91rem; font-weight: 600; }
#review-form input:not([type]), #review-form textarea { display: block; margin: 6px 0 12px; }
#review-form textarea { padding: 9px 12px; min-height: 100px; resize: vertical; }
#review-form fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
.star-input input { position: absolute; opacity: 0; }
#review-form .star-input label { padding-right: 6px; font-size: 1.5rem; color: #656e63; cursor: pointer; }
#review-form .star-input input:checked ~ label, #review-form .star-input label:hover, #review-form .star-input label:hover ~ label { color: #8a570d; }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); }
.form-status { margin: 6px 0 0; color: var(--accent); font-size: .85rem; }
.review-list { display: grid; gap: 12px; }
.review, .first-review { padding: 18px 22px; border: 1px solid var(--line); border-radius: 5px; }
.review > div { display: flex; justify-content: space-between; gap: 10px; }
.review > div span { color: #8a570d; }
.review p { margin: 6px 0; overflow-wrap: anywhere; }
.review time, .first-review span { color: var(--muted); }
.first-review span { display: block; }
.prose { width: min(100%, 850px); padding: 24px var(--gutter) 55px; margin: 0 auto; }
.prose h2 { margin: 22px 0 10px; }
.prose p, .prose li { color: var(--muted); }
footer { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; margin-top: 24px; padding-block: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
footer > div { display: flex; flex-direction: column; align-items: start; gap: 6px; }
footer strong, .footer-brand { color: var(--ink); }
footer a:hover { text-decoration: underline; }
footer p { margin: 6px 0 0; }

@media (max-width: 930px) {
  .genre-showcase { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .genre-cover { aspect-ratio: 5 / 4; }
  .index-row ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 8px 12px; padding-block: 11px 8px; }
  .header-search { grid-row: 1; grid-column: 2; }
  .site-header nav { grid-row: 2; grid-column: 1 / -1; gap: clamp(10px, 4vw, 25px); flex-wrap: wrap; }
  .catalog-heading { display: block; padding-bottom: 15px; }
  .catalog-heading p { max-width: 36ch; margin-top: 10px; }
  .genre-showcase { gap: 10px; padding-block: 16px 23px; }
  .genre-cover { aspect-ratio: 4 / 5; }
  .genre-cover-caption > span:first-child { display: none; }
  .index-row { grid-template-columns: 1fr; gap: 8px; padding-block: 12px; }
  .index-row ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field { grid-column: 1 / -1; }
  .section-heading { align-items: start; flex-wrap: wrap; }
  .faq-section, .game-hero, .detail-section, .review-layout { grid-template-columns: 1fr; }
  .game-facts { grid-template-columns: 1fr; }
  .game-facts article { padding: 10px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .game-facts article:last-child { border-bottom: 0; }
  .community-score { text-align: left; }
  footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 440px) {
  .genre-cover-title { font-size: 1.42rem; }
  .genre-cover { padding: 9px; }
  .game-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .genre-cover img, .card-image img { transition: none; }
}
