/* ==========================================================================
   まろん工房 (Atelier Marron) — style.css
   コンセプト：「工房のノート」。淡いラベンダーの方眼紙に、
   マスキングテープで貼った紙片（カード）が並ぶ手工芸の質感。
   すべての色はCSS変数（トークン）経由で指定すること。
   ========================================================================== */

/* --------------------------------------------------------------------
   1. カラートークン
   -------------------------------------------------------------------- */
:root {
  --paper: #faf6fd;
  --paper-grid: #ece1f5;
  --surface: #ffffff;
  --lilac: #a98fd8;
  --lilac-deep: #6f549f;
  --sakura: #f2a8c8;
  --tape-pink: rgba(255, 199, 224, .72);
  --tape-lilac: rgba(214, 197, 244, .72);
  --marron: #8c6350;
  --ink: #463a52;
  --ink-mute: #867a93;
  --line: #e7dcf2;
  --ok: #7bb98f;
  --warn: #e0a45c;
  --radius: 14px;
  --shadow: 0 8px 22px rgba(140, 105, 180, .10);

  --font-jp: "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN", "Yu Gothic Medium", "游ゴシック Medium", "Meiryo", system-ui, sans-serif;
  --font-latin: Candara, Optima, "Gill Sans Nova", "Segoe UI", sans-serif;
}

/* ダーク（「夜の工房」）: OS設定に追従 */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #241d2b;
    --paper-grid: #2f2637;
    --surface: #302739;
    --ink: #eee7f4;
    --ink-mute: #a99cb6;
    --line: #3d3247;
    --lilac: #bda6e6;
    --lilac-deep: #d3c1f2;
    --sakura: #f0aecb;
    --marron: #c39685;
    --tape-pink: rgba(255, 199, 224, .55);
    --tape-lilac: rgba(214, 197, 244, .55);
    --shadow: 0 8px 22px rgba(0, 0, 0, .32);
  }
}

/* 手動テーマ切り替え：メディアクエリより後に置き、両方向を上書きできるようにする */
:root[data-theme="dark"] {
  --paper: #241d2b;
  --paper-grid: #2f2637;
  --surface: #302739;
  --ink: #eee7f4;
  --ink-mute: #a99cb6;
  --line: #3d3247;
  --lilac: #bda6e6;
  --lilac-deep: #d3c1f2;
  --sakura: #f0aecb;
  --marron: #c39685;
  --tape-pink: rgba(255, 199, 224, .55);
  --tape-lilac: rgba(214, 197, 244, .55);
  --shadow: 0 8px 22px rgba(0, 0, 0, .32);
}

:root[data-theme="light"] {
  --paper: #faf6fd;
  --paper-grid: #ece1f5;
  --surface: #ffffff;
  --lilac: #a98fd8;
  --lilac-deep: #6f549f;
  --sakura: #f2a8c8;
  --tape-pink: rgba(255, 199, 224, .72);
  --tape-lilac: rgba(214, 197, 244, .72);
  --marron: #8c6350;
  --ink: #463a52;
  --ink-mute: #867a93;
  --line: #e7dcf2;
  --shadow: 0 8px 22px rgba(140, 105, 180, .10);
}

/* --------------------------------------------------------------------
   2. リセット & 基本
   -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  overflow-x: hidden; /* まろんスロットの粒子・紙吹雪コンテナがはみ出しても横スクロールさせない */
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(to right, var(--paper-grid) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(to bottom, var(--paper-grid) 0 1px, transparent 1px 24px);
  font-family: var(--font-jp);
  font-size: 15.5px;
  line-height: 1.85;
  transition: background-color .2s ease, color .2s ease;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--sakura);
  outline-offset: 2px;
}

h1, h2, h3, p {
  margin: 0;
}

.container {
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: 20px;
}

.prose {
  max-width: 100%;
}

.eyebrow {
  display: block;
  font-family: var(--font-latin);
  color: var(--marron);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  margin-bottom: 6px;
}

h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.3;
  text-wrap: balance;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.4;
  text-wrap: balance;
}

