/* レイアウト: 上のバー (名前と入手ボタン) → 1 行の見出し → 下線のタブ → 短い説明と画面。箱や帯を重ねず、1 画面に 1 つのことだけ */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --ink: #1c1d21; --muted: #646a78; --line: #e1e4ea;
  --accent: #e8762b; --accent-soft: #fde9d9; --primary: #42598c; --primary-soft: #e3e8f3;
  --open: #2f8a57; --open-soft: #dcf1e4; --closed: #42598c; --on-badge: #ffffff; --gold: #d9a11a;
  --cat: #1b1b1f; --cat-eye: #f5c542;
  --display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif;
  --body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131418; --surface: #1c1e24; --ink: #eceef2; --muted: #a3a8b5; --line: #2e313a;
    --accent: #f08a45; --accent-soft: #3a2618; --primary: #9fb3e0; --primary-soft: #252c3d;
    --open: #5cc28a; --open-soft: #1b3326; --closed: #9fb3e0; --on-badge: #131418; --gold: #e8b93a; --cat: #050506; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131418; --surface: #1c1e24; --ink: #eceef2; --muted: #a3a8b5; --line: #2e313a;
  --accent: #f08a45; --accent-soft: #3a2618; --primary: #9fb3e0; --primary-soft: #252c3d;
  --open: #5cc28a; --open-soft: #1b3326; --closed: #9fb3e0; --on-badge: #131418; --gold: #e8b93a; --cat: #050506; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.7; }
