@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");
:root {
  color-scheme: dark;
  font-family: "DM Sans", sans-serif;
  color: #f7efdf;
  background: #271936;
}
* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #ded0e542;
  background: #d6b4ed;
  color: #291b36;
  padding: 14px 20px;
  border-radius: 6px;
  font-weight: 700;
}
button:hover {
  background: #efdafe;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #ffa74d;
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
[hidden] {
  display: none !important;
}
#experience,
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#world {
  display: block;
  touch-action: none;
}
#experience::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 42%,
    transparent 46%,
    rgba(30, 14, 39, 0.18) 100%
  );
}
#exit {
  position: absolute;
  z-index: 6;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #261c36a8;
  border: 1px solid #d9bbe04d;
}
#exit svg,
#controls svg,
#start svg {
  fill: none;
  stroke: #f4e8fa;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#exit svg {
  width: 22px;
  height: 22px;
}
#intro {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
#start {
  width: 84px;
  height: 84px;
  padding: 0;
  border-radius: 50%;
  background: #6f4a8dd9;
  border: 2px solid #e8d2f58c;
  box-shadow: 0 8px 40px #1c0f2a88;
}
#start svg {
  width: 40px;
  height: 40px;
  fill: #f4e8fa;
  margin-left: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Typed subtitles for Little Boyfriend's comments. */
#subtitle {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: max(170px, calc(env(safe-area-inset-bottom) + 158px));
  width: min(92vw, 520px);
  margin: 0;
  transform: translateX(-50%);
  text-align: center;
  font: 600 clamp(15px, 4.2vw, 19px) / 1.35 "DM Sans", sans-serif;
  color: #fff6e6;
  text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
}
#subtitle.show { opacity: 1; transition: none; }
#subtitle b { color: #ffce98; font-weight: 700; }
/* Contextual interact prompt: text only, soft shadow, no box. */
#prompt {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 84px));
  transform: translateX(-50%);
  display: flex;
  gap: 28px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
#prompt.show {
  opacity: 1;
  pointer-events: auto;
}
#prompt button {
  background: none;
  border: 0;
  padding: 12px 8px;
  color: #fff6e6;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.6px;
  white-space: nowrap;
  text-shadow: 0 1px 3px #1a0f26, 0 0 12px #1a0f26, 0 0 24px #1a0f26aa;
}
#prompt button:hover {
  background: none;
}
.hologram {
  position: absolute;
  right: 7vw;
  top: 22%;
  width: min(400px, 85vw);
  padding: 23px;
  color: #d7ffff;
  background: linear-gradient(135deg, #142f39ed, #212443ec);
  border: 1px solid #9cf0ee87;
  border-radius: 8px;
  box-shadow:
    0 0 45px #6de4ed25,
    inset 0 0 35px #68deea12;
  backdrop-filter: blur(16px);
}
.holo-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 1.4px;
  font-size: 10px;
  border-bottom: 1px solid #9ee8ef44;
  margin-bottom: 20px;
  padding-bottom: 10px;
}
.holo-top button {
  background: none;
  color: #a3f8fc;
  padding: 0 4px;
  font-size: 24px;
  border: 0;
}
.hologram h2 {
  font-size: 27px;
  color: #dcffff;
}
.hologram p {
  color: #c4e5ec;
  font-size: 13px;
}
.hologram a {
  overflow-wrap: anywhere;
  font-size: 11px;
  color: #94dde4;
  text-underline-offset: 3px;
}
.advert {
  border-top: 1px solid #e2b9ff55;
  margin-top: 22px;
  padding-top: 14px;
}
.advert > span {
  color: #ffbaf9;
  font-size: 9px;
  letter-spacing: 1.4px;
}
.advert p {
  color: #f4c4fb;
  font-size: 15px;
}
.hologram #accept-ad {
  width: 100%;
  background: #e4acfa;
  margin-top: 8px;
}
#ending {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 12vw;
  text-align: center;
  z-index: 10;
}
#ending p {
  max-width: 650px;
  color: #e0d9df;
  font-size: clamp(16px, 2vw, 23px);
  line-height: 1.8;
  white-space: pre-line;
}
#ending button {
  background: transparent;
  color: #e9d6f1;
  margin-top: 24px;
}
#error {
  position: absolute;
  inset: 25%;
  background: #26152f;
  padding: 35px;
  z-index: 20;
}
body.flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffad39;
  pointer-events: none;
  opacity: var(--flash, 0);
  z-index: 8;
}
body.locked #controls button,
#controls.idle button {
  opacity: 0.25;
  pointer-events: none;
}
#controls button {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 64px;
  height: 64px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: radial-gradient(circle at 35% 28%, #8a63a7, #5b3d78);
  border: 2px solid #d9bbe066;
  box-shadow: inset 0 3px 6px #ffffff2e, inset 0 -4px 8px #2a164288, 0 6px 14px #1a0f2655;
  touch-action: none;
}
#controls button:active {
  background: #74528b;
  transform: translateY(2px);
}
#controls svg {
  width: 34px;
  height: 34px;
}
#back {
  left: max(16px, env(safe-area-inset-left));
}
#forward {
  right: max(16px, env(safe-area-inset-right));
}