/* --------------------------------------------------------------------
   3. ヘッダー
   -------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  font-size: 26px;
  line-height: 1;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-jp {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.logo-en {
  font-family: var(--font-latin);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--ink-mute);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  background-color: var(--ink);
  border-radius: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-mute);
  padding-block: 4px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--lilac);
}

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-color: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.theme-toggle:hover { transform: translateY(-1px); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background-color: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 10px 20px 16px;
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding-block: 10px;
  }

  .theme-toggle {
    margin-top: 6px;
  }
}

/* --------------------------------------------------------------------
   4. セクション見出し
   -------------------------------------------------------------------- */
.section {
  padding-block: 48px;
}

.section-head {
  margin-bottom: 24px;
}

/* --------------------------------------------------------------------
   5. カード（紙 + マスキングテープ）
   -------------------------------------------------------------------- */
.sheet {
  position: relative;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.tape {
  position: absolute;
  top: -10px;
  left: 18px;
  width: 76px;
  height: 20px;
  transform: rotate(-2.5deg);
  background-color: var(--tape-lilac);
  background-image: repeating-linear-gradient(
    to right,
    rgba(255, 255, 255, .08) 0 1px,
    transparent 1px 5px
  );
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
  pointer-events: none;
  z-index: 2;
}

.sheet--pink .tape,
.tape--pink {
  background-color: var(--tape-pink);
}

.sheet--tape {
  margin-top: 10px;
  transition: transform .18s ease;
}

.sheet--tape:hover {
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------
   6. ボタン
   -------------------------------------------------------------------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn {
  background-color: var(--lilac-deep);
  color: #fff;
}

/* ダークモードでは --lilac-deep が淡い色になり白文字だとコントラスト不足になるため、
   文字色を暗い --paper に切り替える（背景色はライトモードと同じ変数のまま） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn {
    color: var(--paper);
  }
}

:root[data-theme="dark"] .btn {
  color: var(--paper);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  transform: translateY(-1px);
  border-color: var(--lilac);
}

.btn[disabled],
.btn-ghost[disabled] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.is-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------
   7. 更新履歴タイムライン
   -------------------------------------------------------------------- */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background-color: var(--line);
}

.timeline-item {
  position: relative;
  padding-bottom: 26px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--lilac);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line);
}

.timeline-date {
  font-family: var(--font-latin);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--ink-mute);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-body {
  color: var(--ink-mute);
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.pill--new {
  background-color: color-mix(in srgb, var(--lilac) 22%, var(--surface));
  color: var(--lilac-deep);
}

.pill--tool {
  background-color: color-mix(in srgb, var(--sakura) 30%, var(--surface));
  color: #a5476c;
}

.pill--booth {
  background-color: color-mix(in srgb, var(--marron) 22%, var(--surface));
  color: var(--marron);
}

/* --------------------------------------------------------------------
   8. グリッド
   -------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}

.card-desc {
  color: var(--ink-mute);
  font-size: 14px;
  margin-bottom: 12px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.card-tag {
  font-size: 11px;
  color: var(--ink-mute);
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.card-price {
  font-family: var(--font-latin);
  font-weight: 700;
  color: var(--lilac-deep);
  font-size: 15px;
  margin-bottom: 10px;
}

.card-mark {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 10px;
}

.card-thumb {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 12px;
  background-color: color-mix(in srgb, var(--lilac) 10%, var(--surface));
  border: 1px solid var(--line);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pill--ok {
  background-color: color-mix(in srgb, var(--ok) 24%, var(--surface));
  color: color-mix(in srgb, var(--ok) 55%, var(--ink));
}

.pill--warn {
  background-color: color-mix(in srgb, var(--warn) 26%, var(--surface));
  color: color-mix(in srgb, var(--warn) 55%, var(--ink));
}

.card-status {
  margin-bottom: 12px;
}

.sheet--pickup {
  padding: 28px 26px;
}

.pickup-note {
  color: var(--ink-mute);
  font-size: 13.5px;
  margin-bottom: 16px;
}

.card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background-color: var(--sakura);
  padding: 3px 9px;
  border-radius: 999px;
}

.card--disabled {
  opacity: .58;
}

.card--disabled .btn,
.card--disabled .btn-ghost {
  pointer-events: none;
}

/* --------------------------------------------------------------------
   9. リンク集
   -------------------------------------------------------------------- */
.link-group {
  margin-bottom: 28px;
}

.link-group-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--ink);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-item a {
  text-decoration: none;
  font-weight: 700;
  color: var(--lilac-deep);
}

