/* ふたりで謎旅：夜の旅先。紺の夜空に、紙の手がかりカードが浮かぶ */
:root {
  --night: #1d2440;
  --night-2: #2a3358;
  --star: #f5c84c;
  --paper: #fffaf0;
  --paper-2: #f3ead8;
  --ink: #2b2620;
  --muted: #7d7466;
  --line: #e2d6bf;
  --coral: #ef7a62;
  --mint: #5fb59a;
  --a: #f08a74;   /* Aの色 */
  --b: #6fa8dc;   /* Bの色 */
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #3b4678 0%, transparent 60%), var(--night);
  color: var(--paper); font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100%;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
button { font-family: inherit; font-size: 16px; border: 0; cursor: pointer; border-radius: 999px; padding: 12px 20px; font-weight: 700; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--star); outline-offset: 2px; }
.btn { background: var(--star); color: var(--night); }
.btn.sub { background: rgba(255,255,255,.12); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--paper); text-decoration: underline; padding: 8px; }
.btn.wide { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }
.muted { color: #b9bdd3; font-size: 14px; }
h1, h2, h3 { margin: 0; line-height: 1.35; text-wrap: balance; }

/* タイトル */
.title { text-align: center; padding-top: 12vh; display: grid; gap: 18px; }
.title .logo { font-size: 44px; font-weight: 900; letter-spacing: .04em; }
.title .logo span { color: var(--star); }
.title .tag { color: #c9cde2; }
.stars { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .55; }

/* ステージ一覧 */
.stage-card { background: var(--paper); color: var(--ink); border-radius: 20px; padding: 16px; display: grid; gap: 6px; text-align: left; width: 100%; }
.stage-card .meta { color: var(--muted); font-size: 13px; }
.stage-card.locked { opacity: .45; }
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink); font-weight: 700; }

/* A/B を選ぶ */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role { border-radius: 22px; padding: 26px 10px; color: #fff; display: grid; gap: 4px; place-items: center; }
.role b { font-size: 48px; line-height: 1; }
.role.a { background: var(--a); } .role.b { background: var(--b); }

/* 謎の画面 */
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.top .where { font-size: 14px; color: #c9cde2; }
.me { font-weight: 900; border-radius: 999px; padding: 2px 12px; color: #fff; font-size: 14px; white-space: nowrap; }
.me.a { background: var(--a); } .me.b { background: var(--b); }
.progress { display: flex; gap: 6px; margin: 4px 0 12px; }
.progress i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); }
.progress i.on { background: var(--star); }
.card { background: var(--paper); color: var(--ink); border-radius: 22px; padding: 18px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.card h2 { font-size: 20px; }
.card .lead { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.only { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 8px; color: #fff; margin-bottom: 8px; }
.only.a { background: var(--a); } .only.b { background: var(--b); }
.clue { overflow-x: auto; }
.clue svg { display: block; width: 100%; height: auto; max-width: 440px; margin: 0 auto; }
.answer { margin-top: 14px; display: flex; gap: 8px; }
.answer input { flex: 1; min-width: 0; font: inherit; font-size: 20px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); letter-spacing: .1em; }
.answer button { background: var(--night); color: var(--paper); }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.ok { background: #e5f4ee; border-radius: 14px; padding: 12px 14px; margin-top: 12px; color: #24584a; }
.story { white-space: pre-line; }

/* シート */
.sheet { position: fixed; inset: 0; background: rgba(10,12,25,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet-body { background: var(--paper); color: var(--ink); width: 100%; max-width: 520px; border-radius: 24px 24px 0 0;
  padding: 10px 18px max(20px, env(safe-area-inset-bottom)); max-height: 86vh; overflow-y: auto; display: grid; gap: 12px; }
.grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 4px; }
.sheet .btn.sub { background: var(--paper-2); color: var(--ink); }
.sheet .btn.ghost { color: var(--ink); }
.hint { background: var(--paper-2); border-radius: 14px; padding: 12px 14px; }
.hint b { display: block; font-size: 13px; color: var(--muted); }
.adnote { font-size: 13px; color: var(--muted); }
textarea { width: 100%; min-height: 220px; font: inherit; font-size: 16px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); resize: vertical; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 10px 18px; font-weight: 700; z-index: 30; box-shadow: 0 6px 20px rgba(0,0,0,.3); max-width: calc(100% - 32px); }

/* 手がかりの紙もの（ステージで使う共通の見た目） */
.paper-note { background: #fffdf6; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 16px; }
.paper-note .hand { font-size: 17px; }
.paper-note .sign { text-align: right; color: var(--muted); margin-top: 6px; }
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.menu-list li { display: flex; gap: 6px; align-items: baseline; }
.menu-list li .dots { flex: 1; border-bottom: 2px dotted #cbbd9f; transform: translateY(-4px); }
.menu-list li .p { font-variant-numeric: tabular-nums; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }
