.prototype-title-copy { margin-bottom: .5rem; }
.prototype-chapter {
  margin: .65rem 0 0;
  color: #ead9ad;
  font-size: clamp(.82rem, 1.7vw, 1.05rem);
  letter-spacing: .16em;
}

.future-footage-overlay {
  position: absolute;
  z-index: 3;
  inset: clamp(4.5rem, 9vh, 6rem) 3vw clamp(13.5rem, 28vh, 16rem);
  overflow: hidden;
  border: 1px solid rgba(239, 176, 111, .42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  color: rgba(255, 231, 192, .88);
  font: .58rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-shadow: 0 1px 4px #000;
  transition: opacity .35s ease, visibility 0s linear .35s;
}
.event-cg[hidden],
.future-footage-overlay[hidden],
.terminal-screen[hidden],
.pathway-screen[hidden],
.journal-screen[hidden],
.chapter-card[hidden] { display: none !important; }
.event-cg[data-scene="future-footage"].is-visible + .future-footage-overlay {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.event-cg.is-hidden + .future-footage-overlay {
  opacity: 0;
  visibility: hidden;
  transition: none;
}
.future-footage-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 218, 166, .11) 4px);
  animation: future-footage-noise .28s steps(2) infinite;
}
.future-footage-overlay::after {
  content: "";
  position: absolute;
  right: -4%;
  bottom: -10%;
  width: 20%;
  height: 62%;
  border-radius: 50% 38% 0 0;
  background: linear-gradient(90deg, transparent, rgba(223, 113, 37, .28) 35%, rgba(36, 18, 12, .82));
  filter: blur(5px);
  opacity: 0;
  transform: translateX(22%);
  transition: opacity .16s ease, transform .16s ease;
}
.event-cg[data-variant="jem-shadow"] + .future-footage-overlay::after { opacity: .9; transform: translateX(0); }
.future-footage-rec, .future-footage-overlay time, .future-footage-audio { position: absolute; z-index: 1; top: .7rem; }
.future-footage-rec { left: .8rem; color: #f28a6f; }
.future-footage-overlay time { left: 50%; translate: -50% 0; }
.future-footage-audio { right: .8rem; }
@keyframes future-footage-noise { 50% { translate: 0 1px; opacity: .14; } }

.terminal-screen {
  position: absolute;
  z-index: 2;
  top: clamp(4.8rem, 11vh, 7.5rem);
  left: 50%;
  width: min(760px, 67vw);
  max-height: 49vh;
  translate: -50% 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease, translate .32s ease;
  --terminal-accent: #8fc8e9;
  --terminal-glow: rgba(89, 165, 211, .24);
}
.terminal-screen.is-visible { opacity: 1; translate: -50% 0; }
.terminal-screen.is-hidden { display: none; visibility: hidden; opacity: 0; transition: none; }
.terminal-screen[data-theme="response"] { --terminal-accent: #83c9ff; --terminal-glow: rgba(44, 141, 214, .3); }
.terminal-screen[data-theme="unsent"] { --terminal-accent: #d8c99d; --terminal-glow: rgba(198, 170, 99, .2); }
.terminal-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--terminal-accent) 68%, transparent);
  background: linear-gradient(135deg, rgba(2, 12, 24, .94), rgba(8, 23, 38, .91));
  box-shadow: 0 24px 65px rgba(0, 0, 0, .55), inset 0 0 42px var(--terminal-glow), 0 0 28px var(--terminal-glow);
  backdrop-filter: blur(10px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.terminal-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(153, 211, 243, .1) 4px);
  pointer-events: none;
}
.terminal-header, .terminal-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .68rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--terminal-accent) 26%, transparent);
  color: var(--terminal-accent);
  font-size: clamp(.62rem, 1vw, .76rem);
  letter-spacing: .14em;
}
.terminal-header span { opacity: .72; }
.terminal-body {
  position: relative;
  min-height: 9.5rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  color: #dcebf3;
}
.terminal-line {
  display: grid;
  grid-template-columns: minmax(7rem, .42fr) 1fr;
  gap: 1rem;
  margin: 0;
  padding: .32rem 0;
  border-bottom: 1px solid rgba(147, 200, 230, .09);
  font-size: clamp(.72rem, 1.2vw, .94rem);
  line-height: 1.65;
  letter-spacing: .035em;
}
.terminal-line.is-emphasis { color: #fff; text-shadow: 0 0 12px var(--terminal-accent); }
.terminal-line.is-dim { opacity: .52; }
.terminal-label { color: var(--terminal-accent); opacity: .7; }
.terminal-footer {
  border-top: 1px solid color-mix(in srgb, var(--terminal-accent) 20%, transparent);
  border-bottom: 0;
  opacity: .7;
}
.terminal-footer i { width: 5.5rem; height: 2px; background: linear-gradient(90deg, transparent, var(--terminal-accent)); }
.terminal-screen[data-theme="unsent"] .terminal-line { display: block; border: 0; line-height: 1.85; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; }
.terminal-screen[data-theme="unsent"] .terminal-body { padding-block: 1.25rem; }

.pathway-screen {
  position: absolute;
  z-index: 2;
  inset: clamp(4.5rem, 9vh, 6rem) 4vw clamp(13.5rem, 28vh, 16rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.pathway-screen.is-visible { opacity: 1; }
.pathway-screen.is-hidden { display: none; visibility: hidden; opacity: 0; transition: none; }
.pathway-map { position: relative; width: min(100%, 1040px); height: 100%; margin: auto; }
.pathway-chart {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: min(45%, 430px);
  aspect-ratio: 1200 / 850;
  translate: -50% -50%;
  background: url("../assets/images/star-chart.svg") center / contain no-repeat;
  filter: drop-shadow(0 18px 35px rgba(0,0,0,.65));
}
.pathway-lines { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pathway-line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 10; opacity: .55; animation: pathway-flow 2.4s linear infinite; }
.pathway-map:not(.is-connected) .pathway-line { stroke-dasharray: 2 15; opacity: .3; }
.pathway-line.is-green { stroke: #78e2ae; filter: drop-shadow(0 0 8px #78e2ae); }
.pathway-line.is-blue { stroke: #72bff4; filter: drop-shadow(0 0 8px #72bff4); }
.pathway-line.is-silver { stroke: #e5e7f0; filter: drop-shadow(0 0 8px #e5e7f0); }
.pathway-line.is-orange { stroke: #efaa62; filter: drop-shadow(0 0 8px #efaa62); }
.pathway-core { fill: #fff7cf; stroke: #e9ca83; stroke-width: 4; filter: drop-shadow(0 0 13px #fff0a7); animation: pathway-core 2s ease-in-out infinite; }
.pathway-gate {
  position: absolute;
  z-index: 3;
  width: min(24%, 220px);
  padding: .7rem .9rem;
  border: 1px solid currentColor;
  background: linear-gradient(110deg, rgba(3,10,23,.94), rgba(14,27,45,.87));
  box-shadow: 0 16px 35px rgba(0,0,0,.45), 0 0 18px color-mix(in srgb, currentColor 25%, transparent);
  text-align: center;
  backdrop-filter: blur(8px);
}
.pathway-gate small, .pathway-gate span { display: block; font: .57rem/1.4 system-ui, sans-serif; letter-spacing: .1em; opacity: .7; }
.pathway-gate strong { display: block; margin: .18rem 0; color: #f5f2e9; font-size: clamp(.8rem, 1.5vw, 1.05rem); font-weight: 500; letter-spacing: .12em; }
.pathway-gate.is-green { top: 5%; left: 1%; color: #78e2ae; }
.pathway-gate.is-blue { top: 5%; right: 1%; color: #72bff4; }
.pathway-gate.is-silver { bottom: 5%; left: 1%; color: #e5e7f0; }
.pathway-gate.is-orange { right: 1%; bottom: 5%; color: #efaa62; }
.pathway-status { position: absolute; z-index: 4; left: 50%; bottom: 0; translate: -50% 0; margin: 0; color: #e9d49c; font: .68rem/1.4 ui-monospace, monospace; letter-spacing: .16em; text-shadow: 0 0 10px #000; white-space: nowrap; }
@keyframes pathway-flow { to { stroke-dashoffset: -40; } }
@keyframes pathway-core { 50% { opacity: .6; transform: scale(.78); transform-origin: center; } }

.journal-screen {
  position: absolute;
  z-index: 2;
  inset: clamp(4.2rem, 8vh, 6rem) 3vw clamp(13.5rem, 28vh, 16rem);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .42s ease;
}
.journal-screen.is-visible { opacity: 1; }
.journal-screen.is-hidden { display: none; visibility: hidden; opacity: 0; transition: none; }
.future-journal {
  position: relative;
  width: auto;
  max-width: min(100%, 980px);
  height: 100%;
  max-height: 100%;
  aspect-ratio: 4 / 3;
  background: url("../assets/images/props/future-journal-v3.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 22px 42px rgba(0,0,0,.58));
  color: #35443d;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}
.journal-page {
  position: absolute;
  top: 16.5%;
  width: 34.4%;
  height: 68%;
  overflow: hidden;
  transform: rotate(-.2deg);
}
.journal-page-left { left: 11.3%; transform: none; }
.journal-page-right { right: 10.8%; transform: none; }
.journal-page p {
  margin: 0 0 .34rem;
  padding: 0 0 .27rem;
  font-size: clamp(.54rem, 1vw, .78rem);
  line-height: 1.45;
  letter-spacing: .025em;
  opacity: 0;
  animation: journal-write .6s ease forwards;
  animation-delay: calc(var(--line-index) * .38s + .18s);
}
.journal-page time { display: block; color: #5c7566; font-size: .78em; letter-spacing: .08em; }
.journal-page span { display: block; white-space: pre-line; }
.journal-page p.is-missing span { color: #7a5a56; }
.journal-page p.is-missing span::after { content: "チャッピー帰宅：記録なし"; display: block; width: max-content; margin-top: .08rem; font-size: .88em; font-style: italic; }
.journal-page p.is-current { padding: .35rem .4rem; border: 1px solid rgba(72,110,88,.42); background: rgba(231,239,212,.48); color: #243d30; font-weight: 600; }
.journal-status {
  position: absolute;
  left: 50%;
  bottom: 1.2%;
  translate: -50% 0;
  padding: .35rem .85rem;
  border: 1px solid rgba(137,190,151,.5);
  background: rgba(8,25,20,.78);
  color: #c9e7c9;
  font: .62rem/1.4 system-ui, sans-serif;
  letter-spacing: .1em;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(102,185,126,.28);
}
.future-journal.is-final .journal-status { color: #f0e4b9; border-color: rgba(224,199,131,.55); background: rgba(33,28,17,.82); }
.private-notebook {
  background-image: url("../assets/images/props/kuro-private-notebook-v1.webp");
  color: #403b36;
}
.private-notebook .journal-page {
  top: 18%;
  width: 36%;
  height: 65%;
}
.private-notebook .journal-page-left { left: 10.8%; }
.private-notebook .journal-page-right { right: 10.8%; }
.private-notebook .journal-page p {
  margin-bottom: .8rem;
  padding: .36rem .5rem;
  background: rgba(235, 224, 199, .22);
  font-size: clamp(.62rem, 1.08vw, .86rem);
  letter-spacing: .06em;
}
.private-notebook .journal-page time {
  color: #58636a;
  font-size: .72em;
}
.private-notebook .journal-page p.is-cut {
  position: absolute;
  top: 45%;
  left: 39%;
  width: auto;
  padding: .3rem 0;
  background: transparent;
  color: #786f66;
  text-align: left;
}
.private-notebook .journal-page p.is-cut span::after {
  content: "切り取り";
  display: block;
  color: #886a68;
  font-size: .8em;
  font-style: italic;
}
.private-notebook .journal-status {
  color: #e2e5e8;
  border-color: rgba(192, 202, 211, .55);
  background: rgba(10, 15, 23, .84);
  box-shadow: 0 0 18px rgba(161, 177, 192, .18);
}
.investigation-shelf {
  position: relative;
  width: min(100%, 1100px);
  max-height: 100%;
  aspect-ratio: 1672 / 941;
  background: url("../assets/images/props/investigation-shelf-v1.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 22px 42px rgba(0,0,0,.58));
  color: #332b25;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}
.investigation-category {
  position: absolute;
  top: 21.5%;
  width: 20.2%;
  height: 62%;
  text-align: center;
}
.investigation-category:nth-of-type(1) { left: 6.2%; --category-color: #b89c61; }
.investigation-category:nth-of-type(2) { left: 28.8%; --category-color: #7d91a0; }
.investigation-category:nth-of-type(3) { left: 51.3%; --category-color: #9283a5; }
.investigation-category:nth-of-type(4) { left: 73.8%; --category-color: #bd8058; }
.investigation-category h3 {
  position: absolute;
  top: 7.2%;
  left: 5%;
  width: 90%;
  margin: 0;
  color: color-mix(in srgb, var(--category-color) 38%, #241c17);
  font-size: clamp(.56rem, 1.15vw, .9rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .1em;
  text-shadow: 0 1px rgba(255,255,255,.2);
}
.investigation-category.is-fact h3 { color: #493a28; }
.investigation-card {
  position: absolute;
  top: 39%;
  left: 18%;
  margin: 0;
  width: 64%;
  padding: .55rem .48rem;
  border: 1px solid color-mix(in srgb, var(--category-color) 52%, transparent);
  background: rgba(244,232,207,.88);
  box-shadow: 0 6px 13px rgba(30,20,12,.24);
  font-size: clamp(.48rem, .92vw, .72rem);
  line-height: 1.55;
  text-align: left;
  transform: rotate(-.6deg);
  animation: shelf-card-in .55s ease both;
}
.investigation-card.is-selected {
  border-color: var(--category-color);
  background: rgba(251,240,216,.96);
  transform: rotate(.5deg);
}
.investigation-status { bottom: 1.5%; }
@keyframes shelf-card-in { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }
@keyframes journal-write { from { opacity: 0; translate: 0 -4px; filter: blur(2px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }

@media (max-width: 700px) {
  .prototype-title-copy { padding-top: .25rem; }
  .prototype-chapter { margin-top: .35rem; font-size: .72rem; }
  .terminal-screen { top: 8.3dvh; width: 94vw; max-height: 45dvh; }
  .terminal-body { min-height: 7rem; padding: .7rem .8rem; }
  .terminal-header, .terminal-footer { padding: .5rem .7rem; font-size: .55rem; }
  .terminal-line { grid-template-columns: minmax(5.3rem, .42fr) 1fr; gap: .55rem; padding: .2rem 0; font-size: .66rem; line-height: 1.45; }
  .terminal-screen[data-theme="unsent"] .terminal-line { font-size: .68rem; line-height: 1.65; }
  .pathway-screen { inset: 7.5dvh 2vw 43dvh; }
  .pathway-chart { width: 56%; }
  .pathway-gate { width: 31%; padding: .38rem .3rem; }
  .pathway-gate small { font-size: .42rem; letter-spacing: .03em; }
  .pathway-gate strong { font-size: .62rem; letter-spacing: .04em; }
  .pathway-gate span { font-size: .48rem; }
  .pathway-status { bottom: -1rem; font-size: .5rem; letter-spacing: .08em; }
  .journal-screen { inset: 7.5dvh 1vw 43dvh; }
  .future-footage-overlay { inset: 7.5dvh 1vw auto; height: 40dvh; font-size: .42rem; }
  .future-journal { width: 100%; height: auto; }
  .journal-page { top: 16.5%; width: 34.4%; height: 68%; }
  .journal-page-left { left: 11.3%; }
  .journal-page-right { right: 10.8%; }
  .journal-page p { margin-bottom: .12rem; padding-bottom: .08rem; font-size: clamp(.34rem, 1.58vw, .44rem); line-height: 1.28; }
  .private-notebook .journal-page p { margin-bottom: .28rem; padding: .12rem .18rem; font-size: clamp(.36rem, 1.62vw, .48rem); }
  .private-notebook .journal-page p.is-cut { top: 45%; left: 39%; padding: .1rem 0; }
  .investigation-shelf { width: 100%; height: auto; }
  .investigation-category h3 { top: 7%; font-size: clamp(.34rem, 1.5vw, .46rem); letter-spacing: .03em; }
  .investigation-card { top: 39%; padding: .18rem .16rem; font-size: clamp(.28rem, 1.25vw, .38rem); line-height: 1.3; }
  .journal-status { bottom: 1%; padding: .25rem .5rem; font-size: .45rem; letter-spacing: .04em; }
}