.link-item a:hover {
  text-decoration: underline;
}

.link-item p {
  color: var(--ink-mute);
  font-size: 13px;
  margin-top: 2px;
}

.link-item-pending {
  color: var(--ink-mute);
  font-weight: 700;
}

/* クレジット表記のうち、リンク先が無いもの（表記だけの素材） */
.credit-name {
  font-weight: 700;
  color: var(--ink);
}

/* --------------------------------------------------------------------
   10. 広告枠
   -------------------------------------------------------------------- */
.ad-slot {
  min-height: 110px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background-color: color-mix(in srgb, var(--surface) 70%, var(--paper));
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 中身が枠より広いとき、center のままだと左右にはみ出して左端がスクロールでも
     見られなくなる。safe を付けると、はみ出す場合だけ左寄せに切り替わる。
     （safe 未対応のブラウザはこの行を無視し、上の center がそのまま効く） */
  align-items: safe center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  /* padding はここではなく overflow-x を持つ本体側ではなく、
     スクロールしない外枠に付ける（下の理由を参照）。 */
  padding: 16px 0;
  /* 広告タグは幅468pxなど固定サイズのことが多く、スマホ幅からはみ出すと
     ページ全体が縮小表示されてしまう。ここで確実に断ち切っておく。
     ただし overflow-x:auto を持つ要素自身に左右の padding を付けると、
     多くのブラウザはスクロール終端側（右）の padding を無視してしまい、
     右マージンだけ詰まって見える。そのため左右の余白は
     .ad-slot-sub 側の padding-inline で確保する。 */
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
  height: auto;
}

/* 広告タグを入れる器。広告そのものが中身なので、装飾は最小限にとどめる。
   左右の余白（本来 .ad-slot の padding だったもの）はここで確保する。
   スクロールする親要素(.ad-slot)自身の左右 padding だとブラウザによって
   終端側が無視されるため、スクロールしないこの子要素に padding-inline を
   持たせることで、広告がはみ出しても左右とも同じ余白を保つ。 */
.ad-slot-sub {
  font-size: 11px;
  color: var(--ink-mute);
  opacity: .8;
  /* ここに max-width:100% を付けると、広告本体（600px 幅など）を包める
     大きさまで広がれなくなり、右側だけ padding の外にはみ出してしまう。
     ページ全体を横に広げない役目は外側の .ad-slot（overflow-x:auto側）が
     すでに担っているので、この内側の器はあえて幅を制限しない。 */
  padding-inline: 16px;
  box-sizing: border-box;
}

/* 広告タグが差し込む画像・表は、幅が固定でも枠内に収まるよう縮小する。
   table は縮小しきれないことがあるので、.ad-slot 側の overflow-x:auto が
   最後の保険として効く。 */
.ad-slot img,
.ad-slot table {
  max-width: 100%;
  height: auto;
}

/* iframe には上のルールを当てないこと。
   img と違って iframe は縦横比を保って縮まないため、height:auto を指定すると
   広告が指定した高さ(例:200px)が無効になり、iframe 既定の150pxまで潰れて
   中身の下側が見切れる。広告は指定サイズのまま置き、枠に収まらない分は
   .ad-slot の overflow-x:auto で横スクロールさせる。 */

/* ランダム広告（デスク周り／音／飲み物の3カテゴリ。ads.js が iframe を差し込む） */
.ad-rotate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
}

.ad-category {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ad-category-label {
  font-size: 13px;
  color: var(--ink-mute);
  text-align: center;
}

/* トップページ等の .ad-slot と同じ、点線の枠で広告を囲む */
.ad-rotate-slot {
  min-height: 110px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background-color: color-mix(in srgb, var(--surface) 70%, var(--paper));
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-frame {
  display: block;
  width: 100%;
  height: 240px; /* 読み込み後に ads.js が中身の高さへ合わせる */
  border: 0;
  background: transparent;
}

/* --------------------------------------------------------------------
   11. ヒーロー
   -------------------------------------------------------------------- */
.hero {
  padding-block: 56px 40px;
}

.hero-sub {
  display: block;
  font-family: var(--font-latin);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--marron);
  font-size: 12px;
  margin-bottom: 10px;
}

.hero-lead {
  margin-top: 16px;
  color: var(--ink-mute);
  max-width: 100%;
}

.hero-actions {
  margin-top: 24px;
}

/* --------------------------------------------------------------------
   12. パンくず
   -------------------------------------------------------------------- */
.breadcrumb {
  font-size: 13px;
  color: var(--ink-mute);
  padding-top: 20px;
}

.breadcrumb a {
  color: var(--ink-mute);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------
   13. まろんタイマー
   -------------------------------------------------------------------- */
.timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 22px;
}

.timer-modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.timer-mode-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background-color: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mute);
}

