:root {
  --bg: #fbfaf7;
  --fg: #1c1b19;
  --muted: #6b665c;
  --accent: #b4491c;
  --line: #e2ded3;
  --card: #fbfaf7;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", Meiryo, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f;
    --fg: #ece8de;
    --muted: #a39d8f;
    --accent: #f08a56;
    --line: #34312a;
    --card: #15140f;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); }
body { overflow: hidden; }

.brand {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2;
  padding: max(12px, env(safe-area-inset-top)) 20px 8px;
  pointer-events: none;
}
.brand a {
  pointer-events: auto; color: var(--muted); text-decoration: none;
  font-size: 0.8rem; letter-spacing: 0.18em; font-weight: 700;
}

/* 1画面 = 1雑学。スナップで「次の雑学」へ、アニメーションなしで切り替わる。 */
#feed {
  height: 100vh; height: 100dvh;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  outline: none;
}
.card {
  height: 100vh; height: 100dvh;
  scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; justify-content: center; align-items: center;
  padding: 56px 24px 72px;
  background: var(--card);
}
.card-inner {
  width: 100%; max-width: 38rem;
  max-height: 100%; overflow-y: auto;
  padding: 4px 2px;
}
.category { margin: 0 0 0.9rem; font-size: 0.8rem; color: var(--accent); font-weight: 700; letter-spacing: 0.08em; }
.title { margin: 0 0 1rem; font-size: clamp(1.45rem, 5.4vw, 2.1rem); line-height: 1.35; font-weight: 800; text-wrap: balance; word-break: auto-phrase; }
.claim { margin: 0 0 1.6rem; font-size: clamp(1.05rem, 3.6vw, 1.3rem); line-height: 1.85; word-break: auto-phrase; text-wrap: pretty; }

details { margin: 0 0 0.6rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
summary { cursor: pointer; color: var(--accent); font-weight: 700; padding: 0.35rem 0; list-style-position: inside; }
summary:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.detail { margin: 0.4rem 0 0.6rem; line-height: 1.9; font-size: 1rem; word-break: auto-phrase; }
.sources ul { margin: 0.3rem 0 0.6rem; padding-left: 1.1rem; line-height: 1.8; font-size: 0.92rem; }
.sources a { color: var(--fg); text-underline-offset: 3px; }
.src-meta { color: var(--muted); font-size: 0.82rem; }
.tags { margin: 1rem 0 0; color: var(--muted); font-size: 0.85rem; }

.hint {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; text-align: center;
  padding: 10px 20px max(14px, env(safe-area-inset-bottom));
  font-size: 0.78rem; color: var(--muted); pointer-events: none;
}
.hint-key { display: none; }
body.past-first .hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  .hint-touch { display: none; }
  .hint-key { display: inline; }
}

#next {
  position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  font-size: 1.2rem; cursor: pointer;
}
#next:hover { border-color: var(--accent); color: var(--accent); }
@media (hover: none) { #next { display: none; } }

.loading, .error { padding: 40vh 24px 0; text-align: center; color: var(--muted); }
.error button { margin-top: 1rem; padding: 0.6rem 1.2rem; font: inherit; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 8px; cursor: pointer; }
.error a { color: var(--accent); }
