/* 北海道の市町村データ（/furusato-nozei/） */
:root {
  --ink: #2c313b;
  --ink-2: #5d626b;
  --ink-3: #8a8e95;
  --paper: #fbfaf7;
  --card: #ffffff;
  --line: #e4e1da;
  --accent: #ae8174;       /* 見出しの帯（旧サイトの見出しから） */
  --accent-soft: #f4ece9;
  --link: #1c5cab;
  --bar: #2a78d6;
  --mark: #1c5cab;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
a { color: var(--link); }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ---- 枠 ---- */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  flex-wrap: wrap;
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 16px 6px;
}
header.site a { color: var(--ink); text-decoration: none; }
.logo img { display: block; width: 150px; height: auto; }
/* メニューボタン（右上） */
.menu-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; font: inherit; font-size: 0.85em; font-weight: 700;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.menu-btn:hover { border-color: var(--accent); }
.menu-ico { display: inline-grid; gap: 3px; width: 16px; }
.menu-ico i { display: block; height: 2px; background: var(--accent); border-radius: 1px; transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] .menu-ico i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-ico i:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .menu-ico i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* 主な入口の帯（スマホでは横にスクロール。PC はマウスで横に動かせないので、折り返して全部見せる） */
.gnav { max-width: 820px; margin: 4px auto 8px; padding: 0 16px; }
.gnav ul {
  position: relative; list-style: none; margin: 0; padding: 0 0 2px; display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gnav ul::-webkit-scrollbar { display: none; }
.gnav a {
  display: block; white-space: nowrap; padding: 6px 12px; font-size: 0.85em; font-weight: 700;
  color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent;
}
.gnav a:hover { color: var(--accent); }
.gnav a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
@media (min-width: 641px) {
  .gnav ul { flex-wrap: wrap; gap: 0; overflow: visible; }
  .gnav a { padding: 5px 8px; }
}
@media (max-width: 640px) {
  .gnav { padding: 0; }
  .gnav ul { padding: 0 12px 2px; mask-image: linear-gradient(to right, #000 88%, transparent); }
}

/* 全部の入口（メニューボタンで開く） */
.menu {
  position: fixed; inset: 0; z-index: 950; overflow-y: auto;
  background: rgba(44, 49, 59, .35); padding: 64px 12px 24px;
}
.menu[hidden] { display: none; }
.menu-in {
  max-width: 820px; margin: 0 auto; padding: 18px 20px 12px; background: var(--paper);
  border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 22px;
}
.menu section h2 {
  margin: 8px 0 6px; padding: 0 0 4px; font-size: 0.85em; color: var(--accent);
  background: none; border-bottom: 1px solid var(--line);
}
.menu section h2::before, .menu section h2::after { display: none; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li a { display: block; padding: 6px 2px; font-size: 0.92em; color: var(--ink); text-decoration: none; }
.menu li a:hover { color: var(--accent); }
.menu-subs { grid-column: 1 / -1; }
.menu-subs ul { display: flex; flex-wrap: wrap; gap: 0 14px; }
.menu-close { grid-column: 1 / -1; text-align: center; margin: 8px 0 4px; }
.menu-x { padding: 8px 28px; font: inherit; font-size: 0.9em; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
body.menu-open { overflow: hidden; }

/* トップに戻る（右下。lakes などと同じ動き） */
.to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 900;
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s, transform .25s, visibility .25s, box-shadow .2s;
}
.to-top.show { opacity: .9; visibility: visible; transform: none; }
.to-top:hover { opacity: 1; box-shadow: 0 4px 12px rgba(0, 0, 0, .28); }
.to-top:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; opacity: 1; }
main[tabindex="-1"]:focus { outline: none; }
@media (max-width: 600px) { .to-top { width: 42px; height: 42px; } }
@media (prefers-reduced-motion: reduce) { .to-top, .menu-ico i { transition: none; } }
.crumbs {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
  font-size: 0.78em;
  color: var(--ink-3);
}
.crumbs a { color: var(--ink-2); }
.crumbs > * + *::before { content: "›"; margin: 0 0.5em; color: var(--ink-3); }
main { max-width: 820px; margin: 0 auto; padding: 8px 16px 48px; }
footer.site {
  border-top: 1px solid var(--line);
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  font-size: 0.85em;
  color: var(--ink-2);
}
footer.site a { color: var(--ink-2); }
.small { font-size: 0.85em; }

/* ---- 見出し ---- */
h1 {
  font-size: 1.6em;
  line-height: 1.4;
  margin: 18px 0 4px;
  letter-spacing: 0.02em;
}
.h1-sub { display: block; font-size: 0.6em; color: var(--accent); font-weight: 700; letter-spacing: 0.08em; }
.meta { color: var(--ink-3); font-size: 0.85em; margin: 0 0 16px; }

/* 斜めに切った帯を上と下に置く（旧サイトの見出しの形） */
h2 {
  position: relative;
  color: var(--accent);
  background: var(--card);
  font-size: 1.25em;
  line-height: 1.5;
  padding: 14px 16px;
  margin: 48px 0 16px;
}
h2::before,
h2::after {
  content: "";
  position: absolute;
  width: 50%;
  height: 5px;
  background: var(--accent);
}
h2::before { left: 0; top: 0; clip-path: polygon(0 0, 100% 0, 70% 100%, 0 100%); }
h2::after { right: 0; bottom: 0; clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); }
h3 { font-size: 1.05em; margin: 28px 0 8px; }

/* ---- 本文 ---- */
.lead { font-size: 1.02em; }
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 20px 0;
}
.facts > div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}
.facts .k { display: block; font-size: 0.75em; color: var(--ink-2); }
.facts .v { display: block; font-size: 1.35em; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.facts small { font-size: 0.6em; font-weight: 400; margin-left: 2px; }
@media (max-width: 600px) { .facts { grid-template-columns: repeat(2, 1fr); } }

.note { font-size: 0.8em; color: var(--ink-2); }
.pr {
  display: inline-block;
  font-size: 0.72em;
  border: 1px solid var(--ink-3);
  color: var(--ink-2);
  border-radius: 3px;
  padding: 0 5px;
  margin-left: 4px;
  line-height: 1.5;
  vertical-align: 1px;
}

/* ---- 表 ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.88em; background: var(--card); }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { font-size: 0.85em; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid var(--line); white-space: nowrap; }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td small { font-size: 0.8em; color: var(--ink-3); margin-left: 1px; }
.rank .r { text-align: center; font-weight: 700; width: 3em; }
.rank tbody tr:nth-child(-n+3) .r { color: var(--accent); }
.rank td.name, .trend td:first-child { white-space: nowrap; }
.sub { display: block; font-size: 0.78em; color: var(--ink-3); }
.parts { display: block; font-size: 0.75em; color: var(--ink-2); }
.more-btn { text-align: center; }
.more-btn button {
  font: inherit;
  font-size: 0.9em;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 20px;
  cursor: pointer;
  color: var(--ink);
}
.more-btn button:hover { border-color: var(--ink-3); }
.trend tr.sum td { font-weight: 700; border-top: 2px solid var(--line); }

/* 振興局×月の表 */
.heat { font-size: 0.78em; }
.heat th, .heat td { padding: 6px 4px; text-align: center; white-space: nowrap; }
.heat tbody th { text-align: left; font-weight: 600; }
.heat td { border-left: 2px solid var(--card); color: var(--ink); font-variant-numeric: tabular-nums; }
.heat td.dk { color: #fff; }

/* ---- 地図とグラフ ---- */
.map-wrap { margin: 8px 0 0; }
svg.map { width: 100%; height: auto; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
svg.map path { stroke: #fff; stroke-width: 0.6; stroke-linejoin: round; }
svg.map path.none { stroke: #d6d3cc; }
svg.map a path:hover, svg.map path:hover { stroke: var(--ink); stroke-width: 1.5; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0; margin: 8px 0 0; font-size: 0.78em; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }

svg.chart { width: 100%; height: auto; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; }
svg.chart .grid { stroke: #eceae5; stroke-width: 1; }
svg.chart .grid.base { stroke: #c9c6bf; }
svg.chart .tick { font-size: 11px; fill: var(--ink-2); }
svg.chart .val { font-size: 12px; font-weight: 700; fill: var(--ink); }
svg.chart .bar { fill: var(--bar); }
svg.chart .bar.mark { fill: var(--mark); }
svg.chart .hit { fill: transparent; }
svg.chart .hit:hover { fill: rgba(44, 49, 59, 0.05); }

#tip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 0.8em;
  padding: 4px 9px;
  border-radius: 4px;
  white-space: nowrap;
}

/* 横棒（振興局別など） */
.hbars { list-style: none; padding: 0; margin: 8px 0; font-size: 0.88em; }
.hbars li { display: grid; grid-template-columns: 6.5em 1fr 9em; align-items: center; gap: 8px; padding: 3px 0; }
.hb-bar { background: #f0eee9; border-radius: 0 4px 4px 0; height: 14px; }
.hb-bar i { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.hb-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-val small { color: var(--ink-3); }
.hb-pct { color: var(--ink-2); font-size: 0.85em; margin-left: 4px; }
@media (max-width: 480px) { .hbars li { grid-template-columns: 5em 1fr 7.5em; } }

/* ---- 返礼品 ---- */
.shop { margin: 20px 0 8px; }
.shop h3 { margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; }
.shop h3 .sub { display: inline; }
.gifts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 640px) { .gifts { grid-template-columns: repeat(2, 1fr); } }
.gifts a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.8em;
  line-height: 1.5;
}
.gifts a:hover { border-color: var(--ink-3); }
.gifts img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; margin-bottom: 6px; }
.g-name { flex: 1; }
.g-price { font-weight: 700; margin-top: 4px; color: #e0383e; font-size: 1.15em; font-variant-numeric: tabular-nums; }
.g-price small { font-size: 0.7em; margin-left: 1px; }
.g-rev { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 0.9em; }
.stars { position: relative; display: inline-block; color: #e3e0d9; letter-spacing: 1px; line-height: 1; }
.stars::before { content: "★★★★★"; }
.stars i { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: #f5a623; font-style: normal; }
.stars i::before { content: "★★★★★"; }
.g-avg { font-weight: 700; color: var(--ink); }
.g-cnt { color: var(--link); }

/* 返礼品ランキング（市町村ページ）。上に順位の帯、画像、商品名、寄付額、星の縦長カードを並べる */
.g-rank { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 12px; }
.g-rank a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85em;
  line-height: 1.6;
}
.g-rank a:hover { border-color: var(--accent); }
.g-no { display: block; text-align: center; background: #c9ada5; color: #fff; font-weight: 700; font-size: 1.25em; padding: 5px 0; line-height: 1.3; }
.g-no.top { background: var(--accent); font-size: 1.45em; }
.g-no small { font-size: 0.6em; margin-left: 1px; }
.g-img img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: #fff; margin: 0; }
.g-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 10px 12px 12px; }
.g-rank .g-name { font-weight: 700; }
.g-shop { font-size: 0.92em; color: var(--ink-2); }
.g-rank .g-price { margin-top: auto; }
@media (max-width: 520px) {
  .g-rank { grid-template-columns: repeat(2, 1fr); gap: 10px 8px; }
  .g-body { padding: 8px 10px 10px; }
}


/* ---- 下の一覧 ---- */
.about { font-size: 0.85em; color: var(--ink-2); padding-left: 1.2em; }
.others ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.others a, .others span {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85em;
}
.others span[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.others a:hover { border-color: var(--accent); }

/* ---- 一覧のカード ---- */
.cards { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.cards a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink);
}
.cards a:hover { border-color: var(--accent); }
.c-name { font-weight: 700; font-size: 1.05em; }
.c-num { font-size: 1.1em; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-num small { font-size: 0.65em; font-weight: 400; }
.c-sub { font-size: 0.7em; font-weight: 400; color: var(--ink-2); }
.c-top { font-size: 0.78em; color: var(--ink-2); margin-top: 4px; }
/* クイズ・ゲームのカード（lib/quiz.php の play_cards()）。どの行も同じ高さ、左にアイコン、説明は3行まで */
.cards-play { grid-auto-rows: 1fr; }
.cards-play a { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto 1fr; column-gap: 10px; align-content: start; }
.cards-play .c-ico { grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.cards-play .c-name { align-self: center; line-height: 1.4; }
.cards-play .c-top { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) {
  .cards-play a { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .cards-play .c-name { align-self: start; }
  .cards-play .c-ico { grid-row: auto; width: 32px; height: 32px; font-size: 15px; margin-bottom: 4px; }
}

/* ---- 市町村ページ ---- */
.kana { font-size: 0.55em; font-weight: 400; color: var(--ink-2); margin-left: 4px; }
.muni-top { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin: 16px 0; }
@media (max-width: 640px) { .muni-top { grid-template-columns: 1fr; } }
.loc { margin: 0; }
.loc figcaption { font-size: 0.75em; color: var(--ink-3); margin-top: 4px; }
table.basic th { width: 6.5em; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
table.basic td { overflow-wrap: anywhere; }
.titles { list-style: none; padding: 0; margin: 12px 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.titles a {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink);
}
.titles a:hover { border-color: var(--accent); }
.t-rank { grid-row: 1 / 3; font-size: 1.6em; font-weight: 700; color: var(--accent); line-height: 1; }
.t-rank small { font-size: 0.5em; }
.t-label { font-weight: 700; font-size: 0.92em; }
.t-val { font-size: 0.78em; color: var(--ink-2); }
.ranks td small { color: var(--ink-3); }
a.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 0.9em;
}
a.btn:hover { opacity: 0.9; }

/* 写真・タブ・表の開閉 */
.hero { margin: 12px 0 8px; }
.hero img { display: block; width: 100%; height: auto; border-radius: 6px; aspect-ratio: 3 / 2; object-fit: cover; }
.tab-btns { display: flex; gap: 6px; margin: 8px 0 0; flex-wrap: wrap; }
.tab-btns button {
  font: inherit;
  font-size: 0.85em;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 16px;
  cursor: pointer;
  color: var(--ink-2);
}
.tab-btns button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
details.data { margin: 8px 0; }
details.data summary { cursor: pointer; font-size: 0.88em; color: var(--link); }

/* 本文の途中の横型の返礼品カード */
.g-inline { margin: 28px 0; }
.g-inline a {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88em;
  line-height: 1.55;
}
.g-inline a:hover { border-color: #e0383e; }
.g-inline img { width: 140px; height: 140px; object-fit: cover; border-radius: 6px; margin: 0; }
.gi-body { display: flex; flex-direction: column; gap: 3px; }
.gi-label { font-size: 0.8em; font-weight: 700; color: var(--accent); }
.gi-btn {
  align-self: flex-start;
  margin-top: 4px;
  background: #bf0000;
  color: #fff;
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 0.9em;
  font-weight: 700;
}
@media (max-width: 520px) {
  .g-inline a { grid-template-columns: 96px 1fr; gap: 10px; }
  .g-inline img { width: 96px; height: 96px; }
}

/* 地名の由来 */
.level { display: flex; gap: 10px; align-items: flex-start; font-size: 0.82em; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.lv { flex: none; display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; color: #fff; font-weight: 700; font-size: 1.1em; }
.lv-A { background: #1c5cab; }
.lv-B { background: #3987e5; }
.lv-C { background: #8a8e95; }
.src { font-size: 0.78em; color: var(--ink-2); }
.more-link { font-size: 0.9em; }
.yurai { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.yurai li { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.yurai a { text-decoration: none; color: var(--ink); }
.y-name { font-weight: 700; font-size: 1.05em; }
.y-kana { font-size: 0.75em; color: var(--ink-3); margin-left: 6px; }
.yurai p { margin: 4px 0 0; font-size: 0.8em; color: var(--ink-2); line-height: 1.65; }
.yurai .lv { width: 1.6em; height: 1.6em; font-size: 0.85em; margin-right: 6px; vertical-align: 1px; }
.y-wait { color: var(--ink-3) !important; }

/* ---- トップ ---- */
.top-title { font-size: 1.7em; }
.search-box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 20px 0; }
.search-box label { display: block; font-weight: 700; font-size: 0.9em; margin-bottom: 6px; }
.search-box input { width: 100%; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.hits { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.9em; }
.hits a { display: inline-block; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--paper); }
.hits a:hover { border-color: var(--accent); }
.search-box { scroll-margin-top: 12px; }
.sb-subs-label { margin: 12px 0 6px; font-size: 0.82em; font-weight: 700; color: var(--ink-2); }
.sb-subs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.88em; }
.sb-subs a { display: inline-block; padding: 3px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); text-decoration: none; }
.sb-subs a:hover { border-color: var(--accent); }
.sb-more { margin: 10px 0 0; font-size: 0.82em; }
.top10 { list-style: none; padding: 0; margin: 12px 0; counter-reset: rank; }
.top10 li { counter-increment: rank; }
.top10 a { display: grid; grid-template-columns: 2em 7em 1fr 6.5em; align-items: center; gap: 8px; padding: 5px 0; text-decoration: none; color: var(--ink); font-size: 0.92em; border-bottom: 1px solid var(--line); }
.top10 a::before { content: counter(rank); font-weight: 700; color: var(--accent); text-align: center; }
.t10-name { font-weight: 700; }
.t10-bar { background: #f0eee9; height: 12px; border-radius: 0 4px 4px 0; }
.t10-bar i { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.t10-val { text-align: right; font-variant-numeric: tabular-nums; }
.top10 a:hover .t10-name { color: var(--link); }
@media (max-width: 520px) { .top10 a { grid-template-columns: 1.6em 5.5em 1fr 5.5em; font-size: 0.85em; } }
.chips { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { display: inline-flex; flex-direction: column; padding: 5px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); text-decoration: none; color: var(--ink); font-weight: 700; font-size: 0.9em; line-height: 1.35; }
.chips small { font-weight: 400; font-size: 0.75em; color: var(--ink-2); }
.chips a:hover { border-color: var(--accent); }
.subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.subs section { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.subs h3 { margin: 0 0 6px; font-size: 0.95em; color: var(--accent); }
.subs h3 a { color: inherit; }
.subs h3 small { color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.subs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 0.85em; }

th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.8em; }
th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.8em; }

.sym { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sym section { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.sym h3 { margin: 0 0 4px; font-size: 1em; }
.sym h3 small { font-weight: 400; color: var(--ink-3); font-size: 0.75em; margin-left: 6px; }
.sym ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 0.85em; }

/* 控除上限額の計算の箱 */
.calc { margin: 28px 0; padding: 4px 18px 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; }
.calc h2 { margin-top: 12px; }
.calc-lead { font-size: 0.9em; color: var(--ink-2); }
.calc form { display: grid; gap: 12px; }
.calc label { font-size: 0.9em; }
.calc-salary label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.calc-yen { display: inline-flex; align-items: center; gap: 4px; }
.calc input[type=text] { width: 9.5em; padding: 6px 8px; font: inherit; font-size: 1.05em; text-align: right; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.calc input[type=range] { width: 100%; margin: 8px 0 0; accent-color: var(--accent); }
.calc-family { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.calc-family legend { float: left; font-size: 0.9em; margin-right: 6px; }
.calc-kids { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.calc select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.calc-more summary { cursor: pointer; font-size: 0.9em; color: var(--link); }
.calc-more label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.calc-result { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.calc-big { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; font-weight: 700; }
.calc-big span { font-size: 1.1em; }
.calc-big b { font-size: 1.9em; color: var(--accent); margin: 0 2px; font-variant-numeric: tabular-nums; }
.calc-meter { height: 8px; margin: 8px 0 4px; background: var(--accent-soft); border-radius: 4px; overflow: hidden; }
.calc-meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s; }
.calc-fit { font-size: 0.9em; margin: 8px 0 0; }
.calc-detail { font-size: 0.78em; color: var(--ink-3); margin: 6px 0 0; }
.calc-note { font-size: 0.75em; color: var(--ink-3); margin: 4px 0 0; }
/* 上限をこえる返礼品（計算機で入力を動かしたときだけ） */
.g-over { display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: 0.68rem; font-weight: 700; line-height: 1.5; color: #8a5a00; background: #fff4d6; border: 1px solid #ecd28f; border-radius: 4px; vertical-align: middle; white-space: nowrap; }
.formula { padding: 10px 14px; background: var(--accent-soft); border-radius: 6px; font-weight: 700; }

/* クイズ */
.quiz [hidden], .qz-result[hidden] { display: none !important; }
.qz-cover { width: 100%; height: auto; border-radius: 8px; }
.quiz { margin: 20px 0; padding: 14px 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; scroll-margin-top: 12px; }
/* 問題のカードのいちばん上の吹き出し（lib/quiz.php の quiz_tag()）。今日の10問・レベルなど、何の問題かを見せる */
.qz-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 12px; }
.qz-tag b { position: relative; padding: 4px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.92em; }
.qz-tag b::after { content: ''; position: absolute; left: 18px; bottom: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--accent); }
.qz-tag span { font-size: 0.85em; color: var(--ink-2); }
.qz-head { display: flex; justify-content: space-between; font-size: 0.85em; color: var(--ink-2); font-weight: 700; }
.qz-bar { height: 6px; margin: 6px 0 12px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.qz-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.qz-prompt { font-size: 1.15em; font-weight: 700; margin: 0 0 12px; }
.qz-fig { margin: 0 0 12px; }
.qz-fig img { display: block; width: 100%; height: auto; border-radius: 6px; }
.qz-map { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; background: #ae8174; border-radius: 6px; }
/* PC で画面が低いとき、地図・画像の下の選択肢と「次の問題へ」が画面の外にならないよう、高さに上限（左右が余ったら背景の色） */
@media (min-width: 641px) {
  .quiz .qz-map, .quiz .qz-fig img { max-height: calc(100vh - 320px); min-height: 240px; }
  .quiz .qz-fig img { object-fit: contain; background: var(--accent-soft); }
}
.qz-map path { fill: #fff; stroke: #8a8a8a; stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.qz-map.solo { background: var(--accent-soft); }
.qz-map.solo path:not(.on) { visibility: hidden; }
.qz-map.solo path.on { fill: #4b7d8c; }
.qz-quote { margin: 0 0 14px; padding: 12px 16px; background: var(--accent-soft); border-radius: 8px; line-height: 1.9; }
.qz-map path.on { fill: #4b7d8c; stroke: #2f5561; stroke-width: 1.4; }
.qz-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.qz-choice { padding: 12px 10px; font: inherit; font-weight: 700; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; }
.qz-choice:hover:not(:disabled) { border-color: var(--accent); }
.qz-choice:disabled { cursor: default; }
.qz-choice.is-right { border-color: #2e7d4f; background: #e8f4ec; }
.qz-choice.is-right::before { content: '○ '; color: #2e7d4f; }
.qz-choice.is-wrong { border-color: #b3403a; background: #fbeceb; }
.qz-choice.is-wrong::before { content: '× '; color: #b3403a; }
.qz-after { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.qz-judge { font-size: 1.15em; font-weight: 700; margin: 0 0 4px; }
.qz-judge.ok { color: #2e7d4f; }
.qz-judge.ng { color: #b3403a; }
.qz-note { margin: 0 0 12px; font-size: 0.92em; }
.qz-next { padding: 10px 28px; font: inherit; font-weight: 700; color: #fff; background: var(--accent); border: 0; border-radius: 999px; cursor: pointer; }
.qz-result { scroll-margin-top: 12px; }
.qz-total { text-align: center; margin: 20px 0 8px; padding: 18px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.qz-total p { margin: 4px 0; }
.qz-total-label { font-weight: 700; color: var(--ink-2); }
.qz-total-num { font-size: 3.2em; font-weight: 700; color: var(--accent); line-height: 1.1; }
.qz-total-num small { font-size: 0.35em; margin-left: 2px; }
.qz-share { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0; }
.qz-share .btn { display: inline-block; padding: 9px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.9em; }
.qz-share .btn-main { background: var(--accent); border-color: var(--accent); color: #fff; }
.qz-review { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; counter-reset: q; }
.qz-review li { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid #2e7d4f; border-radius: 8px; }
.qz-review li.ng { border-left-color: #b3403a; }
.qz-review p { margin: 0 0 6px; }
.qz-r-head { display: flex; gap: 8px; font-weight: 700; }
.qz-mark { flex: none; }
li.ok .qz-mark { color: #2e7d4f; }
li.ng .qz-mark { color: #b3403a; }
.qz-r-head::before { counter-increment: q; content: 'Q' counter(q); color: var(--ink-3); flex: none; }
.qz-r-note { font-size: 0.88em; color: var(--ink-2); }
.qz-r-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.88em; }
.qz-gift { display: flex; gap: 10px; align-items: center; margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; color: var(--ink); font-size: 0.85em; line-height: 1.5; }
.qz-gift:hover { border-color: var(--accent); }
.qz-gift img { flex: none; width: 80px; height: 80px; object-fit: contain; }
.qz-gift-body { display: flex; flex-direction: column; gap: 2px; }
.qz-gift-label { font-size: 0.85em; color: var(--ink-3); }

/* ゲーム（lib/games.php・assets/{ゲーム}.js）。頭の数字や結果はクイズの部品（qz-）を使う */
.game [hidden] { display: none !important; }
.game { margin: 20px 0; padding: 14px 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; scroll-margin-top: 12px; }
.gm-prompt { margin: 0 0 12px; font-size: 1.15em; }
.gm-prompt b { font-size: 1.3em; }
.gm-kana { margin: 0 4px 0 2px; color: var(--ink-2); font-size: 0.8em; }
.gm-fig { margin: 0 0 12px; }
.gm-map { display: block; width: 100%; height: auto; background: #dbe7ee; border-radius: 6px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.gm-map.is-play { cursor: crosshair; }
/* PC で画面が低い（ノート PC など）と、地図の下のボタンや入力欄が画面の外になるので、地図の高さに上限をつける
   （画面の高さから、お題の行と操作の分を引いた高さ。地図が横に余るときは左右が海の色になる）。地図かるたは karuta.js が決める */
@media (min-width: 641px) {
  [data-game] > .gm-fig .gm-map { max-height: calc(100vh - var(--gm-ui, 200px)); }
  .jt-score ~ .gm-fig { --gm-ui: 240px; }
}
.gm-map path { fill: #fff; stroke: #9a9a9a; stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.gm-map path.on { fill: #4b7d8c; stroke: #2f5561; stroke-width: 1.4; }
.gm-pin { fill: #b3403a; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.gm-pin.hit { fill: #2e7d4f; }
.gm-line { stroke: #b3403a; stroke-width: 2; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.gm-no { font-size: 15px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.gm-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; }
.gm-ctrl .qz-next:disabled { opacity: 0.4; cursor: default; }
.gm-hint { font-size: 0.88em; color: var(--ink-2); }
.qz-total .gm-how { margin-top: 8px; font-size: 0.82em; color: var(--ink-3); }
.gm-how a { margin-left: 6px; }
.gm-badge { display: inline-block; margin: 2px 0 6px !important; padding: 3px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--ink-2); font-weight: 700; }
.gm-badge.is-clear { background: #e8f4ec; color: #2e7d4f; }
/* 町つなぎ（games/tsunagi/・assets/tsunagi.js） */
.ts-route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 4px; font-size: 1.2em; }
.ts-route b { padding: 2px 12px; border-radius: 6px; color: #fff; }
.ts-from { background: #2e7d4f; }
.ts-to { background: #b3403a; }
.ts-arrow { color: var(--ink-3); }
.ts-info { margin: 0 0 10px; font-size: 0.9em; color: var(--ink-2); }
.gm-map path.ts-from { fill: #2e7d4f; }
.gm-map path.ts-to { fill: #b3403a; }
.gm-map path.ts-best { fill: #7cc39a; }
.gm-map path.ts-near { fill: #f1d36b; }
.gm-map path.ts-far { fill: #c9c9c9; }
.gm-map path.ts-ans { fill: #dcefe3; stroke: #2e7d4f; stroke-width: 2; stroke-dasharray: 4 3; }
/* 文字の大きさとふちの太さは tsunagi.js が地図の拡大率から決めて、g に入れる */
.ts-labels text { font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: #fff; stroke-linejoin: round; pointer-events: none; }
.ts-form { position: relative; margin: 4px 0 0; }
.ts-label { display: block; margin: 0 0 4px; font-size: 0.85em; font-weight: 700; color: var(--ink-2); }
.ts-row { display: flex; gap: 8px; }
.ts-row input { flex: 1; min-width: 0; padding: 10px 12px; font: inherit; font-size: 16px; border: 2px solid var(--line); border-radius: 8px; }
.ts-row input:focus { outline: none; border-color: var(--accent); }
.ts-sugg { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ts-sugg button { padding: 6px 12px; font: inherit; font-weight: 700; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.ts-sugg button:hover { border-color: var(--accent); }
.ts-sugg small { margin-left: 4px; font-weight: 400; color: var(--ink-3); }
.ts-msg { min-height: 1.4em; margin: 4px 0 0; font-size: 0.85em; color: #b3403a; }
.ts-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ts-list li { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); font-weight: 700; font-size: 0.92em; }
.ts-dot, .ts-key::before { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.ts-list .ts-best .ts-dot, .ts-key.best::before { background: #7cc39a; }
.ts-list .ts-near .ts-dot, .ts-key.near::before { background: #f1d36b; }
.ts-list .ts-far .ts-dot, .ts-key.far::before { background: #c9c9c9; }
.ts-key::before { content: ''; margin-right: 3px; }
.ts-giveup { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 14px 0 0; }
.ts-giveup .ts-hint { padding: 6px 14px; font-size: 0.88em; font-weight: 700; color: var(--ink-2); background: #fff8dc; border: 1px solid #ecd28f; border-radius: 999px; text-decoration: none; }
.ts-giveup button { padding: 0; font: inherit; font-size: 0.85em; color: var(--ink-3); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.ts-chain .qz-r-head::before { content: none; }
.ts-chain li.ts-mid { border-left-color: #7cc39a; }

/* 陣取り（games/jintori/・assets/jintori.js）。あなたは青、CPU は赤 */
.jt-level { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 0.88em; }
.jt-level span { margin-right: 4px; font-weight: 700; color: var(--ink-2); }
.jt-level button { padding: 4px 14px; font: inherit; font-weight: 700; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.jt-level button[aria-pressed="true"] { color: #fff; background: var(--ink-2); border-color: var(--ink-2); }
.jt-score { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; }
.jt-side { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 8px 12px; border-radius: 8px; color: #fff; }
.jt-side span { font-weight: 700; font-size: 0.9em; }
.jt-side b { font-size: 1.6em; line-height: 1.1; }
.jt-side small { margin-left: auto; font-size: 0.78em; opacity: 0.9; }
.jt-me { background: #2a6fb5; }
.jt-cpu { background: #b3403a; }
.jt-status { min-height: 1.5em; margin: 0 0 8px; font-size: 0.9em; font-weight: 700; color: var(--ink-2); }
.gm-map path.jt-p { fill: #8db8e3; }
.gm-map path.jt-c { fill: #e8a29c; }
.gm-map path.jt-p.jt-home { fill: #2a6fb5; }
.gm-map path.jt-c.jt-home { fill: #b3403a; }
.gm-map path.jt-can { fill: #f3f8fd; stroke: #2a6fb5; stroke-width: 1.4; stroke-dasharray: 3 2; cursor: pointer; }
.gm-map path.jt-sel { fill: #f1d36b; stroke: #2a6fb5; stroke-width: 2.2; stroke-dasharray: none; }
.jt-log { list-style: none; margin: 10px 0 0; padding: 0; max-height: 9.5em; overflow-y: auto; font-size: 0.85em; }
.jt-log li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.jt-log b { display: inline-block; min-width: 4.5em; }
.jt-log .jt-p b { color: #2a6fb5; }
.jt-log .jt-c b { color: #b3403a; }
.jt-all { font-size: 0.9em; color: var(--ink-2); }

/* くらべ（games/kurabe/・assets/kurabe.js）。多いほうは緑のふち、選んだのが外れなら赤 */
.kb-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; }
.kb-vs { align-self: center; font-weight: 700; color: var(--ink-3); font-size: 0.9em; }
.kb-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 150px; padding: 14px 8px; font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.kb-card:hover:not(:disabled) { border-color: var(--accent); }
.kb-card:disabled { cursor: default; }
.kb-sub { font-size: 0.75em; color: var(--ink-3); }
.kb-name { font-size: 1.35em; font-weight: 700; line-height: 1.3; }
.kb-kana { font-size: 0.78em; color: var(--ink-2); }
.kb-val { margin-top: 8px; font-size: 1.1em; font-weight: 700; color: var(--ink-3); }
.kb-card.is-more { border-color: #2e7d4f; background: #e8f4ec; }
.kb-card.is-more .kb-val { color: #2e7d4f; }
.kb-card.is-less .kb-val { color: var(--ink-2); }
.kb-card.is-wrong { border-color: #b3403a; background: #fbeceb; }
.kb-src { min-height: 1.4em; margin: 10px 0 0; font-size: 0.78em; color: var(--ink-3); }
@media (max-width: 480px) { .kb-pair { gap: 6px; } .kb-card { min-height: 130px; } .kb-name { font-size: 1.15em; } }

/* 地図かるた（games/karuta/・assets/karuta.js）。札は縦書き。あなたが取った札は青、CPU は赤 */
.kr-set { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; }
.kr-set .jt-level { margin: 0; }
.kr-set select { padding: 4px 8px; font: inherit; font-size: 1em; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.kr-fig { margin-bottom: 6px; }
.gm-map path.kr-on { fill: #f0a830; stroke: #a0640a; stroke-width: 1.6; }
.gm-map .kr-ring { fill: none; stroke: #f0a830; stroke-width: 3; vector-effect: non-scaling-stroke; animation: kr-pulse 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes kr-pulse { 50% { stroke-opacity: .25; } }
.gm-map path.kr-just { stroke: #fff; stroke-width: 1.4; }
.kr-left { margin: 0 0 6px; font-size: 0.82em; color: var(--ink-3); text-align: right; }
.kr-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.kr-card { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 118px; padding: 6px 2px; font: inherit; font-weight: 700; font-size: 1.05em; color: var(--ink); background: #fffdf6; border: 2px solid #c9b48a; border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); cursor: pointer; }
.kr-card:hover:not(:disabled) { border-color: var(--accent); background: #fff; }
/* 札の名前は縦に1列（折り返すと「ふかがわ／し」のように読みにくい）。札に収まらない長さのときは karuta.js が字を小さくする */
.kr-name { writing-mode: vertical-rl; letter-spacing: .08em; line-height: 1.1; white-space: nowrap; }
.kr-name.is-kana { white-space: pre; letter-spacing: 0; line-height: 1.25; }   /* ひらがなの札は「名前／し・ちょう・むら・まち」の2列（改行は karuta.js が入れる） */
.kr-card:disabled { cursor: default; opacity: .55; }
.kr-card.by-p { background: #e3eefa; border-color: #2a6fb5; opacity: .75; }
.kr-card.by-c { background: #fbeceb; border-color: #b3403a; opacity: .75; }
.kr-who { position: absolute; left: 0; right: 0; bottom: 3px; font-size: 0.58em; font-weight: 700; color: var(--ink-2); }
.kr-card.is-miss { animation: kr-shake .4s; border-color: #b3403a; }
@keyframes kr-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
/* 地図は横幅いっぱい（高さは karuta.js が画面の6割までにする）、札はその下に。PC は札を8列にして低くする */
.kr-board { scroll-margin-top: 8px; }
.kr-board .jt-status { min-height: 2.9em; margin-bottom: 4px; }   /* 知らせが2行になっても札がずれないよう、いつも2行分 */
.kr-fig { position: relative; }
.kr-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(251, 250, 247, .6); border-radius: 6px; }
.kr-cover span { font-size: 0.85em; font-weight: 700; color: var(--ink-2); }
.kr-go { padding: 14px 48px; font-size: 1.15em; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
@media (min-width: 641px) {
  .kr-cards { grid-template-columns: repeat(8, 1fr); }
  .kr-card { height: 96px; }
}
@media (max-width: 480px) { .kr-card { height: 92px; font-size: 0.98em; } }
@media (max-width: 480px) and (max-height: 720px) { .kr-card { height: 76px; font-size: 0.9em; } .kr-cards { gap: 6px; } }   /* 画面の低いスマホで16枚（4段）でも収まるように */

/* 地図パズル（games/puzzle/・assets/puzzle.js）。型は白に点線、ほかの地域は薄い灰、はまったピースは色つき */
.pz-fig { --gm-ui: 270px; }
.pz-cur { margin-right: 4px; font-size: 1.05em; color: var(--ink); }
.pz-subs { margin: 0 0 12px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.pz-subs-head { margin: 0 0 4px; font-size: 0.85em; font-weight: 700; color: var(--ink-2); }
.pz-subs .gm-levels { margin: 6px 0 0; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.gm-map path.pz-slot { fill: #fff; stroke: #8a8a8a; stroke-width: 1; stroke-dasharray: 3 2; }
.gm-map path.pz-out { fill: #e9e7e2; stroke: #d2cfc8; }
.gm-map path.pz-done { stroke: #555; stroke-width: 1; stroke-dasharray: none; animation: pz-pop .35s ease-out; }
@keyframes pz-pop { from { opacity: .3; } }
/* ピースの並び：横にスクロール（横のスワイプはスクロール、上へ引っぱるとドラッグ） */
.pz-tray { list-style: none; margin: 8px 0 0; padding: 4px 2px 8px; display: flex; gap: 8px; overflow-x: auto; }
.pz-piece { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 84px; height: 96px; padding: 6px 4px; font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 8px; cursor: grab; touch-action: pan-x; user-select: none; -webkit-user-select: none; }
.pz-piece:hover { border-color: var(--accent); }
.pz-piece.is-sel { border-color: #2a6fb5; background: #e3eefa; }
.pz-piece.is-drag { opacity: .35; }
.pz-piece.is-miss { animation: kr-shake .4s; border-color: #b3403a; }
.pz-thumb { width: 64px; height: 56px; flex: none; }
.pz-thumb path { fill: #9fd3cf; stroke: #3f7f7a; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pz-name { font-size: 0.75em; font-weight: 700; line-height: 1.2; text-align: center; }
.pz-ghost { position: fixed; z-index: 50; pointer-events: none; opacity: .85; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .3)); }
.pz-ghost path { fill: #f0a830; stroke: #a0640a; stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* 今日の10問の上の、レベルへの入口（lib/quiz.php の level_bar()） */
.gm-lvbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin: 14px 0 -6px; padding: 10px 14px; background: var(--accent-soft); border-radius: 10px; font-size: 0.92em; }
.gm-lvbar span { font-weight: 700; color: var(--ink-2); }
/* 下の問題のカードの吹き出し（今日の10問）より目立たないよう、ボタンは白地にする */
.gm-lvbar a { padding: 5px 16px; border: 1px solid var(--accent); border-radius: 999px; background: #fff; color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.gm-lvbar a:hover { background: var(--accent); color: #fff; }
/* レベルの一覧（lib/quiz.php の level_grid()。位置当てと形だけクイズ） */
.gm-levels { list-style: none; padding: 0; margin: 12px 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gm-levels a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.gm-levels a:hover { border-color: var(--accent); }
.gm-levels a[aria-current] { background: var(--accent-soft); }
.gm-levels a.is-clear { border-left-color: #2e7d4f; }
.gm-levels a.is-perfect { border-left-color: #c9a227; }
.gl-no { font-weight: 700; }
.gl-first { font-size: 0.82em; color: var(--ink-3); }
/* 記録の行はどの枠にも出して、高さをそろえる（まだ遊んでいないレベルは「未挑戦」） */
.gl-best { font-size: 0.8em; color: var(--ink-3); }
.gm-levels a.is-played .gl-best { font-weight: 700; color: var(--ink-2); }
.gm-levels a.is-clear .gl-best { color: #2e7d4f; }

/* 市町村ページの返礼品ランキングの11位から（detail.php） */
details.g-more { margin: 12px 0 0; }
details.g-more > summary { display: block; width: fit-content; margin: 0 auto 12px; padding: 9px 22px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 700; font-size: 0.92em; cursor: pointer; }
details.g-more[open] > summary { margin-bottom: 14px; }

/* 旬メーター（lib/shun.php の shun_meter()）。12か月の水揚げ量の帯。.on は旬の月、.now は今月 */
.meter { display: inline-grid; grid-template-columns: repeat(12, 1fr); gap: 2px; align-items: end; width: 168px; height: 26px; vertical-align: middle; }
.meter .m { position: relative; display: block; height: 100%; }
.meter .m i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: #d7dbe2; border-radius: 2px 2px 0 0; }
.meter .m.on i { background: var(--bar); }
.meter .m.now { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
.meter.big { display: grid; width: 100%; max-width: 520px; height: 110px; gap: 4px; margin: 6px 0 26px; }
.meter.big .m b { position: absolute; left: 0; right: 0; bottom: -22px; color: var(--ink-3); font-size: 12px; font-weight: 400; text-align: center; }
.meter.big .m.now b { color: var(--accent); font-weight: 700; }
.shun-box { margin: 18px 0; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.shun-box p { margin: 0; font-size: 0.92em; }
.shun-box .shun-title { margin-bottom: 4px; font-weight: 700; font-size: 1em; }
.shun-title span { margin-left: 8px; color: var(--ink-3); font-size: 0.8em; font-weight: 400; }
.shun-list { margin: 0 0 16px; padding: 0; list-style: none; }
.shun-list li { display: grid; grid-template-columns: 1fr auto 76px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sh-name { font-weight: 700; }
.sh-name small { margin-left: 6px; color: var(--accent); font-size: 0.75em; }
.sh-top { margin-left: 8px; color: var(--ink-2); font-size: 0.75em; font-weight: 400; }
.sh-peak { color: var(--ink-3); font-size: 0.75em; text-align: right; }
.sh-areas-label { margin: 18px 0 0; font-size: 0.85em; color: var(--ink-2); font-weight: 700; }
.sh-areas a[aria-current] { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 480px) { .meter { width: 120px; } .shun-list li { grid-template-columns: 1fr auto; } .sh-peak { grid-column: 1 / -1; text-align: left; margin-top: -6px; } }
.sh-jump { display: flex; gap: 8px; margin: 0 0 8px; }
.sh-jump a { padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 0.85em; font-weight: 700; text-decoration: none; color: var(--ink); }
.shun-list + details.data, h3 + .shun-list { margin-top: 4px; }
ul.notes { padding-left: 1.2em; font-size: 0.9em; }
.qz-gift-go { margin-top: 2px; color: var(--link); font-size: 0.85em; font-weight: 700; }