.timer-mode-btn[aria-pressed="true"] {
  color: #fff;
  background-color: var(--lilac-deep);
  border-color: var(--lilac-deep);
}

.timer-ring-wrap {
  position: relative;
  width: min(280px, 70vw);
  aspect-ratio: 1 / 1;
}

.timer-ring-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 10;
}

.timer-ring-progress {
  fill: none;
  stroke: var(--lilac-deep);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset .25s linear, stroke .25s ease;
}

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.timer-time {
  font-family: var(--font-latin);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 700;
  color: var(--ink);
}

.timer-mode-label {
  font-size: 13px;
  color: var(--ink-mute);
}

.timer-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.timer-count {
  font-size: 13.5px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.timer-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-mute);
}

.timer-settings label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-settings input[type="number"] {
  width: 58px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.timer-notify {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  font-size: 12.5px;
  color: var(--ink-mute);
}

/* --------------------------------------------------------------------
   14. フッター
   -------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 32px;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.footer-brand {
  font-weight: 700;
}

.footer-en {
  font-family: var(--font-latin);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: .12em;
  margin-left: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink-mute);
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-sub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  font-size: 12px;
  width: 100%;
}

.footer-sub-links a {
  text-decoration: none;
  color: var(--ink-mute);
}

.footer-sub-links a:hover {
  color: var(--ink);
}

.footer-copy,
.footer-disclosure {
  width: 100%;
  font-size: 12px;
  color: var(--ink-mute);
}

/* --------------------------------------------------------------------
   15. 404
   -------------------------------------------------------------------- */
.notfound {
  padding-block: 90px;
  text-align: center;
}

.notfound-mark {
  font-size: 44px;
  margin-bottom: 12px;
}

.notfound-lead {
  margin-inline: auto;
}

.notfound-actions {
  justify-content: center;
}

/* --------------------------------------------------------------------
   16. このサイトについて／プライバシーポリシー
   -------------------------------------------------------------------- */
.info-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 10px;
  column-gap: 12px;
  font-size: 14px;
  margin: 0;
}

.info-list dt {
  color: var(--ink-mute);
  font-weight: 700;
}

.info-list dd {
  margin: 0;
  color: var(--ink);
}

.legal h2 {
  font-size: 1.15rem;
  margin-top: 2em;
}

.legal h2:first-of-type {
  margin-top: 0;
}

.legal p {
  margin-top: .6em;
  color: var(--ink-mute);
  font-size: 14px;
}

.legal-date {
  margin-top: 2em;
  color: var(--ink-mute);
  font-size: 12px;
}

/* --------------------------------------------------------------------
   17. スクロール演出（IntersectionObserver で付与）
   -------------------------------------------------------------------- */
.js-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}

.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .js-reveal {
    opacity: 1;
    transform: none;
  }

  /* まろんスロット：揺れ・フラッシュ・グロー・バウンドを止める
     （粒子・紙吹雪は slot.js 側で生成そのものを止めている） */
  .slot-machine.slot-shake,
  .slot-machine.slot-reach-flash,
  .slot-reel.slot-stop-bounce,
  .slot-reel.slot-win-glow {
    animation: none;
  }
}

/* --------------------------------------------------------------------
   18. まろんスロット（tool-slot.html）
   演出は元のスロットアプリと同じ。色は下記の5色（リール用パステル）と
   リール文字色・ロックリング色の3点だけを直接指定し、それ以外は
   サイトのCSS変数（トークン）に合わせる。
   -------------------------------------------------------------------- */
/* リールの寸法はここ1箇所で決まる。
   ・リールは「幅を固定」して 4:3 の横長にする（絵柄の文字数で幅が変わらない）
   ・機械の幅＝リール3つ＋すき間2つ＋左右パディング＋枠線
   ・絵柄入力エリアも同じ --slot-col-w を使い、2つの幅を必ず揃える */
