/* なにきる ウェブサイト
   配色はアプリ (ios/Nanikiru/Views/Theme.swift) と同じ。麻雀牌の素材から取っている。 */
:root {
  --bg: #fcf5ea;          /* 生成りのクリーム */
  --bg-alt: #f6ecdc;
  --card: #fffdf8;        /* 牌の表面に近いアイボリー */
  --border: #efe4d3;
  --ink: #3a3d38;         /* 牌の墨色 */
  --sub: #6f695f;         /* 本文の補足 (アプリの subInk を文字用に少し濃く) */
  --coral: #e0604f;
  --coral-deep: #b8473a;
  --coral-soft: #fce3dc;
  --indigo: #306890;
  --indigo-soft: #e1ecf4;
  --sage: #3a9262;
  --sage-deep: #2b7149;
  --sage-soft: #ddf0e3;
  --mint: #86b99c;
  --gold: #edb443;
  --gold-soft: #fff1cf;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(84, 62, 30, .08);
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .02em;
}
img { max-width: 100%; height: auto; }
a { color: var(--indigo); text-underline-offset: 3px; }
a:hover { color: var(--coral-deep); }
h1, h2, h3 { line-height: 1.4; margin: 0; font-weight: 700; }
p { margin: 0; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ヘッダー */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(252, 245, 234, .9);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 20px; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand img { width: 24px; height: auto; transform: rotate(-6deg); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.site-nav a:hover { background: var(--card); color: var(--coral-deep); }
.site-nav a[aria-current="page"] { background: var(--card); color: var(--coral-deep); }
@media (max-width: 560px) { .nav-optional { display: none; } }

/* 牌 */
.tile { display: inline-block; width: 40px; aspect-ratio: 120 / 165; vertical-align: middle; }
.tile img { display: block; width: 100%; height: 100%; }
.tile-inline { width: 1.15em; margin: 0 1px; vertical-align: -.35em; }

/* 共通の節 */
section { padding: 88px 0; }
section.alt { background: var(--bg-alt); }
.eyebrow { color: var(--coral-deep); font-weight: 700; font-size: 14px; letter-spacing: .08em; margin-bottom: 10px; }
.section-title { font-size: clamp(24px, 4vw, 32px); text-align: center; }
.section-lead { color: var(--sub); text-align: center; max-width: 640px; margin: 14px auto 44px; }
em { font-style: normal; color: var(--coral); }

/* ヒーロー */
.hero { padding: 72px 0 80px; text-align: center; overflow: hidden; }
.hero-tiles { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.hero-tiles .tile { width: 64px; filter: drop-shadow(0 8px 12px rgba(84, 62, 30, .14)); animation: bob 3.2s ease-in-out infinite; }
.hero-tiles .tile:nth-child(1) { --r: -8deg; animation-delay: 0s; }
.hero-tiles .tile:nth-child(2) { --r: 0deg; animation-delay: .25s; }
.hero-tiles .tile:nth-child(3) { --r: 8deg; animation-delay: .5s; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(var(--r)); }
  50% { transform: translateY(-6px) rotate(var(--r)); }
}
@media (prefers-reduced-motion: reduce) { .hero-tiles .tile { animation: none; transform: rotate(var(--r)); } }
.hero-name { font-size: 18px; font-weight: 700; color: var(--sub); margin-bottom: 6px; }
.hero h1 { font-size: clamp(30px, 6.4vw, 52px); letter-spacing: .04em; }
.hero .lead { color: var(--sub); max-width: 600px; margin: 20px auto 30px; font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-note { color: var(--sub); font-size: 13px; margin-top: 16px; }

/* ボタン (アプリの ChunkyButtonStyle に寄せる) */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 28px;
  border: 0; border-radius: 999px;
  background: var(--coral); color: #fff;
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 0 var(--coral-deep);
  transition: transform .12s, box-shadow .12s, background .2s;
}
.button:hover { color: #fff; background: #e56c5c; }
.button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--coral-deep); }
.button:disabled { background: #d9cfc0; box-shadow: 0 5px 0 #c3b8a8; cursor: default; transform: none; }
.button.secondary { background: var(--card); color: var(--ink); box-shadow: 0 5px 0 var(--border), inset 0 0 0 2px var(--border); }
.button.secondary:hover { color: var(--coral-deep); }
.button.secondary:active { box-shadow: 0 1px 0 var(--border), inset 0 0 0 2px var(--border); }
.coming-soon {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 24px;
  border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px;
}

/* 遊んでみる */
.quiz {
  max-width: 760px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 28px;
  box-shadow: var(--shadow); padding: 28px 24px 30px;
}
.quiz-info { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; margin-bottom: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--bg); font-size: 14px; font-weight: 700; }
.chip .tile { width: 20px; }
.chip.level { background: var(--gold-soft); color: #8a6411; }
.quiz-prompt { text-align: center; font-weight: 700; font-size: 20px; }
.quiz-hint { text-align: center; color: var(--sub); font-size: 14px; margin-top: 2px; }
.hand { display: flex; justify-content: center; align-items: flex-end; margin: 20px 0 8px; }
.hand-tile {
  position: relative; flex: 0 1 46px; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer;
  transition: transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.hand-tile img { display: block; width: 100%; height: auto; }
.hand-tile:hover { transform: translateY(-4px); }
.hand-tile[aria-pressed="true"] { transform: translateY(-12px); }
.hand-tile[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 3%; top: 2%; width: 88%; height: 90%;
  border: 3px solid var(--coral); border-radius: 12%; pointer-events: none;
}
.hand-tile:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; border-radius: 6px; }
.hand-gap { flex: 0 0 10px; }
.hand-label { display: flex; justify-content: flex-end; font-size: 12px; color: var(--sub); max-width: 680px; margin: 0 auto; }
.quiz-actions { display: flex; justify-content: center; margin-top: 22px; }
.hand.locked .hand-tile { cursor: default; }
.hand.locked .hand-tile:hover { transform: none; }
.hand.locked .hand-tile[aria-pressed="true"] { transform: translateY(-12px); }

.result { margin-top: 26px; }
.result[hidden] { display: none; }
.banner { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; border-radius: 18px; font-size: 20px; font-weight: 700; }
.banner.ok { background: var(--sage-soft); color: var(--sage-deep); }
.banner.ng { background: var(--coral-soft); color: var(--coral-deep); }
.banner small { font-size: 14px; font-weight: 700; opacity: .85; }
.explain { margin-top: 18px; padding: 20px; border-radius: 20px; background: var(--bg); }
.explain-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--indigo); font-size: 14px; margin-bottom: 8px; }
.explain-summary { font-weight: 700; font-size: 17px; margin-bottom: 10px; }
.explain-body { font-size: 15px; }
.explain ul { margin: 12px 0 0; padding-left: 1.2em; font-size: 15px; }
.explain li { margin: 4px 0; }
.blocks { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.block { display: flex; padding: 6px 6px 4px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.block .tile { width: 28px; }

.table-wrap { overflow-x: auto; margin-top: 18px; -webkit-overflow-scrolling: touch; }
.cand { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.cand th { color: var(--sub); font-weight: 700; font-size: 12px; text-align: right; padding: 6px 8px; border-bottom: 2px solid var(--border); }
.cand th:first-child { text-align: left; }
.cand td { padding: 8px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.cand td:first-child { text-align: left; }
.cand td:first-child .tile { width: 26px; margin-right: 6px; }
.cand tr.best td { background: var(--sage-soft); }
.cand tr.mine td { box-shadow: inset 0 0 0 0 transparent; }
.cand tr.mine td:first-child { box-shadow: inset 4px 0 0 var(--coral); }
.mark { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: 2px; }
.mark.best { background: var(--sage); color: #fff; }
.mark.mine { background: var(--coral); color: #fff; }
.ev-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--gold); vertical-align: middle; margin-right: 8px; }
.cand-note { color: var(--sub); font-size: 12px; margin-top: 10px; }
.result .quiz-actions { gap: 12px; flex-wrap: wrap; }

/* 特長 */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 880px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow); }
.feature-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; margin-bottom: 14px; font-size: 24px; }
.feature-icon .tile { width: 30px; }
.feature-icon.coral { background: var(--coral-soft); }
.feature-icon.indigo { background: var(--indigo-soft); }
.feature-icon.sage { background: var(--sage-soft); }
.feature-icon.gold { background: var(--gold-soft); }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--sub); font-size: 15px; }

