/* PlayShelf — core styles */
:root {
  --paper: #faf8f3;
  --surface: #ffffff;
  --ink: #16181c;
  --muted: #5d6068;
  --line: #e5e1d7;
  --line-strong: #d4cfc2;
  --accent: #d9471b;
  --accent-dark: #b93c15;
  --accent-wash: #fdeee8;
  --soft: #f2efe7;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1180px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Iowan Old Style", Baskerville, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --shadow-sm: 0 1px 2px rgba(22, 24, 28, 0.04);
  --shadow-md: 0 10px 30px -12px rgba(22, 24, 28, 0.18);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0;
}

p { margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 243, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14.5px;
  font-weight: 500;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.header-search {
  position: relative;
  display: none;
}
@media (min-width: 900px) {
  .header-search { display: block; width: 220px; }
}

/* ---------- hero ---------- */
.hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--line);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.hero__eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  max-width: 17ch;
}

.hero__lede {
  margin-top: 20px;
  max-width: 62ch;
  font-size: 18px;
  color: var(--muted);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.hero__stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.1;
}
.hero__stat span {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- filter bar ---------- */
.filterbar {
  position: sticky;
  top: 64px;
  z-index: 30;
  background: rgba(250, 248, 243, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.filterbar__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
}
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
}
.search input::placeholder { color: #8a8d95; }
.search input:focus { outline: none; border-color: var(--ink); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"],
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- game grid ---------- */
.section {
  padding: 56px 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.section__head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}
.section__head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.card__art {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.card__cat {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card__desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  flex: 1;
}
.card__play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}
.card__play::after { content: "→"; transition: transform 0.15s ease; }
.card:hover .card__play::after { transform: translateX(3px); }

/* ---------- editor's picks ---------- */
.picks {
  padding: 10px 0 42px;
}
.picks .section__head {
  margin-bottom: 18px;
}
.picks__grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 16px;
}
.pick {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.pick:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.pick__art {
  flex: 0 0 148px;
  background: var(--soft);
}
.pick__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.pick--lead {
  grid-row: span 3;
  flex-direction: column;
}
.pick--lead .pick__art {
  flex: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--line);
}
.pick__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 16px 14px;
  min-width: 0;
}
.pick--lead .pick__body {
  padding: 20px 22px 22px;
  gap: 7px;
}
.pick__meta {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.pick__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.pick--lead .pick__title {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
}
.pick__note {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.pick--lead .pick__note {
  font-size: 15px;
  line-height: 1.6;
}
.pick__cta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}
.pick__cta::after { content: " →"; }

.grid__empty {
  padding: 40px 0;
  color: var(--muted);
}

/* ---------- category tiles ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.cat-tile {
  display: block;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cat-tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.cat-tile__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.cat-tile__emoji { font-size: 22px; }
.cat-tile__name { font-family: var(--font-display); font-size: 20px; }
.cat-tile__count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}
.cat-tile p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.pillar {
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}
.pillar h3 {
  font-size: 19px;
  margin-bottom: 6px;
}
.pillar p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- page head ---------- */
.page-head {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
}
.page-head__lede {
  margin-top: 16px;
  max-width: 68ch;
  color: var(--muted);
  font-size: 17px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 18px;
}
.breadcrumbs a { text-decoration: none; color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumbs span[aria-hidden] { opacity: 0.5; }

/* ---------- game page ---------- */
.game-head {
  padding: 40px 0 28px;
}
.game-head h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
}
.game-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--muted);
}
.game-head__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tag-list li {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--muted);
  background: var(--surface);
}

.stage-wrap {
  padding: 8px 0 0;
}

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  background: #101216;
  border: 1px solid #22252b;
  border-radius: 20px;
  padding: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(18, 20, 24, 0.6);
}
.stage--landscape { width: 100%; }
.stage__frame {
  display: block;
  border: 0;
  border-radius: 10px;
  background: #000;
  width: auto;
  max-width: 100%;
  height: min(76vh, 760px);
  aspect-ratio: 9 / 16;
}
.stage--landscape .stage__frame {
  height: auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
}
.stage:fullscreen {
  border-radius: 0;
  padding: 0;
  border: 0;
  background: #000;
}
.stage:fullscreen .stage__frame {
  width: 100vw;
  height: 100vh;
  max-height: none;
  max-width: none;
  aspect-ratio: auto;
  border-radius: 0;
}

.stage-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
}
.stage-tools p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--ink); }
.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn--primary:hover { background: #000; }

.game-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
  padding: 52px 0 24px;
}
@media (max-width: 960px) {
  .game-body { grid-template-columns: 1fr; gap: 36px; }
}

.prose {
  max-width: 68ch;
  font-size: 15.5px;
  line-height: 1.72;
}
.prose h2 {
  font-size: 26px;
  margin: 40px 0 14px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; margin: 26px 0 8px; }
.prose p { color: #2c2f35; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1.1em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent); font-weight: 600; }
.prose--legal h2 { margin-top: 34px; font-size: 22px; }
.prose--legal h3 { margin-top: 22px; font-size: 17px; }
.prose--legal ul { margin-bottom: 1.1em; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  padding: 16px 18px;
  border-radius: 0 10px 10px 0;
  margin: 24px 0;
  font-size: 14.5px;
}
.callout p { margin: 0; }

.aside {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.aside__box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}
.aside__box h2 {
  font-size: 17px;
  margin-bottom: 10px;
}
.aside__box p { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.mini-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: 14px;
}
.mini-list li:last-child a { border-bottom: 0; }
.mini-list a:hover { color: var(--accent); }
.mini-list em { font-style: normal; font-size: 12px; color: var(--muted); }

/* FAQ */
.faq { border-top: 1px solid var(--line); margin-top: 14px; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }

/* related */
.related { padding: 30px 0 60px; border-top: 1px solid var(--line); }
.related h2 { font-size: 24px; margin-bottom: 18px; }

/* ---------- category page ---------- */
.cat-intro {
  max-width: 72ch;
  font-size: 16.5px;
  color: #2c2f35;
  padding: 34px 0 0;
}
.cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
}

/* ---------- legal / info pages ---------- */
.legal {
  padding: 44px 0 72px;
  max-width: 76ch;
}
.legal .updated { font-size: 13px; color: var(--muted); margin-bottom: 28px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--soft);
  margin-top: 24px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 36px;
  padding: 48px 0 28px;
}
@media (max-width: 840px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .site-footer__inner { grid-template-columns: 1fr; gap: 26px; }
}
.site-footer h2 {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { text-decoration: none; font-size: 14px; color: #3a3d44; }
.site-footer a:hover { color: var(--accent); }
.site-footer p { font-size: 14px; color: var(--muted); margin: 0 0 10px; max-width: 34ch; }
.site-footer__bottom {
  border-top: 1px solid var(--line);
  padding: 18px 0 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- misc ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .hero { padding: 44px 0 32px; }
  .hero__lede { font-size: 16.5px; }
  .site-nav { gap: 14px; font-size: 13.5px; }
  .site-nav a.nav-optional { display: none; }
  .section { padding: 40px 0; }
  .picks { padding: 6px 0 30px; }
  .picks__grid { grid-template-columns: 1fr; gap: 12px; }
  .pick--lead { grid-row: auto; }
  .pick__art { flex: 0 0 104px; }
  .stage { padding: 10px; border-radius: 16px; }
  .stage__frame { height: min(70vh, 620px); }
  .game-body { padding-top: 36px; }
  .aside { position: static; }
  .filterbar { top: 64px; }
}
