:root {
  color-scheme: light dark;
  --bg: #fff6ee;
  --surface: #ffffff;
  --surface-alt: #fff1e4;
  --text: #1c140f;
  --muted: #5c483c;
  --line: #f0e2d4;
  --accent: #f5a024;
  --accent-deep: #9a4510;
  --on-accent: #1c140f;
  --mint: #cdebd4;
  --butter: #f8e7a8;
  --peach: #f6d7c3;
  --lavender: #e4d7ff;
  --shadow: 0 18px 40px rgba(28, 20, 15, 0.08);
  --max: 68rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html:lang(ja) {
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}

html:lang(zh-Hans) {
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
}

html:lang(zh-Hant) {
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Hiragino Sans CNS", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", serif;
}

html:lang(ja) .kicker,
html:lang(zh-Hans) .kicker,
html:lang(zh-Hant) .kicker {
  letter-spacing: 0.06em;
  text-transform: none;
}

html:lang(ja) h1,
html:lang(zh-Hans) h1,
html:lang(zh-Hant) h1,
html:lang(ja) .band h2,
html:lang(zh-Hans) .band h2,
html:lang(zh-Hant) .band h2,
html:lang(ja) .panel h2,
html:lang(zh-Hans) .panel h2,
html:lang(zh-Hant) .panel h2 {
  letter-spacing: 0;
  line-height: 1.28;
}

html:lang(ja) h1,
html:lang(zh-Hans) h1,
html:lang(zh-Hant) h1 {
  font-size: clamp(2.05rem, 4.2vw, 3.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a120e;
    --surface: #2a1c16;
    --surface-alt: #3a261d;
    --text: #fff6ee;
    --muted: #c4a898;
    --line: #5a3c2e;
    --accent: #f5a024;
    --accent-deep: #ffb15a;
    --on-accent: #1a120e;
    --mint: #234033;
    --butter: #4a3e22;
    --peach: #5a3a2c;
    --lavender: #3a2e4e;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 50rem 24rem at 100% -8rem, rgba(245, 160, 36, 0.28), transparent 60%),
    radial-gradient(ellipse 36rem 20rem at -10% 20%, rgba(228, 215, 255, 0.55), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}

a { color: var(--accent-deep); }

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  z-index: 2;
}

.skip:focus { top: 1rem; }

.site-header,
.site-footer,
.hero,
.band,
.panel {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 1.05rem;
}

.brand svg { display: block; }

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.85rem;
}

.lang-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
}

.lang-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.28rem 0.48rem;
  border-radius: 999px;
}

.lang-nav a[aria-current="true"] {
  background: var(--surface-alt);
  color: var(--text);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.2rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.site-nav a[aria-current="page"] {
  background: var(--text);
  color: var(--bg);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.8fr);
  gap: 2rem;
  align-items: end;
  padding: 2.5rem 0 1rem;
}

.kicker {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.03em; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4.3rem);
  font-weight: 700;
}

.lede {
  margin: 1.1rem 0 0;
  max-width: 38rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  text-decoration: none;
}

.button.quiet {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.stats li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-weight: 700;
  font-size: 0.92rem;
}

.score-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  padding: 1.35rem 1.35rem 1.1rem;
}

.score-card h2 {
  margin: 0;
  font-size: 1rem;
}

.score-range {
  margin: 0.35rem 0 0.2rem;
  font-family: var(--serif);
  font-size: 3.4rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.score-card p { margin: 0; color: var(--muted); }

.weights {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.weights li { display: grid; gap: 0.25rem; }

.weights li > div:first-child {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.92rem;
}

.track {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}

.track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.w65 { width: 65%; }
.w20 { width: 20%; }
.w15 { width: 15%; }

.band { padding: 2.4rem 0; }

#features { scroll-margin-top: 1.25rem; }

.band h2, .panel h2 {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.band > p, .panel > p { margin: 0; color: var(--muted); max-width: 42rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: 1.15rem 1.15rem 1.05rem;
}

.card h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }

.card p { margin: 0; color: var(--muted); }

.swatch {
  width: 2.3rem;
  height: 0.45rem;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}

.s1 { background: var(--accent); }
.s2 { background: var(--peach); }
.s3 { background: var(--lavender); }
.s4 { background: var(--mint); }
.s5 { background: var(--butter); }
.s6 { background: #ff7a3c; }
.s7 { background: #3e9b6d; }
.s8 { background: #e15b4a; }

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  margin-top: 1.3rem;
}

.note, .contact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: 1.2rem;
}

.note h3, .contact h2 { margin: 0 0 0.4rem; font-size: 1.2rem; letter-spacing: -0.02em; }

.note p, .contact p { margin: 0.4rem 0 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  background: var(--surface-alt);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-weight: 700;
}

.panel {
  padding-bottom: 3rem;
}

.game-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.4rem 1.4rem;
}

.game-head {
  display: grid;
  gap: 0.55rem;
  max-width: 40rem;
  margin-bottom: 1.35rem;
}

.game-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.game-head p { margin: 0; color: var(--muted); }

.game-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-points li {
  background: var(--surface-alt);
  border-radius: 1rem;
  padding: 0.95rem 1rem 1.05rem;
}

.game-points strong { display: block; margin-bottom: 0.3rem; }

.game-points span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.game-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.faq { margin-top: 1.2rem; display: grid; gap: 0.6rem; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
}

.faq p { margin: 0.55rem 0 0; color: var(--muted); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p { margin: 0.15rem 0; }

.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.doc {
  width: min(44rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.doc h1 {
  font-family: var(--sans);
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.doc h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; letter-spacing: -0.02em; }

.doc .meta, .doc footer { color: var(--muted); }

.doc ul { padding-left: 1.2rem; }

.doc li { margin: 0.35rem 0; }

.not-found {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.not-found section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.9rem 1rem 1rem;
}

.not-found h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.not-found p { margin: 0.35rem 0 0; }

.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.doc code {
  font-size: 0.92em;
}

@media (max-width: 800px) {
  .hero, .split, .grid, .game-points { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .header-tools { justify-content: flex-start; }
}
