/* 書体はサイトの中に置く(SIL Open Font License。ライセンス文は fonts/ にある) */
@font-face { font-family: 'Mochiy Pop One'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/mochiypopone-fareneko.woff2') format('woff2'); }
@font-face { font-family: 'YS Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/ibmplexmono-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'YS Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/ibmplexmono-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --bg-2: #121418;
  --bg-3: #191c22;
  --line: #262a32;
  --ink: #ece8dc;
  --ink-dim: #9a968a;
  --ink-faint: #6e6b62;
  --amber: #ffb000;
  --amber-dim: #8c6200;
  --amber-rgb: 255, 176, 0;
  --on-amber: #111;
  --green: #4ade80;
  --green-rgb: 74, 222, 128;
  --red: #ff6b6b;
  --red-rgb: 255, 107, 107;
  --sun: #ff8f8f;
  --sat: #8fb6ff;
  --glow: .07;
  --mono: 'YS Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --disp: 'Mochiy Pop One', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', 'Yu Gothic', Meiryo, sans-serif;
}
/* 白地: 端末がライトのとき、または手動でライトを選んだとき */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #ffffff;
  --bg-3: #fff3c4;
  --line: #e2d6b8;
  --ink: #1d1f2b;
  --ink-dim: #5f5a4c;
  --ink-faint: #8f8873;
  --amber: #d63c14;
  --amber-dim: #1d1f2b;
  --amber-rgb: 214, 60, 20;
  --on-amber: #fff;
  --green: #14833f;
  --green-rgb: 20, 131, 63;
  --red: #d63c14;
  --red-rgb: 214, 60, 20;
  --sun: #d63c14;
  --sat: #2f6fe0;
  --glow: 0;
  /* ゲーム風の白地だけで使う色 */
  --edge: #1d1f2b;
  --coin: #ffc93c;
  --sky: #2f6fe0;
  --leaf: #8be28f;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; min-height: 100vh;
  background: radial-gradient(1000px 420px at 75% -10%, rgba(var(--amber-rgb), var(--glow)), transparent 60%), var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
header.top, nav.tabs, main, footer { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
header.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px 24px; padding-top: 32px; padding-bottom: 20px; }
.brand { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
.brand h1 { margin: 0; font-family: var(--disp); font-weight: 400; font-size: clamp(32px, 6vw, 48px); letter-spacing: .02em; color: var(--ink); }
.brand h1 span { color: #ffb000; } /* 機長ネコの毛と同じ色 */
.brand .sub { grid-column: 2; margin: 0; color: var(--ink-dim); font-size: 14px; }
img { image-rendering: pixelated; }
.mark { display: block; width: 58px; height: 51px; grid-row: span 2; }
.neko-mini { width: 34px; height: 30px; margin-right: 8px; vertical-align: -6px; }
.meta { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 26px; margin: 0; }
.meta dt { font-size: 11px; color: var(--ink-faint); }
.meta dd { margin: 0; font-family: var(--mono); font-size: 14px; }
.theme { align-self: center; display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--line); border-radius: 4px; padding: 5px 10px; font-size: 13px; color: var(--ink-dim); }
.theme:hover { color: var(--ink); border-color: var(--ink-faint); }
.theme svg { width: 15px; height: 15px; fill: currentColor; }

/* 絞り込み */
nav.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; border-bottom: 1px solid var(--line); }
.group { display: flex; flex-wrap: wrap; gap: 4px; }
.group button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ink-dim); font-weight: 500; padding: 10px 12px; margin-bottom: -1px; }
.group button:hover { color: var(--ink); }
.group button[aria-pressed="true"] { color: var(--amber); border-bottom-color: var(--amber); }
.opts { margin-left: auto; display: flex; align-items: center; gap: 16px; padding: 6px 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--ink-dim); font-size: 14px; padding: 5px 14px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--on-amber); font-weight: 700; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-dim); cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--amber); margin: 0; }