.slot-layout {
  --slot-gap: 14px;
  --slot-pad: 22px;

  /* スロットエリアと絵柄入力エリアは同じ列幅を使うので、必ず同じ幅になる */
  display: grid;
  grid-template-columns: min(460px, 100%);
  justify-content: center;
  gap: 20px;
  /* 横並びのとき、絵柄リストのカードをスロット側と同じ高さに揃える */
  align-items: stretch;
}

/* 2列が余裕をもって入る幅のときだけ横並びにする */
@media (min-width: 981px) {
  .slot-layout {
    grid-template-columns: repeat(2, min(460px, 100%));
  }
}

@media (max-width: 420px) {
  .slot-layout {
    --slot-gap: 10px;
    --slot-pad: 14px;
  }
}

.slot-stage-card,
.slot-symbols-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.slot-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 84px; /* バナーが飛び出す分の余白（枠外に出さないため） */
}

@media (max-width: 520px) {
  .slot-stage {
    padding-top: 66px;
  }
}

.slot-machine {
  /* リールのパステル5色（ライト/ダーク共通で固定） */
  --slot-p1: #f7cfe0;
  --slot-p2: #f6e7bd;
  --slot-p3: #cfead6;
  --slot-p4: #cfe0f5;
  --slot-p5: #ddd0f5;

  position: relative;
  display: flex;
  justify-content: center;
  gap: var(--slot-gap);
  padding: var(--slot-pad);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  /* 幅を明示しないと内容に合わせて縮み、リールの % 指定が循環参照になる */
  width: 100%;
  max-width: 100%;
}

.slot-machine.slot-shake {
  animation: slot-shake .35s infinite;
}

@keyframes slot-shake {
  0%   { transform: translate(0, 0) rotate(0deg); }
  20%  { transform: translate(-6px, 4px) rotate(-1deg); }
  40%  { transform: translate(6px, -4px) rotate(1deg); }
  60%  { transform: translate(-5px, -3px) rotate(-1deg); }
  80%  { transform: translate(5px, 3px) rotate(1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.slot-machine.slot-reach-flash {
  animation: slot-reach-flash .6s infinite;
}

@keyframes slot-reach-flash {
  0%   { box-shadow: 0 0 40px 8px var(--slot-p1); }
  25%  { box-shadow: 0 0 40px 8px var(--slot-p2); }
  50%  { box-shadow: 0 0 40px 8px var(--slot-p4); }
  75%  { box-shadow: 0 0 40px 8px var(--slot-p5); }
  100% { box-shadow: 0 0 40px 8px var(--slot-p1); }
}

.slot-reel {
  position: relative;
  /* 機械の内側幅を3等分した固定幅。中身の文字数には一切影響されない。
     高さは aspect-ratio で 4:3 の横長に固定する */
  flex: 0 0 auto;
  width: calc((100% - var(--slot-gap) * 2) / 3);
  aspect-ratio: 4 / 3;
  height: auto;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  /* overflow は hidden にしないこと。ロックリング（inset:-6px）が切り取られる */
  text-align: center;
  word-break: break-all;
  line-height: 1.15;
  border: 1px solid var(--line);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .10), 0 3px 8px rgba(0, 0, 0, .08);
  background-color: var(--slot-p1);
  transition: background-color .15s ease, transform .12s;
}

.slot-reel-text {
  display: block;
  max-width: 100%;
  word-break: break-all;
  font-family: var(--font-jp);
  font-weight: 800;
  /* 初期表示用。回転後は slot.js の REEL_BASE_FONT_SIZE から自動調整される */
  font-size: 22px;
  /* パステル背景の上に置くため、テーマに関わらず読みやすい濃色に固定する（--ink は使わない） */
  color: #463a52;
}

.slot-reel.slot-spinning {
  filter: blur(1.5px);
}

.slot-reel.slot-stop-bounce {
  animation: slot-bounce .35s ease;
}

@keyframes slot-bounce {
  0%   { transform: scale(1.15); }
  50%  { transform: scale(.94); }
  100% { transform: scale(1); }
}

.slot-reel.slot-win-glow {
  animation: slot-win-glow .7s ease-in-out infinite alternate;
}

@keyframes slot-win-glow {
  0%   { box-shadow: inset 0 3px 8px rgba(0, 0, 0, .10), 0 0 10px 2px rgba(255, 255, 255, .6); transform: scale(1); }
  100% { box-shadow: inset 0 3px 8px rgba(0, 0, 0, .10), 0 0 34px 10px #fff, 0 0 50px 16px var(--slot-p2); transform: scale(1.08); }
}

.slot-lock-ring {
  position: absolute;
  inset: -6px;
  border-radius: 12px;
  border: 4px solid #e0b062;
  box-shadow: 0 0 16px 4px #e0b062;
  opacity: 0;
  transform: scale(1.5);
  pointer-events: none;
}

.slot-lock-ring i {
  position: absolute;
  top: -18px;
  right: -14px;
  font-size: 22px;
  font-style: normal;
}

.slot-lock-ring.slot-show {
  animation: slot-lock-ring-in 2s ease forwards;
}

.slot-lock-ring.slot-fade-out {
  animation: slot-lock-ring-out .3s ease forwards;
}

@keyframes slot-lock-ring-in {
  from { opacity: 0; transform: scale(1.5); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slot-lock-ring-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.3); }
}

.slot-spin-btn {
  font-family: var(--font-jp);
  font-size: 18px;
  font-weight: 800;
  padding: 14px 42px;
  border-radius: 14px;
  letter-spacing: .08em;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .28), 0 8px 16px rgba(0, 0, 0, .18);
  transition: transform .08s, box-shadow .08s;
}

.slot-spin-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .28), 0 4px 10px rgba(0, 0, 0, .15);
}

