/* Tokens. The gold and the blue are the ones the CurseForge listing uses. */
:root {
  --bg: #0f0c0a;
  --bg-raised: #17120e;
  --bg-panel: #1d1712;
  --line: #5a4526;
  --line-soft: #3a2d1b;
  --gold: #e8c77e;
  --gold-bright: #ffd766;
  --blue: #8cb8e8;
  --text: #ece3d1;
  --muted: #b5a78e;
  --parchment: #e9d6a8;
  --parchment-deep: #d3b97f;
  --ink: #2a1c0d;
  --red: #7d1712;
  --red-bright: #a9261d;
  --red-dark: #4a0c09;

  --font-title: "Cinzel", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", Meiryo, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --radius: 6px;
  --bar-height: 60px;
}

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../webfonts/cinzel-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../webfonts/cinzel-latin-700.woff2") format("woff2");
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-height) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}

/* One language at a time. Without the script the page stays in English. */
html:not([data-lang="ja"]) [data-t][lang="ja"],
html[data-lang="ja"] [data-t][lang="en"] { display: none !important; }

html[data-lang="ja"] body { line-height: 1.8; }

/* Controls that need a script stay out of sight until that script has run. */
html:not(.has-lang) .lang,
.slider:not(.is-ready) .slider-range,
.slider:not(.is-ready) .slider-handle,
.slider:not(.is-ready) figcaption { display: none; }

.noscript { margin: 0; padding: 10px 24px; background: var(--bg-panel); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; text-align: center; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: #b6d3f3; }

:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--font-title);
  color: var(--gold);
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 700; letter-spacing: 0.01em; text-shadow: 0 2px 0 #000, 0 0 28px rgba(232, 199, 126, 0.18); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
html[data-lang="ja"] h1 { font-size: clamp(1.8rem, 4.2vw, 3rem); line-height: 1.35; }
html[data-lang="ja"] h1, html[data-lang="ja"] h2, html[data-lang="ja"] h3 { letter-spacing: 0.02em; }

p { margin: 0 0 1em; }

kbd, code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  background: #0a0806;
  border: 1px solid var(--line);
  color: var(--gold);
  white-space: nowrap;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; color: var(--ink); }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 12, 10, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 #000, 0 8px 24px rgba(0, 0, 0, 0.45);
}
@supports (backdrop-filter: blur(8px)) {
  .bar { background: rgba(15, 12, 10, 0.78); backdrop-filter: blur(10px); }
}
.bar-row { display: flex; align-items: center; gap: 20px; min-height: var(--bar-height); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); min-width: 0; }
.brand img { width: 36px; height: 36px; flex: none; }
.brand-name { font-family: var(--font-title); font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--gold); }

.lang { display: flex; flex: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0a0806; }
.lang-btn {
  font: inherit; font-size: 0.9rem; line-height: 1;
  padding: 9px 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--line); }
