:root {
  color-scheme: dark;
  --canvas: #17130f;
  --raised: #231b14;
  --ink: #f5e9d3;
  --muted: #cbbca8;
  --gold: #e8bf79;
  --border: #584534;
  --display: "Songti SC", "Noto Serif TC", "Noto Serif SC", "STSong", "SimSun", serif;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.65;
  background: var(--canvas);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; min-width: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
h1, h2 { font-family: var(--display); font-weight: 700; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
a:focus-visible, summary:focus-visible {
  outline: 2px solid #f8ce83;
  outline-offset: 4px;
}
.wrap { width: min(100% - 80px, 1320px); margin-inline: auto; }
.skip-link {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  background: var(--raised);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.masthead {
  position: relative;
  z-index: 1;
  background: #1b1611;
  border-bottom: 1px solid #4e3c2b;
}
.masthead-inner, .footer-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.6vw, 42px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
}
.brand img { border-radius: 7px; }
.main-nav, .footer nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 34px);
  color: var(--muted);
}
.main-nav { margin-inline-start: auto; }
.main-nav a, .footer nav a { white-space: nowrap; }
.main-nav a:hover, .footer nav a:hover, nav [aria-current="page"] { color: var(--gold); }
.language-switch {
  flex-shrink: 0;
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 5px;
  white-space: nowrap;
  color: var(--muted);
}
.language-switch a { display: block; padding: 2px 8px; font-size: 14px; border-radius: 3px; }
.language-switch a[aria-current="true"] { background: #503824; color: #ffe8bc; }
.language-switch a:hover { color: #ffe8bc; }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
}
.button-primary { color: #2a1a0e; background: #edc382; border-color: #edc382; }
.button-primary:hover { background: #ffdb9b; border-color: #ffdb9b; }
.button-secondary, .button-header { border-color: #9c7751; color: #f4dcaf; }
.button-secondary { background: #211810b5; }
.button-header { min-height: 40px; padding: 8px 15px; white-space: nowrap; font-size: 14px; }
.button-secondary:hover, .button-header:hover { background: #543d25; border-color: #e6b873; }
.game-unavailable { padding-block: 9px; color: var(--muted); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(490px, 51vw, 685px);
  background: #231a14;
}
.hero-art, .hero-shade { position: absolute; inset: 0; }
.hero-art { z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 49%; }
.hero-shade {
  z-index: -1;
  background:
    linear-gradient(0deg, var(--canvas), #17130f00 37%),
    linear-gradient(90deg, #17120fed 3%, #17120fc7 27%, #17120f57 58%, #17120f05 100%);
}
.hero-content { padding-block: 58px 72px; }
.hero-kicker { color: var(--gold); font-size: 15px; font-weight: 650; letter-spacing: 0.16em; }
.hero h1 {
  width: min(100%, 560px);
  margin: 8px 0 19px -22px;
}
.title-art { width: 100%; height: auto; }
.hero-description { max-width: 23em; font-size: clamp(17px, 2vw, 22px); color: #f3e4cc; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; }
.hero-caption {
  position: absolute;
  bottom: 24px;
  right: max(40px, (100% - 1320px) / 2);
  color: #e7d5bc;
  font-size: 14px;
  text-shadow: 0 1px 5px #17120f;
}

.series-section { padding-block: 34px 76px; scroll-margin-top: 24px; }
.series-directory { padding-top: 58px; }
.section-heading { margin-bottom: 24px; }
.section-heading h1, .section-heading h2 { font-size: clamp(32px, 4vw, 50px); }
.section-heading p { margin-top: 8px; color: var(--muted); }
.edition-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.edition-card {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 4 / 3;
  min-height: 156px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--raised);
}
.edition-card img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease-out;
}
.edition-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #140f0cf5 1%, #17120faf 33%, #17120f08 72%);
}
.edition-card-copy { padding: 17px; }
.edition-card h3 { margin-top: 5px; font: 700 clamp(20px, 2.1vw, 28px)/1.24 var(--display); color: #fff0d8; }
.edition-status { color: #e7d7be; font-size: 14px; }
.edition-current { border-color: #ac8251; }
.edition-current .edition-status { color: #ffd99e; }
.edition-card:hover { border-color: #e9bb77; }
.edition-card:hover img { transform: scale(1.035); }

.edition-page { padding-block: 36px 72px; }
.back-link { display: inline-block; margin-bottom: 19px; color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }
.edition-hero {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(22px, 5vw, 64px);
}
.edition-hero > img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; }
.edition-intro h1 { width: min(100%, 480px); margin: 6px 0 18px -16px; }
.edition-intro p:not(.hero-kicker) { max-width: 28em; color: var(--muted); font-size: 18px; }
.edition-intro .button { margin-top: 24px; }
.edition-intro .game-unavailable { display: inline-block; margin-top: 14px; }
.battle-list, .role-overview { margin-top: 42px; }
.battle-list h2, .role-overview h2 { margin-bottom: 14px; font-size: 28px; }
.battle-list ul { padding-inline-start: 1.35em; margin: 0; color: var(--muted); }
.battle-list li { margin-bottom: 5px; }
.battle-list li::marker { color: var(--gold); }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.roles div { padding: 20px 22px; background: var(--raised); border: 1px solid var(--border); border-radius: 6px; }
.roles h3 { margin-bottom: 8px; color: var(--gold); }
.roles p { color: var(--muted); }

.info-page { width: min(100% - 80px, 780px); margin-inline: auto; padding-block: 54px 72px; }
.info-header { margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.info-header h1 { font-size: clamp(36px, 5vw, 60px); }
.info-header p { margin-top: 12px; color: var(--muted); }
.info-header .info-meta { color: var(--gold); font-size: 14px; }
.info-body { display: grid; gap: 25px; }
.info-body h2 { color: var(--gold); font-size: 24px; margin-bottom: 9px; }
.info-body p { max-width: 46em; color: var(--muted); line-height: 1.78; }
.info-body p + p { margin-top: 8px; }
.info-body p a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.support-contact { padding: 22px 24px; background: var(--raised); border: 1px solid var(--border); border-radius: 6px; }
.support-contact .button { margin-top: 17px; overflow-wrap: anywhere; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { padding-block: 12px; cursor: pointer; }
.faq summary::marker { color: var(--gold); }
.faq details p { padding: 0 0 13px 18px; }
.footer { background: #1b1611; border-top: 1px solid #4e3c2b; }
.footer-inner { justify-content: space-between; padding-block: 14px; }
.footer nav { flex-wrap: wrap; font-size: 14px; }

@media (max-width: 950px) {
  .edition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edition-card { aspect-ratio: 1.62; }
}

@media (max-width: 670px) {
  .wrap, .info-page { width: calc(100% - 36px); }
  .masthead-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding-block: 9px;
  }
  .brand { font-size: 19px; }
  .brand img { width: 30px; height: 30px; }
  .main-nav { grid-row: 2; margin-inline-start: 0; gap: 15px; font-size: 14px; }
  .language-switch { grid-column: 2; grid-row: 1; justify-self: end; }
  .button-header { grid-column: 2; grid-row: 2; justify-self: end; min-height: 34px; padding: 6px 11px; }
  .hero { min-height: 488px; align-items: end; }
  .hero-art img { object-position: 62% center; }
  .hero-shade {
    background:
      linear-gradient(0deg, var(--canvas) 2%, #17130fbd 35%, #17130f2b 83%),
      linear-gradient(90deg, #17120f5e, #17120f17);
  }
  .hero-content { padding-block: 64px 62px; }
  .hero h1, .edition-intro h1 { width: min(100%, 410px); margin: 6px 0 14px -13px; }
  .hero-description { max-width: 21em; }
  .actions { margin-top: 21px; }
  .actions .button { padding-inline: 13px; }
  .hero-caption { bottom: 15px; right: 18px; }
  .series-section { padding-block: 20px 48px; }
  .series-directory, .info-page { padding-top: 36px; }
  .section-heading { margin-bottom: 17px; }
  .edition-grid { gap: 10px; }
  .edition-card { aspect-ratio: 1.22; min-height: 131px; }
  .edition-card-copy { padding: 10px; }
  .edition-card h3 { font-size: 20px; }
  .edition-hero { grid-template-columns: minmax(0, 1fr); }
  .edition-page, .info-page { padding-bottom: 45px; }
  .roles { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 8px; }
  .footer nav { gap: 6px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .edition-card img { transition: none; }
  .edition-card:hover img { transform: none; }
}
