:root {
  --color-bg: #f0f0f0;
  --color-surface: #fff;
  --color-surface-alt: #f9f9f9;
  --color-border: #e4e4e4;
  --color-text: #282828;
  --color-text-secondary: #6c6b6b;
  --color-text-muted: #a5a5a5;
  --color-accent: #d63d3f;
  --color-accent-hover: #c02a2c;
  --color-header-bg: #2b2b2b;
  --color-header-text: #e3e3e3;
  --color-footer-bg: #1e1e1e;
  --color-footer-text: #a5a5a5;
  --color-button-bg: #c6e6fe;
  --color-button-border: #95c9f0;
  --color-button-text: #4f90c1;
  --card-shadow: 0 2px 8px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --card-shadow-soft: 0 2px 8px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-hover: 0 8px 24px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.06);
  --card-radius: 8px;
  --container-width: 960px;
  --header-height: 56px;
  --font-family: "Source Sans Pro", sans-serif;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

*, *:before, *:after { box-sizing: border-box; }
html, body, div, span, h1, h2, h3, p, a, img, ul, li, ol, form, input, select, button, table, thead, tbody, tr, th, td, section, article, aside, nav, header, footer, main { margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--color-text); text-decoration: none; }
a:hover { color: var(--color-accent); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button, input, select { font: inherit; }
::selection { background: var(--color-accent); color: #fff; }

#theme-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/assets/img/theme-bg.png");
  background-position: right top;
  background-repeat: no-repeat;
  background-size: auto 100%;
}
.has-theme:after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(90deg, rgba(240,240,240,.96) 0%, rgba(240,240,240,.92) 58%, rgba(240,240,240,.28) 100%);
}
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  position: relative;
  z-index: 1;
}

header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-header-bg);
  transition: transform .45s cubic-bezier(.694,.048,.335,1);
}
header.hide-nav { transform: translateY(-120%); }
header .container, #navigation {
  height: 100%;
  display: flex;
  align-items: center;
}
#navigation { width: 100%; }
#spacer { height: var(--header-height); }
.logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: var(--spacing-lg);
  color: #f3f3f3;
  letter-spacing: 0;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}
.logo span {
  display: inline-block;
  transform: skew(-8deg);
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.12));
}
.logo i {
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  display: inline-block;
  margin-top: 11px;
}
.menu-left {
  display: flex;
  gap: 14px;
  align-items: center;
  white-space: nowrap;
  font-size: 14px;
}
header a, header a:visited { color: var(--color-header-text); font-weight: 700; }
header a:hover { color: #fff; }
.header-search {
  margin-left: auto;
  margin-right: var(--spacing-md);
  position: relative;
}
.header-search input {
  width: 180px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  padding: 0 35px 0 10px;
  background: rgba(255,255,255,.12);
  color: #fff;
  outline: none;
  transition: width .2s, background .2s;
}
.header-search input:focus { width: 220px; background: rgba(255,255,255,.2); }
.header-search input::placeholder { color: rgba(255,255,255,.55); }
.header-search button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.header-search button span {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.65);
  border-radius: 50%;
  position: relative;
}
.header-search button span:after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  background: rgba(255,255,255,.65);
  right: -6px;
  bottom: -4px;
  transform: rotate(45deg);
}
.menu-right { font-size: 14px; white-space: nowrap; }
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
}
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.mobile-nav-overlay.active { opacity: 1; visibility: visible; }
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 400;
  width: min(320px, 88vw);
  height: 100vh;
  background: var(--color-header-bg);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.16,.68,.43,.99);
  overflow-y: auto;
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #fff;
}
.mobile-nav-header button {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
.mobile-nav-search { padding: 16px 20px; }
.mobile-nav-search input {
  width: 100%;
  border: 0;
  border-radius: 4px;
  height: 38px;
  padding: 0 10px;
  background: rgba(255,255,255,.1);
  color: #fff;
}
.mobile-nav li a {
  display: block;
  padding: 13px 20px;
  color: var(--color-header-text);
  font-weight: 700;
  border-top: 1px solid rgba(255,255,255,.06);
}

#index-wrap, #footer { position: relative; z-index: 1; }
.hero-section { padding: var(--spacing-md) 0 0; }
.hero-card, .upcoming-card, .idx-card, .tracker-card {
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: var(--card-shadow-soft);
}
.hero-card { padding: var(--spacing-lg); overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--spacing-lg);
}
.hero-featured, .hero-thumb {
  display: block;
  border-radius: var(--card-radius);
  overflow: hidden;
}
.hero-thumb { aspect-ratio: 16/9; background: #ddd; }
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-meta { padding-top: 16px; }
.hero-meta h1, .page-card h1 {
  font-size: 30px;
  line-height: 1.12;
  font-weight: 800;
  color: var(--color-text);
}
.dot { color: var(--color-accent); }
.hero-meta p, .lede {
  margin-top: 10px;
  color: var(--color-text-secondary);
  line-height: 1.58;
  font-size: 16px;
}
.headlines-card h2, .section-header h2, .card-header h2, .page-card h2 {
  color: var(--color-text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}
.headline-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.headline-item:last-child { border-bottom: 0; }
.headline-thumb {
  width: 100px;
  min-width: 100px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
}
.headline-item strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}
.headline-item em {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-style: normal;
}
.platform-badge {
  display: inline-block;
  padding: 3px 5px;
  border-radius: 2px;
  background: #00439c;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  vertical-align: 1px;
}
.upcoming-section, .content-split, .page-section { padding: var(--spacing-lg) 0 0; }
.upcoming-card, .idx-card, .tracker-card, .page-card { padding: var(--spacing-lg); }
.section-header, .card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}
.see-all, .link, .text-link {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 700;
}
.game-row {
  display: flex;
  gap: var(--spacing-md);
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}
.release-card {
  flex: 0 0 145px;
  min-height: 170px;
  border-radius: var(--card-radius);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  padding: 12px;
  scroll-snap-align: start;
}
.release-card strong {
  display: block;
  min-height: 58px;
  line-height: 1.2;
  font-size: 15px;
}
.release-card span, .release-card small {
  display: block;
  margin-top: 9px;
  color: var(--color-text-muted);
  font-size: 12px;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: var(--spacing-lg);
}
.guide-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.guide-item:last-child { border-bottom: 0; }
.guide-item img {
  width: 82px;
  height: 104px;
  object-fit: cover;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}
