/* 鼻くそ飛ばしのサイト部分（トップ・スコアアタック・図鑑）。ゲーム本体は play/ */
:root {
  --bg: #f6efd9;
  --paper: #fff8e6;
  --ink: #2a2118;
  --ink-soft: rgba(42, 33, 24, 0.62);
  --line: rgba(42, 33, 24, 0.16);
  --booger: #8fb33a;
  --booger-dark: #6e8f26;
  --accent: #e0503a;
  --gold: #d99a00;
  --frame: #2b3a2a;
  --font-display: "Dela Gothic One", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-body: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.site-header {
  background: var(--frame);
  color: var(--paper);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.logo { font-family: var(--font-display); font-size: 22px; text-decoration: none; color: #b9d66a; letter-spacing: 0.02em; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-weight: 800; font-size: 14px;
  padding: 6px 12px; border-radius: 999px;
}
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 248, 230, 0.14); }
@media (max-width: 560px) {
  .site-header .wrap { padding-top: 8px; padding-bottom: 8px; gap: 4px; }
  .nav { margin-left: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .nav a { text-align: center; }
  .nav a { padding: 4px 8px; font-size: 13px; }
}

/* 見出し・セクション */
main { padding-bottom: 48px; }
section { padding: 32px 0 8px; scroll-margin-top: 64px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: 1.3; }
h2 { font-size: 26px; margin-bottom: 4px; }
.lead { color: var(--ink-soft); margin: 0 0 16px; font-weight: 800; font-size: 14px; }

/* ヒーロー */
.hero { background: linear-gradient(#9fd6e8, #e9f5dc); border-bottom: 6px solid #6fa85a; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; padding-top: 28px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(40px, 9vw, 72px); color: #9cc23f; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.hero p { font-weight: 800; margin: 12px 0 18px; }
.hero img { height: auto; border-radius: 12px; border: 3px solid var(--ink); box-shadow: 0 6px 0 rgba(42, 33, 24, 0.25); }
@media (max-width: 700px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 14px; padding-top: 18px; padding-bottom: 18px; }
  .hero p { margin: 6px 0 12px; font-size: 14px; }
  .hero img { max-height: 38vw; width: auto; margin: 0 auto; }
}

/* ボタン */
.btn {
  touch-action: manipulation;   /* 連打してもダブルタップで拡大しない */
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 800; font-size: 16px;
  padding: 12px 22px; border-radius: 12px;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
  text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.hot { background: var(--accent); color: var(--paper); }
.btn.green { background: var(--booger); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* カード */
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 18px; box-shadow: 0 5px 0 rgba(42, 33, 24, 0.2); }

/* 今日のお題 */
.daily { display: grid; grid-template-columns: 1fr 1.1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .daily { grid-template-columns: 1fr; } }
.missions { list-style: none; margin: 10px 0 14px; padding: 0; }
.missions li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-weight: 800; }
.missions li::before { content: "★ "; color: var(--gold); }
.missions li.main::after { content: "クリア条件"; font-size: 11px; margin-left: 8px; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: var(--paper); vertical-align: 2px; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.stat b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--ink-soft); font-weight: 800; }

/* カレンダー */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h3 { font-size: 18px; }
.cal-head button { font: inherit; font-weight: 800; border: 2px solid var(--ink); background: var(--paper); border-radius: 8px; width: 36px; height: 32px; cursor: pointer; }
.cal-head button:disabled { opacity: 0.3; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.cal .day {
  aspect-ratio: 1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; background: rgba(42, 33, 24, 0.05); position: relative; line-height: 1.1;
}
.cal .day small { font-size: 10px; letter-spacing: -0.05em; color: var(--gold); }
.cal .day.played { background: #e7e1c8; }
.cal .day.cleared { background: var(--booger); color: var(--ink); }
.cal .day.cleared small { color: var(--ink); }
.cal .day.today { outline: 3px solid var(--accent); outline-offset: -3px; }
.cal .day.future { opacity: 0.35; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; font-weight: 800; color: var(--ink-soft); margin-top: 10px; }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 4px; }

/* トップのメニュー */
.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.menu-item { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 12px 40px 12px 14px; position: relative; min-height: 76px; }
.menu-item img { flex: none; width: 44px; height: 44px; }
.menu-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; }
.menu-item::after { content: "▶"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--accent); }
.menu-item b { font-family: var(--font-display); font-weight: 400; font-size: 18px; }
.menu-item .menu-text span { font-size: 13px; color: var(--ink-soft); font-weight: 800; }
.menu-item:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(42, 33, 24, 0.2); }