.wrap { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2 { font-family: var(--display); line-height: 1.4; margin: 0; }
p, li { margin: 0; text-wrap: pretty; }
.ph { display: inline-block; }
.nw { white-space: nowrap; }
a:focus-visible, label:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* 上のバー */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--bg); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 9px; }
.brand { flex: none; white-space: nowrap; display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 900; font-size: 18px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand small { font-family: var(--body); font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 1px 8px; border-radius: 999px; }
.get { display: inline-flex; align-items: center; height: 40px; font-size: 13px; font-weight: 700; padding: 0 12px; border-radius: 999px; background: var(--ink); color: var(--bg); text-decoration: none; white-space: nowrap; }
.get[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* 上のバーの言語切り替え (details なのでスクリプトなしでも開く) */
.top-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink); height: 40px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu .glyph { font-size: 12px; letter-spacing: -1px; }
.lang-menu .caret { font-size: 10px; color: var(--muted); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; min-width: 150px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px -12px rgba(20, 22, 30, .35); z-index: 30; }
.lang-menu li a { display: block; padding: 7px 12px; border-radius: 8px; font-size: 14px; color: var(--ink); text-decoration: none; }
.lang-menu li a:hover { background: var(--bg); }
.lang-menu li a[aria-current="true"] { font-weight: 700; color: var(--accent); }
/* スマホで狭いときは「文A ▾」だけ */
@media (max-width: 480px) { .lang-menu .lname { display: none; } .lang-menu summary { padding: 0 7px; gap: 3px; } .get { padding: 0 10px; font-size: 12px; } .topbar .wrap { gap: 8px; } .top-right { gap: 4px; } }
/* さらに狭い端末 (幅 360 など) はアプリ名を隠してアイコンだけ */
@media (max-width: 380px) { .brand .bname { display: none; } }

/* 見出し */
.intro .wrap { padding-block: 20px 8px; text-align: center; }
.intro h1 { font-size: clamp(22px, 5vw, 40px); font-weight: 900; text-wrap: balance; }
/* 日本語・中国語・韓国語は短いので 1 行に収める */
:lang(ja) .intro h1, :lang(zh) .intro h1, :lang(ko) .intro h1 { font-size: clamp(18px, 5.4vw, 40px); white-space: nowrap; }
:lang(ru) .intro h1 { font-size: clamp(22px, 5vw, 34px); }
.intro p { margin-top: 6px; font-size: 13px; color: var(--muted); text-wrap: balance; }

/* タブ (下線。CSS だけで切り替え) と、その上を歩く猫 */
.tabs { position: relative; margin-top: 8px; }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.ground { position: relative; height: 32px; border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .tabbar .ink { transition: none; } }
/* タブ: 下線。横にスワイプしても切り替わる (パネルは横に並べてスナップ) */
.tabbar { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 440px; margin: 10px auto 0; }
.tabbar a { text-align: center; padding: 8px 4px 10px; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--muted); text-decoration: none; }
.tabbar a[aria-current="true"] { color: var(--accent); }
.tabbar.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 300px; }
.tabbar.two .ink { width: 50%; }
.tabbar .ink { position: absolute; left: 0; bottom: 0; width: calc(100% / 3); height: 3px; border-radius: 3px; background: var(--accent); transition: transform .25s ease; }
/* 中身は横に動かさず、選んだタブの分だけ出す。左右のスワイプでタブが替わる (縦のスクロールはそのまま) */
.track { touch-action: pan-y; }
.panel { min-width: 0; padding-block: 22px 32px; }
.panel { display: grid; }
.panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .panel.show { animation: fade .2s ease-out; } @keyframes fade { from { opacity: 0; } to { opacity: 1; } } }
.p-tour, .p-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.panel h2 { font-size: clamp(20px, 3vw, 28px); }
.why { margin-top: 6px; color: var(--muted); font-size: 14px; }
.points { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.points li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: center; font-weight: 500; }
.points li::before { content: ""; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.5l2.6 2.6L11 4.4' fill='none' stroke='%23e8762b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; }
.more { display: inline-block; margin-top: 20px; font-weight: 700; font-size: 15px; color: #fff; background: var(--accent); padding: 10px 22px; border-radius: 999px; text-decoration: none; cursor: pointer; box-shadow: 0 4px 12px -6px rgba(232, 118, 43, .7); }
.more:active { transform: translateY(1px); }
.phone { justify-self: center; width: min(100%, 240px); border-radius: 24px; border: 7px solid #1b1c20; background: #1b1c20; overflow: hidden; box-shadow: 0 16px 36px -20px rgba(20, 22, 30, .5); }
.phone img { display: block; width: 100%; height: auto; }

/* 実際の募集 */
.p-list { gap: 14px; }
.list-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; overflow: hidden; }
.card.featured { border: 2px solid var(--gold); }
.ribbon { position: absolute; top: 12px; right: -36px; transform: rotate(45deg); background: var(--gold); color: #3b2a00; font-size: 11px; font-weight: 700; padding: 2px 40px; }
.card .top { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; }
.icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 19px; color: #fff; }
img.icon { object-fit: cover; display: block; }
.empty { color: var(--muted); }
.title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.title h2 { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* クローズドは紺、オープンは緑で塗る (ひと目で見分けられるように) */
.badge { flex: none; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--closed); color: var(--on-badge); }
.badge.open { background: var(--open); color: var(--on-badge); }
.badge.form { background: var(--accent-soft); color: var(--accent); }
.posted { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.desc { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.count { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.count b { color: var(--ink); }
.bar { flex: 0 1 64px; min-width: 20px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.join { flex: none; font-weight: 700; font-size: 14px; color: #fff; background: var(--accent); padding: 7px 16px; border-radius: 999px; text-decoration: none; box-shadow: 0 4px 10px -6px rgba(232, 118, 43, .7); }
.join:active { transform: translateY(1px); }

/* 歩く猫 (タブの上の線を行ったり来たり) */
.walker { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cat { position: absolute; left: 4%; bottom: 0; width: 48px; height: 30px; }
.cat svg { width: 100%; height: 100%; display: block; }
.cat::after { content: ""; position: absolute; left: 14%; right: 10%; bottom: -3px; height: 5px; border-radius: 50%; background: var(--ink); opacity: .14; }
.cat .body, .cat .head, .cat .ear, .cat .leg { fill: var(--cat); }
.cat .tail { fill: none; stroke: var(--cat); stroke-width: 4; stroke-linecap: round; }
.cat .eye { fill: var(--cat-eye); }
@media (prefers-reduced-motion: no-preference) {
  .cat { animation: walk 18s ease-in-out infinite; }
  .cat .leg.a { animation: step .5s ease-in-out infinite alternate; transform-origin: top center; transform-box: fill-box; }
  .cat .leg.b { animation: step .5s ease-in-out infinite alternate-reverse; transform-origin: top center; transform-box: fill-box; }
  .cat .tail { animation: wag 1.2s ease-in-out infinite alternate; transform-origin: 14px 22px; }
  @keyframes walk {
    0% { left: 4%; transform: scaleX(1); } 44% { left: calc(96% - 48px); transform: scaleX(1); }
    50% { left: calc(96% - 48px); transform: scaleX(-1); } 94% { left: 4%; transform: scaleX(-1); } 100% { left: 4%; transform: scaleX(1); }
  }
  @keyframes step { from { transform: rotate(14deg); } to { transform: rotate(-14deg); } }
  @keyframes wag { from { transform: rotate(-8deg); } to { transform: rotate(10deg); } }
}

footer .wrap { padding-block: 16px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; font-size: 12px; color: var(--muted); }
footer a { color: var(--muted); }
.social { display: flex; gap: 10px; }
.social a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 13px; }
.social svg { width: 14px; height: 14px; fill: currentColor; }

@media (max-width: 860px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .p-tour, .p-board { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .phone { width: min(64%, 220px); order: 2; border-width: 6px; border-radius: 20px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .tabbar a { font-size: 15px; }
}

/* 言語の切り替え (いちばん下) */
main { touch-action: pan-y; }
.play-icon { margin-right: 6px; vertical-align: -2px; }
/* いちばん上のページ (言語を選ぶ。ふつうはスクリプトで自動で移る) */
/* 募集のリンク (/r/<募集ID>) のページ: アプリかストアへ移るまでの一瞬だけ見える */
.recruit { text-align: center; padding-block: 48px; display: grid; gap: 12px; justify-items: center; }
.recruit img { border-radius: 16px; }
.recruit .get { display: inline-block; }

/* 共有のボタン (上のバーの言語の隣と、募集のカード)。端末の共有画面が無いときは下から小さなシートを出す */
.share-site { flex: none; width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.share-site:active, .share-card:active { transform: translateY(1px); }
.actions { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.share-card { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0; }
.share-site:focus-visible, .share-card:focus-visible, .sheet button:focus-visible, .sheet a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.share-sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-end; justify-content: center; }
.share-sheet[hidden] { display: none; }
.sheet { width: min(420px, 100%); margin: 0 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-radius: 20px; padding: 12px; display: grid; gap: 8px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); }
.sheet a, .sheet button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 700 15px var(--body); text-decoration: none; cursor: pointer; }
.sheet svg { width: 16px; height: 16px; fill: currentColor; }
.sheet .sheet-close { border: 0; background: transparent; color: var(--muted); font-weight: 500; }
/* とても狭い画面 (320px など) では、上のバーのボタンを少し詰める */
@media (max-width: 360px) { .share-site { width: 38px; height: 38px; } .lang-menu summary { height: 38px; padding: 0 8px; } .get { height: 38px; padding: 0 8px; font-size: 11px; } .top-right { gap: 3px; } .lang-menu .caret { display: none; } }
@media (max-width: 340px) { :lang(ja) .intro h1, :lang(zh) .intro h1, :lang(ko) .intro h1 { font-size: 15.5px; } }
@media (max-width: 360px) { .topbar .wrap { padding-left: 12px; padding-right: 12px; gap: 4px; } }
/* Google Play のボタン: スマホでは「Google Play」だけにして上のバーに余裕を作る (言語で長さが違うため) */
.get .short { display: none; }
@media (max-width: 480px) { .get .long { display: none; } .get .short { display: inline; } }
