:root {
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.28);
  --ink: #050505;
  --panel: rgba(2, 6, 23, 0.9);
  --paper: #fef3c7;
  --muted: #cbd5e1;
  --line: rgba(255, 255, 255, 0.12);
  --chapter: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
  background: #050505;
  color: #e2e8f0;
  font-family: "Noto Serif SC", "Songti SC", "Microsoft YaHei", serif;
  letter-spacing: 0;
  touch-action: manipulation;
  user-select: none;
}

button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.heart-game {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  padding: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(139, 92, 246, 0.18), transparent 24rem),
    radial-gradient(circle at 82% 80%, rgba(251, 191, 36, 0.1), transparent 22rem),
    #050505;
}

.heart-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: 460px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 52px rgba(0, 0, 0, 0.82);
}

@media (min-width: 720px) {
  .heart-shell {
    height: min(92vh, 900px);
    height: min(92dvh, 900px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
  }
}

.heart-sidebar {
  display: none;
}

.heart-stage,
.intro-playfield,
.playfield,
.result-playfield {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.scene-layer,
.result-bg {
  position: absolute;
  inset: -22px;
  z-index: 1;
  background-image: var(--scene-image), var(--scene-fallback);
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  opacity: 0.9;
  transition: opacity 800ms ease, transform 1200ms ease;
}

.scene-layer::after,
.result-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.12) 40%, rgba(0, 0, 0, 0.94)),
    radial-gradient(circle at 50% 36%, transparent, rgba(0, 0, 0, 0.48));
}

.overlay-grain {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.42;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.2'/%3E%3C/svg%3E");
}

.intro-content,
.top-ui,
.visual-area,
.bottom-ui,
.result-content {
  position: relative;
  z-index: 10;
}

.intro-playfield {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
}

.chapter-seal {
  margin-bottom: 26px;
  color: var(--paper);
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 0 18px var(--chapter));
  animation: float-breathe 4s ease-in-out infinite;
}

.intro-cinematic {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.intro-rings {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, -50%);
}

.intro-rings i {
  position: absolute;
  inset: calc(var(--r, 0) * 28px);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 50%;
  animation: rotate-slow 18s linear infinite;
}

.intro-rings i:nth-child(2) {
  --r: 1;
  border-color: rgba(96, 165, 250, 0.22);
  animation-duration: 25s;
  animation-direction: reverse;
}

.intro-rings i:nth-child(3) {
  --r: 2;
  border-color: rgba(52, 211, 153, 0.2);
  animation-duration: 32s;
}

.intro-gates {
  position: absolute;
  inset: 8% 8% auto;
  height: 62%;
}

.intro-gates span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--chapter), white 20%);
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.62);
  color: #fff7ed;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 0 28px color-mix(in srgb, var(--chapter), transparent 36%);
  animation: gate-float 4.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.7s);
}

.intro-gates span:nth-child(1) {
  left: 7%;
  top: 20%;
}

.intro-gates span:nth-child(2) {
  right: 8%;
  top: 10%;
}

.intro-gates span:nth-child(3) {
  left: 14%;
  bottom: 10%;
}

.intro-gates span:nth-child(4) {
  right: 12%;
  bottom: 0;
}

@keyframes float-breathe {
  0%, 100% {
    transform: translateY(0);
    filter: drop-shadow(0 0 10px var(--chapter));
  }
  50% {
    transform: translateY(-6px);
    filter: drop-shadow(0 0 22px var(--chapter));
  }
}

.intro-kicker,
.stage-hud span,
.result-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  backdrop-filter: blur(8px);
}

.intro-title {
  margin: 14px 0 12px;
  background: linear-gradient(to bottom, #fef3c7, #d97706);
  -webkit-background-clip: text;
  color: transparent;
  font-size: 50px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-shadow: 0 8px 12px rgba(0, 0, 0, 0.95);
}

.intro-desc {
  max-width: 310px;
  margin: 0 auto 36px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.48);
  color: #f3f4f6;
  font-size: 14px;
  line-height: 1.85;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(6px);
}

.heart-primary,
.heart-actions button,
.choice-card,
.gate-tile {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.heart-primary {
  min-height: 48px;
  padding: 0 34px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.88);
  color: #fef3c7;
  font-weight: 900;
  letter-spacing: 0.12em;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.18);
}

.heart-primary:hover,
.choice-card:hover,
.gate-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(251, 191, 36, 0.85);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.18);
}

