:root {
  color-scheme: dark;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #10100f;
  color: #f5eee7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(142, 37, 28, 0.24), transparent 34rem),
    linear-gradient(145deg, #161310, #0d1012 62%, #171211);
}

button {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.game {
  position: relative;
  width: min(100vw - 24px, 430px);
  height: min(100vh - 36px, 860px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #060606;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.56);
}

.scene-video,
.explore-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-video {
  background: #050505;
}

.scene-video.soft-enter {
  animation: videoSoftEnter 0.9s ease-out;
}

.explore-layer {
  background-size: cover;
  background-position: center;
}

.shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.58), transparent 22%, transparent 58%, rgba(0, 0, 0, 0.82)),
    radial-gradient(circle at 50% 45%, transparent 44%, rgba(0, 0, 0, 0.18));
}

.topbar {
  position: absolute;
  z-index: 12;
  left: 16px;
  right: 16px;
  top: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.kicker,
.series-title {
  margin: 0 0 4px;
  color: rgba(245, 238, 231, 0.7);
  font-size: 12px;
  line-height: 1.4;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
}

.icon-btn {
  pointer-events: auto;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 10, 0.42);
  color: #f5eee7;
  border-radius: 6px;
}

.start-panel,
.choice-panel,
.modal {
  position: absolute;
  z-index: 20;
  left: 16px;
  right: 16px;
  bottom: 20px;
}

.start-panel {
  display: grid;
  gap: 14px;
}

.cover-panel {
  z-index: 35;
  inset: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  background: #050607;
}

.cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-actions {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 22px;
  display: grid;
  gap: 10px;
}

.cover-actions .series-title {
  text-align: center;
  color: rgba(255, 247, 237, 0.78);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.start-panel h2 {
  margin: 0;
  max-width: 13em;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: 0;
}

.primary-btn,
.choice-btn,
.hotspot {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff7ed;
  background: rgba(22, 16, 14, 0.78);
  backdrop-filter: blur(18px);
  border-radius: 8px;
}

.primary-btn {
  min-height: 48px;
  font-size: 16px;
  font-weight: 650;
}

.choice-panel {
  display: grid;
  gap: 10px;
}

.choice-context {
  margin: 0 0 2px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(9, 9, 9, 0.58);
  color: rgba(255, 247, 237, 0.86);
  font-size: 13px;
  line-height: 1.45;
}

.choice-btn {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  line-height: 1.35;
}

.choice-btn:active,
.primary-btn:active,
.hotspot:active {
  transform: translateY(1px);
}

.choice-btn.disabled {
  opacity: 0.48;
  color: rgba(255, 247, 237, 0.72);
}

.tag {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(165, 49, 41, 0.92);
  color: white;
  font-size: 12px;
}

.clue-rail {
  position: absolute;
  z-index: 13;
  left: 16px;
  right: 16px;
  top: 70px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  pointer-events: none;
}

.clue-chip {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 18, 17, 0.62);
  color: rgba(255, 247, 237, 0.92);
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
}

.toast {
  position: absolute;
  z-index: 30;
  left: 20px;
  right: 20px;
  top: 112px;
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(9, 9, 9, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.16);
  line-height: 1.5;
  font-size: 14px;
}

.memory-transition {
  position: absolute;
  z-index: 28;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 7rem),
    rgba(0, 0, 0, 0.24);
  animation: memoryFade 1.65s ease-in-out forwards;
  pointer-events: none;
}

.blur-copy {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(0);
  animation: memoryBlur 1.65s ease-in-out forwards;
}

.memory-transition::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  animation: memoryFlash 1.65s ease-in-out forwards;
}

.memory-transition p {
  position: relative;
  z-index: 2;
  margin: 0;
  color: rgba(255, 247, 237, 0.95);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(255, 247, 237, 0.32);
  animation: memoryText 1.65s ease-in-out forwards;
}

.pulse-ring {
  position: absolute;
  z-index: 1;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(255, 247, 237, 0.32);
  border-radius: 50%;
  animation: pulseRing 1.65s ease-out forwards;
}

@keyframes memoryFade {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  18%,
  82% {
    opacity: 1;
    transform: scale(1.015);
  }
  100% {
    opacity: 0;
    transform: scale(1.03);
  }
}

@keyframes memoryBlur {
  0% {
    opacity: 0;
    backdrop-filter: blur(0);
  }
  28% {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
  76% {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
  100% {
    opacity: 0;
    backdrop-filter: blur(12px);
  }
}

@keyframes memoryText {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(6px);
  }
  28%,
  72% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(-5px);
  }
}

