/* Quizmundo — 共通スタイル (base.css)
   各ページは <body class="q-hima|q-color|q-age"> と
   :root へ --accent / --accent-ink を指定して個性を出す */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Zen+Kaku+Gothic+New:wght@500;700;900&family=Noto+Sans+KR:wght@400;500;700;900&family=Noto+Sans+Thai:wght@400;500;700;900&display=swap');

:root {
  color-scheme: light;
  --ground: #F4F2F8;
  --surface: #FFFFFF;
  --surface-2: #F1EEF6;
  --ink: #262330;
  --muted: #6B6579;
  --accent: #FF7A59;
  --accent-ink: #B53F22;
  --accent-2: #5FA38C;
  --line: rgba(38, 35, 48, 0.09);
  --shadow: 0 12px 34px -18px rgba(38, 35, 48, 0.28);
  --font-display: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
/* 信頼感重視のため常に明色テーマに固定（暗色モードには追従しない） */
:root[data-theme="light"] {
  --ground: #F4F2F8; --surface: #FFFFFF; --surface-2: #F1EEF6; --ink: #262330;
  --muted: #6B6579; --line: rgba(38, 35, 48, 0.09); --shadow: 0 12px 34px -18px rgba(38, 35, 48, 0.28);
}
/* 言語別フォント: 韓国語=Noto Sans KR / タイ語=Noto Sans Thai（字形を正しく表示） */
html[lang="ko"] {
  --font-display: "Noto Sans KR", "Noto Sans JP", sans-serif;
  --font-body: "Noto Sans KR", "Noto Sans JP", sans-serif;
}
html[lang="th"] {
  --font-display: "Noto Sans Thai", "Noto Sans JP", sans-serif;
  --font-body: "Noto Sans Thai", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--ground); color: var(--ink);
  font-family: var(--font-body); line-height: 1.75; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; overflow-x: hidden; position: relative;
}
/* 見出しは字間を詰めて整った印象に（日本語の詰め組み） */
h1, .q-text, .result-name, .brand, .qcard .nm, .more-card .nm, .wash .big {
  font-feature-settings: "palt" 1;
}

/* ===== RTL（アラビア語など）対応 ===== */
[dir="rtl"] .opt { text-align: right; }
[dir="rtl"] .opt:hover { transform: translateX(-3px); }
[dir="rtl"] .content, [dir="rtl"] .doc, [dir="rtl"] .type-list .ti, [dir="rtl"] .fact, [dir="rtl"] .result-desc { text-align: right; }
[dir="rtl"] .content ul, [dir="rtl"] .faq { padding-left: 0; padding-right: 1.2em; }
[dir="rtl"] .content h2::before { margin-right: 0; margin-left: 10px; }
[dir="rtl"] .fact .value, [dir="rtl"] .brand { flex-direction: row-reverse; }
[dir="rtl"] .progress-top, [dir="rtl"] .topbar { direction: rtl; }
/* 数字・URL・ハッシュタグは左→右のまま読ませる */
[dir="rtl"] .age-num, [dir="rtl"] .wash .sub, [dir="rtl"] .site-footer { direction: ltr; unicode-bidi: plaintext; }

/* ambient background — 各ページの --accent で色づく */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg .blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.10; }
.bg .b1 { width: 44vmax; height: 44vmax; background: var(--accent); top: -18vmax; left: -14vmax; }
.bg .b2 { width: 34vmax; height: 34vmax; background: var(--accent-2); bottom: -18vmax; right: -14vmax; opacity: 0.08; }
.bg .b3 { display: none; }
@keyframes drift1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(4vmax,6vmax) scale(1.08)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-5vmax,-4vmax) scale(1.1)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-4vmax,3vmax) scale(0.92)} }

.wrap { position: relative; z-index: 1; width: 100%; max-width: 620px; margin: 0 auto; padding: 24px 16px 40px; }
.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 92vh; }

.card { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: 40px 32px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
.brand a { color: inherit; text-decoration: none; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; flex: none; }
.langswitch { display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 3px; flex: none; }
.langswitch a { text-decoration: none; font-size: 0.72rem; font-weight: 700; color: var(--muted); padding: 4px 10px; border-radius: 999px; letter-spacing: 0.04em; }
.langswitch a[aria-current="true"] { background: var(--accent); color: #fff; }

.screen { display: none; }
.screen.active { display: block; animation: fadeUp 0.5s ease both; }
@keyframes fadeUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

.hero-emoji { font-size: 4rem; text-align: center; line-height: 1; margin-bottom: 8px; }
h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 6vw, 2.6rem); text-align: center; line-height: 1.25; text-wrap: balance; margin: 0 0 14px; }
h1 .hl { color: var(--accent-ink); }
.lead { text-align: center; color: var(--muted); font-size: 1rem; margin: 0 auto 24px; max-width: 34ch; }
.meta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 0.82rem; margin-bottom: 28px; }
.meta-row b { color: var(--ink); font-weight: 700; }