/* ステージ */
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stage {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 0 rgba(42, 33, 24, 0.25);
}
.stage .sky { height: 40px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 22px; border-bottom: 2px solid var(--ink); }
.stage .sky.night { color: var(--paper); }
.stage .body { padding: 8px 10px 10px; text-align: center; }
.stage .name { font-weight: 800; font-size: 14px; }
.stage .stars { color: var(--gold); font-size: 18px; letter-spacing: 2px; }
.stage .goal { font-size: 12px; font-weight: 800; }
.stage .meta { font-size: 11px; color: var(--ink-soft); font-weight: 800; }
.stage.locked { opacity: 0.55; pointer-events: none; box-shadow: none; }
.stage:not(.locked):active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(42, 33, 24, 0.25); }

/* 期間限定（ハロウィン） */
.event { background: linear-gradient(#2a1645, #6a2f3a); color: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 16px; margin-bottom: 18px; box-shadow: 0 5px 0 rgba(42, 33, 24, 0.2); }
.event h2 { font-size: 20px; margin: 0 0 4px; color: #f6a04a; }
.event .event-until { font-family: var(--font-body); font-size: 13px; font-weight: 800; color: var(--paper); background: var(--accent); border-radius: 8px; padding: 2px 8px; vertical-align: 3px; white-space: nowrap; }
.event p { margin: 0 0 12px; font-size: 13px; font-weight: 800; }
.event .stage { color: var(--ink); }
.event .stage .sky { background: #2a1645; color: #f6a04a; }
.btn.event-btn { background: #2a1645; color: #f6a04a; }

/* 図鑑 */
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.skin { font: inherit; text-align: center; background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; padding: 14px 8px; cursor: pointer; }
.skin.on { background: #f4c430; }
.skin:disabled { opacity: 0.5; cursor: default; }
.skin .blob { width: 44px; height: 38px; margin: 0 auto 8px; border-radius: 48% 52% 44% 56% / 55% 50% 50% 45%; border: 3px solid var(--ink); }
.skin b { display: block; font-size: 14px; }
.skin span { font-size: 12px; color: var(--ink-soft); font-weight: 800; }
.titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.titles li { background: var(--paper); border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.titles li b { display: block; font-size: 15px; }
.titles li span { font-size: 12px; color: var(--ink-soft); font-weight: 800; }
.titles li.got { border-color: var(--ink); }
.titles li.got b::before { content: "◆ "; color: var(--accent); }
.titles li:not(.got) b { color: var(--ink-soft); }

/* 説明 */
.rules { margin: 0; padding-left: 1.2em; }
.rules li { margin: 4px 0; }

/* フッター */
.site-footer { background: var(--frame); color: var(--paper); padding: 24px 0 32px; font-size: 14px; }
.site-footer .wrap { display: flex; gap: 16px 24px; flex-wrap: wrap; }
.site-footer a { font-weight: 800; }

/* ページ見出しのアイコン */
h2.with-icon { display: flex; align-items: center; gap: 8px; }
h2.with-icon img { flex: none; width: 1.25em; height: 1.25em; }
/* PCではメニューを横に5つ並べ、アイコンを上・文字を下にそろえる */
@media (min-width: 760px) {
  .menu { grid-template-columns: repeat(5, 1fr); }
  .menu-item { flex-direction: column; justify-content: flex-start; gap: 10px; padding: 18px 10px 16px; text-align: center; }
  .menu-item::after { display: none; }
  .menu-item img { width: 56px; height: 56px; }
  .menu-text { align-items: center; }
  .menu-item b { font-size: 17px; }
  .menu-item .menu-text span { font-size: 12px; }
}

/* ホーム画面に追加 */
.hidden { display: none !important; }
.install { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; padding: 12px 14px; border: 2px dashed var(--line); border-radius: 12px; font-weight: 800; font-size: 14px; color: var(--ink-soft); }
.install .btn { padding: 8px 16px; font-size: 14px; }
.install-how { flex-basis: 100%; margin: 0; color: var(--ink); }
