* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  font-family: "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  background: var(--background, #f5f7fa);
  color: var(--foreground, #17212b);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, color-mix(in oklch, var(--primary, #2367d1) 18%, transparent), transparent 34rem),
    var(--background, #f5f7fa);
  color: var(--foreground, #17212b);
  line-height: 1.7;
}

a {
  color: var(--primary, #1858b8);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--ring, var(--primary, #1858b8));
  outline-offset: 3px;
}

header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--border, #d6dce5);
  background: color-mix(in oklch, var(--background, #fff) 90%, transparent);
  backdrop-filter: blur(16px);
}

header > a {
  display: flex;
  align-items: center;
  width: min(1120px, calc(100% - 2rem));
  min-height: 56px;
  margin: 0 auto;
  color: var(--foreground, #17212b);
  font-weight: 800;
  text-decoration: none;
}

main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0 5rem;
}

footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--border, #d6dce5);
  color: var(--muted-foreground, #596675);
  font-size: 0.9rem;
}

main > nav:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  color: var(--muted-foreground, #596675);
  font-size: 0.875rem;
}

h1 {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 + p {
  max-width: 68ch;
  margin: 1.25rem 0 clamp(2rem, 5vw, 4rem);
  color: var(--muted-foreground, #596675);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

form[role="search"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 0.8rem;
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border, #d6dce5);
  border-radius: var(--radius, 0.75rem);
  background: var(--card, #fff);
}

form[role="search"] label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted-foreground, #596675);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
button {
  min-height: 44px;
  border: 1px solid var(--border, #d6dce5);
  border-radius: calc(var(--radius, 0.75rem) * 0.75);
  padding: 0.65rem 0.75rem;
  background: var(--background, #fff);
  color: var(--foreground, #17212b);
  font: inherit;
}

button {
  align-self: end;
  border-color: var(--primary, #1858b8);
  background: var(--primary, #1858b8);
  color: var(--primary-foreground, #fff);
  font-weight: 800;
  cursor: pointer;
}

#search-status {
  color: var(--muted-foreground, #596675);
}

main > nav[aria-label="ゲーム別大会結果"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}

main > nav[aria-label="ゲーム別大会結果"] a {
  display: grid;
  min-height: 92px;
  place-items: center start;
  padding: 1.25rem;
  border: 1px solid var(--border, #d6dce5);
  border-radius: var(--radius, 0.75rem);
  background: var(--card, #fff);
  color: var(--card-foreground, var(--foreground, #17212b));
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 14px 42px color-mix(in oklch, var(--foreground, #17212b) 8%, transparent);
}

section[aria-label$="大会結果"],
section[aria-label="大会結果一覧"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 1.25rem;
}

article {
  overflow: hidden;
  border: 1px solid var(--border, #d6dce5);
  border-radius: var(--radius, 0.75rem);
  background: var(--card, #fff);
  color: var(--card-foreground, var(--foreground, #17212b));
  box-shadow: 0 18px 50px color-mix(in oklch, var(--foreground, #17212b) 9%, transparent);
}

article > a:first-child {
  display: block;
  background: var(--muted, #eef1f5);
}

article img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

article p {
  margin: 0;
  padding: 1rem 1.1rem 0;
  overflow-wrap: anywhere;
}

article p:last-child {
  padding-bottom: 1.1rem;
  color: var(--muted-foreground, #596675);
  font-size: 0.9rem;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 1rem 1.1rem 0;
  list-style: none;
}

.result-tags li {
  border: 1px solid color-mix(in oklch, var(--primary, #1858b8) 35%, var(--border, #d6dce5));
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: color-mix(in oklch, var(--primary, #1858b8) 10%, var(--card, #fff));
  color: var(--card-foreground, var(--foreground, #17212b));
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.game-archive-page {
  --archive-ink: #151514;
  --archive-paper: #eee6d4;
  --archive-paper-strong: #f7f0df;
  --archive-rule: color-mix(in oklch, var(--primary, #b59657) 52%, #39352e);
  --archive-gold: color-mix(in oklch, var(--primary, #b59657) 64%, #d0b67b);
  background: var(--archive-ink);
  color: var(--archive-paper);
  font-family: "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
}

.game-archive-page a {
  color: inherit;
}

.game-archive-page h1,
.game-archive-page h2,
.game-archive-page h3,
.game-archive-page .archive-title {
  font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

body.game-archive-page > .game-masthead {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(560px, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  width: min(1400px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.25rem 0 1.4rem;
  border-bottom: 1px solid var(--archive-rule);
  background: transparent;
  backdrop-filter: none;
}

.game-identity,
.masthead-tools {
  min-width: 0;
}

.archive-home-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--archive-gold);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.game-publisher,
.section-kicker,
.archive-updated {
  margin: 0;
  color: var(--archive-gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-archive-page h1 {
  max-width: none;
  margin: 0.25rem 0 0;
  color: var(--archive-paper-strong);
  font-size: clamp(1.05rem, 1.55vw, 1.35rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.archive-title {
  margin: 0.3rem 0 0;
  color: var(--archive-paper-strong);
  font-size: clamp(1.7rem, 2.7vw, 2.45rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.015em;
}

.archive-description {
  max-width: 62ch;
  margin: 0.65rem 0 0;
  color: color-mix(in oklch, var(--archive-paper) 78%, transparent);
  font-size: 0.95rem;
}

.masthead-tools {
  display: grid;
  align-content: end;
  gap: 0.8rem;
}

.archive-updated {
  text-align: right;
}

.archive-updated time {
  margin-left: 0.6rem;
  color: var(--archive-paper-strong);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.game-archive-page .archive-search {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 125px 145px 84px;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.game-archive-page .archive-search input,
.game-archive-page .archive-search select,
.game-archive-page .archive-search button {
  min-width: 0;
  border-color: var(--archive-rule);
  border-radius: 2px;
  background: #171716;
  color: var(--archive-paper-strong);
  font-size: 0.82rem;
}

.game-archive-page .archive-search input::placeholder {
  color: color-mix(in oklch, var(--archive-paper) 55%, transparent);
}

.game-archive-page .archive-search button {
  background: color-mix(in oklch, var(--primary, #b59657) 62%, #2b261d);
  color: #fffdf8;
  white-space: nowrap;
}

.field-archive-shell {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr) 285px;
  grid-template-areas:
    "months latest recent"
    "months records tags";
  gap: 0.8rem;
  width: min(1400px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.field-archive-shell h2,
.field-archive-shell h3,
.field-archive-shell p {
  margin-top: 0;
}

.field-archive-shell h2 {
  margin-bottom: 0;
  color: var(--archive-paper-strong);
  font-size: 1.08rem;
  line-height: 1.3;
}

.archive-month-index,
.latest-discovery,
.recent-findings,
.archive-results-section,
.archive-tag-index {
  min-width: 0;
  border: 1px solid var(--archive-rule);
  background: #191918;
}

.section-heading,
.archive-list-heading,
.archive-month-index > div:first-child {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--archive-rule);
}

.section-heading > p:last-child {
  margin: 0.3rem 0 0;
  color: color-mix(in oklch, var(--archive-paper) 65%, transparent);
  font-size: 0.8rem;
}

.archive-month-index {
  grid-area: months;
  align-self: stretch;
}

.archive-month-index ol,
.recent-findings ol,
.archive-tag-index ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-month-index li + li,
.recent-findings li + li,
.archive-tag-index li + li {
  border-top: 1px solid color-mix(in oklch, var(--archive-rule) 60%, transparent);
}

.archive-month-index a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0.75rem 0.9rem;
  color: color-mix(in oklch, var(--archive-paper) 76%, transparent);
  font-family: "Noto Serif JP", "Yu Mincho", serif;
  text-decoration: none;
}

.archive-month-index li[aria-current="page"] a {
  background: var(--archive-paper);
  color: #191714;
}

.archive-month-index strong {
  color: var(--archive-gold);
  font-family: "Noto Sans JP", "Yu Gothic UI", sans-serif;
}

.archive-month-index li[aria-current="page"] strong {
  color: color-mix(in oklch, var(--primary, #7b5a2c) 70%, #2a1e10);
}

.latest-discovery {
  grid-area: latest;
}

.featured-result {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(270px, 0.88fr);
  min-height: 390px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: var(--archive-paper);
  color: #211e19;
  box-shadow: none;
}

.featured-image {
  min-width: 0;
  padding: 1.15rem;
}

.featured-image a {
  display: block;
  height: 100%;
  background: #d8cdb8;
}

.featured-image img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: contain;
}

.featured-record {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem 1.25rem 1.15rem;
  border-left: 1px solid color-mix(in oklch, var(--archive-gold) 45%, #928876);
}

.featured-record .result-tags {
  padding: 0;
}

.featured-record .result-tags li {
  border-radius: 2px;
  background: transparent;
  color: #2c2923;
}

.featured-game-label {
  margin: 1rem 0 0.2rem;
  color: #665f53;
  font-size: 0.78rem;
}

.featured-record h3 {
  margin: 0;
  color: #171512;
  font-size: clamp(1.45rem, 2.4vw, 2.3rem);
  line-height: 1.25;
}

.featured-record dl {
  margin: 1rem 0;
}

.featured-record dl > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-top: 1px dotted #a39988;
}

.featured-record dt {
  color: #655e53;
  font-size: 0.76rem;
  font-weight: 800;
}

.featured-record dd {
  margin: 0;
  max-height: 5.1rem;
  overflow: hidden;
  font-size: 0.83rem;
}

.source-action {
  display: grid;
  min-height: 44px;
  margin-top: auto;
  place-items: center;
  border: 1px solid #514a3f;
  color: #221f1a;
  font-weight: 800;
  text-decoration: none;
}

.recent-findings {
  grid-area: recent;
}

.recent-findings li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
}

.recent-findings time {
  color: var(--archive-gold);
  font-size: 0.72rem;
  line-height: 1.4;
}

.recent-findings a {
  display: grid;
  gap: 0.2rem;
  min-height: 44px;
  text-decoration: none;
}

.recent-findings strong {
  color: var(--archive-paper-strong);
  font-size: 0.83rem;
}

.recent-findings span {
  color: color-mix(in oklch, var(--archive-paper) 62%, transparent);
  font-size: 0.72rem;
}

.archive-results-section {
  grid-area: records;
}

.archive-list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.archive-list-heading #search-status {
  margin: 0;
  color: color-mix(in oklch, var(--archive-paper) 65%, transparent);
  font-size: 0.78rem;
}

.archive-result-list {
  display: grid;
}

.archive-result-row {
  display: grid;
  grid-template-columns: 78px 106px minmax(0, 1fr) 120px 120px;
  gap: 0.8rem;
  align-items: center;
  min-height: 82px;
  padding: 0.65rem 0.8rem;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--archive-paper);
  box-shadow: none;
}

.archive-result-row + .archive-result-row {
  border-top: 1px solid color-mix(in oklch, var(--archive-rule) 58%, transparent);
}

.archive-result-row[hidden] {
  display: none;
}

.archive-result-row > time {
  color: var(--archive-gold);
  font-size: 0.76rem;
}

.archive-row-kind {
  display: grid;
  gap: 0.25rem;
}

.archive-row-kind span,
.archive-row-kind strong {
  width: fit-content;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--archive-rule);
  color: var(--archive-paper);
  font-size: 0.68rem;
  line-height: 1.25;
}

.archive-row-kind strong {
  background: color-mix(in oklch, var(--archive-gold) 42%, transparent);
}

.archive-row-copy {
  min-width: 0;
}

.archive-row-copy > a {
  color: var(--archive-paper-strong);
  font-family: "Noto Serif JP", "Yu Mincho", serif;
  font-weight: 800;
  text-decoration: none;
}

.archive-row-copy p {
  display: -webkit-box;
  margin: 0.2rem 0 0;
  overflow: hidden;
  color: color-mix(in oklch, var(--archive-paper) 65%, transparent);
  font-size: 0.72rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.archive-row-image {
  display: block;
  background: #292725;
}

.archive-row-image > a {
  display: block;
}

.archive-row-image img {
  display: block;
  width: 100%;
  height: 64px;
  object-fit: cover;
}

.archive-row-image [data-image-fallback] {
  display: grid;
  min-height: 64px;
  margin: 0;
  padding: 0.35rem;
  place-content: center;
  color: var(--archive-paper);
  font-size: 0.66rem;
  text-align: center;
}

.archive-row-image [data-image-fallback][hidden] {
  display: none;
}

img[data-result-image][hidden] {
  display: none !important;
}

.archive-row-image [data-image-fallback] a {
  color: var(--archive-paper-strong);
}

.archive-row-source {
  overflow: hidden;
  color: color-mix(in oklch, var(--archive-paper) 68%, transparent);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-tag-index {
  grid-area: tags;
  align-self: start;
}

.archive-tag-index li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  color: color-mix(in oklch, var(--archive-paper) 76%, transparent);
  font-size: 0.8rem;
}

.archive-tag-index strong {
  color: var(--archive-gold);
}

.official-game-link {
  display: grid;
  min-height: 48px;
  margin: 1rem;
  place-items: center;
  border: 1px solid var(--archive-rule);
  color: var(--archive-paper-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.archive-empty {
  padding: 1rem;
  color: color-mix(in oklch, var(--archive-paper) 65%, transparent);
}

.game-archive-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  width: min(1400px, calc(100% - 3rem));
  border-color: var(--archive-rule);
  color: color-mix(in oklch, var(--archive-paper) 65%, transparent);
}

.subpage-masthead .masthead-tools {
  justify-items: end;
}

.subpage-return {
  display: grid;
  min-height: 48px;
  padding: 0.7rem 1rem;
  place-items: center;
  border: 1px solid var(--archive-rule);
  color: var(--archive-paper-strong);
  font-weight: 800;
  text-decoration: none;
}

.archive-subpage {
  display: grid;
  gap: 1rem;
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
}

.archive-breadcrumb {
  color: color-mix(in oklch, var(--archive-paper) 70%, transparent);
  font-size: 0.78rem;
}

.archive-breadcrumb a {
  color: var(--archive-paper-strong);
}

.archive-subpage > section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 1rem;
}

.archive-subpage > article,
.archive-subpage > section > article {
  margin: 0;
}

@media (max-width: 1120px) {
  body.game-archive-page > .game-masthead {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .archive-updated {
    text-align: left;
  }

  .subpage-masthead .masthead-tools {
    justify-items: start;
  }

  .field-archive-shell {
    grid-template-columns: minmax(0, 1fr) 285px;
    grid-template-areas:
      "months months"
      "latest recent"
      "records tags";
  }

  .archive-month-index ol {
    display: flex;
    overflow-x: auto;
  }

  .archive-month-index li {
    min-width: 160px;
  }

  .archive-month-index li + li {
    border-top: 0;
    border-left: 1px solid color-mix(in oklch, var(--archive-rule) 60%, transparent);
  }

  .featured-result {
    grid-template-columns: 1fr;
  }

  .featured-record {
    border-top: 1px solid color-mix(in oklch, var(--archive-gold) 45%, #928876);
    border-left: 0;
  }
}

@media (max-width: 760px) {
  body.game-archive-page > .game-masthead,
  .field-archive-shell,
  .game-archive-footer {
    width: min(100% - 1.25rem, 1400px);
  }

  .archive-title {
    font-size: clamp(1.55rem, 9vw, 2.4rem);
  }

  .game-archive-page .archive-search {
    grid-template-columns: 1fr 1fr;
  }

  .game-archive-page .archive-search input {
    grid-column: 1 / -1;
  }

  .game-archive-page .archive-search button {
    grid-column: 1 / -1;
  }

  .field-archive-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "months"
      "latest"
      "recent"
      "records"
      "tags";
  }

  .featured-image img {
    min-height: 220px;
  }

  .archive-result-row {
    grid-template-columns: 68px 1fr 92px;
  }

  .archive-row-kind {
    display: none;
  }

  .archive-row-image {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .archive-row-source {
    grid-column: 2;
  }

  .game-archive-footer {
    justify-content: flex-start;
    flex-wrap: wrap;
  }


  .archive-subpage {
    width: min(100% - 1.25rem, 1120px);
  }
}

@media (max-width: 600px) {
  header > a,
  main {
    width: min(100% - 1.25rem, 1120px);
  }

  main {
    padding-top: 2rem;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  article a,
  main > nav[aria-label="ゲーム別大会結果"] a {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  article,
  main > nav[aria-label="ゲーム別大会結果"] a {
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  article:hover,
  main > nav[aria-label="ゲーム別大会結果"] a:hover {
    transform: translateY(-2px);
  }
}