.guide-item a {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.25;
}
.guide-item p, .page-card p {
  color: var(--color-text-secondary);
  line-height: 1.58;
}
.guide-item p { margin-top: 7px; }
.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}
.mini-stats li {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px 7px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}
.tool-link {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-border);
}
.tool-link:last-child { border-bottom: 0; }
.tool-link strong { display: block; font-size: 17px; }
.tool-link span {
  display: block;
  margin-top: 4px;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.35;
}
.tracker-section { padding-bottom: var(--spacing-lg); }
.tracker-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
}
.button {
  display: inline-block;
  min-width: 132px;
  border: 1px solid var(--color-button-border);
  background: var(--color-button-bg);
  color: var(--color-button-text);
  padding: 7px 14px;
  border-radius: 4px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
}
.button:hover { background: #e6f4ff; color: var(--color-button-text); }

.page-card h1 { margin-bottom: 8px; }
.page-card h2 { margin-top: 24px; margin-bottom: 10px; }
.filters {
  display: grid;
  grid-template-columns: 1fr 190px 210px;
  gap: 10px;
  margin: 22px 0;
}
.filters input, .filters select {
  height: 38px;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  padding: 0 10px;
  background: #fff;
  color: var(--color-text);
}
.database-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.game-card { min-width: 0; }
.game-card .game-cover {
  width: 100%;
  aspect-ratio: 29/34;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform .2s, box-shadow .2s;
}
.game-card:hover .game-cover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.game-card .game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game-card-title {
  margin-top: 7px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}
.game-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--color-text-muted);
  font-size: 12px;
}
.game-card p {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.35;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  margin-top: 14px;
}
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td {
  padding: 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--color-surface-alt);
  color: #515151;
  font-weight: 800;
}
td { color: var(--color-text-secondary); }
tr:last-child td { border-bottom: 0; }
.steps-grid, .plus-grid, .walkthrough-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.steps-grid section, .plus-grid section, .walkthrough-grid section, .review-list article {
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  border-radius: var(--card-radius);
  padding: 16px;
}
.steps-grid b, .rank {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-weight: 800;
}
.steps-grid h3, .steps-grid h2 { margin-top: 10px; }
.clean-list li, .check-list li, .roadmap li {
  position: relative;
  padding: 8px 0 8px 18px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  border-bottom: 1px solid var(--color-border);
}
.clean-list li:before, .check-list li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}
.roadmap { counter-reset: road; }
.roadmap li {
  list-style: decimal;
  margin-left: 20px;
  padding-left: 4px;
}
.rank-list { margin-top: 18px; }
.rank-list article {
  display: grid;
  grid-template-columns: 42px 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}
.rank-list img {
  width: 92px;
  height: 116px;
  object-fit: cover;
  border-radius: var(--card-radius);
}
.source-links a {
  display: inline-block;
  margin: 0 8px 8px 0;
  color: var(--color-accent);
  font-weight: 700;
}
.walkthrough-grid img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--card-radius);
  margin-bottom: 10px;
}
.review-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.review-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--color-accent);
}
.game-header-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.game-header-cover img {
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

#footer {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-xl) 0;
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--spacing-lg);
}
.colheader {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}
#footer p, #footer a {
  display: block;
  color: var(--color-footer-text);
  line-height: 1.5;
  margin-bottom: 7px;
}
#footer a:hover { color: #fff; }

@media (max-width: 980px) {
  .menu-left, .header-search, .menu-right { display: none; }
  .nav-toggle { display: block; }
  .hero-grid, .content-grid, .game-header-grid { grid-template-columns: 1fr; }
  .hero-card, .upcoming-card, .idx-card, .tracker-card { border-radius: 10px; }
  #theme-bg, .has-theme:after { display: none; }
  .database-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .container { padding: 0 12px; }
  .hero-section, .upcoming-section, .content-split, .page-section { padding-top: 12px; }
  .hero-card, .upcoming-card, .idx-card, .tracker-card, .page-card { padding: 16px; }
  .logo { font-size: 22px; margin-right: 0; }
  .hero-meta h1, .page-card h1 { font-size: 25px; }
  .headlines-card h2, .section-header h2, .card-header h2, .page-card h2 { font-size: 20px; }
  .headline-thumb { width: 82px; min-width: 82px; height: 54px; }
  .tracker-card { flex-direction: column; align-items: flex-start; }
  .guide-item { align-items: flex-start; }
  .guide-item img { width: 72px; height: 92px; }
  .database-grid, .steps-grid, .plus-grid, .walkthrough-grid, .footer-grid { grid-template-columns: 1fr; }
  .rank-list article { grid-template-columns: 34px 76px minmax(0, 1fr); }
  .rank-list img { width: 76px; height: 96px; }
  .button { width: 100%; }
}
