/* ============================================================
   ダークパターン博物館 — style.css
   表はポップな文化祭、裏（タネあかし）は暗転。
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --paper: #f7f1e3;
  --paper2: #f1e9d6;
  --white: #fffdf6;
  --ink: #26203a;
  --ink-soft: rgba(38, 32, 58, 0.72);
  --ink-dim: rgba(38, 32, 58, 0.5);
  --line: rgba(38, 32, 58, 0.16);
  --red: #e94b3c;
  --red-deep: #c93327;
  --blue: #3457d5;
  --yellow: #ffc93c;
  --green: #2f9e60;
  --purple: #6a4fd8;
  --dark: #1b1531;
  --dark2: #262046;
  --hanko: #d8322a;
  --shadow: 0.55rem 0.55rem 0 rgba(38, 32, 58, 0.14);
  --bd: 3px solid var(--ink);
  --radius: 18px;
  --font-head: "Dela Gothic One", "Hiragino Sans", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  --font-dot: "DotGothic16", monospace;
  --font-hand: "Yusei Magic", "Hiragino Sans", sans-serif;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--paper);
  background-image: radial-gradient(rgba(38, 32, 58, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--yellow); color: var(--ink); }

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Dela Gothic One / Yusei Magic はウェイト400のみ。
   見出しのデフォルト太字だと疑似ボールドで輪郭が汚く滲むため400に固定する。 */
h1, h2, h3 { font-weight: 400; }
.bill-total strong, .clock-meta strong, .zawa-badge strong,
.shateki-hud strong, .stampbook-count strong, .meiro-meta strong { font-weight: 400; }
strong { font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.pc { display: inline; }
@media (max-width: 700px) { .pc { display: none; } }

/* OGP撮影用（?ogp=1）：固定UIを隠し、リビールを即時表示 */
.is-ogp .stampbook, .is-ogp .topbar, .is-ogp .hero-naming,
.is-ogp .hero-cta, .is-ogp .hero-ticket { display: none; }
.is-ogp .hero { min-height: 100svh; padding-bottom: 40px; }
.is-ogp .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
.is-ogp .hf { animation-play-state: paused; }
.is-ogp .hf > i { animation-play-state: paused; }

/* ---------- 共通ボタン ---------- */

.btn-main {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 17px;
  color: var(--white);
  background: var(--red);
  border: var(--bd);
  border-radius: 100px;
  padding: 16px 38px;
  text-decoration: none;
  box-shadow: 0.35rem 0.35rem 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-main:hover {
  transform: translate(2px, 2px);
  box-shadow: 0.12rem 0.12rem 0 var(--ink);
  background: var(--red-deep);
}
.btn-main:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--ink); }

.btn-sub {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--white);
  border: var(--bd);
  border-radius: 100px;
  padding: 14px 30px;
  text-decoration: none;
  box-shadow: 0.35rem 0.35rem 0 rgba(38, 32, 58, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-sub:hover { transform: translate(2px, 2px); box-shadow: 0.12rem 0.12rem 0 rgba(38, 32, 58, 0.18); }

.btn-demo {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
  background: var(--blue);
  border: var(--bd);
  border-radius: 12px;
  padding: 12px 26px;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
  transition: transform 0.13s ease, box-shadow 0.13s ease, opacity 0.2s;
}
.btn-demo:hover { transform: translate(2px, 2px); box-shadow: 0.1rem 0.1rem 0 var(--ink); }
.btn-demo:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: 0.3rem 0.3rem 0 var(--ink); }
.btn-demo-ghost { background: var(--white); color: var(--ink); }