.lang-btn:hover { color: var(--text); }
/* The group clips what sticks out, so the ring is drawn inside the button. */
.lang-btn:focus-visible { outline-offset: -3px; }
.lang-btn[aria-pressed="true"]:focus-visible { outline-color: var(--ink); }
.lang-btn[aria-pressed="true"] {
  color: var(--ink);
  background: linear-gradient(#f3d991, #cfa954);
  font-weight: 700;
}

/* Buttons, in the red and gold of the game's own */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
  padding: 13px 22px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent;
  transition: filter 120ms ease, transform 120ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-main {
  color: var(--gold-bright);
  background: linear-gradient(var(--red-bright), var(--red) 55%, var(--red-dark));
  border-color: #c9a24d;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 3px 10px rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 0 #000;
}
.btn-main:hover { color: #fff1c4; filter: brightness(1.15); }
.btn-ghost { color: var(--gold); border-color: var(--line); background: rgba(10, 8, 6, 0.55); }
.btn-ghost:hover { color: var(--gold-bright); border-color: var(--gold); }
.btn-hold {
  color: var(--ink);
  background: linear-gradient(#f3d991, #cfa954);
  border-color: #7d6228;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 8px rgba(0, 0, 0, 0.5);
  padding: 10px 18px;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.btn-hold:hover { filter: brightness(1.06); }
.is-held .btn-hold { filter: brightness(0.9); transform: translateY(1px); }

/* Hero */
.hero { position: relative; isolation: isolate; padding: 64px 0 72px; border-bottom: 1px solid var(--line); }
.hero-back {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 520px at 78% 30%, rgba(122, 64, 150, 0.30), transparent 70%),
    radial-gradient(900px 460px at 12% 8%, rgba(232, 199, 126, 0.10), transparent 70%),
    linear-gradient(#15100d, var(--bg));
}
.hero-back::after {
  content: ""; position: absolute; inset: -20px;
  background: url("../images/hero-back.webp") center / cover no-repeat;
  filter: blur(14px) saturate(1.1);
  opacity: 0.16;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 56px; align-items: center; }
.eyebrow { color: var(--blue); font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.9em; }
html[data-lang="ja"] .eyebrow { letter-spacing: 0.04em; }
.lead { font-size: 1.15rem; color: var(--text); max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.fine { color: var(--muted); font-size: 0.92rem; }

/* Slider. Its width follows the window's height, so the whole picture fits on a short or sideways screen. */
.slider {
  --pos: 50;
  --fit: calc((100vh - var(--bar-height) - 150px) * 584 / 836);
  margin: 0; justify-self: center; width: 100%;
  max-width: clamp(220px, var(--fit), 420px);
}
@supports (height: 100dvh) {
  .slider { --fit: calc((100dvh - var(--bar-height) - 150px) * 584 / 836); }
}
.slider-stage {
  position: relative; overflow: hidden; border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px #000, 0 18px 50px rgba(0, 0, 0, 0.7), 0 0 60px rgba(232, 199, 126, 0.08);
  background: #000;
  aspect-ratio: 584 / 836;
}
.slider-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.slider-top { clip-path: inset(0 calc(100% - var(--pos) * 1%) 0 0); }
.slider-handle {
  position: absolute; top: 0; bottom: 0; left: calc(var(--pos) * 1%); width: 2px; margin-left: -1px;
  background: var(--gold-bright); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 0 14px rgba(255, 215, 102, 0.7);
  pointer-events: none;
}
.slider-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 44%, var(--ink) 44% 47%, transparent 47% 53%, var(--ink) 53% 56%, transparent 56%),
    radial-gradient(circle at 35% 30%, #fbe7a9, #c99f45);
  border: 2px solid #5b4218;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.slider-tag {
  position: absolute; top: 10px; padding: 3px 9px; border-radius: 4px; font-size: 0.78rem; font-weight: 700;
  background: rgba(10, 8, 6, 0.82); color: var(--gold); border: 1px solid var(--line); pointer-events: none;
}
.slider-tag-en { left: 10px; }
.slider-tag-ja { right: 10px; }
.slider-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; touch-action: pan-y;
  -webkit-appearance: none; appearance: none; background: transparent;
}
.slider-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 44px; height: 100vh; }
.slider-range::-moz-range-thumb { width: 44px; height: 100vh; border: 0; }

/* Under a finger the picture is what people scroll past. Only the handle's strip takes a touch,
   so a scroll that starts on the picture does not move the slider. */
@media (hover: none), (pointer: coarse) {
  .slider-range { pointer-events: none; }
  .slider-range::-webkit-slider-thumb { pointer-events: auto; width: 64px; }
  .slider-range::-moz-range-thumb { pointer-events: auto; width: 64px; }
}
.slider-stage:focus-within { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.slider figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.slider-note { color: var(--muted); font-size: 0.88rem; flex: 1 1 200px; line-height: 1.45; }

/* Sections */
.band { padding: 76px 0; }
.band-alt { background: var(--bg-raised); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.band h2, .world h2 { position: relative; padding-bottom: 14px; margin-bottom: 26px; }
.band h2::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 120px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.section-lead { color: var(--text); max-width: 46em; margin-bottom: 28px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0 0 34px; }
.chips li {
  padding: 6px 14px; border-radius: 999px; font-size: 0.92rem;
  color: var(--gold); background: rgba(232, 199, 126, 0.07); border: 1px solid var(--line);
}

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 56px; }
.card, .panel {
  background: linear-gradient(var(--bg-panel), #15110d);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(232, 199, 126, 0.08), 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 24px;
}
.card p:last-child, .panel p:last-child { margin-bottom: 0; }

/* Parchment, like the quest window */
.card {
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 246, 214, 0.55), transparent 60%),
    linear-gradient(var(--parchment), var(--parchment-deep));
  border-color: #6d5426;
  box-shadow: inset 0 0 0 1px rgba(255, 246, 214, 0.35), inset 0 0 40px rgba(110, 72, 20, 0.28), 0 10px 26px rgba(0, 0, 0, 0.55);
}
.card h3 { color: #3a230b; }
.card .marker { color: #6b1a10; font-weight: 700; white-space: nowrap; }

.feature { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 44px; align-items: center; margin-bottom: 56px; }
.feature:last-child { margin-bottom: 0; }
.feature-flip .feature-text { order: 2; }
.feature-flip .shot-pair { order: 1; }
.shot { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 0 0 1px #000, 0 12px 34px rgba(0, 0, 0, 0.6); background: #000; }

/* The game band */
.world { position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #000; }
.world-img { width: 100%; max-height: 560px; object-fit: cover; object-position: 70% 30%; }
.world::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(15, 12, 10, 0.92) 0%, rgba(15, 12, 10, 0.6) 34%, transparent 62%);
}
.world-text { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; }
.world-text h2, .world-text p { max-width: 15em; }
.world-text p { max-width: 24em; font-size: 1.05rem; text-shadow: 0 1px 2px #000; }
.world h2 { margin-bottom: 10px; padding-bottom: 0; text-shadow: 0 2px 0 #000; }

/* Install */
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.panel ol { margin: 0 0 1em; padding-left: 1.3em; }
.panel li { margin-bottom: 0.55em; }
.panel li::marker { color: var(--gold); font-weight: 700; }
.panel .shot { margin-top: 16px; }
.panel-cta { margin-top: 20px; }
.byhand summary {
  cursor: pointer; font-family: var(--font-title); font-weight: 600; font-size: 1.1rem; color: var(--gold);
  list-style-position: inside;
}
.byhand[open] summary { margin-bottom: 16px; }

/* Report */
.flow { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 0; margin: 0; }
.flow li { counter-increment: step; position: relative; padding-top: 30px; }
.flow li::before {
  content: counter(step);
  position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-title); font-weight: 700; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #fbe7a9, #c99f45); border: 2px solid #5b4218;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.flow .shot { margin: 0 0 16px; width: 100%; aspect-ratio: 964 / 664; object-fit: cover; object-position: top left; }

/* The page for a wrong address */
.lost { padding: 72px 0 96px; }
.lost .card { padding: 36px; }
.lost h1 { color: #3a230b; text-shadow: none; font-size: clamp(1.6rem, 4vw, 2.3rem); }

/* Footer */
.foot { border-top: 1px solid var(--line); background: #0a0806; padding: 40px 0 48px; }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 0; margin: 0 0 22px; }
.foot-links a { color: var(--gold); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.legal { color: var(--muted); font-size: 0.82rem; line-height: 1.6; max-width: 70em; margin: 0; }

/* Narrow screens */
@media (max-width: 900px) {
  .hero { padding: 36px 0 52px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .slider { max-width: clamp(220px, var(--fit), 380px); }
  .cards, .steps, .flow { grid-template-columns: minmax(0, 1fr); }
  .flow { gap: 34px; }
  .feature { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .feature-flip .feature-text { order: 1; }
  .feature-flip .shot-pair { order: 2; }
  .band { padding: 56px 0; }
  .world-img { min-height: 300px; object-position: 88% 30%; }
  .world::after { background: linear-gradient(180deg, rgba(15, 12, 10, 0.2), rgba(15, 12, 10, 0.88) 70%); }
  .world-text { justify-content: flex-end; padding-bottom: 22px; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
  .bar-row { gap: 10px; }
  .brand { gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .brand-name { font-size: 0.84rem; }
  .lang-btn { padding: 9px 9px; font-size: 0.84rem; }
  body { font-size: 1rem; }
  .wrap { padding: 0 18px; }
  .btn { padding: 12px 18px; }
  .cta .btn { flex: 1 1 auto; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 0.74rem; }
  .lang-btn { padding: 9px 7px; font-size: 0.8rem; }
}

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