/* ============================================================
   ミライ国シミュレーター — デザインシステム
   方向: 公文書 × エディトリアル。和紙の白、墨の黒、朱の赤。
   参照: Apple(余白), Notion(静けさ), Linear(精度), Stripe(階調)
   ============================================================ */
:root {
  --paper: #f6f3ec;
  --paper-2: #efeae0;
  --paper-card: #fffdf8;
  --ink: #1d1b17;
  --ink-2: #57534a;
  --ink-3: #9a948a;
  --line: #ddd6c8;
  --line-strong: #cfc5b3;
  --shu: #c8401f;          /* 朱 */
  --shu-soft: #fbeae4;
  --night: #14120e;
  --night-2: #1c1812;
  --shadow-sm: 0 8px 22px rgba(40,30,10,.06);
  --shadow-md: 0 18px 48px rgba(40,30,10,.10);
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Hiragino Sans", "Noto Sans JP", "Yu Gothic Medium", system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  background: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,0) 42vh),
    radial-gradient(rgba(0,0,0,0.022) 1px, transparent 1px);
  background-size: 5px 5px;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; }
.view { padding: 24px 22px 64px; animation: viewIn .5s cubic-bezier(.2,.7,.3,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }
em { font-style: normal; color: var(--shu); }

/* ---------- buttons ---------- */
.btn-main {
  display: block; width: 100%; margin-top: 26px; padding: 17px 18px;
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 4px;
  font-family: var(--sans); font-size: 15px; font-weight: 700; letter-spacing: 2.4px;
  cursor: pointer; transition: transform .12s, background .2s, box-shadow .2s;
  box-shadow: 0 8px 18px rgba(29,27,23,.12);
}
.btn-main:hover { background: #000; box-shadow: 0 12px 26px rgba(29,27,23,.16); }
.btn-main:active { transform: scale(.98); }
.btn-sub {
  display: block; width: 100%; margin-top: 12px; padding: 15px 18px;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 4px;
  font-size: 14px; font-weight: 600; letter-spacing: 1.8px; cursor: pointer;
  transition: background .18s, transform .12s;
}
.btn-sub:hover { background: rgba(29,27,23,.04); }
.btn-ghost {
  display: block; width: 100%; margin-top: 12px; padding: 13px;
  background: none; border: none; color: var(--ink-3);
  font-size: 13px; letter-spacing: 1px; cursor: pointer; text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- title ---------- */
.v-title { display: flex; align-items: center; min-height: 100dvh; }
.title-wrap { width: 100%; padding-bottom: 8vh; text-align: center; }
.title-kicker {
  font-size: 12px; letter-spacing: 6px; color: var(--shu); font-weight: 700;
  margin-bottom: 26px;
}
.title-h1 {
  font-family: var(--serif); font-size: clamp(32px, 8.6vw, 54px);
  font-weight: 600; line-height: 1.42; letter-spacing: 1.6px;
}
.title-rule { width: 56px; height: 3px; background: var(--shu); margin: 30px auto; }
.title-lede { max-width: 34em; margin: 0 auto; font-size: 14.5px; color: var(--ink-2); text-align: center; }
.title-wrap .btn-main { max-width: 360px; margin-left: auto; margin-right: auto; }
.title-meta { margin-top: 16px; font-size: 11.5px; color: var(--ink-3); letter-spacing: 1.5px; text-align: center; }
.title-privacy {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

/* ---------- prologue (公文書) ---------- */
.doc {
  position: relative; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 38px 28px 30px; margin: 8vh auto 0;
  box-shadow: 0 1px 0 var(--line), var(--shadow-md);
  font-size: 14.5px; color: var(--ink-2);
}
.doc p { margin-bottom: 14px; }
.doc strong { color: var(--ink); }
.doc-stamp {
  position: absolute; top: 18px; right: 18px;
  width: 52px; height: 52px; border: 2.5px solid var(--shu);
  border-radius: 50%; color: var(--shu);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 15px; font-weight: 700;
  transform: rotate(8deg); opacity: .85;
}
.doc-head { font-size: 11px; letter-spacing: 4px; color: var(--ink-3); margin-bottom: 14px; }
.doc-title { font-family: var(--serif); font-size: 24px; color: var(--ink); margin-bottom: 18px; letter-spacing: 1px; }
.doc-sign { text-align: right; color: var(--ink-3); margin-top: 20px; }

/* ---------- HUD ---------- */
.hud {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin: 0 auto 28px;
}
.hud-year { font-family: var(--serif); font-size: 13.5px; letter-spacing: 1px; white-space: nowrap; }
.hud-prog { display: flex; gap: 4px; flex: 1; justify-content: center; }
.hud-prog i { width: 10px; height: 3px; background: var(--line); border-radius: 2px; transition: background .2s; }
.hud-prog i.on { background: var(--shu); }
.hud-approval { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.hud-approval b { color: var(--ink); font-size: 14px; }

/* ---------- scene ---------- */
.scene-tag {
  display: inline-block; font-size: 11px; letter-spacing: 3px; font-weight: 700;
  padding: 5px 12px; border-radius: 2px; margin-bottom: 20px;
}
.is-dilemma .scene-tag { background: var(--ink); color: var(--paper); }
.is-event .scene-tag { background: var(--shu); color: #fff; }
.scene-title {
  font-family: var(--serif); font-size: clamp(28px, 7.6vw, 36px);
  font-weight: 600; line-height: 1.42; letter-spacing: .6px; margin-bottom: 18px;
}
.scene-desc { font-size: 15px; color: var(--ink-2); margin-bottom: 30px; }
.scene-divider {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  color: var(--ink-3); font-size: 11.5px; letter-spacing: 3px;
}
.scene-divider::before, .scene-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 5px;
  padding: 17px 18px; cursor: pointer; font-family: var(--sans);
  font-size: 14.5px; line-height: 1.6; color: var(--ink);
  opacity: 0; animation: choiceIn .4s cubic-bezier(.2,.7,.3,1) forwards;
  transition: border-color .15s, transform .12s, box-shadow .15s, background .15s;
}
@keyframes choiceIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; } }
.choice:hover { border-color: var(--ink); background: #fffefa; box-shadow: var(--shadow-sm); }
.choice:active { transform: scale(.985); }
.choice-key {
  flex-shrink: 0; width: 30px; height: 30px; border: 1.5px solid var(--ink);
  border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-size: 14px; font-weight: 700;
}
.choice:hover .choice-key { background: var(--ink); color: var(--paper); }

/* ---------- flash (速報インタースティシャル) ---------- */
.v-flash {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  background:
    radial-gradient(circle at 50% 12%, rgba(200,64,31,.10), transparent 34%),
    linear-gradient(180deg, #181510 0%, var(--night) 58%, #0f0d0a 100%);
  color: #f2efe7;
  width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  padding: 28px 26px !important;
  animation: flashIn .25s ease;
}
.flash { width: min(720px, calc(100vw - 48px)); margin: 0 auto; }
@keyframes flashIn { from { opacity: 0; } }
.flash-bar {
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 30px;
  animation: barIn .4s cubic-bezier(.2,.7,.3,1);
}
@keyframes barIn { from { transform: translateX(-30px); opacity: 0; } }
.flash-label {
  background: var(--shu); color: #fff; padding: 6px 16px;
  font-size: 14px; font-weight: 800; letter-spacing: 4px;
  animation: pulse 1.1s infinite;
}
@keyframes pulse { 50% { opacity: .75; } }
.flash-time { font-size: 13px; color: #a59d8e; letter-spacing: 2.4px; }
.flash-headline {
  font-family: var(--serif); font-size: clamp(26px, 7vw, 34px); font-weight: 600;
  line-height: 1.45; margin-bottom: 32px; text-align: center; letter-spacing: .5px;
  animation: viewIn .5s .15s cubic-bezier(.2,.7,.3,1) backwards;
}
.flash-voice {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  margin-bottom: 34px; animation: viewIn .5s .6s cubic-bezier(.2,.7,.3,1) backwards;
}
.voice-item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px;
}
.voice-avatar {
  width: 34px; height: 34px; border: 1px solid #51493d; border-radius: 50%;
  background: linear-gradient(180deg, #302b24, #1d1a15);
  position: relative; box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.voice-avatar::before {
  content: ""; position: absolute; left: 12px; top: 8px;
  width: 8px; height: 8px; border-radius: 50%; background: #cfc9bb;
}
.voice-avatar::after {
  content: ""; position: absolute; left: 9px; bottom: 7px;
  width: 14px; height: 9px; border-radius: 9px 9px 4px 4px; background: #cfc9bb;
}
.voice-bubble {
  display: block; background: rgba(35,32,26,.92); border: 1px solid #3a362d;
  border-radius: 14px 14px 14px 4px; padding: 12px 16px; position: relative;
  font-size: 13.5px; color: #cfc9bb; line-height: 1.75;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.voice-bubble::before {
  content: ""; position: absolute; left: -7px; top: 16px;
  width: 12px; height: 12px; background: rgba(35,32,26,.92);
  border-left: 1px solid #3a362d; border-bottom: 1px solid #3a362d;
  transform: rotate(45deg);
}
.voice-item.v2 .voice-bubble { color: #ded8ca; }
.voice-item.v3 .voice-bubble { color: #bdb5a5; }
.flash-approval {
  display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: #9b9487;
  letter-spacing: 1px; animation: viewIn .5s 1.1s cubic-bezier(.2,.7,.3,1) backwards;
}
.flash-approval b { color: #f2efe7; font-size: 15px; }
.ap-track { flex: 1; height: 4px; background: #2c2922; border-radius: 2px; overflow: hidden; }
.ap-fill { height: 100%; background: var(--shu); border-radius: 2px; transition: width .8s ease; }
.btn-skip {
  display: block;
  margin: 38px auto 0; align-self: center;
  background: none; border: 1px solid #3a362d; color: #8d887c;
  padding: 9px 22px; border-radius: 20px; font-size: 12px; letter-spacing: 2px; cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
.btn-skip:hover { border-color: #6b6254; color: #ded8ca; background: rgba(255,255,255,.03); }

/* ---------- reveal ---------- */
.v-reveal {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.05), transparent 34%),
    linear-gradient(180deg, #181510 0%, var(--night) 58%, #0f0d0a 100%);
  color: #f2efe7;
  width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  padding: 28px 30px !important;
}
.reveal { width: min(720px, calc(100vw - 56px)); margin: 0 auto; text-align: center; }
.reveal-line {
  font-family: var(--serif); font-size: clamp(19px, 5.4vw, 24px); line-height: 2.1;
  opacity: 0; animation: lineIn 1s cubic-bezier(.2,.7,.3,1) forwards;
}
.reveal-line.l1 { animation-delay: .2s; }
.reveal-line.l2 { animation-delay: 1.2s; }
.reveal-line.l3 { animation-delay: 2.2s; color: #b5ae9f; font-size: 15.5px; margin-top: 14px; }
@keyframes lineIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }

/* ---------- result ---------- */
.result-kicker {
  text-align: center; font-size: 12px; letter-spacing: 5px; color: var(--ink-3);
  margin: 26px 0 14px; font-weight: 700;
}
.result-kicker.k2 { margin-top: 44px; }
.pm-card {
  background: var(--paper-card); border: 1px solid var(--line); border-top: 4px solid var(--pm);
  border-radius: 5px; padding: 34px 26px 26px; text-align: center;
  box-shadow: var(--shadow-md);
}
.emblem { display: block; margin: 0 auto 18px; }
.pm-name {
  font-family: var(--serif); font-size: 38px; font-weight: 600; letter-spacing: 3px;
  color: var(--pm);
}
.pm-en { font-size: 12px; letter-spacing: 3px; color: var(--ink-3); font-style: italic; margin: 4px 0 22px; }
.pm-traits {
  list-style: none; text-align: left; display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 14px; margin-bottom: 20px;
}
.pm-traits li {
  font-size: 12.5px; color: var(--ink-2); padding-left: 16px; position: relative; line-height: 1.6;
}
.pm-traits li::before { content: "—"; position: absolute; left: 0; color: var(--pm); }
.pm-desc { text-align: left; font-size: 14px; color: var(--ink-2); margin-bottom: 22px; }
.pm-pct {
  display: inline-block; background: var(--pm-soft); color: var(--ink);
  font-size: 13px; padding: 8px 20px; border-radius: 20px;
}
.pm-pct b { font-size: 16px; }

.nation-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 5px; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.skyline { display: block; width: 100%; height: auto; }
.nation-body { padding: 22px 24px 24px; }
.nation-name { font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: 2px; }
.nation-en { font-size: 11.5px; letter-spacing: 3px; color: var(--ink-3); font-style: italic; margin: 2px 0 12px; }
.nation-desc { font-size: 13.5px; color: var(--ink-2); }

.vm-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 5px;
  padding: 26px 24px 18px;
}
.vm-row { display: flex; align-items: center; gap: 14px; margin-bottom: 15px; }
.vm-label { width: 64px; font-size: 13px; font-weight: 600; letter-spacing: 1px; }
.vm-bar { flex: 1; display: flex; gap: 4px; }
.vm-bar i {
  flex: 1; height: 16px; background: var(--paper-2); border-radius: 2px;
}
.vm-bar i.f { background: var(--ink); animation: segIn .3s backwards; }
@keyframes segIn { from { transform: scaleY(0); } }
.vm-num { width: 28px; text-align: right; font-size: 12px; color: var(--ink-3); }
.vm-note { text-align: center; font-size: 11.5px; color: var(--ink-3); margin-top: 18px; line-height: 1.9; }
.result-actions { margin-top: 34px; }

/* ---------- history ---------- */
.page-title { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: 2px; margin: 14px 0 4px; }
.page-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 28px; }
.timeline { border-left: 2px solid var(--line); padding-left: 20px; }
.tl-item { position: relative; margin-bottom: 26px; }
.tl-item::before {
  content: ""; position: absolute; left: -25px; top: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--shu);
}
.tl-year { font-size: 11px; letter-spacing: 2px; color: var(--ink-3); margin-bottom: 3px; }
.tl-title { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.tl-choice { font-size: 13px; color: var(--ink); margin: 4px 0 2px; }
.tl-news { font-size: 12px; color: var(--ink-3); margin-bottom: 7px; }
.tl-axes { display: flex; flex-wrap: wrap; gap: 5px; }
.ax {
  font-size: 10.5px; padding: 2.5px 9px; border-radius: 10px;
  background: var(--paper-2); color: var(--ink-2);
}
.ax.up { background: #e8efe2; color: #3c6b2e; }
.ax.dn { background: #f6e3dd; color: #9c3a20; }
.ax.ap { background: var(--ink); color: var(--paper); }

/* ---------- share ---------- */
.share-cv {
  width: 100%; border-radius: 4px; border: 1px solid var(--line);
  box-shadow: 0 14px 38px rgba(40,30,10,.1); margin-top: 10px;
}

@media (min-width: 560px) {
  .v-flash, .v-reveal {
    min-height: 100dvh;
    border-radius: 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
}

/* ---------- FB対応 (2026-06-11) ---------- */
/* FB#2: 総理タイプ × 国家タイプを等格の二本柱として見せる */
.combo-strip {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 5px;
  padding: 18px 14px; font-family: var(--serif); font-size: 21px; font-weight: 600;
  letter-spacing: 1px; box-shadow: var(--shadow-sm);
}
.combo-x { color: var(--ink-3); font-size: 16px; }
.combo-pct {
  width: max-content; max-width: 100%; margin: 12px auto 0; padding: 8px 18px;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 20px;
  color: var(--ink-2); font-size: 12.5px; text-align: center;
}
.combo-pct b { color: var(--ink); font-size: 16px; }
.nation-card { border-top: 4px solid var(--nt, var(--line)); }
.nation-name { font-size: 38px; letter-spacing: 3px; color: var(--nt, var(--ink)); }
.nation-pct {
  display: inline-block; background: var(--nt-soft, var(--paper-2)); color: var(--ink);
  font-size: 13px; padding: 8px 20px; border-radius: 20px; margin-top: 14px;
}
.nation-pct b { font-size: 16px; }

/* FB#4: 近い思想を持つ政治家 */
.pol-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 5px;
  padding: 24px 24px 16px;
}
.pol-lead { font-size: 13px; color: var(--ink-2); margin-bottom: 18px; }
.pol-item { border-top: 1px solid var(--line); padding: 16px 0 6px; }
.pol-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.pol-name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.pol-area {
  font-size: 10.5px; letter-spacing: 2px; color: var(--shu);
  border: 1px solid var(--shu); border-radius: 3px; padding: 1.5px 8px;
}
.pol-desc { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.pol-note { font-size: 10.5px; color: var(--ink-3); margin-top: 12px; line-height: 1.7; }

/* FB#5: 履歴に選ばなかった選択肢も表示 */
.tl-choices { margin: 6px 0 4px; }
.tlc { font-size: 12.5px; padding: 2.5px 0; }
.tlc.chosen { color: var(--ink); font-weight: 700; }
.tlc.passed { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(0,0,0,0.18); }

@media (min-width: 760px) {
  #app { max-width: 720px; }
  .view { padding: 34px 34px 76px; }
  .v-title { min-height: 94dvh; }
  .title-wrap { max-width: 640px; margin: 0 auto; }
  .title-h1 { font-size: 64px; line-height: 1.32; }
  .title-lede { text-align: center; }
  .doc { max-width: 620px; padding: 46px 44px 36px; }
  .v-prologue > .btn-main { max-width: 360px; margin-left: auto; margin-right: auto; }
  .scene-title { font-size: 42px; }
  .scene-desc { font-size: 16px; }
  .choice { min-height: 76px; font-size: 15.5px; padding: 20px 22px; }
  .v-flash, .v-reveal {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 42px 44px !important;
  }
  .flash-headline { font-size: 42px; }
  .voice-item { grid-template-columns: 38px minmax(0, 1fr); gap: 14px; }
  .voice-avatar { width: 38px; height: 38px; }
  .voice-avatar::before { left: 14px; top: 9px; }
  .voice-avatar::after { left: 11px; bottom: 8px; }
  .voice-bubble { padding: 14px 18px; font-size: 14px; }
}

@media (min-width: 980px) {
  #app { max-width: 1040px; }
  .v-scene, .v-result, .v-history, .v-share { padding-inline: 48px; }
  .hud { max-width: 900px; margin-inline: auto; }
  .scene {
    max-width: 920px; margin: 0 auto;
    display: grid; grid-template-columns: minmax(320px, .95fr) minmax(380px, 1.05fr);
    column-gap: 46px; align-items: center;
  }
  .scene-tag, .scene-title, .scene-desc { grid-column: 1; }
  .scene-divider, .choices { grid-column: 2; }
  .scene-divider { margin-top: 8px; }
  .choices { gap: 14px; }
  .scene-tag { width: max-content; }
  .scene-desc { max-width: 32em; }
  .combo-strip, .combo-pct, .result-actions { max-width: 820px; margin-inline: auto; }
  .combo-strip { font-size: 26px; }
  .result-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px; align-items: stretch; margin: 26px auto 0; max-width: 920px;
  }
  .result-grid .result-kicker { min-height: 38px; margin: 0 0 14px; }
  .result-grid .pm-card, .result-grid .nation-card { height: calc(100% - 52px); }
  .vm-card, .pol-card, .timeline, .share-cv { max-width: 820px; margin-inline: auto; }
  .share-cv { display: block; }
  .result-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  }
  .result-actions .btn-main,
  .result-actions .btn-sub,
  .result-actions .btn-ghost { margin-top: 0; }
  .result-actions .btn-ghost { grid-column: 1 / -1; }
}

@media (min-width: 1200px) {
  #app { max-width: 1120px; }
  .scene, .result-grid { max-width: 980px; }
  .flash, .reveal { width: min(780px, calc(100vw - 80px)); }
}