/* Opaque color bloom at the cut, surrounded by rotating interference rings. */
#size-transition-veil {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 48%, #ffdb8d 0%, #ff963b 18%, #ac37e5 47%, #361058 82%);
}
#size-transition-veil::before {
  content: "";
  position: absolute;
  inset: -85%;
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 3%, #ffd5a975 3.5% 4%, transparent 4.5% 7%, #dc8cff80 7.5% 8%),
    repeating-conic-gradient(from 25deg, #ff933baa 0deg 13deg, #7c21dcbb 15deg 30deg, #f1b7ff88 32deg 37deg, #49187988 40deg 57deg);
  transform: rotate(var(--warp-turn, 0deg)) scale(var(--warp-scale, 1));
}
#size-transition-veil::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #fff0c7 0%, #ffb559 32%, #b963f3 75%, #813bd7 100%);
  opacity: var(--warp-core, 0);
}
@media (prefers-reduced-motion: reduce) {
  #size-transition-veil::before { display: none; }
}

/* Optical text is projected inside the physical lens: no dialog surface. */
.hologram, .hologram.lens-readout {
  inset: 18% 14% auto;
  width: auto;
  max-height: 62%;
  padding: 0;
  overflow-y: auto;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  text-align: left;
  color: #dcffff;
  text-shadow: 0 1px 2px #141029, 0 0 9px #101426, 0 0 18px #00dde955;
  z-index: 5;
}
.hologram .holo-top { border: 0; margin-bottom: 12px; padding: 0; }
.hologram h2 { margin: 8px 0; font-size: clamp(22px,3vw,36px); }
.hologram p { font-size: clamp(13px,1.5vw,18px); line-height: 1.55; max-width: 60ch; }
.hologram .advert { border: 0; margin-top: 20px; padding: 0; }
.hologram .advert > span { display: none; }
.hologram .advert p { color: #ffce98; font-weight: 700; }
#holo-source { display: none; }
/* Room-sign read card: screen-space at the bottom, clear of the hanging sign. */
.hologram.sign-card, .hologram.sign-card.lens-readout {
  inset: auto 8% max(150px, calc(env(safe-area-inset-bottom) + 138px));
  max-height: 45%;
  text-align: center;
  color: #fff6e6;
  text-shadow: 0 1px 3px #1a0f26, 0 0 12px #1a0f26, 0 0 26px #1a0f26cc;
}
.hologram.sign-card p { margin: 0 auto; }
.hologram { pointer-events: auto; }
@media (max-width:650px) {
  .hologram, .hologram.lens-readout { inset: 17% 13% auto; max-height: 63%; }
  .hologram p { font-size: 14px; line-height: 1.55; }
  .hologram .holo-top { font-size: 8px; }
}
