:root {
  color-scheme: dark;
  --background: #101014;
  --surface: #18181e;
  --text: #f7f5f1;
  --muted: #b5b2bc;
  --line: #33323b;
  --accent: #ffd36d;
  --accent-ink: #211807;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 1rem/1.6 var(--sans);
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
p, h1, h2, h3 { margin: 0; }
img { display: block; width: 100%; }

svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icons { position: absolute; width: 0; height: 0; overflow: hidden; }

.shell {
  width: min(100% - 2rem, 76rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 2;
  top: .75rem;
  left: 1rem;
  padding: .65rem 1rem;
  transform: translateY(-200%);
  background: var(--accent);
  color: var(--accent-ink);
}

.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }

.header-inner {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.brand, .brand-name, .header-tag, .site-header nav, .site-header nav a {
  display: flex;
  align-items: center;
}

.brand { min-height: 2.75rem; gap: .6rem; }

.brand-mark {
  display: grid;
  width: 2.25rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: .55rem;
  background: var(--accent);
  color: var(--accent-ink);
}

.brand-name { flex-direction: column; align-items: flex-start; gap: .15rem; font-size: .93rem; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.brand-name strong { margin-right: .22rem; font: 800 1.15rem/1 var(--mono); letter-spacing: -.08em; }
.brand-descriptor { color: var(--muted); font-size: .78rem; }

.site-header nav { gap: .25rem; color: var(--muted); }

.site-header nav a {
  min-height: 2.75rem;
  padding-inline: .6rem;
  font-size: .9rem;
  font-weight: 650;
  transition: color 180ms ease;
}

.site-header nav a:hover { color: var(--accent); }

.header-tag {
  display: none;
  gap: .65rem;
  color: var(--muted);
  font: 600 .7rem/1 var(--mono);
  letter-spacing: .14em;
}

.header-tag > span, .pixel {
  width: .5rem;
  height: .5rem;
  background: var(--accent);
}

.arcade-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 2rem;
  margin-top: 1.25rem;
  padding: clamp(1.15rem, 3vw, 2.25rem);
  border: 1px solid #5b4930;
  border-inline-start: .25rem solid var(--accent);
  border-radius: .85rem;
  background: linear-gradient(115deg, #2a2116, var(--surface) 75%);
}

.arcade-intro h1 { font-size: clamp(1.85rem, 5.2vw, 3.9rem); font-weight: 900; line-height: 1.2; }
.arcade-promise strong { color: var(--accent); font-size: clamp(1.5rem, 3.1vw, 2.5rem); font-weight: 850; line-height: 1.2; }
.arcade-promise p { margin-top: .3rem; color: var(--text); font-size: clamp(.95rem, 2vw, 1.15rem); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  margin-top: 1.25rem;
  overflow: hidden;
  border: 1px solid #454039;
  border-radius: 1rem;
  background: #0d0e12;
  scroll-margin-top: 1rem;
}

.hero::after {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 1.5rem;
  width: 3.5rem;
  height: 2px;
  background: var(--accent);
  content: "";
}

.hero-art, .hero-shade {
  position: absolute;
  inset: 0 0 auto;
  height: 19rem;
  z-index: -1;
}

.hero-art img { height: 100%; object-fit: cover; object-position: 54% top; }

.hero-shade {
  background: linear-gradient(180deg, transparent 35%, #0d0e12 97%);
}

.hero-content { padding: 11.25rem 1.35rem 1.75rem; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--accent);
  font: 700 .72rem/1.4 var(--mono);
  letter-spacing: .12em;
}

.eyebrow-divider { height: .8rem; width: 1px; background: currentColor; opacity: .55; }

.hero-english {
  margin-top: 1.05rem;
  color: #dfd2b7;
  font: 700 .76rem/1.4 var(--mono);
  letter-spacing: .19em;
}

.hero h2 {
  margin-top: .35rem;
  font-size: clamp(2.65rem, 11vw, 4.75rem);
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1.1;
}

.hero-description { max-width: 25rem; margin-top: .9rem; color: #e0dce0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.4rem; }

.action {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .65rem .75rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  font-size: .9rem;
  font-weight: 750;
  transition: background 180ms ease, border-color 180ms ease;
}

.action-primary { background: var(--accent); color: var(--accent-ink); }
.action-primary:hover { background: #ffe39e; }
.action-primary:active { background: #efbb49; }
.action-secondary { border-color: #5e585e; background: #16161bd9; }
.action-secondary:hover { background: #29282f; border-color: #918993; }
.action-secondary:active { background: #34323b; }

.hero-controls {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .81rem;
}

.hero-controls { margin-top: 1rem; }
.hero-controls svg { width: 1rem; height: 1rem; }

.hero-index {
  position: absolute;
  top: .9rem;
  right: .9rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid #d9d4c84d;
  border-radius: .4rem;
  padding: .55rem .65rem;
  background: #0d0e12d9;
  color: #d1cbd4;
  font: 600 .7rem/1 var(--mono);
}

.hero-index-value { color: var(--accent); }
.hero-index-rule { width: 1rem; height: 1px; background: #a19a9f; }

.library { padding-block: 2.7rem 3.5rem; scroll-margin-top: 1rem; }

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: .85rem 1.5rem;
  margin-bottom: 1.3rem;
}

.section-header h2 {
  margin-top: .45rem;
  font-size: clamp(2rem, 4vw, 2.65rem);
  font-weight: 850;
  letter-spacing: -.045em;
  line-height: 1.2;
}

.section-description { max-width: 38rem; margin-top: .55rem; color: var(--muted); }
.game-count { color: var(--muted); font: 600 .78rem/1.7 var(--mono); }
.game-count span { color: var(--accent); font-size: 1.05rem; }

.game-grid { display: grid; gap: 1rem; padding: 0; margin: 0; list-style: none; }
.game-card { display: grid; --game-color: #ffc083; }
.game-tank { --game-color: #a0d9c0; }
.game-claw { --game-color: #e2b8fa; }
.game-rush { --game-color: #9adcf6; }

.game-card > a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--surface);
  transition: border-color 180ms ease, background 180ms ease;
}

.game-card > a:hover, .game-card > a:focus-visible { border-color: var(--game-color); }
.game-card > a:active { background: #25242b; }

.game-art { position: relative; overflow: hidden; background: #24212a; }

.game-art img {
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 240ms ease;
}

@media (hover: hover) {
  .game-card a:hover img { transform: scale(1.035); }
}

.game-number {
  position: absolute;
  top: .75rem;
  left: .75rem;
  border: 1px solid #e1d9db4d;
  border-radius: .35rem;
  padding: .5rem .6rem;
  background: #111117eb;
  color: #eee9ee;
  font: 650 .73rem/1 var(--mono);
  letter-spacing: .1em;
}

.game-content { display: flex; flex: 1; flex-direction: column; padding: 1rem 1rem .8rem; }

.game-genre {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--game-color);
  font-size: .81rem;
  font-weight: 750;
  letter-spacing: .04em;
}

.game-genre span { width: .4rem; height: .4rem; background: currentColor; }
.game-content h3 { margin-top: .35rem; font-size: 1.45rem; font-weight: 820; line-height: 1.3; }
.game-summary { flex: 1; margin-top: .45rem; color: var(--muted); font-size: .95rem; }
.game-facts { display: grid; gap: .2rem; margin: .65rem 0 0; color: var(--muted); font-size: .85rem; }
.game-facts div { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .6rem; }
.game-facts dd { margin: 0; color: var(--text); font-weight: 700; }

.game-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  min-height: 2.7rem;
  margin-top: 1rem;
  padding-top: .55rem;
  border-top: 1px solid var(--line);
}

.game-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .4rem;
  color: var(--game-color);
  font-size: .9rem;
  font-weight: 750;
}

.game-link svg { width: 1.1rem; height: 1.1rem; }
@media (min-width: 38rem) {
  .shell { width: min(100% - 3rem, 76rem); }
  .header-inner { min-height: 4.6rem; }
  .brand-name { flex-direction: row; align-items: baseline; gap: .55rem; }
  .brand-name strong { font-size: 1.25rem; }
  .header-tag { display: flex; }
  .site-header nav { gap: 1.1rem; }
  .hero-content { padding-left: 2rem; }
  .action { padding-inline: 1.15rem; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 45rem) {
  .hero { min-height: 30rem; margin-top: 2rem; }
  .hero-art, .hero-shade { inset: 0; height: 100%; }
  .hero-art img { object-position: 65% center; }
  .hero-shade {
    background: linear-gradient(90deg, #0d0e12 8%, #0d0e12e0 28%, #0d0e1270 49%, transparent 74%),
                linear-gradient(0deg, #0d0e1277, transparent 22%);
  }
  .hero-content { padding: 3rem clamp(2.25rem, 5vw, 4.5rem); }
  .hero-english { margin-top: 1.55rem; font-size: .9rem; }
  .hero-description { margin-top: 1.05rem; font-size: 1.07rem; }
  .hero-actions { margin-top: 1.75rem; }
  .hero-index { inset: auto 1.4rem 1.4rem auto; }
  .library { padding-block: 3.6rem 4.25rem; }
}

@media (min-width: 60rem) {
  .shell { width: min(100% - 5rem, 76rem); }
  .header-inner { display: grid; grid-template-columns: 1fr auto 1fr; }
  .brand { justify-self: start; }
  .header-tag { justify-self: end; }
  .hero::after { left: 2rem; width: 4.5rem; }
  .game-grid { gap: 1.25rem; }
  .game-content { padding: 1.15rem 1.2rem .95rem; }
}

@media (min-width: 70rem) {
  .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .game-card a:hover img { transform: none; }
}
