:root {
  color-scheme: dark;
  --background: #151216;
  --surface: #201b20;
  --ink: #f5e8d8;
  --muted: #c1b4aa;
  --gold: #e4b47a;
  --line: #493a3a;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-family: var(--sans);
  background: var(--background);
  color: var(--ink);
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, figure, dl, dd { margin: 0; }

:focus-visible {
  outline: 2px solid #ffd197;
  outline-offset: 5px;
}

.shell {
  width: min(1180px, calc(100% - 100px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 5;
  padding: 10px 18px;
  background: var(--gold);
  color: #1c1516;
  transform: translateY(-200%);
}

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

.site-header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid #392d30;
  background: #171417;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.wordmark {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: .12em;
  white-space: nowrap;
}

.wordmark img {
  width: 20px;
  height: auto;
  image-rendering: pixelated;
}

.site-header nav {
  display: flex;
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
  font-size: .9rem;
  color: var(--muted);
  white-space: nowrap;
}

.site-header nav a, .site-footer a { padding-block: 9px; }
.site-header nav a:hover, .site-footer a:hover { color: var(--gold); }

.button {
  display: inline-flex;
  min-height: 48px;
  justify-content: center;
  align-items: center;
  padding: 10px 23px;
  border: 1px solid transparent;
  font-size: .94rem;
  font-weight: 650;
  letter-spacing: .05em;
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.button-outline {
  border-color: #74573e;
  color: #f0c692;
}

.button-outline:hover { border-color: var(--gold); background: #2f231f; }

.header-play {
  justify-self: end;
  min-height: 38px;
  padding: 7px 15px;
  font-size: .88rem;
}

.button-primary {
  background: #e7b47b;
  border-color: #edc290;
  color: #251911;
}

.button-primary:hover { background: #f7cc96; border-color: #f7cc96; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #151216;
  border-bottom: 1px solid #3c3031;
}

.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0;
}

.hero-art img {
  position: absolute;
  top: 0;
  right: 0;
  width: min(83%, 1550px);
  height: 100%;
  object-fit: cover;
  object-position: 56% center;
  image-rendering: pixelated;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #151216 0%, #15121600 29%),
    linear-gradient(90deg, #151216 8%, #151216 17%, #151216dc 28%, #15121655 49%, transparent 68%);
}

.hero-inner {
  display: flex;
  align-items: center;
  min-height: clamp(560px, 47vw, 710px);
  padding-block: 62px 90px;
}

.hero-copy { width: min(100%, 490px); }

.game-genre {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 21px;
  color: #f0c18a;
  font-size: .89rem;
  font-weight: 650;
  letter-spacing: .15em;
}

.game-genre::before {
  content: "";
  width: 23px;
  height: 1px;
  background: #ca9258;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 6.6vw, 6.35rem);
  letter-spacing: .065em;
  line-height: 1.12;
  font-weight: 900;
  color: #fff0d7;
  text-shadow: 0 4px 30px #150d0bd9;
}

.english-title {
  margin-top: 14px;
  color: #edbf8a;
  font-family: Georgia, serif;
  text-transform: uppercase;
  font-size: clamp(.94rem, 1.4vw, 1.18rem);
  letter-spacing: .24em;
}

.hero-premise {
  max-width: 386px;
  margin-block: 29px 26px;
  color: #e7d9cb;
  font-size: 1.06rem;
  line-height: 1.9;
  text-shadow: 0 1px 12px #151216, 0 1px 4px #151216;
}

.section {
  padding-block: clamp(64px, 7vw, 109px);
  border-bottom: 1px solid #33292d;
  scroll-margin-top: 16px;
}

.section-lead { margin-bottom: 37px; }

.section h2 {
  font: 800 clamp(2rem, 4vw, 3.18rem)/1.22 var(--serif);
  letter-spacing: .035em;
  text-wrap: balance;
}

.section-lead > p, .play p {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.8;
}

.era-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.era-tabs button {
  position: relative;
  background: #211c21;
  border: 1px solid #40343b;
  padding: 13px 8px;
  min-height: 68px;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.era-tabs button span, .era-tabs small { display: block; }

.era-tabs button span {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: .08em;
}

.era-tabs small {
  margin-top: 5px;
  color: var(--muted);
  font-size: .78rem;
}

.era-tabs button:hover { background: #30262a; }

.era-tabs button[aria-selected="true"] {
  background: #332520;
  border-color: #b28356;
  color: #ffe0ac;
}

.era-tabs button[aria-selected="true"]::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 2px;
  background: var(--gold);
}

.era-panel {
  --era-color: #e8bb7e;
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  border: 1px solid var(--line);
  background: var(--surface);
}

.era-panel + .era-panel:not([role="tabpanel"]) { margin-top: 16px; }
#era-crown { --era-color: #eac48b; }
#era-ash { --era-color: #ecad82; }
#era-silence { --era-color: #b5d0e5; }

.era-art, .battle-art {
  position: relative;
  align-self: start;
}

.era-art img, .battle-art img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
}

.era-art figcaption, .battle-art figcaption {
  padding: 7px 11px;
  font-size: .8rem;
  line-height: 1.4;
}

.era-art figcaption {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: #171417e8;
  color: #fff0dc;
}

.era-copy {
  align-self: center;
  padding: clamp(20px, 4vw, 58px);
}

.era-copy h3 {
  font: 800 clamp(1.85rem, 4vw, 3.15rem)/1.14 var(--serif);
  letter-spacing: .045em;
  color: var(--era-color);
}

.era-copy h3 + p {
  max-width: 23em;
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.85;
}

.systems { background: #1c171b; }

.systems-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  align-items: center;
  gap: clamp(24px, 5vw, 75px);
}

.battle-art {
  border: 1px solid var(--line);
  background: #151216;
}

.battle-art figcaption { color: var(--muted); }

.system-list > div {
  padding-block: 18px;
  border-top: 1px solid var(--line);
}

.system-list > div:first-child { padding-top: 0; border: 0; }
.system-list > div:last-child { padding-bottom: 0; }

.system-list dt {
  color: #f1cca0;
  font: 800 1.35rem/1.35 var(--serif);
}

.system-list dd {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.72;
}

.party-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 18px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.party-member {
  min-width: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.portrait {
  overflow: hidden;
  display: grid;
  align-items: end;
  justify-items: center;
  aspect-ratio: 1 / 1;
  border: 1px solid #45363a;
  background: radial-gradient(ellipse at 50% 70%, #47332e, #261f26 73%);
}

.party-member:nth-child(n+4) .portrait {
  background: radial-gradient(ellipse at 50% 70%, #393945, #25212a 73%);
}

.portrait img {
  width: min(100%, 155px);
  height: auto;
  image-rendering: pixelated;
}

.party h3 {
  margin-top: 11px;
  font: 800 1.25rem/1.25 var(--serif);
}

.party li p {
  margin-top: 5px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.play {
  padding-block: clamp(51px, 6vw, 85px);
  background: #21191b;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  min-height: 79px;
  color: var(--muted);
  font-size: .875rem;
}

.footer-english {
  margin-left: 8px;
  font-family: Georgia, serif;
  letter-spacing: .075em;
}

@media (max-width: 820px) {
  .shell { width: calc(100% - 52px); }
  .hero-art img { width: 100%; object-position: 59% center; }
  .hero-art::after {
    background:
      linear-gradient(0deg, #151216 0%, #15121600 33%),
      linear-gradient(90deg, #151216 0%, #151216cf 21%, #15121655 54%, transparent 85%);
  }
  .hero-inner { min-height: 565px; }
  .party-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .portrait { aspect-ratio: 1.2 / 1; }
}

@media (max-width: 580px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { grid-template-columns: 1fr 1fr; gap: 0 12px; padding-top: 12px; }
  .site-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    min-height: 44px;
    gap: 12px;
    margin-top: 5px;
  }
  .header-play { grid-column: 2; grid-row: 1; }
  .hero-inner { display: block; min-height: auto; padding-block: 240px 53px; }
  .hero-art img { height: 340px; object-position: 55% 48%; }
  .hero-art::after {
    background: linear-gradient(0deg, #151216 0%, #151216 42%, #15121600 85%);
  }
  .hero h1 { font-size: clamp(3.1rem, 11.8vw, 4.4rem); }
  .game-genre { margin-bottom: 12px; font-size: .82rem; }
  .english-title { margin-top: 10px; }
  .hero-premise { margin-block: 20px 22px; font-size: 1rem; }
  .section { padding-block: 58px; }
  .section-lead { margin-bottom: 24px; }
  .era-tabs { gap: 4px; margin-bottom: 9px; }
  .era-tabs button { padding-inline: 2px; min-height: 55px; }
  .era-tabs button span { font-size: 1.02rem; letter-spacing: .025em; }
  .era-tabs small { font-size: .75rem; }
  .era-panel, .systems-layout { grid-template-columns: 1fr; }
  .era-copy { padding: 21px 19px 24px; }
  .era-copy h3 + p { margin-top: 10px; }
  .party-list { gap: 12px; }
  .party li p { font-size: .82rem; }
  .footer-english { display: block; margin: 4px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
