/* 花梨クエスト — あたたかい絵本 + ぼうけんRPG
   スマホ(360-430px)中心。PCでは中央に最大 480px のカラム。 */
:root {
  --cream: #fff8e6;
  --cream-2: #fdf0cf;
  --paper: #fffdf6;
  --leaf: #8bc768;
  --leaf-d: #4e9b3c;
  --leaf-dd: #2f6f2a;
  --sky: #bfe6fa;
  --sky-d: #2a7db1;
  --sky-dd: #1c5f8a;
  --gold: #ffd25e;
  --gold-d: #d99a1c;
  --coral: #ff8a65;
  --coral-d: #d4552f;
  --berry: #c8466b;
  --ink: #3b2f2a;
  --ink-2: #5d4d45;
  --line: #ecd9b0;
  --shadow: 0 3px 0 rgba(120, 90, 40, 0.18), 0 8px 18px rgba(120, 90, 40, 0.12);
  --r: 22px;
  --tab-h: 68px;
  font-size: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
/* display を指定した要素でも、hidden 属性は必ず効かせる */
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  background: #e9f3d8;
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Hiragino Maru Gothic ProN', 'Hiragino Kaku Gothic ProN', 'BIZ UDPGothic', 'Yu Gothic UI', 'Noto Sans JP', 'Meiryo', system-ui, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background: linear-gradient(#e7f5ff 0, #f2fadf 220px, var(--cream) 520px);
  background-attachment: fixed;
  /* 子ども向けは「ぶんせつ」ごとに スペースを入れているので、スペースで改行する。長い語だけ最終手段で折る */
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-break: strict;
}
@supports (word-break: auto-phrase) {
  body {
    word-break: auto-phrase;
  }
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(120, 90, 40, 0.08), 0 0 40px rgba(120, 90, 40, 0.12);
}
body.has-tabbar .view {
  padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom));
}
.view {
  padding: 14px 14px 32px;
}
img,
svg {
  max-width: 100%;
}
a {
  color: var(--sky-dd);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 1.35rem;
  line-height: 1.35;
}
h2 {
  font-size: 1.15rem;
  line-height: 1.4;
}
small {
  font-size: 0.8em;
}
.muted {
  color: var(--ink-2);
  font-size: 0.9rem;
}
.fine {
  color: var(--ink-2);
  font-size: 0.82rem;
  line-height: 1.55;
}
.center {
  text-align: center;
}
.lead {
  font-size: 1rem;
  color: var(--ink-2);
}
.hint {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--ink-2);
  margin-top: 8px;
}
.hint .ico {
  flex: none;
  margin-top: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--sky-d);
  outline-offset: 2px;
  border-radius: 8px;
}
.ico {
  flex: none;
  vertical-align: middle;
}
.page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row.wrap {
  flex-wrap: wrap;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--leaf-dd);
}