main { padding-top: 24px; padding-bottom: 48px; display: grid; gap: 44px; }
h2 { margin: 0; font-family: var(--disp); font-weight: 400; font-size: 21px; letter-spacing: .01em; }
.count { display: inline-block; min-width: 2ch; padding: 0 7px; margin-left: 6px; border-radius: 3px; background: var(--amber); color: var(--on-amber); font-family: var(--mono); font-weight: 600; font-size: 15px; text-align: center; vertical-align: 2px; }
.rule { margin: 2px 0 0; color: var(--ink-dim); font-size: 13px; }
.rule b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.collecting { margin: 10px 0 0; font-size: 13px; color: var(--amber); }

/* 掘り出し物ボード */
.board { padding: 0; }
.board-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 20px; }
/* 掘り出し物: どこへ / いつ / いくら */
.deals { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.deal { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr) 236px; gap: 32px; align-items: center; padding: 20px 24px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.deal:hover { border-color: var(--amber-dim); }

.where .route { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--ink-dim); }
.where .route .codes { font-family: var(--mono); color: var(--amber); letter-spacing: .04em; }
.where .city { margin: 2px 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.where .city b { font-size: 26px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.where .city span { font-size: 12px; color: var(--ink-dim); letter-spacing: .12em; text-transform: uppercase; }
.where .carrier { font-size: 13px; color: var(--ink-dim); }
.where .carrier .code { font-family: var(--mono); font-weight: 600; color: var(--amber); margin-right: 6px; }
.where .carrier .direct { color: var(--green); }

.when .leg { display: flex; align-items: baseline; gap: 10px; line-height: 1.5; }
.when .leg + .leg { margin-top: 2px; }
.when .lbl { flex: none; font-size: 11px; color: var(--ink-dim); border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; }
.dt { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt .wd { font-weight: 500; font-size: 15px; margin-left: 1px; color: var(--ink-dim); }
.dt .w0 { color: var(--sun); } .dt .w6 { color: var(--sat); }
.when .rel { margin-top: 4px; font-size: 12px; color: var(--ink-dim); }

.cost { text-align: right; }
.tagline { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.off { font-family: var(--mono); font-weight: 600; font-size: 13px; line-height: 1.4; padding: 4px 10px; border-radius: 4px; letter-spacing: .02em; color: var(--green); background: rgba(var(--green-rgb), .1); border: 1px solid rgba(var(--green-rgb), .35); white-space: nowrap; }
.low .off { color: var(--amber); background: rgba(var(--amber-rgb), .08); border-color: rgba(var(--amber-rgb), .35); }
.ref { font-size: 11px; color: var(--ink-faint); }
.price { margin-top: 14px; font-family: var(--mono); font-weight: 600; font-size: 28px; line-height: 1.15; color: var(--amber); white-space: nowrap; }
.price small { font-family: var(--sans); font-weight: 400; font-size: 12px; color: var(--ink-faint); margin-left: 8px; }
.usual { margin-top: 8px; font-size: 12px; color: var(--ink-dim); }
.usual s { margin-left: 4px; }
.usual s { font-family: var(--mono); text-decoration-color: rgba(var(--red-rgb), .7); }
.go { display: inline-block; margin-top: 16px; font-size: 13px; font-weight: 500; color: var(--amber); border: 1px solid var(--amber-dim); padding: 7px 14px; border-radius: 4px; text-decoration: none; white-space: nowrap; }
.go:hover { background: var(--amber); color: var(--on-amber); }
.spark { width: 100%; height: 26px; display: block; }
.spark path { fill: none; stroke: var(--ink-dim); stroke-width: 1.2; }
.spark .baseline { stroke: rgba(var(--amber-rgb), .5); stroke-dasharray: 2 3; }
.spark .today { fill: var(--green); }
.empty { display: flex; align-items: center; gap: 16px; color: var(--ink-dim); font-size: 14px; padding: 20px 24px; margin: 16px 0 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.empty[hidden] { display: none; }
.empty p { margin: 0; }
.foot { margin: 10px 0 0; padding: 0 2px; font-size: 12px; color: var(--ink-faint); }

/* 路線ごと */
.routes .rule { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.grp { grid-column: 1 / -1; margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--ink-dim); }
.grp:first-child { margin-top: 0; }
.card { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); text-decoration: none; color: inherit; }
.card:hover { border-color: var(--amber-dim); }
.card.hit { border-color: rgba(var(--green-rgb), .45); }
.c-city b { font-size: 18px; font-weight: 700; color: var(--ink); }
.c-city span { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.c-price { text-align: right; font-family: var(--mono); font-weight: 600; font-size: 20px; color: var(--amber); white-space: nowrap; }
.c-city { min-width: 0; }
.c-date { grid-column: 1 / -1; margin-top: 2px; }
.c-date .dt { font-size: 15px; }
.c-date .dt .wd { font-size: 13px; }
.c-date .arrow { color: var(--ink-faint); margin: 0 4px; }
.c-air { font-size: 12px; color: var(--ink-dim); }
.delta { text-align: right; font-size: 12px; white-space: nowrap; align-self: center; }
.delta.down { color: var(--green); } .delta.up { color: var(--red); } .delta.na { color: var(--ink-faint); }
.card .spark { grid-column: 1 / -1; margin-top: 6px; }

/* 終わった掘り出し物 */
.ended { margin-top: 24px; }
.ended h3 { margin: 0 0 8px; font-size: 14px; color: var(--ink-dim); }
.ended ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ended li { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-dim); background: var(--bg); }
.ended li b { color: var(--ink-dim); font-weight: 500; }
.was-price { font-family: var(--mono); text-decoration: line-through; }
.end-state { margin-left: auto; color: var(--red); font-weight: 700; }
.where .city b a { color: inherit; text-decoration: none; }
.where .city b a:hover { text-decoration: underline; }
footer a { color: inherit; }

/* 英語ページ: 見出しの書体はロゴの文字しか持たないので、見出しは本文の太字にする */
html[lang="en"] h2 { font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
.lang { text-decoration: none; }

/* 路線ページ */
.sub-top { max-width: 1180px; margin: 0 auto; padding: 20px 16px 12px; position: relative; }
.logo-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--disp); font-size: 24px; color: var(--ink); }
.logo-link i { font-style: normal; color: #ffb000; }
.sub-top { display: flex; justify-content: space-between; align-items: center; }
.sub-lang { font-size: 14px; color: var(--ink-dim); }
.crumb { font-size: 13px; color: var(--ink-dim); }
.crumb a { color: inherit; }
.rp-title { margin: 12px 0 6px; font-family: var(--sans); font-weight: 700; font-size: clamp(24px, 5vw, 34px); line-height: 1.3; }
.sub-page h2, .sub-page h3 { font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
.rp-lead { margin: 0; color: var(--ink-dim); }
.rp-hit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 14px 0 0; font-weight: 700; }
.rp-hit a { color: inherit; white-space: nowrap; }
.sub-page main { display: block; }
.rp-grid { display: grid; gap: 16px; margin-top: 20px; }
@media (min-width: 860px) { .rp-grid { grid-template-columns: 1fr 1fr; } }
.rp-fare { padding: 20px 24px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.rp-fare h2, .rp-others h2 { font-size: 17px; }
.rp-fare h3 { margin: 18px 0 6px; font-size: 14px; color: var(--ink-dim); }
.rp-fare p { margin: 4px 0; }
.rp-fare .price { text-align: left; }
.rp-chart { display: block; width: 100%; height: auto; color: var(--amber); }
.rp-deal { max-width: 560px; margin-top: 16px; }
.rp-deal .rp-off { margin: 0 0 14px; }
.rp-deal .price small { font-size: 14px; font-weight: 400; color: var(--ink-dim); }
.rp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0; }
.rp-facts dt { font-size: 12px; color: var(--ink-dim); }
.rp-facts dd { margin: 2px 0 0; font-weight: 700; }
.rp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 4px; }
.rp-share { margin-top: 16px; color: inherit; font-size: 14px; }
.rp-more { margin-top: 20px; }
.rp-others { margin-top: 32px; }
.rp-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rp-links a { padding: 6px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; }
.rp-links a:hover { border-color: var(--amber-dim); }
.sub-page footer { max-width: 1180px; margin: 32px auto 0; }

footer { color: var(--ink-faint); font-size: 12px; border-top: 1px solid var(--line); padding-top: 14px; padding-bottom: 36px; }
footer p { margin: 3px 0; }
#demoNote { color: var(--amber); }

/* スマホ: どこへ → いつ → いくら を縦に */
@media (max-width: 760px) {
  .deal { grid-template-columns: 1fr; gap: 12px; padding: 18px 16px; }
  .where .city b { font-size: 24px; }
  .when { padding: 10px 12px; background: var(--bg-3); border-radius: 6px; }
  .cost { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "tag go" "price go" "usual go"; text-align: left; align-items: center; column-gap: 16px; padding-top: 4px; }
  .tagline { grid-area: tag; justify-content: flex-start; }
  .price { grid-area: price; margin-top: 12px; }
  .usual { grid-area: usual; }
  .go { grid-area: go; margin-top: 0; padding: 12px 16px; font-size: 14px; }
  .opts { margin-left: 0; width: 100%; padding-bottom: 10px; }
}

/* ===== 白地: ゲーム風(太い枠・ぼかさない影・はっきりした4色) ===== */
[data-theme="light"] body { background: url('neko/pattern.svg') 0 0 / 96px 96px repeat, var(--bg); }
[data-theme="light"] .meta dd { font-weight: 600; }
[data-theme="light"] .theme { background: #fff; color: var(--ink); border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--edge); font-weight: 700; }
[data-theme="light"] .theme:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--edge); }

[data-theme="light"] nav.tabs { border-bottom: 2px solid var(--edge); }
[data-theme="light"] .group button { font-weight: 700; color: var(--ink-dim); border-bottom-width: 4px; margin-bottom: -2px; }
[data-theme="light"] .group button[aria-pressed="true"] { color: var(--amber); border-bottom-color: var(--amber); }
[data-theme="light"] .seg { border: 2px solid var(--edge); border-radius: 6px; box-shadow: 2px 2px 0 var(--edge); background: #fff; }
[data-theme="light"] .seg button { color: var(--ink); font-weight: 700; }
[data-theme="light"] .seg button + button { border-left: 2px solid var(--edge); }
[data-theme="light"] .seg button[aria-pressed="true"] { background: var(--sky); color: #fff; }
[data-theme="light"] .toggle { color: var(--ink); font-weight: 700; }

[data-theme="light"] h2 { color: var(--ink); }
[data-theme="light"] .count { background: var(--amber); color: #fff; border: 2px solid var(--edge); }

[data-theme="light"] .rp-fare,
[data-theme="light"] .deal,
[data-theme="light"] .card,
[data-theme="light"] .empty { border: 2px solid var(--edge); border-radius: 8px; box-shadow: 4px 4px 0 var(--edge); transition: transform .12s, box-shadow .12s; }
[data-theme="light"] .deal:hover,
[data-theme="light"] .card:hover { border-color: var(--edge); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--edge); }
[data-theme="light"] .card.hit { box-shadow: 4px 4px 0 var(--green); }

[data-theme="light"] .where .route .codes,
[data-theme="light"] .where .carrier .code { color: var(--sky); font-weight: 600; }
[data-theme="light"] .where .city b { color: var(--ink); }
[data-theme="light"] .when .lbl { background: var(--sky); color: #fff; border: 2px solid var(--edge); font-weight: 700; }
[data-theme="light"] .off { background: var(--leaf); color: #0f2d17; border: 2px solid var(--edge); }
[data-theme="light"] .low .off { background: var(--coin); color: #3a2a00; border-color: var(--edge); }
[data-theme="light"] .price { font-weight: 700; }
[data-theme="light"] .go { background: var(--coin); color: var(--edge); border: 2px solid var(--edge); border-radius: 6px; box-shadow: 3px 3px 0 var(--edge); font-weight: 700; }
[data-theme="light"] .go:hover { background: #ffd863; color: var(--edge); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); }
[data-theme="light"] .c-city span { color: var(--sky); }
[data-theme="light"] footer { border-top: 2px solid var(--edge); }

@media (max-width: 760px) {
  [data-theme="light"] .when { border: 2px dashed rgba(29, 31, 43, .35); }
}
@media (prefers-reduced-motion: reduce) {
  [data-theme="light"] .deal:hover, [data-theme="light"] .card:hover, [data-theme="light"] .go:hover { transform: none; }
}