/* ---------- リビール ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- ローディング（書体のチラつき隠し） ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity 0.4s ease;
}
.loader.is-done { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-inline: auto;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-head);
  font-size: 26px;
  box-shadow: 0.25rem 0.25rem 0 rgba(38, 32, 58, 0.15);
  animation: loaderBounce 0.9s ease-in-out infinite;
}
@keyframes loaderBounce {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}
.loader-text {
  margin-top: 16px;
  font-family: var(--font-hand);
  font-size: 13.5px;
  color: var(--ink-soft);
}
@media (prefers-reduced-motion: reduce) {
  .loader-badge { animation: none; }
}
.is-ogp .loader { display: none; }

/* ---------- 展示No.0 入口ゲート ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(27, 21, 49, 0.82);
}
.gate[hidden] { display: none; }
.gate-card {
  max-width: 480px;
  background: var(--white);
  border: var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 30px 26px;
  text-align: center;
}
.gate-no {
  display: inline-block;
  font-family: var(--font-dot);
  font-size: 13px;
  background: var(--ink);
  color: var(--white);
  border-radius: 100px;
  padding: 3px 14px;
  margin-bottom: 16px;
}
.gate-card h2 { font-family: var(--font-body); font-weight: 700; font-size: 21px; line-height: 1.75; }
.gate-note { font-size: 13px; color: var(--ink-soft); margin-top: 12px; }
.gate-actions { display: grid; gap: 12px; margin-top: 22px; }
.gate-yes {
  font-family: var(--font-head);
  font-size: 17px;
  color: var(--white);
  background: var(--red);
  border: var(--bd);
  border-radius: 100px;
  padding: 16px 20px;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
}
.gate-yes:hover { transform: translate(2px, 2px); box-shadow: 0.1rem 0.1rem 0 var(--ink); }
.gate-no-btn {
  font-size: 11px;
  color: var(--ink-dim);
  background: none;
  border: none;
  text-decoration: underline;
  justify-self: center;
}
.gate-fine {
  font-family: var(--font-hand);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 20px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

/* 入口ゲート・認定証のカードはポヨンと出す */
.gate-card, .cert-card { animation: cardPop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes cardPop {
  0% { opacity: 0; transform: scale(0.7) translateY(34px); }
  62% { opacity: 1; transform: scale(1.03) translateY(-7px); }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-card, .cert-card { animation: none; }
}

/* ---------- ヘッダー ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(247, 241, 227, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-110%);
  transition: transform 0.35s ease;
}
.topbar.is-show { transform: none; }
.topbar-logo {
  font-family: var(--font-head);
  font-size: clamp(18px, 4.6vw, 21px);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.topbar-logo span { color: var(--red); }
.topbar-nav { display: flex; gap: 4px; }
.topbar-nav a {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 100px;
  transition: background 0.15s;
}
.topbar-nav a:hover { background: var(--yellow); }

/* モバイルはハンバーガーメニュー */
.topbar-burger {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  flex: none;
  background: var(--white);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 0;
}
.topbar-burger span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.topbar-burger span:nth-child(1) { top: 12px; }
.topbar-burger span:nth-child(2) { top: 50%; margin-top: -1.25px; }
.topbar-burger span:nth-child(3) { bottom: 12px; }
.topbar-burger.is-open span:nth-child(1) { transform: translateY(6.75px) rotate(45deg); }
.topbar-burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
.topbar-burger.is-open span:nth-child(3) { transform: translateY(-6.75px) rotate(-45deg); }
@media (max-width: 600px) {
  .topbar-nav { display: none; }
  .topbar-burger { display: block; }
}

.topbar-menu {
  position: fixed;
  top: 72px;
  right: 12px;
  z-index: 99;
  min-width: 200px;
  background: var(--white);
  border: var(--bd);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  gap: 4px;
  transform-origin: calc(100% - 26px) -10px;
}
.topbar-menu a {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 10px;
}
.topbar-menu a:hover, .topbar-menu a:active { background: var(--yellow); }
.topbar-menu[hidden] { display: none; }
.topbar-menu.is-open { animation: menuIn 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.topbar-menu.is-close { animation: menuOut 0.2s ease-in both; }
@keyframes menuIn {
  0% { opacity: 0; transform: translateY(-14px) scale(0.5) rotate(3deg); }
  62% { opacity: 1; transform: translateY(4px) scale(1.03) rotate(-1deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes menuOut {
  to { opacity: 0; transform: translateY(-12px) scale(0.55) rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .topbar-menu.is-open, .topbar-menu.is-close { animation: none; }
  .topbar-burger span { transition: none; }
}

/* ---------- ヒーロー ---------- */

.hero {
  position: relative;
  min-height: 92svh;
  display: grid;
  place-items: center;
  padding: clamp(120px, 18vh, 190px) 20px 90px;
  overflow: hidden;
}

/* 紅白幕：本体は最上部まで完全に塗り、すそのスカラップは::afterで作る */
.kohaku {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0 70px,
    var(--white) 70px 140px
  );
}
.kohaku::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 34px;
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0 70px,
    var(--white) 70px 140px
  );
  -webkit-mask-image: radial-gradient(circle 35px at 35px 0, #000 98%, transparent 100%);
  -webkit-mask-size: 70px 34px;
  -webkit-mask-repeat: repeat-x;
  mask-image: radial-gradient(circle 35px at 35px 0, #000 98%, transparent 100%);
  mask-size: 70px 34px;
  mask-repeat: repeat-x;
}

/* ガーランド */
.garland {
  position: absolute;
  top: 57px;
  left: -2%;
  width: 104%;
  pointer-events: none;
}
.garland svg { width: 100%; height: clamp(46px, 7vw, 84px); display: block; }
.garland-rope { stroke: var(--ink); stroke-width: 3; }

/* HEROに舞う紙吹雪と「○に×」 */
.hero-float {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.hf {
  position: absolute;
  top: -80px;
  animation: hfFall var(--d, 10s) linear var(--dl, 0s) infinite;
}
.hf > i {
  display: block;
  font-style: normal;
  animation: hfSway var(--s, 2.2s) ease-in-out var(--dl, 0s) infinite alternate;
}
.hf-paper > i {
  width: 11px;
  height: 15px;
  background: var(--c, var(--red));
  border-radius: 2px;
}
.hf-x > i {
  display: grid;
  place-items: center;
  width: var(--w, 32px);
  height: var(--w, 32px);
  font-family: var(--font-head);
  font-size: calc(var(--w, 32px) * 0.44);
  color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 50%;
  opacity: 0.85;
}
@keyframes hfFall {
  to { transform: translateY(calc(100vh + 180px)); }
}
@keyframes hfSway {
  from { transform: translateX(-16px) rotate(-14deg); }
  to { transform: translateX(16px) rotate(14deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-float { display: none; }
}

.hero-inner { text-align: center; width: 100%; max-width: 900px; position: relative; z-index: 2; }

.hero-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 100px;
  padding: 6px 18px;
  margin-bottom: clamp(18px, 3vh, 30px);
}
.hero-open .blink { color: var(--red); animation: blink 1.4s steps(2) infinite; font-size: 10px; }
@keyframes blink { 50% { opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) { .hero-open .blink { animation: none; } }

.hero-title {
  font-family: var(--font-head);
  line-height: 1.04;
  letter-spacing: 0.01em;
}
.hero-title-row { display: block; }
.ht { display: inline-block; }

/* タイトルの1文字ずつの登場演出（JSで.ht-chに分割し、.is-playで再生） */
.js .hero-title .ht-ch {
  --tilt: 9deg;
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) scale(0.3) rotate(var(--tilt));
}
.js .hero-title.is-play .ht-ch {
  animation: chPop 0.55s cubic-bezier(0.2, 1.7, 0.4, 1) forwards;
  animation-delay: calc(0.05s + var(--i, 0) * 0.055s);
}
@keyframes chPop {
  0% { opacity: 0; transform: translateY(0.55em) scale(0.3) rotate(var(--tilt)); }
  62% { opacity: 1; transform: translateY(-0.07em) scale(1.09) rotate(calc(var(--tilt) * -0.25)); }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .hero-title .ht-ch { opacity: 1; transform: none; animation: none !important; }
}
.is-ogp .hero-title .ht-ch { opacity: 1 !important; transform: none !important; animation: none !important; }
.ht-dark {
  font-size: clamp(34px, 9.5vw, 108px);
  color: var(--ink);
  text-shadow: 5px 5px 0 var(--yellow);
}
.ht-pattern {
  font-size: clamp(34px, 9.5vw, 108px);
  color: var(--red);
  text-shadow: 5px 5px 0 rgba(38, 32, 58, 0.16);
}
.ht-museum {
  font-size: clamp(42px, 12vw, 138px);
  color: var(--ink);
  -webkit-text-stroke: 0;
  text-shadow: 6px 6px 0 #5b8ef6;
}
.hero-en {
  font-family: var(--font-dot);
  font-size: clamp(12px, 2vw, 17px);
  letter-spacing: 0.42em;
  color: var(--ink-soft);
  margin-top: 18px;
}
.hero-lead {
  font-size: clamp(14px, 1.8vw, 17px);
  margin-top: clamp(20px, 3.4vh, 34px);
  color: var(--ink);
}
.hero-cta { margin-top: clamp(24px, 4vh, 40px); }
.hero-safety {
  font-family: var(--font-hand);
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 16px;
}

/* チケット（右下の飾り） */
.hero-ticket {
  position: absolute;
  right: clamp(8px, 4vw, 70px);
  bottom: clamp(14px, 5vh, 48px);
  transform: rotate(6deg);
  z-index: 1;
}
.ticket {
  background: var(--yellow);
  border: var(--bd);
  border-radius: 12px;
  padding: 14px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
}
.ticket::before, .ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50%;
  transform: translateY(-50%);
}
.ticket::before { left: -11px; }
.ticket::after { right: -11px; }
.ticket-head { font-family: var(--font-body); font-weight: 700; font-size: 12.5px; letter-spacing: 0.2em; }
.ticket-price { font-family: var(--font-head); font-size: 40px; line-height: 1.15; }
.ticket-note { font-family: var(--font-hand); font-size: 11px; line-height: 1.6; }
@media (max-width: 860px) {
  .hero-ticket { position: static; margin-top: 44px; transform: rotate(-3deg); }
}

/* 呼び名についてボタンとモーダル */
.hero-naming {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-dim);
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero-naming:hover { color: var(--ink); }

.naming {
  position: fixed;
  inset: 0;
  z-index: 205;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(27, 21, 49, 0.82);
  overflow-y: auto;
}
.naming[hidden] { display: none; }
.naming-card {
  max-width: 560px;
  background: var(--white);
  border: var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 42px);
  text-align: center;
  animation: cardPop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
  margin: 14px 0;
}
@media (prefers-reduced-motion: reduce) { .naming-card { animation: none; } }
.naming-tag {
  display: inline-block;
  font-family: var(--font-dot);
  font-size: 13px;
  background: var(--purple);
  color: var(--white);
  border-radius: 100px;
  padding: 3px 16px;
  margin-bottom: 14px;
}
.naming-card h2 { font-family: var(--font-body); font-weight: 700; font-size: 19px; line-height: 1.7; }
.naming-body { text-align: left; margin-top: 18px; }
.naming-body p { font-size: 14px; color: var(--ink-soft); }
.naming-body p + p { margin-top: 12px; }
.naming-body b { color: var(--ink); }
.naming-close { margin-top: 24px; }

/* ---------- マーキー ---------- */

.marquee {
  background: var(--ink);
  color: var(--paper);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
  padding: 12px 0;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 34px;
  width: max-content;
  animation: marquee 26s linear infinite;
  font-family: var(--font-head);
  font-size: 15px;
  white-space: nowrap;
}
.marquee-track i { color: var(--yellow); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- セクション共通 ---------- */

.about, .map, .library, .exit {
  padding: clamp(80px, 12vh, 150px) clamp(20px, 5vw, 60px);
  max-width: 1200px;
  margin-inline: auto;
}

.sec-head { text-align: center; margin-bottom: clamp(40px, 6vh, 70px); }
.sec-en {
  font-family: var(--font-dot);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--red);
}
.sec-title {
  font-family: var(--font-head);
  font-size: clamp(30px, 5.4vw, 52px);
  margin-top: 6px;
}
.sec-lead { margin-top: 18px; color: var(--ink-soft); font-size: 15px; }

/* ---------- ABOUT ---------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; } }
.about-card {
  background: var(--white);
  border: var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px;
}
.about-card:nth-child(2) { transform: rotate(0.6deg); }
.about-card:nth-child(3) { transform: rotate(-0.5deg); }
.about-card h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--line);
}
.about-card p { font-size: 14px; color: var(--ink-soft); }
.about-card strong { color: var(--ink); }

/* ---------- 会場マップ ---------- */

.map-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
}
@media (max-width: 1020px) { .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .map-grid { grid-template-columns: 1fr; } }

.map-item a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  background: var(--white);
  border: var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 16px 22px;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.map-item a:hover { transform: translateY(-5px) rotate(-0.6deg); box-shadow: 0.75rem 0.75rem 0 rgba(38, 32, 58, 0.16); }

.map-roof {
  width: calc(100% + 32px);
  height: 26px;
  margin-bottom: 14px;
  border-bottom: 3px solid var(--ink);
}
.roof-red    { background: repeating-linear-gradient(90deg, var(--red) 0 22px, var(--white) 22px 44px); }
.roof-blue   { background: repeating-linear-gradient(90deg, var(--blue) 0 22px, var(--white) 22px 44px); }
.roof-yellow { background: repeating-linear-gradient(90deg, var(--yellow) 0 22px, var(--white) 22px 44px); }
.roof-green  { background: repeating-linear-gradient(90deg, var(--green) 0 22px, var(--white) 22px 44px); }
.roof-purple { background: repeating-linear-gradient(90deg, var(--purple) 0 22px, var(--white) 22px 44px); }

.map-no { font-family: var(--font-dot); font-size: 12px; color: var(--ink-soft); }
.map-kanji {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 6px 0;
  font-family: var(--font-head);
  font-size: 27px;
  color: var(--red);
  border: 3px solid var(--red);
  border-radius: 50%;
  transform: rotate(-6deg);
}
.map-name { font-family: var(--font-body); font-weight: 700; font-size: 16.5px; }
.map-pat { font-size: 11.5px; color: var(--ink-dim); line-height: 1.5; }

.map-stamp {
  position: absolute;
  top: 34px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-family: var(--font-head);
  font-size: 17px;
  color: var(--hanko);
  border: 3px solid var(--hanko);
  border-radius: 50%;
  transform: rotate(12deg) scale(0);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 2.2, 0.4, 1), opacity 0.2s;
}
.map-stamp.is-on { transform: rotate(12deg) scale(1); opacity: 0.9; }

/* ---------- パビリオン共通 ---------- */

.pav {
  padding: clamp(80px, 12vh, 150px) clamp(20px, 5vw, 60px);
  border-top: 3px solid var(--ink);
}
.pav:nth-of-type(even) { background: var(--paper2); }
.pav > * { max-width: 860px; margin-inline: auto; }

.pav-head { text-align: center; margin-bottom: clamp(30px, 5vh, 50px); }
.pav-no {
  display: inline-block;
  font-family: var(--font-dot);
  font-size: 13px;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 16px;
  border-radius: 100px;
}
.pav-title {
  font-family: var(--font-head);
  font-size: clamp(27px, 5vw, 44px);
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pav-kanji {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 24px;
  color: var(--red);
  border: 3px solid var(--red);
  border-radius: 50%;
  transform: rotate(-6deg);
  flex: none;
}
.pav-pat { font-family: var(--font-dot); font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
.pav-lead { font-size: 15px; margin-top: 14px; }

.demo-frame {
  background: var(--white);
  border: var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 40px);
  position: relative;
}
.demo-goal {
  font-family: var(--font-hand);
  font-size: 14px;
  margin-top: 16px;
  text-align: center;
}

/* ---------- タネあかし ---------- */

.tane { margin-top: 26px; text-align: center; }
.tane-btn {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--ink);
  background: var(--yellow);
  border: 2px dashed var(--ink);
  border-radius: 100px;
  padding: 10px 26px;
  transition: transform 0.15s;
}
.tane-btn:hover { transform: rotate(-1.2deg) scale(1.03); }
.tane-btn[aria-expanded="true"] { background: var(--dark); color: var(--paper); border-style: solid; }

.tane-body {
  transform-origin: top center;
  animation: taneIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
  margin-top: 16px;
  text-align: left;
  background: var(--dark);
  color: rgba(247, 241, 227, 0.92);
  border: var(--bd);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: var(--shadow);
  font-family: var(--font-hand);
}
@keyframes taneIn {
  0% { opacity: 0; transform: translateY(-14px) scale(0.86) rotate(-0.8deg); }
  62% { opacity: 1; transform: translateY(6px) scale(1.02) rotate(0.3deg); }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tane-body { animation: none; }
}
.tane-body h3 {
  font-family: var(--font-head);
  color: var(--yellow);
  font-size: 19px;
  margin-bottom: 14px;
}
.tane-body p { font-size: 15.5px; margin-top: 12px; line-height: 2; }
.tane-body b { color: var(--yellow); font-weight: 400; }

/* ---------- P1 こっそり屋台 ---------- */

.yatai { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 3vw, 34px); align-items: start; }
@media (max-width: 700px) { .yatai { grid-template-columns: 1fr; } }

.yatai-menu {
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 22px 18px;
}
.yatai-sign {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  background: var(--red);
  color: var(--white);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 18px;
}
.yatai-name { font-family: var(--font-body); font-weight: 700; font-size: 15px; }
.yatai-price { font-family: var(--font-dot); font-size: 44px; line-height: 1.3; }
.yatai-price span { font-size: 18px; }
.yatai-menu .btn-demo { margin-top: 14px; }

.yatai-bill { border: 2px solid var(--ink); border-radius: 12px; padding: 20px 18px; }
.bill-head {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  text-align: center;
  border-bottom: 2px dashed var(--line);
  padding-bottom: 10px;
}
.bill-list { list-style: none; margin-top: 8px; }
.bill-empty {
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--ink-dim);
  text-align: center;
  padding: 26px 14px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  margin-top: 10px;
}
.bill-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.bill-list li.bill-sneak { color: var(--ink-soft); }
.bill-list li .bill-yen { font-family: var(--font-dot); white-space: nowrap; }
.bill-remove {
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--red);
  background: none;
  border: 2px solid var(--red);
  border-radius: 100px;
  padding: 2px 10px;
  flex: none;
}
.bill-remove:hover { background: var(--red); color: var(--white); }
.bill-total {
  font-family: var(--font-head);
  font-size: 15px;
  text-align: right;
  margin-top: 12px;
}
.bill-total strong { font-family: var(--font-dot); font-size: 30px; }
.bill-msg { font-family: var(--font-hand); font-size: 13px; margin-top: 10px; text-align: center; min-height: 1.6em; }