/* ---------- カード ---------- */
.card {
  background: var(--paper);
  border: 2.5px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
}
.card-title .count {
  margin-left: auto;
  font-size: 0.9rem;
  background: var(--cream-2);
  border-radius: 99px;
  padding: 0 10px;
}
.card-notice {
  background: #fff4e0;
  border-color: #f2c27c;
}
.notice-head {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #9a5a0a;
}
.card-active {
  background: linear-gradient(#f1fbe4, #e5f6cf);
  border-color: var(--leaf);
}
.step {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--leaf);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}
.empty {
  color: var(--ink-2);
  text-align: center;
  padding: 6px 0;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 2px 10px;
}
.page-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 4px 0;
}
.page-head h1 {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- ボタン（高さ48px以上） ---------- */
.btn {
  appearance: none;
  border: 3px solid transparent;
  border-radius: 18px;
  min-height: 52px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  max-width: 100%;
}
.btn:active:not(:disabled) {
  transform: translateY(3px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.btn-primary {
  background: var(--leaf);
  border-color: var(--leaf-d);
  color: #123b10;
  box-shadow: 0 5px 0 var(--leaf-d);
}
.btn-primary:active:not(:disabled) {
  box-shadow: 0 2px 0 var(--leaf-d);
}
.btn-secondary {
  background: var(--sky);
  border-color: #6fb9e3;
  color: #0e3d5c;
  box-shadow: 0 4px 0 #6fb9e3;
}
.btn-secondary:active:not(:disabled) {
  box-shadow: 0 1px 0 #6fb9e3;
}
.btn-gold {
  background: var(--gold);
  border-color: var(--gold-d);
  color: #5a3a00;
  box-shadow: 0 5px 0 var(--gold-d);
}
.btn-gold:active:not(:disabled) {
  box-shadow: 0 2px 0 var(--gold-d);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  min-height: 48px;
}
.btn-danger {
  background: #ffe1dc;
  border-color: #e98a7c;
  color: #8a2314;
  box-shadow: 0 4px 0 #e98a7c;
}
.btn-end {
  background: #fff;
  border-color: var(--coral);
  color: var(--coral-d);
  box-shadow: 0 4px 0 var(--coral);
}
.btn-xl {
  min-height: 72px;
  font-size: 1.3rem;
  border-radius: 24px;
  width: 100%;
}
.btn-lg {
  min-height: 60px;
  font-size: 1.15rem;
  width: 100%;
}
.btn-sm {
  min-height: 48px;
  padding: 6px 14px;
  font-size: 0.95rem;
}
.btn-prepare {
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  50% {
    transform: translateY(-3px);
  }
}

/* ---------- バッジ・チップ ---------- */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 99px;
  padding: 1px 10px;
  line-height: 1.6;
}
.badge-demo {
  background: #ffe4a8;
  color: #7a4a00;
  border: 2px solid #f0b94a;
}
.badge-live {
  background: #d8f1c4;
  color: #1f5a1a;
  border: 2px solid var(--leaf);
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--cream-2);
  border: 2px solid var(--line);
  border-radius: 99px;
  padding: 0 10px;
  line-height: 1.7;
}
.chip-exp {
  background: #fff2c2;
  border-color: var(--gold);
  color: #6b4700;
}
.chip-new {
  background: var(--coral);
  border-color: var(--coral-d);
  color: #fff;
}
.chip-ok {
  background: #e1f5cf;
  border-color: var(--leaf);
  color: #1f5a1a;
}
.chip-note {
  background: #e8f3fb;
  border-color: #8cc3e6;
  color: #0e4a73;
}
.chip-demo {
  background: #ffe4a8;
  border-color: #f0b94a;
  color: #7a4a00;
}

.demo-banner {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff1c9;
  border: 2.5px dashed #e8a82e;
  color: #6b4200;
  border-radius: 16px;
  padding: 10px 12px;
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 12px;
}
.page .demo-banner,
.home .demo-banner {
  margin-bottom: 0;
}
.title-logo-wrap {
  margin: 0;
  text-align: center;
  line-height: 0;
}
.title-logo {
  display: block;
  width: min(86%, 340px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 4px 6px rgba(120, 80, 20, 0.18));
}
.loading-logo {
  display: block;
  width: min(60vw, 240px);
  height: auto;
  margin: 0 auto 8px;
}
.home {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notice-inline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #eaf6e0;
  border: 2px solid #b6dd9c;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.55;
}
.notice-inline.ok {
  background: #eaf6e0;
}
.notice-inline.warn {
  background: #fff1d6;
  border-color: #f2c27c;
  color: #6b3f00;
}
.notice-inline .ico {
  margin-top: 2px;
}

/* ---------- トップバー・タブバー ---------- */
.topbar {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 4px;
  margin: -4px 0 0;
}
.topbar-title {
  text-align: center;
  font-size: 1.15rem;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--paper);
  border: 2.5px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.icon-btn.ghost {
  visibility: hidden;
}
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border-top: 3px solid var(--line);
  z-index: 20;
}
.tab {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 800;
  min-height: 48px;
}
.tab.active {
  color: var(--leaf-dd);
  background: linear-gradient(transparent, #eaf6dc);
}
.tab.active svg {
  stroke: var(--leaf-d);
}

/* ---------- ホーム ---------- */
.card-hero {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(#cfeeff, #eefaff 60%, #e5f6cf 60%);
  border-color: #9ed0ee;
  flex-direction: row;
  gap: 0;
  align-items: flex-end;
  min-height: 210px;
}
.hero-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 99px;
  opacity: 0.9;
}
.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.c1 {
  width: 64px;
  height: 20px;
  top: 22px;
  right: 24px;
  animation: drift 14s ease-in-out infinite alternate;
}
.c1::before {
  width: 28px;
  height: 28px;
  left: 10px;
  top: -14px;
}
.c1::after {
  width: 22px;
  height: 22px;
  left: 32px;
  top: -9px;
}
.c2 {
  width: 44px;
  height: 14px;
  top: 58px;
  right: 120px;
  animation: drift 18s ease-in-out infinite alternate-reverse;
}
.c2::before {
  width: 20px;
  height: 20px;
  left: 6px;
  top: -10px;
}
@keyframes drift {
  to {
    transform: translateX(-22px);
  }
}
.hill {
  position: absolute;
  bottom: -30px;
  border-radius: 50%;
}
.h1 {
  width: 220px;
  height: 120px;
  left: -40px;
  background: #b6e08f;
}
.h2 {
  width: 260px;
  height: 130px;
  right: -60px;
  background: #9fd57a;
}
.hero-karin {
  position: relative;
  flex: none;
  width: 118px;
  margin-left: 6px;
  margin-bottom: 2px;
  animation: float 3.2s ease-in-out infinite;
}
@keyframes float {
  50% {
    transform: translateY(-5px);
  }
}
.hero-karin svg {
  display: block;
  width: 100%;
  height: auto;
}
.hero-info {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 16px 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero-hello {
  font-weight: 800;
  font-size: 0.98rem;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid #cfe6f5;
  border-radius: 14px;
  padding: 6px 10px;
}
.level-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.level-badge {
  background: var(--gold);
  border: 3px solid var(--gold-d);
  color: #5a3a00;
  border-radius: 99px;
  padding: 0 14px;
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.6;
}
.level-name {
  font-weight: 800;
}
.exp-note {
  font-size: 0.8rem;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  padding: 0 8px;
  align-self: flex-start;
}
.expbar {
  position: relative;
  height: 28px;
  background: #fff;
  border: 3px solid var(--gold-d);
  border-radius: 99px;
  overflow: hidden;
}
.expbar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: repeating-linear-gradient(120deg, #ffd25e 0 14px, #ffc233 14px 28px);
  border-radius: 99px;
  min-width: 0;
  transition: width 1.1s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.expbar-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: #4a3200;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.last-adv {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.last-adv-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.last-adv-treasure {
  width: 64px;
  flex: none;
}
.mini-treasures {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mini-treasures li {
  width: 52px;
  height: 52px;
  background: var(--cream-2);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 4px;
}
.home-foot {
  text-align: center;
}

/* ---------- 出発準備 ---------- */
.map {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid #b6dd9c;
  background: #e6f3cf;
}
.map[hidden] {
  display: none;
}
.map-card {
  padding: 12px;
}
.map-host,
.map-stage {
  width: 100%;
  height: 100%;
}
.map-stage svg {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.map-google .map-stage {
  min-height: 240px;
}
.m-ground {
  fill: #eaf5d3;
}
.m-road {
  stroke: #fff8e1;
  stroke-width: 12;
  stroke-linecap: round;
  opacity: 0.95;
}
.m-tree circle {
  fill: #a8d98a;
}
.m-pond {
  fill: #bfe3f7;
}
.m-house {
  fill: #f6d9b2;
  stroke: #e1bd8a;
  stroke-width: 1.5;
}
.m-route-halo {
  fill: none;
  stroke: #fff;
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.m-route {
  fill: none;
  stroke: var(--coral);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2 9;
}
.m-route-dash {
  stroke: var(--coral);
  stroke-width: 4;
  stroke-dasharray: 3 8;
  stroke-linecap: round;
}
.m-label {
  font-size: 11px;
  font-weight: 800;
  fill: #3b2f2a;
  paint-order: stroke;
  stroke: #fffdf6;
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.m-label-strong {
  font-size: 12.5px;
}
.m-hit {
  cursor: pointer;
}
.map-credit {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 12px;
  color: #5e5e5e;
  background: rgba(255, 255, 255, 0.85);
  padding: 0 8px;
  border-radius: 8px;
  pointer-events: none;
  font-family: Roboto, sans-serif;
  font-weight: 400;
}
.map-zoom {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-zbtn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2.5px solid var(--line);
  background: var(--paper);
  font: inherit;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.gmp-attribution {
  font-family: Roboto, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: normal;
  white-space: nowrap;
  color: #5e5e5e;
}
.find {
  display: flex;
  gap: 8px;
}
.find input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
.find input:focus {
  border-color: var(--sky-d);
  outline: none;
}
.find-results {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.find-results:empty {
  display: none;
}
.find-item {
  width: 100%;
  min-height: 52px;
  display: flex;
  gap: 8px;
  align-items: center;
  text-align: left;
  background: #fff;
  border: 2.5px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.find-item span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.find-item small {
  color: var(--ink-2);
  font-size: 0.78rem;
}
.find-loading,
.find-empty {
  background: var(--cream-2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
}
.duration-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.dur {
  min-height: 72px;
  border-radius: 18px;
  border: 3px solid var(--line);
  background: #fff;
  font: inherit;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  cursor: pointer;
}
.dur b {
  font-size: 1.7rem;
}
.dur small {
  font-size: 0.78rem;
  font-weight: 800;
}
.dur.on {
  background: var(--leaf);
  border-color: var(--leaf-d);
  color: #123b10;
  box-shadow: 0 4px 0 var(--leaf-d);
  transform: translateY(-2px);
}
.plan-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--cream-2);
  border-radius: 16px;
  padding: 12px;
}
.plan-title {
  font-weight: 800;
  font-size: 0.95rem;
}
.plan-bar {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  height: 16px;
  border-radius: 99px;
  overflow: hidden;
  gap: 3px;
}
.plan-bar li {
  border-radius: 99px;
}
.p-travel {
  background: #6fb9e3;
}
.p-explore {
  background: var(--leaf);
}
.p-margin {
  background: var(--gold);
}
.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.92rem;
}
.plan-list li {
  display: flex;
  gap: 8px;
  align-items: center;
}
.plan-list b {
  margin-left: auto;
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}
.sticky-cta {
  position: sticky;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 10;
  padding: 6px 0 0;
}
.sticky-cta[hidden] {
  display: none;
}
.sticky-cta::before {
  content: '';
  position: absolute;
  inset: -10px -14px -20px;
  background: linear-gradient(transparent, var(--cream) 55%);
  z-index: -1;
  pointer-events: none;
}

/* ---------- 目的地 ---------- */
.dest-card h2 {
  font-size: 1.5rem;
  line-height: 1.3;
}
.dest-card {
  border-color: var(--sky-d);
  background: linear-gradient(#f4fbff, var(--paper) 40%);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}
.stats > div {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 8px 6px;
  text-align: center;
}
.stats dt {
  font-size: 0.72rem;
  color: var(--ink-2);
  font-weight: 700;
}
.stats dd {
  margin: 0;
  font-weight: 900;
  font-size: 1.25rem;
}
.stats dd small {
  font-size: 0.7rem;
  font-weight: 800;
}
.parent-note {
  display: flex;
  gap: 10px;
  background: #f3f0ff;
  border: 2px solid #cfc4f5;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #3c2f72;
}
.parent-note .ico {
  margin-top: 3px;
}
.tips {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.92rem;
}
.quest-preview {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quest-preview li {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 700;
}
.quest-preview small {
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.72rem;
}
.q-ico {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
}
.q-shape {
  background: #f0876b;
}
.q-nature {
  background: #6fb04f;
}
.q-talk {
  background: #5aa5d6;
}

/* ---------- 冒険中 ---------- */
.adv-head {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.adv-karin {
  width: 74px;
  flex: none;
  margin-bottom: -4px;
}
.adv-karin svg {
  display: block;
  width: 100%;
  height: auto;
}
.adv-head-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
}
.adv-dest {
  font-size: 1.35rem;
}
.timer-card {
  background: linear-gradient(#eaf7ff, var(--paper));
  border-color: #9ed0ee;
}
.timer-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 8px;
  align-items: end;
}
.timer-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink-2);
}
.timer {
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--sky-dd);
}
.timer-plan-v {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.2;
}
.timer-plan-v small {
  font-size: 0.7rem;
}
.time-bar {
  height: 12px;
  border-radius: 99px;
  background: #d9ecf8;
  overflow: hidden;
}
.time-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8ccbeb, #4da6d6);
  border-radius: 99px;
  transition: width 1s linear;
}
.over-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #fff1d6;
  border: 2.5px solid #f2c27c;
  color: #6b3f00;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 800;
  font-size: 0.95rem;
}
.over-note[hidden] {
  display: none;
}
.arrive-card.arrived {
  background: #eaf6dc;
  border-color: var(--leaf);
}
.arrived-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #1f5a1a;
}
.arrived-row div {
  display: flex;
  flex-direction: column;
}
.arrived-row b {
  font-size: 1.15rem;
}
.quest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quest {
  position: relative;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.quest.done {
  background: #eaf6dc;
  border-color: var(--leaf);
}
.quest.flash {
  animation: flash 0.9s;
}
@keyframes flash {
  30% {
    transform: scale(1.03);
    box-shadow: 0 0 0 6px rgba(255, 210, 94, 0.7);
  }
}
.quest-top {
  display: flex;
  gap: 10px;
  align-items: center;
}
.quest-text {
  flex: 1;
  min-width: 0;
}
.quest-text small {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink-2);
}
.quest-text p {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.45;
}
.quest-text em {
  display: block;
  font-style: normal;
  font-size: 0.8rem;
  color: var(--ink-2);
}
.quest.done .quest-text p {
  text-decoration: line-through;
  text-decoration-color: rgba(47, 111, 42, 0.5);
  color: var(--ink-2);
}
.quest-check {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: #fff;
  border: 3px dashed var(--line);
  display: grid;
  place-items: center;
  color: #fff;
}
.quest.done .quest-check {
  background: var(--leaf);
  border: 3px solid var(--leaf-d);
  animation: stamp 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes stamp {
  from {
    transform: scale(0.2) rotate(-40deg);
  }
}
.quest-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.find-btn {
  flex: 1 1 180px;
  min-height: 64px;
  font-size: 1.3rem;
  width: auto;
}
.quest-done-msg {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: 800;
  color: var(--leaf-dd);
}
.pop-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.pop-text {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  background: var(--coral);
  border: 4px solid #fff;
  border-radius: 99px;
  padding: 0 24px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  animation: popup 1.3s ease-out forwards;
}
@keyframes popup {
  0% {
    transform: scale(0.2) rotate(-8deg);
    opacity: 0;
  }
  25% {
    transform: scale(1.15) rotate(3deg);
    opacity: 1;
  }
  75% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-30px) scale(1);
    opacity: 0;
  }
}

/* ---------- 宝箱 ---------- */
.chest-page {
  min-height: calc(100dvh - 60px);
  justify-content: center;
}
.chest-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 30px 8px;
  text-align: center;
}
.chest-title {
  font-size: 1.3rem;
  font-weight: 900;
}
.chest-glow {
  position: absolute;
  top: 90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(#fff3a8, transparent 65%);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    transform: scale(1.12);
    opacity: 0.7;
  }
}
.chest-btn {
  position: relative;
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  width: min(300px, 80vw);
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.chest-btn svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 10px rgba(120, 80, 20, 0.25));
}
.chest-btn:not(.opened) svg {
  animation: wiggle 2s ease-in-out infinite;
}
.chest-tap {
  background: var(--coral);
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  border-radius: 99px;
  padding: 6px 22px;
  border: 3px solid #fff;
  box-shadow: 0 4px 0 var(--coral-d);
  animation: bob 1.4s ease-in-out infinite;
}
.chest-btn.opened .chest-tap {
  display: none;
}
@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(-3deg);
  }
  20% {
    transform: rotate(3deg);
  }
  30% {
    transform: rotate(0);
  }
}
.chest-btn.shake svg {
  animation: shake 0.65s linear;
}
@keyframes shake {
  10%,
  90% {
    transform: translateX(-3px) rotate(-2deg);
  }
  20%,
  80% {
    transform: translateX(5px) rotate(3deg);
  }
  30%,
  50%,
  70% {
    transform: translateX(-7px) rotate(-4deg);
  }
  40%,
  60% {
    transform: translateX(7px) rotate(4deg);
  }
}
.chest-btn.opened svg {
  animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes pop {
  from {
    transform: scale(0.8);
  }
}
.result-treasure {
  align-items: center;
  text-align: center;
  background: linear-gradient(#fff9d8, var(--paper));
  border-color: var(--gold);
}
.pop-in {
  animation: pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.treasure-big {
  width: 128px;
  height: 128px;
  padding: 14px;
  border-radius: 50%;
  background: radial-gradient(#fff, #fff4c6);
  border: 4px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(255, 210, 94, 0.3);
}
.treasure-big.rarity-uncommon {
  border-color: #6fb9e3;
  box-shadow: 0 0 0 6px rgba(111, 185, 227, 0.3);
  background: radial-gradient(#fff, #e3f4ff);
}
.treasure-big.rarity-rare {
  border-color: #b49cf2;
  box-shadow: 0 0 0 6px rgba(180, 156, 242, 0.35), 0 0 24px rgba(255, 210, 94, 0.7);
  background: radial-gradient(#fff, #f1e9ff);
}
.treasure-big svg,
.treasure-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.stars {
  color: #e0a92b;
  font-size: 1.2rem;
  letter-spacing: 2px;
}
.stars small {
  color: var(--ink-2);
  letter-spacing: 0;
  font-weight: 700;
}
.exp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exp-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 6px 12px;
  font-weight: 700;
}
.exp-list .exp-total {
  background: #fff2c2;
  border-color: var(--gold);
  font-size: 1.15rem;
  font-weight: 900;
}
.done-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.done-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 700;
}
.done-list .mark {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eee;
  color: #aaa;
}
.done-list li.ok .mark {
  background: var(--leaf);
  color: #fff;
}
.done-list li.no {
  color: var(--ink-2);
  font-weight: 600;
}
.praise {
  background: #fff4e0;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 800;
}
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 80;
}
.quest .confetti-layer,
.chest-page .confetti-layer {
  position: absolute;
}
.confetti-layer i {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: 10px;
  height: 14px;
  border-radius: 3px;
  animation: fall var(--d) ease-in var(--delay) forwards;
}
@keyframes fall {
  to {
    transform: translate(var(--dx), 105vh) rotate(var(--r));
    opacity: 0.9;
  }
}
.quest .confetti-layer i {
  animation-name: fallq;
}
@keyframes fallq {
  to {
    transform: translate(var(--dx), 220px) rotate(var(--r));
    opacity: 0;
  }
}
.levelup {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(40, 30, 10, 0.55);
  padding: 20px;
  animation: fadein 0.3s;
}
@keyframes fadein {
  from {
    opacity: 0;
  }
}
.levelup-card {
  position: relative;
  width: min(360px, 100%);
  background: linear-gradient(#fffbe0, #ffefae);
  border: 5px solid var(--gold);
  border-radius: 30px;
  padding: 24px 18px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  animation: pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.levelup-rays {
  position: absolute;
  inset: -60%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.55) 0 10deg, transparent 10deg 20deg);
  animation: spin 14s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.levelup-card > * {
  position: relative;
}
.levelup-karin {
  width: 130px;
}
.levelup-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--coral-d);
  text-shadow: 0 3px 0 #fff;
}
.levelup-lv {
  font-size: 1.4rem;
  font-weight: 800;
}
.levelup-lv b {
  font-size: 2.4rem;
  color: var(--sky-dd);
}
.levelup-msg {
  font-weight: 800;
}

/* ---------- コレクション・履歴 ---------- */
.treasure-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.treasure-cell {
  position: relative;
  width: 100%;
  min-height: 118px;
  border-radius: 18px;
  border: 3px solid var(--line);
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.treasure-cell.got.rarity-uncommon {
  border-color: #8cc3e6;
}
.treasure-cell.got.rarity-rare {
  border-color: #b49cf2;
  background: linear-gradient(#fbf7ff, var(--paper));
}
.treasure-cell.lock {
  background: #f1ead8;
  color: #9a8c78;
}
.t-art {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
}
.t-art svg {
  width: 100%;
  height: 100%;
}
.t-q {
  font-size: 2rem;
  font-weight: 900;
  color: #c9bba0;
}
.t-q.big {
  font-size: 4rem;
}
.t-name {
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}
.t-count {
  position: absolute;
  right: 6px;
  top: 4px;
  background: var(--coral);
  color: #fff;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0 8px;
  border: 2px solid #fff;
}
.treasure-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-link {
  display: flex;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
}
.history-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-date {
  font-size: 0.8rem;
  color: var(--ink-2);
  font-weight: 700;
}
.history-quests {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.history-quests li.ok {
  color: var(--leaf-dd);
  font-weight: 700;
}
.history-quests li.no {
  color: #a39482;
}
.history-quests .ico {
  vertical-align: -3px;
}
.history-treasure {
  width: 70px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.history-treasure small {
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.25;
}

/* ---------- 設定 ---------- */
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-ui {
  position: relative;
  flex: none;
  width: 64px;
  height: 36px;
  border-radius: 99px;
  background: #d8cdb6;
  border: 3px solid #bfb095;
  transition: background 0.15s;
}
.switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.switch input:checked + .switch-ui {
  background: var(--leaf);
  border-color: var(--leaf-d);
}
.switch input:checked + .switch-ui::after {
  transform: translateX(28px);
}
.switch input:focus-visible + .switch-ui {
  outline: 3px solid var(--sky-d);
  outline-offset: 2px;
}
.switch-label {
  font-weight: 800;
}
.chip-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  min-height: 48px;
  padding: 6px 16px;
  border-radius: 99px;
  border: 3px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}
.pill.on {
  background: var(--leaf);
  border-color: var(--leaf-d);
  color: #123b10;
}
input[type='range'] {
  width: 100%;
  min-height: 48px;
  accent-color: var(--leaf-d);
}
.range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-2);
}

/* ---------- モーダル・トースト・読み込み ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(60, 40, 10, 0.5);
  padding: 18px;
  animation: fadein 0.2s;
}
.modal {
  width: min(380px, 100%);
  max-height: 90dvh;
  overflow: auto;
  background: var(--paper);
  border: 4px solid var(--line);
  border-radius: 26px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(60, 40, 10, 0.35);
  animation: pop 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.modal-karin {
  width: 76px;
  margin: -46px auto -6px;
  background: var(--paper);
  border-radius: 50%;
  border: 4px solid var(--line);
  overflow: hidden;
  aspect-ratio: 1;
}
.modal-karin svg {
  width: 150%;
  margin: 2px 0 0 -25%;
  height: auto;
  display: block;
}
.modal h2 {
  text-align: center;
  font-size: 1.25rem;
}
.modal-body {
  font-size: 1rem;
}
.modal-body p + p {
  margin-top: 6px;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-actions .btn {
  width: 100%;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: #3b2f2a;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 100;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 0;
  color: var(--ink-2);
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 5px solid #d8ecc4;
  border-top-color: var(--leaf-d);
  animation: spin 0.9s linear infinite;
  display: inline-block;
}
.spinner.sm {
  width: 18px;
  height: 18px;
  border-width: 3px;
  vertical-align: -3px;
}
.card.center {
  align-items: center;
}

/* ---------- 画面が広いとき ---------- */
@media (min-width: 520px) {
  body {
    padding: 18px 0;
  }
  #app {
    border-radius: 28px;
    min-height: calc(100dvh - 36px);
    overflow: clip;
  }
  .tabbar {
    bottom: 18px;
    border-radius: 0 0 28px 28px;
  }
}
@media (max-width: 359px) {
  :root {
    font-size: 16px;
  }
  .timer {
    font-size: 1.9rem;
  }
  .stats dd {
    font-size: 1.05rem;
  }
  .hero-karin {
    width: 96px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 花梨のまばたき ---------- */
.karin-blink {
  animation: blink 5s infinite;
  transform-origin: 100px 104px;
}
@keyframes blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  97% {
    transform: scaleY(0.1);
  }
}

/* ---------- でんしゃで おでかけ ---------- */
.travel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.travel {
  min-height: 92px;
  border-radius: 18px;
  border: 3px solid var(--line);
  background: #fff;
  font: inherit;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 6px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.travel b {
  font-size: 1.1rem;
}
.travel small {
  color: var(--ink-2);
  font-size: 0.78rem;
}
.travel .ico {
  color: var(--ink-2);
}
.travel.on {
  background: var(--sky);
  border-color: var(--sky-d);
  color: var(--sky-dd);
  box-shadow: 0 4px 0 var(--sky-d);
  transform: translateY(-2px);
}
.travel.on .ico,
.travel.on small {
  color: var(--sky-dd);
}
.duration-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.duration-grid.cols-3 .dur b {
  font-size: 1.5rem;
}
.duration-grid.cols-3 .dur small {
  font-size: 0.72rem;
}
.chip-train {
  background: #e3e7ff;
  border-color: #9aa5e6;
  color: #2f3a8a;
}
.q-train {
  background: #5b6cc9;
}
.adv-stations {
  margin: 2px 0 0;
  font-size: 0.86rem;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 4px;
}
/* 区間（🚶→🚃→🚶） */
.legs {
  list-style: none;
  margin: 10px 0 6px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.leg {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--cream-2);
  border: 2px solid var(--line);
}
.leg .ico {
  flex: none;
  color: var(--ink-2);
}
.leg div {
  display: grid;
  line-height: 1.3;
}
.leg small {
  font-size: 0.72rem;
  color: var(--ink-2);
}
.leg b {
  font-size: 1rem;
}
.leg span {
  font-size: 0.82rem;
  color: var(--ink-2);
}
.leg-ride {
  background: #e9ecff;
  border-color: #b7c0f2;
}
.leg-ride .ico {
  color: #3c4ab0;
}
/* 地図の線路（SVG） */
.m-rail-base {
  fill: none;
  stroke: #5b6cc9;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.m-rail {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-dasharray: 7 7;
  stroke-linecap: butt;
}
