/* 色・文字・形・共通の部品は app/design-system/(tokens.css・components.css)。ここは graaah だけの形 */
body.locked { overflow: hidden; }
/* Quick は紺の地に色面を敷きつめる(Classic は明るい地のまま) */
body.quick { background: var(--night); }

/* ── bento ── */
.bento {
  max-width: var(--page);
  margin: 0 auto;
  padding: 24px var(--gutter) 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: var(--gap);
}

.tile { min-height: 180px; }
.tile .big { margin-top: auto; } /* 大きな数字はタイルの左下 */
.wide { grid-column: span 2; }

/* 文字と絵を左右に分けるタイル(はやみ・一覧)。絵の大きさはどのタイルでも同じ */
.split { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.split .txt { align-self: stretch; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.art { display: flex; align-items: flex-end; justify-content: flex-end; height: 104px; }
/* 小さいタイルは、文字を上に・絵を右下に積む(文字が絵に押されて折れないように) */
.split:not(.wide) { grid-template-columns: 1fr; gap: 8px; }
.split:not(.wide) .art, .split:not(.wide) .dice { justify-self: end; }
.art img {
  height: 100px;
  width: auto;
  border-radius: 5px;
  transform: rotate(-5deg);
  box-shadow: var(--shadow-pic);
}
.art img + img { margin-left: -34px; transform: rotate(6deg) translateY(-6px); }

/* ヒーロー:白い地に、ロゴ・バッジ・説明を中央にそろえる */
.hero {
  grid-column: span 2;
  grid-row: span 2;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero > * { width: 100%; }
.hero h1.logo { margin: 4px 0 14px; line-height: 0; }
.hero h1.logo img { height: 190px; width: auto; }
@media (max-width: 760px) { .hero h1.logo img { height: 150px; } }
.hero .lead { margin: 12px 0 18px; font-weight: 700; word-break: keep-all; text-wrap: balance; }
.hero .search input { border: var(--stroke) solid var(--ink); background: var(--bg); }

/* 人数・年齢・時間のバッジ */
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.hero .facts { width: auto; }
.facts li {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px 4px 9px;
  border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper);
  font-weight: var(--w-bold); font-size: var(--fs-sub); line-height: 1.2;
}
.facts svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search input {
  width: 100%;
  font: inherit;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  color: var(--text);
}
.search input:focus { outline: 3px solid var(--ink); outline-offset: 0; }
.results { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.results .none { margin: 0; }

/* ヒーローの下:ゴミが流れるエリアの順。4つのエリアの色の札を矢印でつなぐ */
.flow {
  margin-top: auto;
  padding-top: 20px;
  display: grid;
  grid-template-columns: 1fr 14px 1fr 14px 1fr 14px 1fr;
  align-items: center;
}
.flow figure {
  margin: 0;
  padding: 8px 4px 6px;
  border-radius: var(--r-md);
  text-align: center;
}
.flow img { display: block; width: 44px; height: 44px; margin: 0 auto; padding: 5px; border-radius: 50%; background: var(--paper); }
.flow figcaption { font-size: var(--fs-small); font-weight: var(--w-heavy); margin-top: 2px; color: var(--ink); }
.flow .arrow { justify-self: center; width: 0; height: 0; border: 6px solid transparent; border-left: 7px solid var(--ink); border-right: 0; }

/* なかま:フォルダの形。つまみ(ラベル)の右はしをななめに切って、本体とつなげる */
.folder { grid-column: span 2; display: flex; flex-direction: column; background: none !important; }
.folder-tab {
  align-self: flex-start;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 -1px;
  padding: 9px 44px 7px 18px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  background: var(--folder);
  border-radius: var(--radius) 0 0 0;
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 100%, 0 100%);
}
.folder-tab .en { display: inline; font-size: 0.68rem; opacity: 0.55; }
.folder-tab small {
  font-family: var(--big);
  font-size: 0.8rem; font-weight: 900; line-height: 1;
  padding: 3px 7px; border-radius: 4px;
  background: var(--ink); color: var(--paper);
}
.folder-body {
  flex: 1;
  padding: 18px 20px 20px;
  background: var(--folder);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
}
.folder .chip { border-color: transparent; }
.folder.a-machi { --folder: var(--area-machi); }
.folder.a-kawa { --folder: var(--area-kawa); }
.folder.a-kaigan { --folder: var(--area-kaigan); }
.folder.a-umi { --folder: var(--area-umi); }
.list .en { opacity: 0.55; }

/* イベント一覧のタイル:サイコロの目 */
.dice { display: grid; grid-template-columns: repeat(3, 38px); gap: 6px; align-self: end; }
.dice span {
  display: grid; place-items: center; height: 38px;
  border-radius: 6px; background: var(--paper); color: var(--ink);
  font-family: var(--big); font-weight: 900; font-size: 1.3rem;
}

/* 項目のアイコン(シートの見出し・Classic の見出し)。どれも同じ高さの枠に入れる */
.ico { display: inline-flex; align-items: center; flex: none; height: var(--ico, 44px); }
.ico img { height: 100%; width: auto; }
.ico img.svg { width: var(--ico, 44px); }
.ico img.pic { border-radius: 4px; outline: 1.5px solid var(--ink); }
.ico img + img { margin-left: -10px; }

/* 開いたとき、タイルが1枚ずつめくれて出てくる(flip-in は components.css) */
.bento > * { animation: flip-in 0.55s var(--ease-pop) both; animation-delay: calc(var(--i, 0) * 60ms); transform-origin: 50% 0; }
@media (prefers-reduced-motion: reduce) { .bento > * { animation: none; } }

@media (max-width: 760px) {
  .bento { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero, .folder, .wide { grid-column: span 2; }
  .hero { grid-row: auto; padding: 24px 20px; }
  .tile { min-height: 150px; }
  .split:not(.wide) .big { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tile:not(.wide) .art { height: 76px; }
  .tile:not(.wide) .art img { height: 72px; }
  .art { height: 84px; }
  .art img { height: 80px; }
  .flow img { width: 46px; height: 46px; }
}

/* ── シート(1つの項目) ── */
.sheet-wrap {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: grid;
  place-items: start center;
  padding: 32px 16px;
  overflow-y: auto;
  z-index: 10;
}
.sheet-wrap[hidden] { display: none; }
.sheet {
  width: 100%;
  max-width: 640px;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  animation: flip-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}
.sheet header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--paper);
}
.g-cards header { background: var(--area-kawa); }
.g-turn header { background: var(--area-machi); }
.g-points header { background: var(--area-kaigan); }
.g-round header { background: var(--area-umi); }
.sheet-icon { --ico: 44px; }
.sheet-icon:empty { display: none; }
.sheet h2 { margin: 0; flex: 1; font-size: 1.5rem; color: var(--ink); }
.close {
  font-size: 1.8rem;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.close:hover { background: var(--ink); color: var(--paper); }

.sheet-body { padding: 8px 22px 24px; font-size: 1.05rem; }
.sheet-body a:not(.chip) {
  color: var(--type-kaiketsu);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.pics { display: flex; justify-content: center; gap: 12px; margin: 12px 0; }
.pics img { height: 180px !important; width: auto !important; max-width: 60% !important; border-radius: 6px; box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.18); margin: 0 !important; }
.sheet-body img { max-width: 100%; height: auto; display: block; margin: 12px auto; }
.sheet-body ul, .sheet-body ol { padding-left: 1.3em; }
.sheet-body li { margin: 4px 0; }
.formula {
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  text-align: center;
}
table { border-collapse: collapse; width: 100%; margin: 12px 0; }
th, td { border-bottom: 1px solid var(--rule); padding: 6px 8px; text-align: left; }
th { font-size: 0.85rem; color: var(--muted); }

.chips-img { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.chips-img figure { margin: 0; text-align: center; padding: 10px 14px; border-radius: 14px; background: var(--bg); }
.chips-img img { width: 52px !important; height: 52px; margin: 0 auto !important; }
.chips-img figcaption { font-weight: 700; font-size: 0.9rem; }

.related { margin-top: 24px; padding-top: 14px; border-top: 2px dashed var(--rule); display: flex; flex-wrap: wrap; gap: 6px; }
.related p { width: 100%; margin: 0 0 4px; font-size: 0.8rem; color: var(--muted); font-weight: 700; }

/* カード一覧 */
.t-mondai { color: var(--type-mondai); }
.t-kaiketsu { color: var(--type-kaiketsu); }
table.list td:first-child, table.list th:first-child { width: 2.5em; text-align: center; }
table.list tr.a-machi td { background: color-mix(in srgb, var(--area-machi) 35%, var(--paper)); }
table.list tr.a-kawa td { background: color-mix(in srgb, var(--area-kawa) 35%, var(--paper)); }
table.list tr.a-kaigan td { background: color-mix(in srgb, var(--area-kaigan) 35%, var(--paper)); }
table.list tr.a-umi td { background: color-mix(in srgb, var(--area-umi) 35%, var(--paper)); }
.star { color: var(--token-yellow); -webkit-text-stroke: 0.5px var(--ink); }

/* イベント一覧 */
.events { display: grid; gap: 10px; }
.ev { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 12px; border: 2px solid var(--ink); border-radius: 14px; }
.ev .no { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--ink); color: var(--paper); font-weight: 900; }
.ev b { color: var(--ink); font-size: 1.1rem; }
.ev p { margin: 4px 0; }
.ev small { color: var(--muted); line-height: 1.5; display: block; }

/* ── グローバルヘッダー ── */
.gh {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--night);
  color: var(--paper);
}
.gh-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gh-brand {
  text-decoration: none;
  font-family: var(--font-en);
  font-weight: var(--w-heavy);
  letter-spacing: 0.08em;
  font-size: 1.15rem;
  color: var(--paper);
  white-space: nowrap;
}
.gh-brand small { margin-left: 6px; font-size: 0.8rem; opacity: 0.6; }
.gh-right { display: flex; align-items: center; gap: 8px; }
.gh-lang {
  font: inherit;
  font-weight: var(--w-bold);
  font-size: var(--fs-small);
  min-width: 52px;
  white-space: nowrap;
  padding: 6px 10px;
  border: var(--stroke) solid var(--paper);
  border-radius: 8px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}
.gh-lang:hover { background: var(--paper); color: var(--ink); }
.gh-lang { font-family: var(--font-en); letter-spacing: 0.06em; }
.gh-tabs {
  display: flex;
  padding: 3px;
  border-radius: 8px;
  background: var(--paper);
}
.gh-tabs a {
  padding: 4px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  color: var(--ink);
}
.gh-tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
@media (max-width: 420px) { .gh-brand { font-size: 1rem; } .gh-tabs a { padding: 4px 12px; } .gh-lang { min-width: 0; padding: 6px 8px; } .gh-right { gap: 6px; } }

/* ── Classic(1枚ページ) ── */
.page { max-width: 760px; margin: 0 auto; padding: 24px 16px 80px; font-size: 1.05rem; }
.page[hidden], .bento[hidden] { display: none; }
.p-head h1 { margin: 0; font-size: 2rem; color: var(--ink); line-height: 1.3; }
.p-head h1.logo { display: flex; align-items: flex-end; gap: 16px; line-height: 1; }
.p-head h1.logo img { height: 150px; width: auto; }
.p-head h1.logo span { font-size: 1.3rem; padding-bottom: 6px; }
.p-head .facts { justify-content: flex-start; margin: 10px 0 4px; }
.p-head .meta { margin: 6px 0; font-weight: 700; color: var(--ink); }
.toc {
  margin: 20px 0 8px;
  padding: 16px 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 20px;
}
.toc b { display: block; color: var(--ink); font-size: 0.9rem; margin-bottom: 2px; }
.toc a { display: block; color: var(--type-kaiketsu); font-size: 0.95rem; text-decoration: none; line-height: 1.7; }
.toc a:hover { text-decoration: underline; }
.p-group > h2 {
  margin: 40px 0 8px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  font-size: 1.3rem;
  background: var(--paper);
}
.g-cards > h2 { background: var(--area-kawa); }
.g-turn > h2 { background: var(--area-machi); }
.g-points > h2 { background: var(--area-kaigan); }
.g-round > h2 { background: var(--area-umi); }
.p-entry { scroll-margin-top: 72px; padding: 6px 4px 14px; border-bottom: 2px dashed var(--rule); }
.p-entry h3 { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; font-size: 1.25rem; color: var(--ink); }
.p-entry h3 .ico { --ico: 34px; }
.p-entry a { color: var(--type-kaiketsu); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.p-entry img:not(.ico img) { max-width: 100%; height: auto; display: block; margin: 12px auto; }
.p-entry ul, .p-entry ol { padding-left: 1.3em; }
.sheet-body h4, .p-entry h4 { margin: 16px 0 4px; }