/* ---------- P2 せかしの時計台 ---------- */

.clock-hall { text-align: center; }
.sale-label {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  background: var(--red);
  color: var(--white);
  padding: 6px 20px;
  border-radius: 100px;
}
.clock {
  font-family: var(--font-dot);
  font-size: clamp(56px, 12vw, 110px);
  line-height: 1.2;
  letter-spacing: 0.04em;
  margin-top: 10px;
}
.clock.is-panic { color: var(--red); }
.clock.is-reset { animation: clockShake 0.5s ease; }
@keyframes clockShake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-7px) rotate(-1.2deg); }
  60% { transform: translateX(6px) rotate(1deg); }
}
.clock-sub { font-family: var(--font-hand); font-size: 13px; color: var(--ink-soft); }
.clock-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 24px;
  font-size: 14px;
}
.clock-meta strong { font-family: var(--font-dot); font-size: 22px; color: var(--red); }

/* ---------- P3 ざわつき見世物小屋 ---------- */

.zawa { text-align: center; }
.zawa-card {
  max-width: 460px;
  margin-inline: auto;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 22px;
  transition: transform 0.25s ease;
}
.zawa-card.is-roll { animation: zawaPop 0.4s ease; }
@keyframes zawaPop {
  30% { transform: scale(0.97) rotate(-0.6deg); }
  70% { transform: scale(1.02) rotate(0.4deg); }
}
.zawa-product { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.zawa-pname { font-family: var(--font-body); font-weight: 700; font-size: 17px; }
.zawa-pprice { font-family: var(--font-dot); font-size: 24px; }
.zawa-badges { list-style: none; margin-top: 16px; display: grid; gap: 8px; text-align: left; }
.zawa-badge {
  font-size: 13.5px;
  border-radius: 8px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
}
.zawa-badge strong { font-family: var(--font-dot); font-size: 17px; }
.zb-red { background: #ffe3df; color: var(--red-deep); border-color: var(--red); }
.zb-blue { background: #e2e9ff; color: var(--blue); border-color: var(--blue); }
.zb-ink { background: var(--paper); color: var(--ink-soft); border-style: dashed; }
.zawa .btn-demo { margin-top: 20px; }
.zawa-truth {
  font-family: var(--font-hand);
  font-size: 13.5px;
  margin-top: 14px;
  color: var(--ink);
}
.zawa-truth code {
  font-family: var(--font-dot);
  background: var(--dark);
  color: var(--yellow);
  border-radius: 6px;
  padding: 2px 8px;
}

/* ---------- P4 いやみの関所 ---------- */

.sekisho { text-align: center; }
.sekisho-box {
  max-width: 480px;
  margin-inline: auto;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 26px 22px 18px;
}
.sekisho-q { font-family: var(--font-body); font-weight: 700; font-size: 17.5px; line-height: 1.8; }
.sekisho-actions { display: grid; gap: 10px; margin-top: 20px; }
.sekisho-no {
  font-size: 12px;
  color: var(--ink-dim);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 100px;
  padding: 9px 14px;
}
.sekisho-no.is-shake { animation: clockShake 0.4s ease; }
.sekisho-slip {
  margin-top: 16px;
  font-size: 10.5px;
  color: var(--ink-dim);
  background: none;
  border: none;
  text-decoration: underline;
}
.sekisho-msg {
  font-family: var(--font-hand);
  font-size: 14px;
  margin-top: 16px;
  min-height: 2em;
}
.sekisho-msg.is-clear { color: var(--green); font-weight: 700; }

/* ---------- P5 ボタンお化け屋敷 ---------- */

.obake-entry { text-align: center; }
.obake-warn { font-family: var(--font-hand); font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }
.obake-result { font-family: var(--font-hand); font-size: 14px; margin-top: 16px; min-height: 1.8em; }

.obake-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(27, 21, 49, 0.92);
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
}
.obake-overlay[hidden] { display: none; }
.obake-ad {
  position: relative;
  max-width: 520px;
  width: 100%;
  background: linear-gradient(160deg, #fff43a, #ff9d2e);
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: 44px 26px 30px;
  text-align: center;
  box-shadow: 0 0 0 8px rgba(255, 244, 58, 0.25);
}
.obake-flash {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--red-deep);
  animation: blink 0.8s steps(2) infinite;
}
.obake-big { font-family: var(--font-head); font-size: clamp(22px, 5vw, 32px); line-height: 1.5; margin-top: 8px; }
.obake-big .nb { white-space: nowrap; }
.obake-big strong { color: var(--red-deep); font-size: 1.25em; }
.obake-prize { font-size: 13.5px; margin-top: 12px; }
.obake-cta {
  font-family: var(--font-head);
  font-size: 19px;
  color: var(--white);
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 100px;
  padding: 16px 34px;
  margin-top: 18px;
  animation: ctaPulse 1.1s ease infinite;
}
@keyframes ctaPulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .obake-flash, .obake-cta { animation: none; }
}
.obake-hint { font-family: var(--font-hand); font-size: 12px; color: rgba(38, 32, 58, 0.65); margin-top: 16px; }

.obake-x {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-family: var(--font-head);
  font-size: 15px;
  background: var(--white);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.obake-real {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 10px;
  color: rgba(38, 32, 58, 0.4);
  background: none;
  border: none;
  text-decoration: underline;
  opacity: 0;
  transition: opacity 0.6s;
}
.obake-real.is-on { opacity: 1; }
.obake-ghost {
  position: absolute;
  font-size: 26px;
  pointer-events: none;
  animation: ghostUp 1s ease forwards;
}
@keyframes ghostUp {
  from { opacity: 1; transform: translateY(0) scale(0.7); }
  to { opacity: 0; transform: translateY(-56px) scale(1.25) rotate(10deg); }
}

/* ---------- P6 解約大迷路 ---------- */

.meiro-stage { max-width: 540px; margin-inline: auto; }
.meiro-card {
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 26px 22px;
  text-align: center;
  animation: meiroIn 0.3s ease;
}
@keyframes meiroIn {
  from { opacity: 0; transform: translateY(10px); }
}
.meiro-title { font-family: var(--font-body); font-weight: 700; font-size: 17.5px; line-height: 1.8; }
.meiro-text { font-size: 13.5px; color: var(--ink-soft); margin-top: 12px; }
.meiro-actions { display: grid; gap: 10px; margin-top: 20px; justify-items: center; }
.meiro-big {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
  background: var(--green);
  border: var(--bd);
  border-radius: 100px;
  padding: 13px 28px;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
}
.meiro-big:hover { transform: translate(2px, 2px); box-shadow: 0.1rem 0.1rem 0 var(--ink); }
.meiro-small {
  font-size: 11px;
  color: var(--ink-dim);
  background: none;
  border: none;
  text-decoration: underline;
}
.meiro-gray {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  color: rgba(38, 32, 58, 0.38);
  background: #e8e2d2;
  border: 2px solid rgba(38, 32, 58, 0.25);
  border-radius: 100px;
  padding: 11px 24px;
}
.meiro-survey { list-style: none; display: grid; gap: 8px; margin-top: 18px; text-align: left; }
.meiro-survey label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
.meiro-survey label:hover { border-color: var(--ink); }
.meiro-phone {
  font-family: var(--font-dot);
  font-size: 26px;
  margin-top: 12px;
}
.meiro-done-kanji {
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  margin: 0 auto 14px;
  font-family: var(--font-head);
  font-size: 34px;
  color: var(--green);
  border: 4px solid var(--green);
  border-radius: 50%;
  transform: rotate(-8deg);
}
.meiro-meta {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.meiro-meta strong { font-family: var(--font-dot); font-size: 18px; color: var(--ink); }

/* ---------- P7 チェックの森 ---------- */

.mori-form { max-width: 540px; margin-inline: auto; display: grid; gap: 10px; }
.mori-head {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15.5px;
  text-align: center;
  margin-bottom: 8px;
}
.mori-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.8;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--white);
  transition: border-color 0.15s;
}
.mori-row:hover { border-color: var(--ink); }
.mori-row input { width: 18px; height: 18px; margin-top: 5px; accent-color: var(--red); flex: none; }
.mori-row b { color: var(--red-deep); }
.mori-row.is-bad { border-color: var(--red); background: #ffe9e6; }
.mori-form .btn-demo { justify-self: center; margin-top: 10px; }
.mori-result {
  font-family: var(--font-hand);
  font-size: 14px;
  text-align: center;
  min-height: 2em;
}
.mori-result.is-clear { color: var(--green); font-weight: 700; }

/* ---------- P8 ポップアップ射的 ---------- */

.shateki-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
}
.shateki-hud strong { font-family: var(--font-dot); font-size: 22px; color: var(--red); }
.shateki-field {
  position: relative;
  height: 340px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(38, 32, 58, 0.045) 0 26px, transparent 26px 52px),
    var(--paper);
  overflow: hidden;
}
.shateki-pop {
  position: absolute;
  width: min(200px, 46%);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 10px 12px 12px;
  box-shadow: 0.3rem 0.3rem 0 rgba(38, 32, 58, 0.2);
  animation: popIn 0.25s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes popIn { from { transform: scale(0.6); opacity: 0; } }
.shateki-pop-bar {
  display: flex;
  justify-content: flex-end;
  margin: -4px -6px 4px 0;
}
.shateki-x {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 13px;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.shateki-pop p { font-size: 11.5px; line-height: 1.6; font-family: var(--font-body); }
.shateki-pop .fake-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11.5px;
  background: var(--blue);
  color: var(--white);
  border: 2px solid var(--ink);
  border-radius: 100px;
  padding: 6px 0;
  pointer-events: none;
}
.shateki-result { font-family: var(--font-hand); font-size: 14px; margin-top: 14px; text-align: center; min-height: 1.8em; }

/* ---------- 資料室 ---------- */

.library { border-top: 3px solid var(--ink); }
.lib-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}
@media (max-width: 860px) { .lib-grid { grid-template-columns: 1fr; max-width: 620px; margin-inline: auto; } }
.lib-card {
  background: var(--white);
  border: var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 3.4vw, 36px);
}
.lib-card-wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .lib-card-wide { grid-column: auto; } }
.lib-card h3 {
  font-family: var(--font-head);
  font-size: 22px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--line);
}
.lib-card p, .lib-card li { font-size: 14px; color: var(--ink-soft); }
.lib-card p + p { margin-top: 12px; }
.lib-card b { color: var(--ink); }
.lib-list { list-style: none; display: grid; gap: 10px; }
.lib-gokajo { list-style: none; display: grid; gap: 12px; font-family: var(--font-hand); }
.lib-gokajo li { font-size: 15px; color: var(--ink); border-bottom: 1px dashed var(--line); padding-bottom: 10px; }
.lib-gokajo b { color: var(--red); font-weight: 400; }

