:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #2b2b2b;
  --muted: #74716b;
  --line: #e6e2da;
  --accent: #3a7d7b;
  --accent-soft: #e5f0ef;
  --warn: #9b2c2c;
  --found: #f3e3a8;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.8;
  font-size: 15px;
  padding-bottom: 96px;
}

a { color: var(--accent); }

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.2; padding: 8px 0; }
.brand__name { font-weight: 800; letter-spacing: .12em; font-size: 20px; }
.brand__sub { font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.nav { display: flex; gap: 16px; font-size: 14px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 40px; background: linear-gradient(180deg, var(--accent-soft), var(--bg)); }
.hero h1 { font-size: clamp(26px, 6vw, 40px); line-height: 1.4; margin: 0 0 16px; letter-spacing: .04em; }
.hero p { max-width: 36em; color: var(--ink); }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  margin-top: 12px;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 28px; max-width: 560px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 20px; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- header reset ---------- */
.header-reset {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------- reset confirm ---------- */
.confirm {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .45);
}
.confirm__panel {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .25);
}
.confirm__panel p { margin: 0 0 8px; font-size: 14px; }
.confirm__title { font-weight: 800; font-size: 16px !important; }
.confirm__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.confirm__actions .btn { margin-top: 0; padding: 9px 18px; }

