:root {
  color-scheme: light;
  --ink: #1f2424;
  --muted: #66706c;
  --paper: #fbf8f2;
  --paper-strong: #fffdf8;
  --line: #ddd5c8;
  --charcoal: #202524;
  --charcoal-2: #303634;
  --teal: #126a67;
  --teal-dark: #0d4d4a;
  --amber: #b5772f;
  --amber-soft: #f4ddbb;
  --sage: #788867;
  --rose: #a65d58;
  --shadow: 0 16px 44px rgba(31, 36, 36, 0.12);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Yu Gothic", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  line-height: 1.75;
  letter-spacing: 0;
}

body::selection {
  background: var(--amber-soft);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
select {
  font: inherit;
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 44px);
  background: rgba(251, 248, 242, 0.94);
  border-bottom: 1px solid rgba(221, 213, 200, 0.8);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
  color: var(--charcoal);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 6px;
  background: var(--charcoal);
  color: #f8ead3;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: #3d4642;
  font-size: 0.94rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: #ece5d8;
  color: var(--teal-dark);
}

.hero {
  position: relative;
  min-height: clamp(480px, 66vh, 650px);
  overflow: hidden;
  display: grid;
  align-items: center;
  background: var(--charcoal);
  color: #fff8ed;
}

.hero-art,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-art {
  object-fit: cover;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(20, 24, 23, 0.92) 0%, rgba(20, 24, 23, 0.76) 48%, rgba(20, 24, 23, 0.34) 100%),
    linear-gradient(0deg, rgba(20, 24, 23, 0.4), rgba(20, 24, 23, 0.08));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 54px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 0.86rem;
  font-weight: 700;
}

.hero .eyebrow {
  color: #f1c986;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  font-weight: 800;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 5rem);
}

h2 {
  font-size: clamp(1.55rem, 4vw, 2.4rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0;
}

.hero-copy {
  max-width: 720px;
  margin-top: 18px;
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: #f5ead8;
}

.hero-search {
  display: flex;
  gap: 10px;
  width: min(720px, 100%);
  margin-top: 28px;
}

.hero-search input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 12px 13px;
}

.hero-search input {
  border-color: rgba(255, 248, 237, 0.32);
  background: rgba(255, 253, 248, 0.94);
}

.hero-search button,
.secondary-button {
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  padding: 12px 18px;
  min-width: max-content;
  cursor: pointer;
  font-weight: 700;
}

.hero-search button:hover,
.secondary-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  align-self: end;
  background: var(--charcoal-2);
}

.hero-links,
.ranking-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-links a,
.ranking-nav a,
.tag,
.score-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(255, 248, 237, 0.28);
  border-radius: 999px;
  padding: 5px 11px;
  color: #fff6e6;
  background: rgba(255, 248, 237, 0.1);
  font-size: 0.88rem;
}

.hero-links a:hover {
  background: rgba(255, 248, 237, 0.2);
}

.page-hero,
.section {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
}

.page-hero {
  padding: clamp(52px, 8vw, 92px) 0 24px;
}

.page-hero p:not(.eyebrow) {
  max-width: 760px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
}

.section {
  padding: clamp(34px, 5vw, 68px) 0;
}

.section-tight {
  padding-top: 30px;
  padding-bottom: 30px;
}

.muted-band {
  width: 100%;
  max-width: none;
  padding-left: max(18px, calc((100% - var(--max)) / 2));
  padding-right: max(18px, calc((100% - var(--max)) / 2));
  background: #ede5d7;
  border-block: 1px solid var(--line);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 24px;
}

.section-heading p:not(.eyebrow) {
  margin-top: 10px;
  color: var(--muted);
}

.row-heading {
  max-width: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.text-link {
  color: var(--teal-dark);
  font-weight: 700;
  border-bottom: 1px solid currentColor;
}

.lane-grid,
.card-grid,
.ranking-grid,
.feature-columns,
.theme-columns {
  display: grid;
  gap: 18px;
}

.lane-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lane-card {
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: 0 8px 26px rgba(31, 36, 36, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.lane-card:hover,
.game-card:hover {
  transform: translateY(-2px);
  border-color: rgba(18, 106, 103, 0.35);
  box-shadow: var(--shadow);
}

.lane-kicker {
  display: inline-block;
  color: var(--amber);
  font-weight: 800;
  margin-bottom: 16px;
}

.lane-card h3 {
  margin-bottom: 10px;
}

.lane-card p {
  color: var(--muted);
  font-size: 0.94rem;
}

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

.theme-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.feature-columns > div,
.theme-columns > div {
  padding: 22px;
  border: 1px solid #d6cbbb;
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.58);
}

.compact-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.compact-row,
.rank-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(31, 36, 36, 0.1);
}

.compact-row:last-child,
.rank-row:last-child {
  border-bottom: 0;
}

.compact-rank,
.rank-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--charcoal);
  color: #f8ead3;
  font-weight: 800;
}

.compact-title,
.rank-title {
  font-weight: 800;
}