/* ---------- 出口 ---------- */

.exit { text-align: center; }
.exit-lead { font-size: 16px; }
.exit-fine { font-family: var(--font-hand); font-size: 12px; color: var(--ink-dim); margin-top: 8px; }
.exit-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.exit-note { font-family: var(--font-hand); font-size: 13px; color: var(--ink-soft); margin-top: 28px; }

/* ---------- フッター ---------- */

.footer {
  background: var(--dark);
  color: rgba(247, 241, 227, 0.85);
  border-top: 3px solid var(--ink);
  padding: 60px 24px 40px;
  text-align: center;
}
.footer-logo { font-family: var(--font-head); font-size: 18px; color: var(--paper); }
.footer-note { font-size: 12.5px; max-width: 560px; margin: 16px auto 0; color: rgba(247, 241, 227, 0.6); }
.footer-nav { display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap; margin-top: 24px; }
.footer-nav a { font-size: 13px; color: rgba(247, 241, 227, 0.85); }
.footer-copy { font-family: var(--font-dot); font-size: 12px; margin-top: 26px; color: rgba(247, 241, 227, 0.5); }

/* ---------- スタンプ帳 ---------- */

.stampbook {
  position: fixed;
  right: clamp(12px, 2.6vw, 26px);
  bottom: clamp(12px, 2.6vw, 26px);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.stampbook-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  background: var(--yellow);
  border: var(--bd);
  border-radius: 100px;
  padding: 11px 20px;
  box-shadow: 0.3rem 0.3rem 0 rgba(38, 32, 58, 0.3);
  transition: transform 0.15s;
}
.stampbook-toggle:hover { transform: translate(1px, 1px); }
.stampbook-toggle.is-bump { animation: bump 0.45s cubic-bezier(0.2, 2, 0.4, 1); }
@keyframes bump { 40% { transform: scale(1.14) rotate(-3deg); } }
.stampbook-count strong { font-family: var(--font-dot); font-size: 17px; color: var(--red-deep); }