/* ---------- slider ---------- */
.hero:has(.slider), .hero:has(.hero-photo) { padding-top: 24px; }
.hero-photo {
  position: relative;
  margin: 0 0 28px;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
@media (min-width: 760px) { .hero-photo { aspect-ratio: 21 / 9; } }
.hero-photo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; }
.hero-photo__back { opacity: 0; transition: opacity 1.6s ease; }
body.altered .hero-photo__back { opacity: 1; }
body.altered .hero-photo .slide__caption { top: 12px; bottom: auto; }
body.altered .hero-photo::after { top: 30% !important; }
.slider {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 28px;
  background: var(--surface);
}
.slider__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.slider__track::-webkit-scrollbar { display: none; }
.slide {
  position: relative;
  flex: 0 0 100%;
  margin: 0;
  aspect-ratio: 16 / 10;
  scroll-snap-align: start;
}
@media (min-width: 760px) { .slide { aspect-ratio: 21 / 9; } }
.slide__art, .slide__photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.slide__photo { background-position: center; background-size: cover; background-repeat: no-repeat; }
.slide__caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
}
.slider__dots { position: absolute; top: 10px; right: 12px; display: flex; gap: 8px; }
.slider__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: rgba(0, 0, 0, .25);
  cursor: pointer;
}
.slider__dot[aria-current="true"] { background: #fff; }

.s-wall { fill: #f1ece2; }
.s-floor { fill: #dcc6a3; }
.s-subfloor { fill: #b89b73; }
.s-line { fill: none; stroke: #c4ab85; stroke-width: 1.2; }
.s-window { fill: #dcecef; stroke: #fff; stroke-width: 4; }
.s-frame { stroke: #fff; stroke-width: 3; }
.s-frame-dot { fill: #b9ad98; }
.s-light { fill: #fff6d2; opacity: .45; }
.s-base { fill: #e3dccf; }
.s-door { fill: #e9e2d4; stroke: #cfc6b6; stroke-width: 1.5; }
.s-door-panel { fill: none; stroke: #d6cdbd; stroke-width: 1.5; }
.s-bucket { fill: #7fb3b0; }
.s-tool { stroke: #8a7a62; stroke-width: 3; stroke-linecap: round; }
.s-tool-head { fill: #9aa3a8; }
.s-tray { fill: #cfc6b6; }
.s-key { fill: none; stroke: #b08d3c; stroke-width: 3; }
.s-key-line { fill: none; stroke: #b08d3c; stroke-width: 3; stroke-linecap: round; }
.s-tag { fill: #fff; stroke: #cfc6b6; }
.s-tag-text { font-size: 7px; fill: #6d6a64; font-family: inherit; }
.s-stain { fill: #3b0d0d; opacity: 0; transition: opacity 1.2s; }

/* ---------- sections ---------- */
section { padding: 40px 0; }
.section-title { font-size: 22px; margin: 0 0 4px; letter-spacing: .06em; }
.section-lead { color: var(--muted); margin: 0 0 24px; font-size: 14px; }

.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card__label { font-size: 11px; letter-spacing: .15em; color: var(--accent); font-weight: 700; }
.card h3 { margin: 2px 0 10px; font-size: 16px; }
.card dl { margin: 10px 0 0; font-size: 14px; }
.card dt { font-weight: 700; font-size: 12px; color: var(--muted); margin-top: 8px; }
.card dd { margin: 0; }
.plan { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.plan text { font-size: 7px; fill: var(--muted); font-family: inherit; }
.plan .wall { fill: none; stroke: var(--ink); stroke-width: 2; }
.plan .thin { fill: none; stroke: var(--muted); stroke-width: 1; }
.plan .furn { fill: #efece5; stroke: #b3aea4; stroke-width: .8; }
.plan .mark { fill: url(#hatch); stroke: var(--accent); stroke-width: .8; }
body.altered .plan .mark { stroke: var(--warn); }

.promises { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.promises li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.promises b { color: var(--accent); margin-right: 8px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: baseline; }
.steps li::before { content: counter(step, decimal-leading-zero); font-weight: 800; color: var(--accent); min-width: 2em; }

table.price { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.price th, table.price td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top; }
table.price th { width: 55%; font-weight: 500; }
table.price td { text-align: right; white-space: nowrap; font-weight: 700; }
table.price tr:last-child th, table.price tr:last-child td { border-bottom: 0; }
.notes { font-size: 13px; color: var(--muted); padding-left: 0; list-style: none; }
.notes li { margin: 4px 0; padding: 2px 0; } /* 押せる行の高さを 24px 以上に（A12） */

.faq dt { font-weight: 700; margin-top: 16px; }
.faq dt::before { content: "Q. "; color: var(--accent); }
.faq dd { margin: 4px 0 0; }
.faq dd::before { content: "A. "; color: var(--muted); font-weight: 700; }

.voices { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .voices { grid-template-columns: 1fr 1fr; } }
.voice { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.voice .stars { color: #d9a441; letter-spacing: .1em; font-size: 13px; }
.voice .who { font-size: 12px; color: var(--muted); margin-top: 6px; }
.voice p { margin: 6px 0 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 12px; font-size: 12px; color: var(--muted); background: var(--surface); }
.site-footer dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 12px; }
.site-footer dt { font-weight: 700; }
.site-footer dd { margin: 0; }
.fiction { margin-top: 12px; }
.reset { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; font-size: 12px; cursor: pointer; padding: 0; }

/* ---------- investigation ---------- */
[data-inspect] { cursor: pointer; border-radius: 3px; transition: background-color .2s; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { [data-inspect]:hover { background: rgba(58, 125, 123, .07); } }
[data-inspect].is-tapped { background: rgba(58, 125, 123, .16); }
body.altered [data-inspect].is-tapped { background: rgba(192, 57, 43, .22); }
[data-inspect-area] { cursor: pointer; }
[data-inspect].is-found { background: var(--found); box-shadow: 0 0 0 2px var(--found); }
[data-inspect]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.probe {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1f1f1f;
  color: #f4f1ea;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  white-space: nowrap;
}
.probe__slot { display: inline-flex; align-items: center; gap: 4px; opacity: .55; }
.probe__slot::before { content: ""; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 2px; }
.probe__slot.is-done { opacity: 1; color: var(--found); }
.probe__slot.is-done::before { background: currentColor; }
.probe a { color: var(--found); font-weight: 700; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translate(-50%, 8px);
  z-index: 31;
  max-width: min(92vw, 420px);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-clue { border-left-color: #c89b1c; }

.intro {
  position: fixed;
  inset: auto 12px 64px 12px;
  z-index: 32;
  max-width: 440px;
  margin: 0 auto;
  background: #fffdf3;
  border: 1px solid #e8dca8;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.intro p { margin: 0 0 8px; }
.intro .intro__note { font-size: 12px; color: #6b6450; }
.intro .btn { margin-top: 4px; padding: 8px 18px; }

.truth-banner { display: none; background: #1f1f1f; color: #f4f1ea; text-align: center; padding: 12px 16px; font-size: 14px; }
.truth-banner a { color: var(--found); font-weight: 700; }
body.altered .truth-banner { display: block; }
body.altered .brand__sub { color: var(--warn); font-weight: 700; }

/* ---------- alteration: 切り替え演出 ---------- */
.takeover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #0b0b0b;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px);
  color: #e6e1d8;
  font-family: "BIZ UDGothic", "MS Gothic", "Osaka-Mono", monospace;
  font-size: 15px;
  opacity: 0;
  transition: opacity .8s ease;
}
.takeover.is-in { opacity: 1; }
.takeover__inner { max-width: 26em; width: 100%; }
.takeover p { margin: 0 0 14px; opacity: 0; animation: line-in .6s ease forwards; }
.takeover p:nth-child(1) { animation-delay: .5s; }
.takeover p:nth-child(2) { animation-delay: 1.1s; }
.takeover p:nth-child(3) { animation-delay: 1.7s; }
.takeover__strong { color: #e0574a; font-weight: 700; }
.takeover.is-leaving { opacity: 0; transition-duration: 1.4s; }
.takeover.is-static, .takeover.is-static p { animation: none; transition: none; opacity: 1; }
.takeover.is-static.is-leaving { opacity: 0; }
@keyframes line-in { to { opacity: 1; } }

/* ---------- altered: 関係者向けページ ---------- */
body.altered {
  --bg: #111111;
  --surface: #1a1a1a;
  --ink: #e6e1d8;
  --muted: #9b958a;
  --line: #303030;
  --accent: #c0392b;
  --accent-soft: #2a1212;
  --found: rgba(192, 57, 43, .45);
}
body.altered::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%);
}
body.altered .brand__name { color: var(--accent); }
body.altered .plan .furn { fill: #2a2a2a; stroke: #555; }
body.altered #hatch rect { fill: #3a1515; }
body.altered #hatch line { stroke: #c0392b; }
body.altered .voice .stars { color: #555; }
body.altered .truth-banner { background: var(--accent); color: #fff; }
body.altered .truth-banner a { color: #fff; }
body.altered .probe { border: 1px solid #3a3a3a; }
body.altered .probe__slot.is-done { color: #e0574a; }
body.altered .probe a { color: #fff; }
body.altered .coda { background: #000; border: 1px solid var(--line); }
body.altered .header-reset { border-color: #444; color: #cfc9bf; }

/* 裏の姿のスライダー：色が抜け、隠れていたシミが浮かび、紙テープ（「あけないでください」）が貼られる。警察の規制線を思わせる黄色いテープは使わない */
body.altered .s-wall { fill: #2a2626; }
body.altered .s-floor { fill: #3a2f25; }
body.altered .s-subfloor { fill: #241a14; }
body.altered .s-line { stroke: #2a221b; }
body.altered .s-window { fill: #1d2729; stroke: #4a4a4a; }
body.altered .s-frame { stroke: #4a4a4a; }
body.altered .s-light { fill: #8a1f1f; opacity: .22; }
body.altered .s-base { fill: #1f1b1b; }
body.altered .s-door { fill: #2b2626; stroke: #444; }
body.altered .s-door-panel { stroke: #3a3434; }
body.altered .s-bucket { fill: #3d4a49; }
body.altered .s-tag { fill: #3a1515; stroke: #8a1f1f; }
body.altered .s-tag-text { fill: #e0574a; }
body.altered .s-stain { opacity: .85; }
body.altered .slide__photo { filter: grayscale(1) brightness(.55) contrast(1.25) sepia(.5) hue-rotate(-35deg) saturate(2.5); }
body.altered .slide__caption { background: rgba(0, 0, 0, .78); color: #e6e1d8; }
body.altered .slider::after,
body.altered .hero-photo::after {
  content: "あけないでください　あけないでください　あけないでください　あけないでください　あけないでください";
  position: absolute;
  left: -10%;
  right: -10%;
  top: 42%;
  transform: rotate(-5deg);
  background: rgba(226, 219, 196, .92);
  color: #6b231b;
  font-weight: 700;
  letter-spacing: .2em;
  font-size: 13px;
  padding: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}

/* ---------- narrow phones ---------- */
@media (max-width: 374px) {
  body { font-size: 14px; }
  .nav { gap: 12px; }
  .probe { gap: 7px; padding: 7px 11px; font-size: 11px; }
  .probe__label { display: none; }
  .stat b { font-size: 17px; }
}

/* ---------- truth page ---------- */
.truth { padding-top: 48px; padding-bottom: 48px; }
.truth h1 { font-size: clamp(24px, 5.5vw, 34px); line-height: 1.4; margin: 0 0 16px; }
.truth .lead { font-size: 16px; }
.clue-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.clue-list li { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #c89b1c; border-radius: 10px; padding: 12px 14px; }
.clue-list q { display: block; font-weight: 700; margin-bottom: 4px; quotes: "「" "」"; }
.clue-list li.is-missed { border-left-color: var(--line); color: var(--muted); }
.coda { margin-top: 32px; padding: 20px; background: #1f1f1f; color: #f4f1ea; border-radius: 12px; }
.coda .plan { margin: 12px 0; }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.result { font-size: 13px; color: var(--muted); }

/* ---------- M2: 遊び方・ヒント・動きを減らす設定 ---------- */
.svg-defs { position: absolute; }
.section-title--sm { font-size: 17px; }
.stream-ok { margin: 4px 0 0; font-size: 12px; }

.probe { width: max-content; max-width: calc(100vw - 16px); flex-wrap: wrap; justify-content: center; row-gap: 4px; }
.toast { width: max-content; }
.probe__hint {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 12px;
  min-height: 24px;
  font: inherit;
  cursor: pointer;
}
.probe__hint:focus-visible, .btn:focus-visible, .header-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.probe a { display: inline-block; padding: 2px 4px; min-height: 24px; box-sizing: border-box; line-height: 20px; } /* 押せる範囲 24px（A12） */

.intro { max-height: calc(100vh - 88px); max-height: calc(100dvh - 88px); overflow-y: auto; }
.intro__series { font-weight: 800; letter-spacing: .04em; margin-bottom: 4px !important; }
.toast.is-hint { border-left-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .takeover p { opacity: 1; }
}