.gate-board {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  width: min(100%, 390px);
  margin-top: 20px;
}

.gate-tile {
  min-height: 60px;
  padding: 7px 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
}

.gate-tile i,
.gate-tile strong,
.gate-tile span {
  display: block;
}

.gate-tile i {
  color: var(--chapter);
  font-size: 20px;
  font-style: normal;
  font-weight: 900;
}

.gate-tile strong {
  margin-top: 4px;
  color: #f8fafc;
  font-size: 11px;
}

.gate-tile span {
  margin-top: 3px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 900;
}

.playfield {
  display: block;
  background: var(--scene-fallback);
}

.stage-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), transparent);
}

.visual-area {
  position: absolute;
  inset: 58px 0 376px;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 14px;
}

.scene-token {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.36);
  color: #fff7ed;
  font-size: 46px;
  box-shadow: 0 0 28px var(--chapter);
  backdrop-filter: blur(8px);
}

.cinematic-stage {
  position: relative;
  width: min(100%, 430px);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  isolation: isolate;
}

.parallax-plane,
.scene-architecture,
.particle-field,
.cinematic-guide,
.scene-oracle,
.cinematic-caption {
  position: absolute;
}

.parallax-plane {
  inset: 0;
  z-index: 1;
  transform-origin: center bottom;
  animation: camera-breathe 8s ease-in-out infinite;
}

.plane-back {
  background:
    radial-gradient(circle at 26% 24%, color-mix(in srgb, var(--chapter), transparent 62%), transparent 24%),
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.12), transparent 16%),
    linear-gradient(to bottom, transparent 0 58%, rgba(0, 0, 0, 0.4) 100%);
  opacity: 0.85;
}

.plane-mid {
  inset: 18% -8% 0;
  background:
    linear-gradient(135deg, transparent 0 32%, rgba(255, 255, 255, 0.08) 33% 34%, transparent 35%),
    linear-gradient(225deg, transparent 0 36%, rgba(0, 0, 0, 0.38) 37% 43%, transparent 44%);
  opacity: 0.6;
  animation-duration: 10s;
}

.plane-front {
  inset: auto -10% 0;
  height: 35%;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.88), transparent 62%),
    linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
  animation-duration: 7s;
}

.camera-push .plane-back {
  animation-name: camera-push;
}

.camera-drift .plane-mid {
  animation-name: camera-drift;
}

.camera-tilt .cinematic-guide {
  animation-name: guide-tilt;
}

.camera-orbit .scene-oracle {
  animation-name: oracle-orbit;
}

.particle-field {
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.particle-field i {
  position: absolute;
  left: calc((var(--i) * 37) % 100 * 1%);
  top: calc((var(--i) * 23) % 100 * 1%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 12px var(--chapter);
  opacity: 0.5;
  animation: particle-rise 6s linear infinite;
  animation-delay: var(--delay);
}

.ambience-snow i {
  width: 4px;
  height: 4px;
  background: #e0f2fe;
  animation-name: particle-snow;
}

.ambience-spores i {
  background: #bbf7d0;
  animation-name: particle-drift;
}

.ambience-sparks i {
  background: #fef3c7;
  animation-name: particle-spark;
}

.ambience-stars i {
  background: #fefce8;
  animation-name: particle-twinkle;
}

.scene-architecture {
  left: 50%;
  bottom: 12%;
  z-index: 3;
  width: 82%;
  height: 64%;
  transform: translateX(-50%);
}

.scene-architecture i,
.scene-architecture b {
  position: absolute;
  display: block;
}

.scene-architecture i {
  bottom: 0;
  width: 22%;
  height: 64%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.58));
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.48);
}

.scene-architecture i:nth-child(1) {
  left: 0;
  transform: skewY(8deg);
}

.scene-architecture i:nth-child(2) {
  left: 39%;
  height: 88%;
}

.scene-architecture i:nth-child(3) {
  right: 0;
  transform: skewY(-8deg);
}

.scene-architecture b {
  left: 18%;
  bottom: 0;
  width: 64%;
  height: 18%;
  border-radius: 50% 50% 0 0;
  background: rgba(0, 0, 0, 0.55);
}

.scene-architecture b:nth-of-type(2) {
  left: 34%;
  bottom: 24%;
  width: 32%;
  height: 38%;
  border: 1px solid color-mix(in srgb, var(--chapter), white 8%);
  border-bottom: 0;
  background: transparent;
  box-shadow: 0 0 26px color-mix(in srgb, var(--chapter), transparent 42%);
}