@keyframes pulseRing {
  0% {
    opacity: 0;
    transform: scale(0.64);
  }
  30% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

@keyframes memoryFlash {
  0%,
  78% {
    background: rgba(255, 255, 255, 0);
  }
  88% {
    background: rgba(255, 255, 255, 0.42);
  }
  100% {
    background: rgba(255, 255, 255, 0);
  }
}

@keyframes videoSoftEnter {
  0% {
    opacity: 0;
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

.hotspot {
  position: absolute;
  z-index: 16;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
}

.hotspot::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #d7b17c;
  box-shadow: 0 0 0 6px rgba(215, 177, 124, 0.18);
}

.hotspot.band {
  left: 16%;
  top: 80%;
}

.hotspot.phone {
  left: 10%;
  top: 56%;
}

.hotspot.drawer {
  left: 31%;
  top: 37%;
}

.hotspot.locked {
  opacity: 0.62;
  color: rgba(255, 247, 237, 0.72);
}

.hotspot.locked::after {
  content: "锁";
  margin-left: 6px;
  color: rgba(215, 177, 124, 0.86);
  font-size: 12px;
}

.phone-overlay {
  position: absolute;
  z-index: 11;
  left: 12%;
  top: 50%;
  width: 42%;
  max-width: 180px;
  min-width: 140px;
  transform: rotate(-6deg) skewY(-2deg);
  transform-origin: center;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.36));
}

.phone-overlay h3 {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 650;
  color: rgba(30, 34, 39, 0.72);
}

.phone-glass {
  overflow: hidden;
  padding: 7px;
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(226, 232, 238, 0.72)),
    rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 0 0 1px rgba(18, 21, 26, 0.08),
    inset 0 -18px 28px rgba(41, 47, 58, 0.1);
  color: #171b20;
  backdrop-filter: blur(3px);
}

.phone-glass::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin: 0 auto 5px;
  border-radius: 999px;
  background: rgba(24, 29, 35, 0.22);
}

.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  color: rgba(24, 29, 35, 0.52);
  font-size: 8px;
  line-height: 1;
}

.phone-glass.document {
  background: linear-gradient(145deg, rgba(249, 246, 238, 0.9), rgba(229, 224, 214, 0.74));
}

.phone-glass.incoming {
  background: linear-gradient(145deg, rgba(231, 244, 255, 0.9), rgba(209, 224, 238, 0.76));
}

.phone-screen-layer {
  position: absolute;
  z-index: 18;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 76px 28px 150px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), transparent 12rem),
    rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(5px);
}

.phone-device {
  width: min(100%, 292px);
  aspect-ratio: 9 / 16;
  padding: 14px;
  border-radius: 34px;
  background:
    linear-gradient(145deg, #1b1d22, #050608 58%, #23252b),
    #101116;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.04),
    0 28px 80px rgba(0, 0, 0, 0.54);
}

.phone-device::before {
  content: "";
  display: block;
  width: 72px;
  height: 18px;
  margin: 0 auto 12px;
  border-radius: 0 0 16px 16px;
  background: #050608;
}

.device-status {
  display: flex;
  justify-content: space-between;
  padding: 0 8px 10px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
}

.device-panel {
  height: calc(100% - 44px);
  padding: 16px 13px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.96), rgba(229, 235, 242, 0.94)),
    #eef2f6;
  color: #141820;
  overflow: hidden;
}

.device-eyebrow {
  margin: 0 0 8px;
  color: rgba(20, 24, 32, 0.55);
  font-size: 12px;
}

.device-panel h3 {
  margin: 0 0 14px;
  color: #141820;
  font-size: 18px;
}

.device-panel > p:not(.device-eyebrow) {
  margin: 0;
  color: rgba(20, 24, 32, 0.82);
  font-size: 15px;
  line-height: 1.65;
}

.audio-wave {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 70px;
  margin-top: 28px;
}

.audio-wave span {
  width: 8px;
  border-radius: 999px;
  background: #5c6f88;
}

.audio-wave span:nth-child(1) { height: 22px; }
.audio-wave span:nth-child(2) { height: 48px; }
.audio-wave span:nth-child(3) { height: 34px; }
.audio-wave span:nth-child(4) { height: 58px; }
.audio-wave span:nth-child(5) { height: 26px; }

.device-message {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(20, 24, 32, 0.09);
}

.device-message:last-child {
  border-bottom: 0;
}

.device-message .avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.device-message p {
  margin: 0;
  min-width: 0;
}

.device-message strong,
.device-message span {
  display: block;
}

.device-message strong {
  margin-bottom: 3px;
  color: #141820;
  font-size: 14px;
}

.device-message span {
  color: rgba(20, 24, 32, 0.68);
  font-size: 12px;
  line-height: 1.35;
}

.record-card,
.message-row,
.contact-row {
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(24, 29, 35, 0.08);
  padding: 5px;
}

.message-row,
.contact-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

.avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  object-fit: cover;
}

.message-copy {
  min-width: 0;
  margin: 0;
  font-size: 9px;
  line-height: 1.28;
  color: rgba(24, 29, 35, 0.78);
}

.message-copy strong {
  display: block;
  margin: 0 0 1px;
  color: rgba(16, 19, 24, 0.92);
  font-size: 9px;
}

.modal {
  z-index: 40;
  inset: 0;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
}

.modal-card {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}

.modal img {
  display: block;
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  margin: 10px 0 12px;
  border-radius: 6px;
}

.modal h3,
.modal p {
  margin: 0;
}

.modal p {
  margin-top: 6px;
  color: rgba(245, 238, 231, 0.76);
  line-height: 1.55;
  font-size: 14px;
}

.modal button {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

@media (max-height: 680px) {
  .start-panel h2 {
    font-size: 23px;
  }

  .choice-btn {
    min-height: 42px;
    padding-block: 8px;
  }

  .phone-overlay {
    bottom: 10px;
  }
}