.btn { font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; border: none; cursor: pointer; border-radius: 999px; padding: 16px 28px; background: var(--accent); color: #fff; width: 100%; transition: transform .12s ease, filter .12s ease; }
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-size: 0.92rem; padding: 12px 20px; }
.btn.x { background: #111; color: #fff; }
.btn:focus-visible, .opt:focus-visible, a:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

.progress { margin-bottom: 24px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.progress-top b { color: var(--accent-ink); font-weight: 800; font-size: 0.95rem; }
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s cubic-bezier(.4,0,.2,1); }

.q-text { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.25rem, 4.5vw, 1.55rem); line-height: 1.5; text-wrap: balance; margin: 0 0 22px; }
.opts { display: flex; flex-direction: column; gap: 12px; }
.opt { font-family: var(--font-body); font-size: 1rem; text-align: left; background: var(--surface-2); border: 1.5px solid transparent; color: var(--ink); border-radius: 16px; padding: 15px 18px; cursor: pointer; transition: border-color .12s ease, transform .12s ease; line-height: 1.5; }
.opt:hover { border-color: var(--accent); transform: translateX(3px); }
.back-link { display: block; margin: 18px auto 0; }

/* result */
.result-emoji { font-size: 5rem; text-align: center; line-height: 1; margin-bottom: 4px; animation: pop 0.6s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes pop { from{transform:scale(.4);opacity:0} to{transform:scale(1);opacity:1} }
.result-kicker { text-align: center; color: var(--muted); font-size: 0.82rem; letter-spacing: 0.12em; margin-bottom: 4px; }
.result-name { font-family: var(--font-display); font-weight: 800; text-align: center; font-size: clamp(1.6rem, 6vw, 2.2rem); margin: 0 0 4px; }
.result-catch { text-align: center; color: var(--accent-ink); font-weight: 700; margin: 0 0 18px; }
.result-desc { background: var(--surface-2); border-radius: 18px; padding: 18px 20px; margin-bottom: 16px; font-size: 0.98rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.facts.one { grid-template-columns: 1fr; }
.fact { background: var(--surface-2); border-radius: 16px; padding: 14px 16px; }
.fact .label { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 5px; }
.fact .value { font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.fact .value.small { font-size: 0.86rem; font-weight: 600; }
.fact .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }

/* color診断: 結果を色で染めるwash */
.wash { text-align: center; border-radius: 22px; padding: 28px 20px 24px; margin-bottom: 18px; background: var(--accent); color: #fff; animation: pop .55s cubic-bezier(.2,1.2,.4,1) both; }
.wash .kicker { font-size: 0.8rem; letter-spacing: 0.14em; opacity: 0.9; }
.wash .big { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 8vw, 2.8rem); margin: 6px 0 2px; }
.wash .sub { font-size: 0.82rem; letter-spacing: 0.14em; opacity: 0.9; font-variant-numeric: tabular-nums; }

/* age診断: 数字 */
.age-box { text-align: center; margin-bottom: 16px; }
.age-num { font-family: var(--font-display); font-weight: 800; line-height: 1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.age-num b { font-size: clamp(4rem, 20vw, 6rem); color: var(--accent-ink); }
.age-num span { font-size: 1.6rem; }
.age-count { display: inline-block; }

.share-title { text-align: center; font-size: 0.85rem; color: var(--muted); margin: 4px 0 12px; }
.actions { display: flex; flex-direction: column; gap: 10px; }

/* 広告枠 */
.ad-slot { margin: 22px auto; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-slot .ad-note { font-size: 0.7rem; color: var(--muted); opacity: 0.5; }

/* 読み物セクション(thin-content対策) */
.content { max-width: 620px; margin: 30px auto 0; padding: 0 4px; }
.content h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin: 34px 0 12px; text-wrap: balance; }
.content h2::before { content: ""; display: inline-block; width: 20px; height: 4px; border-radius: 2px; background: var(--accent); margin-right: 10px; vertical-align: middle; }
.content p { margin: 0 0 14px; }
.content ul { padding-left: 1.2em; margin: 0 0 14px; }
.content li { margin-bottom: 8px; }
.type-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 4px 0 8px; }
.type-list .ti { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.type-list .ti b { font-size: 1rem; }
.type-list .ti span { color: var(--muted); font-size: 0.9rem; }
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--muted); }

/* コレクション相互リンク */
.more { max-width: 620px; margin: 34px auto 0; }
.more h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; margin: 0 0 14px; text-align: center; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.more-card { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; text-align: center; transition: transform .12s ease, border-color .12s ease; }
.more-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.more-card .em { font-size: 2rem; display: block; margin-bottom: 6px; }
.more-card .nm { font-weight: 700; font-size: 0.95rem; }
.more-card .ds { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }

.site-footer { max-width: 620px; margin: 34px auto 0; text-align: center; color: var(--muted); font-size: 0.78rem; line-height: 1.8; }
.site-footer a { color: var(--accent-ink); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg .blob, .screen.active, .result-emoji, .wash, .age-count { animation: none !important; }
  .bar > i { transition: none; }
}
