/* 配色は app/src/constants/theme.ts に合わせる。アプリはダークのみなので、ライトはそこから作った */

:root {
  color-scheme: light dark;

  --bg: #fbf6ec;
  --bg-deep: #f3ead8;
  --surface: #ffffff;
  --surface-raised: #fffaf0;
  --border: #e3d6bd;
  --text: #0b1626;
  --text-dim: #3c4f68;
  --text-faint: #5f6f84;
  --accent: #f2b04a;
  --accent-ink: #2a1a02;
  /* ライトの背景で読める濃さのアクセント（文字・リンク用） */
  --accent-text: #9a5a00;
  --link: #9a5a00;

  /* 判定の色。アプリと同じく枠にだけ使い、文字は本文の色で書く */
  --yes: #12865f;
  --no: #c8423b;
  --partly: #9a5a00;
  --irrelevant: #5a6d86;

  --font-display: 'Yusei Magic', 'Hiragino Maru Gothic ProN', sans-serif;
  --font-body: system-ui, -apple-system, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', Meiryo, sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --max: 960px;
  --max-text: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1626;
    --bg-deep: #071020;
    --surface: #132338;
    --surface-raised: #1b3049;
    --border: #24405f;
    --text: #f3ead8;
    --text-dim: #9db0c8;
    --text-faint: #8296b0;
    --accent-text: #f2b04a;
    --link: #f2b04a;

    --yes: #4fd1a5;
    --no: #f0706a;
    --partly: #f2b04a;
    --irrelevant: #8ea3bd;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- ヘッダー・フッター ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-deep);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 20px;
}

.site-nav {
  display: flex;
  gap: 4px 16px;
  flex-wrap: wrap;
  font-size: 14px;
}

.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--accent-text);
}

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text-faint);
  font-size: 14px;
  padding: 24px 0 40px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-bottom: 8px;
}

.site-footer a {
  color: var(--text-dim);
}

/* ---------- ロゴ枠 ---------- */

/* site/assets/app-icon.png を置くと、その画像が枠いっぱいに出る。なければ仮の絵（🐢）のまま */
.logo {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 22%;
  overflow: hidden;
  background: linear-gradient(160deg, #1b3049, #071020);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.logo::before {
  content: '🐢';
  font-size: 0.55em;
}

.logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-sm {
  font-size: 36px;
}

.logo-lg {
  width: 112px;
  height: 112px;
  font-size: 112px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
}

/* ---------- LP ---------- */

.hero {
  background: radial-gradient(120% 90% at 50% 0%, var(--bg-deep), var(--bg));
  padding: 56px 0 48px;
  text-align: center;
}

.hero .logo {
  margin: 0 auto 20px;
}

.hero h1 {
  font-size: clamp(32px, 9vw, 52px);
}

.hero .tagline {
  font-family: var(--font-display);
  color: var(--accent-text);
  font-size: clamp(18px, 4.6vw, 24px);
  margin: 8px 0 16px;
}

.hero .lead {
  color: var(--text-dim);
  max-width: 34em;
  margin: 0 auto 28px;
}

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  font-size: 17px;
}

.store-button:hover {
  filter: brightness(1.06);
}

.store-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.note {
  color: var(--text-faint);
  font-size: 13px;
  margin-top: 12px;
}

.section {
  padding: 48px 0 8px;
}

.section > .wrap > h2 {
  font-size: clamp(24px, 6vw, 30px);
  margin-bottom: 8px;
}

.section .section-lead {
  color: var(--text-dim);
  margin: 0 0 24px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* 4枚のカードを 3＋1 にせず 2列ずつ並べる */
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
}

.card h3 {
  font-size: 20px;
  color: var(--accent-text);
  margin-bottom: 6px;
}

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

.card ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
  color: var(--text-dim);
}

.mode-card .mode-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 0 10px;
  margin-bottom: 8px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

/* 判定。アプリの GM の吹き出しと同じく、判定色の 2px 枠に本文色の太字。左上だけ角を小さくする */
.badge {
  display: inline-block;
  border: 2px solid var(--irrelevant);
  border-radius: var(--r-md);
  border-top-left-radius: 4px;
  background: var(--surface);
  color: var(--text);
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.v-yes {
  border-color: var(--yes);
}
.v-no {
  border-color: var(--no);
}
.v-partly {
  border-color: var(--partly);
}
.v-irrelevant {
  border-color: var(--irrelevant);
}

/* 例題（チャットのイメージ） */
.chat {
  display: grid;
  gap: 10px;
}

.chat .problem {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

.chat .q {
  justify-self: end;
  max-width: 85%;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-md) var(--r-md) 4px var(--r-md);
  padding: 8px 14px;
}

/* GM の回答。アプリと同じく、GM の丸いアイコンと判定色の枠の吹き出し */
.chat .gm {
  justify-self: start;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.gm-avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.chat .gm .badge {
  min-width: 96px;
  padding: 6px 12px;
  font-size: 17px;
  line-height: 24px;
}

/* ---------- 規約・ポリシー・サポート ---------- */

.doc {
  max-width: var(--max-text);
  margin: 0 auto;
  padding: 40px 16px 0;
}

.doc h1 {
  font-size: clamp(26px, 7vw, 34px);
  margin-bottom: 8px;
}

.doc .meta {
  color: var(--text-faint);
  font-size: 14px;
  margin: 0 0 28px;
}

.doc h2 {
  font-size: 21px;
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.doc h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  margin: 24px 0 8px;
}

.doc p,
.doc li {
  color: var(--text);
}

.doc ol,
.doc ul {
  padding-left: 1.5em;
}

.doc li + li {
  margin-top: 4px;
}

.doc .summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 0 0 8px;
}

.doc .summary ul {
  margin: 8px 0 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 12px 0;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.7;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--border);
  padding: 8px 10px;
}

.doc th {
  background: var(--surface-raised);
  font-weight: 700;
}

.doc td:first-child {
  width: 34%;
}

/* スマホでは2列の表を、項目ごとのカードに積む */
@media (max-width: 600px) {
  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
    width: auto;
  }

  .doc thead {
    display: none;
  }

  .doc tr {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overflow: hidden;
    margin-bottom: 8px;
  }

  .doc td {
    border: 0;
  }

  .doc td:first-child {
    width: auto;
    font-weight: 700;
    background: var(--surface-raised);
    padding-bottom: 6px;
  }
}

.doc .toc {
  font-size: 14px;
}

.contact {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.contact .card a {
  font-weight: 700;
  font-size: 18px;
}

.doc details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin: 8px 0;
}

.doc summary {
  cursor: pointer;
  font-weight: 700;
}

.doc details p {
  margin: 8px 0 0;
  color: var(--text-dim);
}

.not-found {
  text-align: center;
  padding-top: 80px;
}

.not-found .logo {
  margin: 0 auto 24px;
}

.doc .card h3 {
  margin-top: 0;
}