.stampbook-panel {
  transform-origin: calc(100% - 52px) calc(100% + 16px);
  width: min(320px, calc(100vw - 32px));
  background: var(--white);
  border: var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}
.stampbook-panel.is-open { animation: bookIn 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.stampbook-panel.is-close { animation: bookOut 0.3s cubic-bezier(0.5, -0.2, 0.75, 0.5) both; }
@keyframes bookIn {
  0% { opacity: 0; transform: translateY(26px) scale(0.4) rotate(5deg); }
  62% { opacity: 1; transform: translateY(-7px) scale(1.05) rotate(-1.6deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes bookOut {
  0% { opacity: 1; transform: none; }
  28% { transform: translateY(-8px) scale(1.04) rotate(-1deg); }
  100% { opacity: 0; transform: translateY(26px) scale(0.35) rotate(5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .stampbook-panel.is-open, .stampbook-panel.is-close { animation: none; }
}
.stampbook-head {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  text-align: center;
  margin-bottom: 14px;
}
.stampbook-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
}
.stamp-slot { text-align: center; }
.stamp-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-inline: auto;
  font-family: var(--font-head);
  font-size: 21px;
  color: rgba(38, 32, 58, 0.18);
  border: 3px dashed rgba(38, 32, 58, 0.18);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.2, 2.2, 0.4, 1);
}
.stamp-slot.is-on .stamp-mark {
  color: var(--hanko);
  border: 3px solid var(--hanko);
  transform: rotate(-10deg);
  background:
    radial-gradient(circle at 30% 30%, rgba(216, 50, 42, 0.12), transparent 60%);
}
.stamp-name { display: block; font-size: 9.5px; color: var(--ink-dim); margin-top: 4px; line-height: 1.4; }
.stampbook-reset {
  display: block;
  margin: 16px auto 0;
  font-size: 11px;
  color: var(--ink-dim);
  background: none;
  border: none;
  text-decoration: underline;
}

/* ---------- 認定証 ---------- */

.cert {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(27, 21, 49, 0.85);
  overflow-y: auto;
}
.cert[hidden] { display: none; }
.cert-card {
  position: relative;
  max-width: 560px;
  width: 100%;
  background: var(--white);
  border: 4px double var(--ink);
  outline: 3px solid var(--ink);
  outline-offset: 6px;
  border-radius: 6px;
  padding: clamp(34px, 6vw, 56px) clamp(22px, 5vw, 48px);
  text-align: center;
  margin: 14px;
}
.cert-deco { font-size: 15px; color: var(--yellow); letter-spacing: 0.6em; }
.cert-sub { font-family: var(--font-body); font-weight: 700; font-size: 14px; letter-spacing: 0.5em; margin-top: 12px; }
.cert-title {
  font-family: var(--font-head);
  font-size: clamp(26px, 5.6vw, 40px);
  margin-top: 14px;
  color: var(--ink);
}
.cert-body { font-size: 14px; margin-top: 20px; line-height: 2.1; }
.cert-date { font-family: var(--font-dot); font-size: 13px; margin-top: 20px; color: var(--ink-soft); }
.cert-issuer { font-family: var(--font-body); font-weight: 700; font-size: 13.5px; margin-top: 6px; }
.cert-hanko {
  position: absolute;
  right: clamp(18px, 5vw, 44px);
  bottom: clamp(60px, 12vw, 90px);
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  font-family: var(--font-head);
  font-size: 19px;
  color: var(--hanko);
  border: 3px solid var(--hanko);
  border-radius: 8px;
  transform: rotate(-8deg);
  opacity: 0.85;
}
.cert-close { margin-top: 30px; }

/* ---------- 紙吹雪 ---------- */

.confetti {
  position: fixed;
  top: -20px;
  z-index: 230;
  width: 10px;
  height: 14px;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.7; }
}

/* ---------- トースト ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(18px);
  z-index: 240;
  max-width: min(480px, calc(100vw - 40px));
  background: var(--dark);
  color: var(--paper);
  font-family: var(--font-hand);
  font-size: 13.5px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 13px 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  text-align: center;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