.scene-perception i {
  border-radius: 999px 999px 0 0;
}

.scene-judgment i:nth-child(2) {
  clip-path: polygon(48% 0, 58% 0, 58% 80%, 100% 80%, 100% 100%, 0 100%, 0 80%, 48% 80%);
}

.scene-rhythm i {
  border-radius: 4px 4px 0 0;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 0 8px, transparent 8px 18px),
    linear-gradient(to bottom, rgba(251, 191, 36, 0.12), rgba(0, 0, 0, 0.62));
}

.cinematic-guide {
  left: 50%;
  bottom: 18px;
  z-index: 8;
  width: 142px;
  height: 198px;
  transform: translateX(-50%);
  animation: guide-breathe 4.4s ease-in-out infinite;
}

.guide-aura {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 150px;
  height: 150px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--chapter), transparent 48%), transparent 68%);
  filter: blur(4px);
  opacity: 0.8;
}

.guide-body {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 90px;
  height: 148px;
  transform: translateX(-50%);
}

.guide-head {
  position: absolute;
  left: 50%;
  top: 0;
  width: 62px;
  height: 66px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 44% 44% 48% 48%;
  background:
    radial-gradient(circle at 34% 42%, #fef3c7 0 3px, transparent 4px),
    radial-gradient(circle at 64% 42%, #fef3c7 0 3px, transparent 4px),
    linear-gradient(to bottom, #334155, #0f172a 64%, #020617);
  box-shadow: 0 0 28px color-mix(in srgb, var(--chapter), transparent 28%);
}

.guide-head i,
.guide-head b,
.guide-head em {
  position: absolute;
  display: block;
}

.guide-head i {
  left: 17px;
  top: 17px;
  width: 28px;
  height: 8px;
  border-top: 2px solid rgba(251, 191, 36, 0.86);
  border-radius: 50%;
}

.guide-head b {
  left: 50%;
  bottom: 14px;
  width: 18px;
  height: 5px;
  transform: translateX(-50%);
  border-bottom: 2px solid #fef3c7;
  border-radius: 50%;
}

.guide-head em {
  left: 50%;
  top: -18px;
  width: 36px;
  height: 28px;
  transform: translateX(-50%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.guide-torso {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 82px;
  height: 96px;
  transform: translateX(-50%);
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(90deg, transparent 0 47%, rgba(251, 191, 36, 0.26) 48% 52%, transparent 53%),
    linear-gradient(to bottom, #1e293b, #020617);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.guide-hand {
  position: absolute;
  top: 82px;
  width: 16px;
  height: 62px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #334155, #020617);
}

.guide-hand.left {
  left: 5px;
  transform: rotate(16deg);
}

.guide-hand.right {
  right: 5px;
  transform: rotate(-16deg);
}

.gesture-open .guide-hand.left {
  transform: rotate(38deg);
}

.gesture-open .guide-hand.right {
  transform: rotate(-38deg);
}

.gesture-point .guide-hand.right {
  right: -2px;
  transform: rotate(-62deg);
}

.gesture-hold .guide-hand.left,
.gesture-hold .guide-hand.right {
  top: 96px;
}

.guide-name {
  position: absolute;
  left: 50%;
  bottom: 0;
  min-width: 118px;
  padding: 4px 9px;
  transform: translateX(-50%);
  border: 1px solid rgba(251, 191, 36, 0.26);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.76);
  color: #fef3c7;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  backdrop-filter: blur(8px);
}

.expression-soft .guide-head b {
  border-bottom-color: #fde68a;
}

.expression-watch .guide-head i {
  transform: rotate(-8deg);
}

.expression-focus .guide-head i {
  width: 34px;
  transform: translateX(-3px);
}

.expression-inner .guide-head {
  opacity: 0.9;
  filter: saturate(0.8);
}

.scene-oracle {
  right: 8%;
  top: 12%;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.58);
  color: #fff7ed;
  box-shadow: 0 0 30px color-mix(in srgb, var(--chapter), transparent 36%);
  backdrop-filter: blur(8px);
  animation: oracle-float 5s ease-in-out infinite;
}

.scene-oracle span,
.scene-oracle b {
  display: block;
}

.scene-oracle span {
  font-size: 28px;
  line-height: 1;
}

.scene-oracle b {
  margin-top: 2px;
  color: #fcd34d;
  font-size: 12px;
}

.prop-route {
  border-radius: 8px;
}

.prop-spark span {
  animation: spark-pulse 1.8s ease-in-out infinite;
}

.cinematic-caption {
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.58);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.cinematic-caption span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cinematic-caption strong {
  flex: 0 0 auto;
  color: #fef3c7;
}

.choice-echo {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 55px;
  z-index: 35;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 4px 10px;
  align-items: center;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.84);
  color: #fef3c7;
  box-shadow: 0 0 26px rgba(251, 191, 36, 0.14);
  animation: echo-in 2600ms ease forwards;
  backdrop-filter: blur(10px);
}

.choice-echo i {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
  font-style: normal;
  font-weight: 900;
}

.choice-echo strong {
  font-size: 13px;
}

.choice-echo span {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.35;
}

.journey-navigator {
  position: absolute;
  inset: 54px 14px 132px;
  z-index: 42;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.9);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.72), inset 0 0 24px rgba(251, 191, 36, 0.06);
  backdrop-filter: blur(14px);
}

.journey-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.journey-head strong {
  color: #fef3c7;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.journey-head button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.86);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 900;
}

.journey-scroll {
  overflow-y: auto;
  padding: 12px;
}

.journey-chapter {
  margin-bottom: 16px;
}

.journey-chapter h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
}