.slot-banner {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translate(-50%, -100%) scale(.8);
  font-family: var(--font-jp);
  font-size: 30px;
  font-weight: 900;
  padding: 6px 22px;
  border-radius: 14px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  background: linear-gradient(135deg, var(--lilac-deep), var(--sakura));
  text-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .25s, transform .25s;
}

.slot-banner.slot-show {
  opacity: 1;
  transform: translate(-50%, -104%) scale(1);
}

@media (max-width: 520px) {
  .slot-banner {
    font-size: 22px;
    padding: 5px 16px;
  }
}

.slot-particles,
.slot-confetti {
  position: absolute;
  inset: -40px;
  pointer-events: none;
  overflow: visible;
}

.slot-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  opacity: .95;
}

.slot-confetti-piece {
  position: absolute;
  width: 10px;
  height: 16px;
  opacity: 0;
}

.slot-symbols-card {
  display: flex;
  flex-direction: column;
}

.slot-symbols-label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 8px;
}

.slot-symbols-input {
  width: 100%;
  /* カードの余りを全部使って伸びる（スロット側と高さが揃う） */
  flex: 1 1 auto;
  min-height: 150px;
  box-sizing: border-box;
  resize: vertical;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.6;
}

.slot-symbols-note {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-mute);
}

.slot-steps {
  margin: 0;
  padding-left: 1.4em;
  color: var(--ink-mute);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --------------------------------------------------------------------
   15. Roulette
   -------------------------------------------------------------------- */
.roulette-machine {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 100%;
  padding: 30px;
  min-height: 250px;
  box-sizing: border-box;
}

.roulette-board-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
}

#roulette-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--line);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: block;
}

.roulette-pointer {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  color: #ff5252;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 10;
}

.roulette-center-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: var(--line);
  border-radius: 50%;
  z-index: 5;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.4);
}

/* --------------------------------------------------------------------
   14. ブログ
   -------------------------------------------------------------------- */
.pill--blog {
  background-color: color-mix(in srgb, var(--marron) 26%, var(--surface));
  color: var(--marron);
}

/* ---- 一覧ページのレイアウト ----
   モバイル（既定）: 記事一覧が先、フィルターはその下（1カラム）。
   デスクトップ（861px〜）: 記事一覧を左、フィルターを縦積みのサイドバーとして右に配置する。
   grid-template-areas を使うので、上下どちらのレイアウトでも
   HTML側の並び順（記事一覧→フィルター）を変える必要はない。 */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "main"
    "filters";
  gap: 32px;
}

@media (min-width: 861px) {
  .blog-layout {
    grid-template-columns: 1fr 200px;
    grid-template-areas: "main filters";
    align-items: start;
  }
}

