/* =========================================================
   Dungeon Antiqua – site styles (retro / SNES inspired)
   ========================================================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", -apple-system,
    BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.85;
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #4a5e72 0%, var(--bg) 50%, #18212a 100%);
  background-attachment: fixed;
  font-size: 16px;
  letter-spacing: 0.02em;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Theme tokens ---- */
:root {
  --bg: #2b3846;         /* same as original site */
  --border: transparent;
  --text: #e7e9f0;
  --muted: #b9c1cf;
  --accent: #e8c170;     /* gold */
  --accent-2: #9cc0ff;   /* blue */
  --maxw: 960px;         /* page / wide sections */
  --readw: 736px;        /* narrower reading width for text sections */
}

/* ---- Pixel display font for headings ---- */
.section h2 {
  font-family: "DotGothic16", "Zen Kaku Gothic New", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #4a5e72 0%, var(--bg) 50%, #18212a 100%);
  background-attachment: fixed;
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-menu__title { display: none; }

/* ---- Language toggle (JP / EN) ---- */
[data-lang="ja"] .lang-en { display: none !important; }
[data-lang="en"] .lang-ja { display: none !important; }
.lang-switch { margin-left: auto; display: inline-flex; gap: 4px; }
.lang-btn {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 12px;
  padding: 5px 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  cursor: pointer;
}
.lang-btn:hover { color: var(--text); }
[data-lang="ja"] .lang-btn[data-set-lang="ja"],
[data-lang="en"] .lang-btn[data-set-lang="en"] {
  color: #10131d;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-toggle__bar { width: 22px; height: 2px; background: var(--accent); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle.is-open .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav a.nav-link {
  position: relative;
  display: inline-block;
  padding: 6px 8px;
  color: var(--muted);
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  line-height: 1.6;
}
.nav a.nav-link:hover { color: var(--text); text-decoration: none; }
.nav a.nav-link.is-active { color: var(--accent); padding-left: 24px; }
/* Famicom-style cursor pointing at the current title (pure CSS, no JS) */
.nav a.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .nav a.nav-link.is-active::before { animation: nav-cursor-blink 1s steps(1) infinite; }
  @keyframes nav-cursor-blink { 50% { opacity: 0; } }
}

/* ---- Layout ---- */
.container { max-width: var(--readw); margin: 0 auto; padding: 0 16px; }
/* product-info & screenshots keep the wide width */
#spec .container,
#screenshots .container { max-width: var(--maxw); }

/* ---- Page transition (enter / leave) ---- */
.hero, main { animation: page-enter 0.5s ease both; }
@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
body.is-leaving .hero,
body.is-leaving main {
  animation: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* ---- Hero ---- */
.hero {
  padding: 28px 16px 8px;
  text-align: center;
}
.hero img {
  margin: 0 auto;
  image-rendering: auto;
}

/* ---- Sections ---- */
.section { padding: 40px 0; }
.section h2 {
  font-size: 22px;
  color: var(--text);
  margin: 0 0 32px;
  text-align: center;
  position: relative;
}
.section h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}

.panel {
  background: transparent;
  border: 0;
  padding: 0;
}
/* boxed variant — used for the trial (体験版) details */
.boxed {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(156, 192, 255, 0.45);
  border-radius: 12px;
  padding: 22px 24px;
  margin-top: 8px;
}

/* feature bullet list */
.feature-list { list-style: none; margin: 18px 0 0; padding: 0; }
.feature-list li {
  position: relative;
  padding: 6px 0 6px 28px;
  border-bottom: 1px dashed rgba(49, 58, 85, 0.7);
}
.feature-list li::before {
  content: "▸";
  position: absolute;
  left: 6px;
  color: var(--accent);
}

/* ---- Videos ---- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Spec ---- */
.spec-layout {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.spec-main { flex: 1 1 320px; min-width: 0; }
.spec-figure {
  flex: 0 0 auto;
  margin: 0;
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  overflow: hidden;
}
/* default (DA2 square app icon): fill the circle */
.spec-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* DA1 key art (748x896): frame the fairy + lamp, excluding the top title */
.spec-figure--da1 img {
  position: absolute;
  width: 106%;
  max-width: none;     /* override global img max-width so it can fill the circle */
  height: auto;
  left: -3%;
  top: -24%;
  object-fit: initial;
}
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th,
.spec-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 15px;
}
.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table th {
  white-space: nowrap;
  width: 8.5em;
  color: var(--accent);
  font-weight: 700;
}
.note { font-size: 13px; color: var(--muted); margin: 16px 0 0; }

/* ---- Store buttons ---- */
.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
}
/* official store badges (Google Play / App Store) — heights aligned */
.store-row img { height: 52px; width: auto; }
.store-row a:hover { opacity: 0.85; }
.steam-widget { width: 100%; margin-top: 24px; }
.steam-widget iframe { width: 100%; max-width: 646px; height: 190px; border: 0; margin: 0 auto; display: block; }

/* ---- Screenshot grid ---- */
.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.shots.cols-2 { grid-template-columns: repeat(2, 1fr); }
.shots a { margin: 0; }
.shots img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.shots img:hover { transform: translateY(-3px) scale(1.01); border-color: var(--accent); }