.journey-chapter h3 span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--chapter), transparent 70%);
  color: #fef3c7;
}

.journey-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.journey-grid button {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 2px 7px;
  align-items: center;
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.76);
  color: #cbd5e1;
  text-align: left;
}

.journey-grid button.done {
  border-color: color-mix(in srgb, var(--chapter), white 8%);
  background: color-mix(in srgb, var(--chapter), #0f172a 76%);
}

.journey-grid button.active {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.7), 0 0 22px color-mix(in srgb, var(--chapter), transparent 46%);
}

.journey-grid button.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.journey-grid i {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.34);
  color: #fbbf24;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.journey-grid strong {
  min-width: 0;
  overflow: hidden;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-grid span {
  min-width: 0;
  overflow: hidden;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent);
}

.vn-dialog {
  position: relative;
  min-height: 112px;
  padding: 19px 16px 13px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-top: 2px solid rgba(251, 191, 36, 0.58);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(2, 6, 23, 0.98));
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.72), 0 12px 30px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
}

.speaker-tag {
  position: absolute;
  top: -17px;
  left: 18px;
  min-width: 86px;
  padding: 3px 14px;
  border: 1px solid #fbbf24;
  background: linear-gradient(90deg, #78350f, #451a03);
  color: #fef3c7;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
}

.dialog-title {
  margin: 0 0 8px;
  color: #fef3c7;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.dialog-text {
  margin: 0;
  color: #f3f4f6;
  font-size: 14px;
  line-height: 1.65;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.choices-container {
  display: grid;
  gap: 8px;
}

.choice-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.84);
  color: #e2e8f0;
  text-align: left;
  backdrop-filter: blur(8px);
}

.choice-card.selected {
  border-color: rgba(251, 191, 36, 0.7);
  background: rgba(30, 41, 59, 0.92);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.18);
}

.choice-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 42%;
  height: 100%;
  transform: skewX(-30deg);
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.26), transparent);
}

.choice-card:hover::before {
  left: 120%;
  transition: left 520ms ease;
}

.choice-card span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  font-weight: 900;
}

.choice-card strong {
  font-size: 16px;
  line-height: 1.35;
}

.choice-card em {
  display: block;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.heart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.heart-actions button {
  flex: 1 1 auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.56);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.result-playfield {
  overflow-y: auto;
  background: #000;
}

.result-content {
  min-height: 100%;
  padding: 150px 22px 32px;
}

.result-constellation {
  position: relative;
  width: min(78vw, 310px);
  height: 250px;
  margin: -80px auto 18px;
}

.result-ring {
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(251, 191, 36, 0.08), 0 0 34px rgba(251, 191, 36, 0.14);
  animation: rotate-slow 28s linear infinite;
}

.result-ring::before,
.result-ring::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 50%;
}

.result-ring::after {
  inset: 38%;
  border-color: rgba(52, 211, 153, 0.2);
}

.result-star {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin: -35px;
  transform: rotate(calc(var(--i) * 90deg)) translateY(-100px) rotate(calc(var(--i) * -90deg));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.16);
  backdrop-filter: blur(8px);
  animation: star-pop 700ms ease both;
  animation-delay: calc(var(--i) * 140ms);
}

.result-star b,
.result-star i {
  display: block;
}