.blog-layout-main {
  grid-area: main;
  min-width: 0; /* グリッド内でカードやコードブロックが幅をはみ出さないようにする */
}

.blog-filters {
  grid-area: filters;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 861px) {
  .blog-filters {
    position: sticky;
    top: 84px; /* ヘッダーの高さぶん空けて追従させる */
  }
}

.blog-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-filter-group-label {
  font-size: 12.5px;
  color: var(--ink-mute);
}

.blog-filter-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 861px) {
  .blog-filter-group-items {
    flex-direction: column;
    align-items: flex-start;
  }
}

.blog-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background-color: var(--surface);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
}

.blog-filter-btn:hover {
  transform: translateY(-1px);
  border-color: var(--lilac);
}

.blog-filter-btn.is-active {
  background-color: var(--lilac-deep);
  border-color: var(--lilac-deep);
  color: #fff;
}

/* ---- 記事一覧 ---- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.blog-card-date {
  font-family: var(--font-latin);
  font-size: 12.5px;
  color: var(--ink-mute);
}

.blog-card-title {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 8px;
}

.blog-card-title a {
  text-decoration: none;
}

.blog-card-title a:hover {
  text-decoration: underline;
}

.blog-card-excerpt {
  color: var(--ink-mute);
  font-size: 14px;
}

.blog-more {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.blog-empty {
  color: var(--ink-mute);
  font-size: 14px;
  text-align: center;
  padding: 32px 0;
}

/* .btn-ghost の display:inline-flex が [hidden] の初期スタイルと
   同じ詳細度で衝突し、hidden属性だけでは隠れなくなるための保険。 */
#blog-more[hidden] {
  display: none;
}

/* ---- 記事ページ ---- */
.article-sheet {
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: 32px;
}

.article-head {
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.article-date,
.article-updated {
  font-family: var(--font-latin);
  font-size: 12.5px;
  color: var(--ink-mute);
}

.article-toc {
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 8px;
}

.article-toc-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 8px;
}

.article-toc ol {
  margin: 0;
  padding-left: 1.4em;
}

.article-toc li {
  margin: .3em 0;
  font-size: 14px;
}

.article-toc a {
  color: var(--ink);
  text-decoration: none;
}

.article-toc a:hover {
  color: var(--lilac-deep);
  text-decoration: underline;
}

/* ---- 記事本文 ---- */
.article-body h2 {
  margin-top: 2.4em;
  margin-bottom: .8em;
  padding-bottom: .3em;
  border-bottom: 2px solid var(--line);
}

.article-body h3 {
  margin-top: 1.8em;
  margin-bottom: .6em;
  font-size: 1.15rem;
}

.article-body p {
  margin: 1.2em 0;
}

.article-body ul,
.article-body ol {
  margin: 1.2em 0;
  padding-left: 1.6em;
}

.article-body li {
  margin: .4em 0;
}

.article-body a {
  color: var(--lilac-deep);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.article-body img {
  margin: 1.6em auto;
  border-radius: var(--radius);
}

.article-body blockquote {
  margin: 1.6em 0;
  padding: .1em 1.2em;
  border-left: 4px solid var(--lilac);
  color: var(--ink-mute);
}

.article-body code {
  padding: .15em .4em;
  border-radius: 4px;
  background: var(--paper-grid);
  font-size: .92em;
}

.article-body pre {
  padding: 1em;
  border-radius: var(--radius);
  background: var(--paper-grid);
  overflow-x: auto;
}

.article-body pre code {
  padding: 0;
  background: none;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
}

.article-body th,
.article-body td {
  padding: .6em .8em;
  border: 1px solid var(--line);
}

.article-body hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---- 本文中の広告枠 ---- */
.ad-slot--inline {
  margin: 2em 0;
}

/* ---- 前後記事ナビ ---- */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px auto 0;
  max-width: 720px;
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s ease, border-color .15s ease;
}

.article-nav-link:hover {
  transform: translateY(-1px);
  border-color: var(--lilac);
}

.article-nav-link--next {
  text-align: right;
  grid-column: 2;
}

.article-nav-label {
  font-size: 11.5px;
  color: var(--ink-mute);
}

.article-nav-title {
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 520px) {
  .article-nav {
    grid-template-columns: 1fr;
  }

  .article-nav-link--next {
    grid-column: 1;
    text-align: left;
  }
}