.compact-meta,
.rank-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: 0 8px 28px rgba(31, 36, 36, 0.07);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  overflow: hidden;
  box-shadow: 0 8px 26px rgba(31, 36, 36, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.game-card-media {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  min-height: 108px;
  padding: 16px;
  color: #fff7e8;
  background:
    linear-gradient(135deg, rgba(18, 106, 103, 0.86), rgba(48, 54, 52, 0.95)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0.08) 1px, transparent 1px, transparent 16px);
}

.game-card-media span:first-child {
  font-weight: 800;
  font-size: 0.92rem;
}

.game-card-media span:last-child {
  font-size: 2rem;
  line-height: 1;
  color: rgba(255, 248, 237, 0.86);
  font-weight: 800;
}

.game-card-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.game-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.game-card h3 a:focus-visible::after {
  outline: 3px solid var(--amber);
  outline-offset: -3px;
}

.game-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 11px;
  color: var(--muted);
  font-size: 0.88rem;
}

.game-summary {
  color: #4f5854;
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-color: #d6cbbb;
  color: #44504c;
  background: #f2eadf;
}

.score-grid {
  display: grid;
  gap: 7px;
}

.score-line {
  display: grid;
  grid-template-columns: 7.5em 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

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

.score-meter {
  height: 8px;
  border-radius: 999px;
  background: #e5dccf;
  overflow: hidden;
}

.score-meter span {
  display: block;
  width: calc(var(--score) * 20%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.score-number {
  min-width: 1.5em;
  text-align: right;
  font-weight: 800;
}

.priority {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(31, 36, 36, 0.12);
  font-weight: 800;
}

.priority span {
  color: var(--amber);
}

.result-count {
  color: var(--muted);
  font-weight: 700;
}

.empty-state,
.load-error {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  color: var(--muted);
}

.ranking-nav {
  margin-top: 0;
}

.ranking-nav a {
  border-color: #d6cbbb;
  background: var(--paper-strong);
  color: var(--teal-dark);
}

.ranking-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.ranking-block {
  scroll-margin-top: 92px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: 0 8px 26px rgba(31, 36, 36, 0.07);
}

.ranking-block h3 {
  margin-bottom: 8px;
}

.ranking-description {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 14px;
}

.rank-row {
  grid-template-columns: auto 1fr minmax(78px, auto);
}

.rank-score {
  color: var(--amber);
  font-weight: 800;
  text-align: right;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.article-body,
.score-sidebar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: 0 8px 26px rgba(31, 36, 36, 0.07);
}

.article-body {
  padding: clamp(22px, 4vw, 38px);
}

.article-body a:not(.related-link) {
  color: var(--teal-dark);
  font-weight: 700;
  border-bottom: 1px solid currentColor;
}

.article-body h2 {
  margin-top: 34px;
  margin-bottom: 12px;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.article-body h3 {
  margin-top: 24px;
  margin-bottom: 8px;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body p + p {
  margin-top: 12px;
}

.article-body ul {
  padding-left: 1.2em;
}

.article-body li + li {
  margin-top: 6px;
}

.article-tags {
  margin-top: 12px;
  margin-bottom: 22px;
}

.score-sidebar {
  position: sticky;
  top: 84px;
  padding: 18px;
}

.score-sidebar h2 {
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.sidebar-subhead {
  margin-top: 22px;
}

.score-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.score-chip {
  border-color: #d6cbbb;
  background: #f2eadf;
  color: #44504c;
}

.derived-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.derived-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(31, 36, 36, 0.1);
}

.derived-list div:last-child {
  border-bottom: 0;
}

.derived-list dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.derived-list dd {
  margin: 0;
  color: var(--amber);
  font-weight: 800;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.related-link {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f0e7;
}

.related-link strong {
  display: block;
  margin-bottom: 4px;
}

.related-link span {
  color: var(--muted);
  font-size: 0.88rem;
}

.availability-note {
  padding: 14px;
  border-left: 4px solid var(--teal);
  background: #eef3ed;
  color: #42504b;
}

.site-footer {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 36px 0 48px;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 1120px) {
  .lane-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 590px;
  }

  .hero-shade {
    background: linear-gradient(0deg, rgba(20, 24, 23, 0.92), rgba(20, 24, 23, 0.48));
  }

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

  .hero-search button {
    width: 100%;
  }

  .lane-grid,
  .card-grid,
  .ranking-grid,
  .feature-columns,
  .theme-columns,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .score-sidebar {
    position: static;
  }

  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .site-header,
  .page-hero,
  .section,
  .site-footer {
    width: auto;
  }

  .site-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-hero,
  .section,
  .site-footer {
    margin-left: 14px;
    margin-right: 14px;
  }

  .muted-band {
    margin-left: 0;
    margin-right: 0;
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand {
    font-size: 0.94rem;
  }

  .site-nav a {
    padding: 7px 8px;
    font-size: 0.88rem;
  }

  .row-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-panel {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .score-line {
    grid-template-columns: 6.8em 1fr auto;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .compact-row,
  .rank-row {
    grid-template-columns: auto 1fr;
  }

  .rank-score,
  .compact-meta {
    grid-column: 2;
    text-align: left;
  }
}