.result-star b {
  color: #fef3c7;
  font-size: 24px;
  line-height: 1;
}

.result-star i {
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.result-hero {
  text-align: center;
}

.result-type {
  margin: 6px 0 8px;
  background: linear-gradient(to bottom, #fff, #94a3b8);
  -webkit-background-clip: text;
  color: transparent;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.result-title {
  margin: 0 0 28px;
  color: #fbbf24;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.trait-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 26px;
}

.trait-grid div {
  min-height: 76px;
  padding: 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.68);
  text-align: center;
}

.trait-grid strong,
.trait-grid span {
  display: block;
}

.trait-grid strong {
  color: #fef3c7;
  font-size: 28px;
}

.trait-grid span {
  margin-top: 5px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 900;
}

.report-stack {
  position: relative;
  display: grid;
  gap: 14px;
}

.report-card {
  border-left: 1px solid rgba(251, 191, 36, 0.35);
  padding-left: 18px;
}

.report-card summary {
  color: #fbbf24;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.report-card p {
  margin: 8px 0 0;
  color: #d1d5db;
  font-size: 14px;
  line-height: 1.8;
}

.heart-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 100;
  transform: translateX(-50%);
  width: min(88vw, 360px);
  padding: 12px 16px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.94);
  color: #fef3c7;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.7);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

@keyframes rotate-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes gate-float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.04);
  }
}

@keyframes camera-breathe {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.035) translateY(-4px);
  }
}

@keyframes camera-push {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

@keyframes camera-drift {
  0%, 100% {
    transform: translateX(-10px);
  }
  50% {
    transform: translateX(10px);
  }
}

@keyframes guide-breathe {
  0%, 100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  50% {
    transform: translateX(-50%) translateY(-5px) scale(1.015);
  }
}

@keyframes guide-tilt {
  0%, 100% {
    transform: translateX(-50%) rotate(-1deg);
  }
  50% {
    transform: translateX(-50%) rotate(1.5deg);
  }
}

@keyframes oracle-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes oracle-orbit {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-10px, 8px);
  }
}

@keyframes spark-pulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px var(--chapter));
  }
  50% {
    transform: scale(1.16);
    filter: drop-shadow(0 0 12px var(--chapter));
  }
}

@keyframes particle-rise {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  18%, 75% {
    opacity: 0.56;
  }
  to {
    transform: translateY(-170px);
    opacity: 0;
  }
}

@keyframes particle-snow {
  from {
    transform: translate(0, -40px);
    opacity: 0;
  }
  20%, 80% {
    opacity: 0.7;
  }
  to {
    transform: translate(-34px, 210px);
    opacity: 0;
  }
}

@keyframes particle-drift {
  from {
    transform: translate(-20px, 60px) scale(0.7);
  }
  to {
    transform: translate(28px, -150px) scale(1.25);
  }
}

@keyframes particle-spark {
  0% {
    transform: translateY(60px) scale(0.6);
    opacity: 0;
  }
  35% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-120px) scale(0.2);
    opacity: 0;
  }
}

@keyframes particle-twinkle {
  0%, 100% {
    transform: scale(0.5);
    opacity: 0.16;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.9;
  }
}

@keyframes echo-in {
  0% {
    transform: translateY(-10px);
    opacity: 0;
  }
  12%, 78% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
  }
}

@keyframes star-pop {
  from {
    opacity: 0;
    transform: rotate(calc(var(--i) * 90deg)) translateY(-80px) rotate(calc(var(--i) * -90deg)) scale(0.72);
  }
  to {
    opacity: 1;
    transform: rotate(calc(var(--i) * 90deg)) translateY(-100px) rotate(calc(var(--i) * -90deg)) scale(1);
  }
}

@media (max-width: 420px) {
  .intro-title {
    font-size: 42px;
  }

  .gate-board {
    grid-template-columns: repeat(2, 1fr);
  }

  .visual-area {
    inset: 58px 0 388px;
    min-height: 0;
  }

  .cinematic-stage {
    min-height: 0;
  }

  .cinematic-guide {
    width: 126px;
    height: 176px;
  }

  .guide-body {
    transform: translateX(-50%) scale(0.9);
    transform-origin: center bottom;
  }

  .scene-oracle {
    width: 62px;
    height: 62px;
  }

  .cinematic-caption {
    bottom: 10px;
  }

  .vn-dialog {
    min-height: 120px;
  }

  .dialog-text {
    font-size: 14px;
  }
}