/* 正解の決め方 */
.engine { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 920px; margin: 0 auto; }
@media (max-width: 760px) { .engine { grid-template-columns: 1fr; } }
.engine-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; }
.engine-card h3 { font-size: 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.engine-card h3 .num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--indigo); color: #fff; font-size: 14px; flex: none; }
.engine-card ul { margin: 0; padding-left: 1.2em; color: var(--sub); font-size: 15px; }
.engine-card li { margin: 6px 0; }
.engine-card p { color: var(--sub); font-size: 15px; }
.engine-card.wide { grid-column: 1 / -1; }

/* 安心ポイント */
.points { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; max-width: 880px; margin: 0 auto; }
@media (max-width: 680px) { .points { grid-template-columns: 1fr; } }
.point { display: flex; gap: 14px; align-items: flex-start; }
.point-mark { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--sage); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-top: 2px; }
.point h3 { font-size: 17px; margin-bottom: 4px; }
.point p { color: var(--sub); font-size: 15px; }

/* 最後の呼びかけ */
.cta { text-align: center; }
.cta .hero-tiles { margin-bottom: 14px; }
.cta .section-lead { margin-bottom: 26px; }

/* 文書ページ (規約・ポリシー・サポート) */
main.doc { padding: 48px 0 80px; }
.doc-card {
  max-width: 800px; margin: 0 auto; background: var(--card);
  border: 1px solid var(--border); border-radius: 28px; padding: 44px 40px; box-shadow: var(--shadow);
}
@media (max-width: 600px) { .doc-card { padding: 30px 20px; border-radius: 22px; } }
.doc-card h1 { font-size: clamp(24px, 5vw, 30px); margin-bottom: 8px; }
.doc-card .meta { color: var(--sub); font-size: 14px; margin-bottom: 28px; }
.doc-card h2 { font-size: 19px; margin: 40px 0 12px; padding-left: 12px; border-left: 4px solid var(--coral); }
.doc-card h3 { font-size: 16px; margin: 24px 0 8px; }
.doc-card p { margin: 10px 0; }
.doc-card ul, .doc-card ol { padding-left: 1.4em; margin: 10px 0; }
.doc-card li { margin: 6px 0; }
.summary { background: var(--bg); border-radius: 18px; padding: 6px 22px 14px; margin: 24px 0; }
.summary h2 { border: 0; padding: 0; margin: 18px 0 6px; font-size: 17px; }
.contact { background: var(--bg); border-radius: 14px; padding: 14px 18px; }
.faq details { border: 1px solid var(--border); border-radius: 16px; margin: 10px 0; background: var(--card); }
.faq summary { cursor: pointer; padding: 14px 44px 14px 18px; font-weight: 700; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--coral); font-size: 22px; font-weight: 700; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 18px 12px; color: var(--ink); }

/* フッター */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 40px; text-align: center; color: var(--sub); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-bottom: 12px; }
.footer-links a { color: var(--ink); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--coral-deep); }
.site-footer a.org { color: var(--sub); }

/* 画面に入ったら現れる (site.js が .reveal を付ける。JS が動かないときは最初から見える) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 固定ヘッダーの下に隠れないように */
#try, #features, #engine, #privacy, .quiz, .result { scroll-margin-top: 76px; }
.license-text { background: var(--bg); border-radius: 14px; padding: 14px 16px; margin: 10px 0; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.license-details { margin: 10px 0; }
.license-details summary { cursor: pointer; color: var(--coral); font-weight: 700; }
