/* GEMSEED — アプリの「蔵」の面から。暗い地に、ランタンの灯りと宝石の色だけ。
   配色はアプリの styles-game.css（--v-bg / --v-text / --v-accent）に合わせてある。 */
:root {
  --bg: #0d0f14;
  --panel: #15181f;
  --panel-2: #1b1f28;
  --line: #2a2f3a;
  --ink: #eceae4;
  --dim: #a3a9b6;      /* 背景に対して 4.5:1 以上 */
  --gold: #d7c9a8;     /* アプリの accent */
  --lantern: #f0b25a;
  --radius: 18px;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scroll-behavior: smooth; color-scheme: dark; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  font-size: 15px; line-height: 1.95; letter-spacing: .02em;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--gold); text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; border-radius: 6px; }
b, strong { font-weight: 700; }

.skip {
  position: absolute; top: -60px; left: 16px; z-index: 20;
  padding: 8px 14px; border-radius: 999px; background: var(--gold); color: #1a1a1a;
  font-size: 12px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- 上のバー ---- */
.topbar {
  display: flex; align-items: center; gap: 6px; min-height: 58px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: rgba(13, 15, 20, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar a {
  padding: 6px 12px; border-radius: 999px;
  color: var(--dim); font-size: 12px; text-decoration: none; white-space: nowrap;
}
.topbar a:hover { color: var(--ink); background: var(--panel-2); }
.topbar a[aria-current="page"] { color: var(--ink); background: var(--panel-2); }
.topbar .home {
  display: flex; align-items: center; gap: 7px; margin-right: auto; padding-left: 0;
  color: var(--dim); font-size: 11px; letter-spacing: .1em;
}
.topbar .home:hover { background: none; }
.topbar .home img { width: 16px; opacity: .6; }

/* ---- はじめの画面：坑道の絵に、ランタンの灯り ---- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 64px 20px 56px; isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--bg) url("/gemseed/img/hero.webp") center 62% / cover no-repeat;
  opacity: .5;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(13,15,20,.55) 0%, rgba(13,15,20,.1) 38%, rgba(13,15,20,.92) 100%),
    radial-gradient(ellipse at 50% 40%, transparent 0, rgba(13,15,20,.55) 80%);
}
.hero .icon {
  width: 84px; height: 84px; margin: 0 auto 24px; border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(215,201,168,.25), 0 10px 40px rgba(240,178,90,.25);
}
.hero h1 {
  font-family: var(--serif); font-weight: 400; color: var(--gold);
  font-size: clamp(34px, 9vw, 52px); letter-spacing: .3em; text-indent: .3em; line-height: 1.3;
}
.hero .tag { margin-top: 18px; font-size: 17px; font-weight: 700; letter-spacing: .08em; }
.hero .sub { margin-top: 8px; color: var(--dim); font-size: 13px; }
.hero .status {
  display: inline-block; margin-top: 26px; padding: 5px 16px; border-radius: 999px;
  border: 1px solid rgba(240,178,90,.5); color: var(--lantern); font-size: 12px; letter-spacing: .12em;
}

/* ---- 本文 ---- */
.wrap { width: min(100% - 32px, 760px); margin: 0 auto; }
main.wrap { padding-bottom: 20px; }
section { padding: 56px 0 8px; }
h2 { margin-bottom: 18px; font-size: 20px; letter-spacing: .06em; line-height: 1.5; font-weight: 700; }
h2 .en { display: block; margin-bottom: 4px; color: var(--lantern); font-size: 11px; letter-spacing: .22em; font-weight: 400; }
h3 { margin: 22px 0 4px; font-size: 15px; line-height: 1.6; }
h4 { margin: 20px 0 4px; font-size: 14px; }
p + p { margin-top: 12px; }
ul { padding-left: 1.3em; }
li + li { margin-top: 5px; }
.note, .updated { color: var(--dim); font-size: 12.5px; }
.lead { font-size: 16px; line-height: 1.9; }

/* 画面のならび（横にめくれる） */
.screens {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 210px); gap: 16px;
  margin-top: 26px; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}
.screens figure { scroll-snap-align: start; }
.screens img {
  width: 100%; border-radius: 22px; background: var(--panel);
  box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, .45);
}
.screens figcaption { margin-top: 10px; color: var(--dim); font-size: 12px; text-align: center; }

/* カード */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 6px; }
.card {
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
}
.card h3 { margin: 0 0 4px; color: var(--gold); }
.card p { color: var(--dim); font-size: 13px; line-height: 1.8; }

/* 宝石の絵と GEMSEED */
.gemseed-box { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; margin-top: 6px; }
.gemseed-box img { width: 220px; height: 220px; }
.code {
  display: inline-block; margin: 6px 0 2px; padding: 6px 16px; border-radius: 12px;
  border: 1px solid rgba(255,93,143,.45); background: rgba(255,93,143,.07);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; letter-spacing: .22em; color: #ffd9e4;
}

/* 表 */
.spec { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 14px; }
.spec th, .spec td { padding: 11px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec th { width: 34%; color: var(--dim); font-weight: 400; }

/* App Store バッジ。Apple が配布しているアートワークをそのまま置く(assets/style.css と同じ指定)。
   色・比率・内部の余白は変えない。高さだけ指定し、周囲の余白はバッジ高さの 1/4 以上空ける */
.badge-appstore { display: inline-block; line-height: 0; margin: 16px 16px 0 0; border-radius: 8px; }
.badge-appstore img { height: 52px; width: auto; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px;
  border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  font-size: 13px; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.links a:hover { border-color: var(--gold); color: var(--gold); }

.contact { margin-top: 16px; padding: 18px 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.contact .addr { font-size: 15px; font-weight: 700; letter-spacing: .03em; overflow-wrap: anywhere; }

/* 規約・ポリシー・サポート */
.doc { width: min(100% - 32px, 680px); }
.doc > section:first-child { padding-top: 40px; }
.doc h1 {
  padding-bottom: 14px; border-bottom: 1px solid var(--gold); color: var(--gold);
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(21px, 5vw, 26px); letter-spacing: .05em; line-height: 1.5;
}
.doc h1 + .updated, .doc h1 + .lead { margin-top: 12px; }
.doc h2 { margin-top: 38px; margin-bottom: 10px; font-size: 16px; }
.doc section > h2:first-child { margin-top: 0; }

/* 英語 */
section.en { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }
section.en > h2 { font-size: 18px; }
section.en h3 { color: var(--dim); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

.wrap.foot { padding-bottom: 48px; }
footer {
  margin-top: 40px; padding: 28px 0; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 11px; text-align: center;
}
footer .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
footer .row a { color: var(--dim); text-decoration: none; }
footer .row a:hover { color: var(--gold); }

@media (max-width: 640px) {
  .topbar { gap: 2px; overflow-x: auto; }
  .topbar a { padding: 6px 9px; font-size: 11px; }
  .hero { padding-top: 44px; padding-bottom: 44px; }
  .hero .tag { font-size: 15px; }
  .cards { grid-template-columns: 1fr; }
  .gemseed-box { grid-template-columns: 1fr; gap: 6px; }
  .gemseed-box img { width: min(240px, 70%); height: auto; margin: 0 auto; }
  .code { font-size: 18px; letter-spacing: .16em; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- 発掘済みの数（found.js が読めたときだけ出る。静かに） ---- */
.found { margin-top: 14px; color: var(--dim); font-size: 12.5px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.found b { color: var(--gold); font-weight: 600; }