/* ---- Guidelines ---- */
.guide h3 {
  font-size: 15px;
  color: var(--accent);
  margin: 22px 0 6px;
}
.guide h3:first-child { margin-top: 0; }
.guide p { margin: 0 0 6px; font-size: 15px; }
.guide ul { margin: 8px 0 0; padding-left: 1.3em; color: var(--muted); }
.emph { color: inherit; font-weight: 700; }

/* ---- Trial box ---- */
.trial-url {
  display: inline-block;
  margin: 8px 0 16px;
  font-size: 15px;
  word-break: break-all;
}

/* ---- Download material ---- */
.dl-link { word-break: break-all; }

/* ---- Series cross-sell ---- */
.series-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.series-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.series-card img { width: 200px; flex: 0 0 auto; border-radius: 8px; }
.series-card__text { display: flex; flex-direction: column; gap: 4px; }
.series-card__kicker { font-size: 12px; font-weight: 700; color: var(--accent); }
.series-card__text strong { font-size: 18px; }
.series-card__text .sub { font-size: 13px; color: var(--muted); }

/* ---- Sticky purchase bar ---- */
body { padding-bottom: 84px; }
.buybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(13, 16, 24, 0.97);
  backdrop-filter: blur(8px);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.5);
  padding: 12px 16px;
}
.buybar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
.buybar__label {
  font-family: "DotGothic16", sans-serif;
  font-size: 15px;
  color: var(--accent);
  white-space: nowrap;
  margin-right: 4px;
}
.buybar__btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #10131d;
  background: linear-gradient(180deg, #f3d18a, var(--accent));
  border: 1px solid #f3d693;
  box-shadow: 0 2px 8px rgba(232, 193, 112, 0.35);
  white-space: nowrap;
}
.buybar__btn:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(232, 193, 112, 0.55);
  text-decoration: none;
}
.buybar__btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
/* gentle attention pulse on the whole bar (motion-safe) */
@media (prefers-reduced-motion: no-preference) {
  .buybar { animation: buybar-glow 2.8s ease-in-out infinite; }
  @keyframes buybar-glow {
    0%, 100% { box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.5), 0 0 18px rgba(232, 193, 112, 0.25); }
  }
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 16px;
  text-align: center;
  background: transparent;
}
.social { display: flex; justify-content: center; gap: 16px; margin-bottom: 16px; }
.social a {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}
.social a:hover { background: var(--accent); transform: translateY(-2px); }
.social img { width: 22px; height: 22px; }
/* envelope SVG ships white; darken it so it reads on the white circle */
.social img[src$="ic_envelope.svg"] { filter: brightness(0); }
.copyright { font-size: 13px; color: var(--muted); margin: 0; }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-menu { display: none; }
  /* Famicom-style select panel when opened */
  .nav-menu.open {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-top: 10px;
    padding: 12px 10px;
    background: #0b0f1a;
    border: 3px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  }
  .nav-menu.open .nav-menu__title {
    display: block;
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    color: var(--accent-2);
    letter-spacing: 1px;
    padding: 4px 10px 10px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
    margin-bottom: 6px;
  }
  .nav-menu.open .nav-link {
    width: 100%;
    padding: 13px 10px 13px 32px;
    border-radius: 4px;
  }
  .nav-menu.open .nav-link:hover,
  .nav-menu.open .nav-link:focus { background: rgba(232, 193, 112, 0.14); color: var(--text); }
  .nav-menu.open .nav-link.is-active { background: rgba(232, 193, 112, 0.14); padding-left: 32px; }
  .nav-menu.open .nav-link.is-active::before { left: 10px; }
  .nav-menu.open .nav-link:hover::before,
  .nav-menu.open .nav-link:focus::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid var(--accent);
  }
  .nav a.nav-link { font-size: 10px; }
  .spec-layout { justify-content: center; gap: 24px; }
  .spec-figure { order: -1; }
  .spec-figure { width: 200px; height: 200px; }
  .video-grid { grid-template-columns: 1fr; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 32px 0; }
  .panel { padding: 18px 16px; }
  .spec-table th { width: auto; white-space: normal; display: block; padding-bottom: 2px; border-bottom: 0; }
  .spec-table td { display: block; padding-top: 2px; }
  .spec-table tr { display: block; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
  .spec-table th, .spec-table td { border-bottom: 0; }
  .series-card { flex-direction: column; text-align: center; gap: 14px; }
  .series-card img { width: 100%; max-width: 320px; }
  .buybar__inner { flex-wrap: wrap; }
  .buybar__label { width: 100%; flex-basis: 100%; margin: 0 0 6px; text-align: center; font-size: 12px; }
  .buybar__btn { font-size: 13px; padding: 10px 8px; gap: 6px; }
  body { padding-bottom: 112px; }
}
@media (max-width: 420px) {
  .shots { grid-template-columns: 1fr; }
  .buybar__btn { font-size: 12px; padding: 9px 6px; }
  .buybar__btn svg { width: 16px; height: 16px; }
}
