@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700&display=swap');

:root {
  --ink: #f0ece4;
  --scene-shadow: rgba(0, 0, 0, 0.5);
  --arena-aspect: 9 / 16;
  --panorama-shift: 0px;
  --panorama-width: 100%;

  /* 안내 패널(shared/room-intro.css) — 기본값이 이미 이 방의 어두운 톤이라 색은 그대로
     두고, 글꼴만 이 방의 다른 문구들과 같은 픽셀 글꼴로 맞춘다.
*/
  --ri-font: "RoundedFixedsys", "Noto Sans KR", monospace;
}

@font-face {
  font-family: "RoundedFixedsys";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/DungGeunMo.woff") format("woff");
  font-weight: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-weight: 400;
  color: var(--ink);
}

.top-leave-bar {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.leave-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.leave-link img {
  width: 18px;
  height: 18px;
  display: block;
}

.arena-wrap {
  width: 100%;
  margin: 0;
  padding: 0;
}

.arena {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: var(--arena-aspect);
  min-height: min(78svh, 960px);
  border-radius: 0 0 24px 24px;
  border: 0;
  background: #000;
  box-shadow: none;
  outline: none;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.arena:focus-visible {
  box-shadow:
    0 24px 50px var(--scene-shadow),
    0 0 0 5px rgba(0, 0, 0, 0.1);
}

.scene-stack,
.foreground-stack,
.moon-stack {
  position: absolute;
  inset: 0;
  height: 100%;
  transform: translateY(0);
  transition: transform 1.15s cubic-bezier(0.22, 0.9, 0.2, 1);
}

.scene-stack {
  z-index: 0;
}

.foreground-stack {
  z-index: 3;
  pointer-events: none;
}

/* 어둠(spotlight, z-index 4) 위에서 달빛만 새어 나오도록 그 위에 올린다 */
.moon-stack {
  z-index: 5;
  pointer-events: none;
}

.arena.is-transitioning-to-two .scene-stack,
.arena.is-transitioning-to-two .foreground-stack,
.arena.is-transitioning-to-two .moon-stack,
.arena.is-scene-two .scene-stack,
.arena.is-scene-two .foreground-stack,
.arena.is-scene-two .moon-stack {
  transform: translateY(-100%);
}

.arena.is-transitioning-to-three .scene-stack,
.arena.is-transitioning-to-three .foreground-stack,
.arena.is-transitioning-to-three .moon-stack,
.arena.is-scene-three .scene-stack,
.arena.is-scene-three .foreground-stack,
.arena.is-scene-three .moon-stack {
  transform: translateY(-200%);
}

.arena.is-transitioning-to-four .scene-stack,
.arena.is-transitioning-to-four .foreground-stack,
.arena.is-transitioning-to-four .moon-stack,
.arena.is-scene-four .scene-stack,
.arena.is-scene-four .foreground-stack,
.arena.is-scene-four .moon-stack {
  transform: translateY(-300%);
}

.arena.is-transitioning-to-five .scene-stack,
.arena.is-transitioning-to-five .foreground-stack,
.arena.is-transitioning-to-five .moon-stack,
.arena.is-scene-five .scene-stack,
.arena.is-scene-five .foreground-stack,
.arena.is-scene-five .moon-stack {
  transform: translateY(-400%);
}

.scene-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-panorama {
  position: absolute;
  inset: 0;
  width: var(--panorama-width);
  height: 100%;
  left: 0;
  transform: translate3d(var(--panorama-shift), 0, 0);
  transition: transform 220ms ease-out;
  will-change: transform;
}

.scene-panorama--far {
  --panorama-shift: calc(var(--camera-pan, 0px) * 0.42);
}

.scene-panorama--mid {
  --panorama-shift: calc(var(--camera-pan, 0px) * 0.7);
}

.scene-panorama--near {
  --panorama-shift: var(--camera-pan, 0px);
}

.scene-panel-one {
  top: 0;
}

.scene-panel-two {
  top: 100%;
}

.scene-panel-three {
  top: 200%;
}

.scene-panel-four {
  top: 300%;
}

.scene-panel-five {
  top: 400%;
}

.scene-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  pointer-events: none;
  -webkit-user-drag: none;
}

.scene-panel-two .scene-art {
  width: 100%;
  height: 100%;
}

.scene-wind-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  pointer-events: none;
  will-change: transform;
}

.scene2-trees {
  transform-origin: 78% 100%;
  animation: tree-breeze 6.8s ease-in-out infinite;
}

.scene2-grass {
  transform-origin: 12% 100%;
  animation: grass-breeze 4.6s ease-in-out infinite;
}

.scene2-flowers {
  transform-origin: 80% 100%;
  animation: flower-breeze 5.4s ease-in-out 0.7s infinite;
}

.scene3-flowers {
  transform-origin: 11% 100%;
  animation: leaf-breeze 4.8s ease-in-out 0.25s infinite;
}

.scene3-water {
  transform-origin: 50% 84%;
  animation: river-flow 5.6s ease-in-out infinite;
}

.scene-foreground-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  pointer-events: none;
}

.scene5-foreground {
  z-index: 1;
}

.scene5-decor {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  pointer-events: none;
}

.scene5-paths {
  opacity: 0;
}

.arena.is-scene-five .scene5-paths {
  animation: scene5-decor-fade 480ms 0.18s ease forwards;
}

.idle-guide {
  position: absolute;
  left: 50%;
  width: max-content;
  bottom: 10%;
  z-index: 5;
  display: flex;
  white-space: pre-line;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 280ms ease, transform 280ms ease, left 280ms ease, right 280ms ease;
}

.idle-guide.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.idle-guide-arrow {
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  animation: idle-arrow-bob-right 1.35s ease-in-out infinite;
}

.idle-guide-text {
  margin: 0;
  max-width: 190px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  font-size: clamp(0.82rem, 1.5vw, 0.92rem);
  letter-spacing: 0.08em;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.scene-door {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  transform-origin: 5.9% 16.8%;
  animation: door-wobble 4.2s ease-in-out infinite;
  pointer-events: none;
  will-change: transform;
}

@keyframes door-wobble {
  0%,
  100% {
    transform: rotate(0deg);
  }

  16% {
    transform: rotate(-1.6deg) translateX(-3px);
  }

  30% {
    transform: rotate(0.9deg) translateX(2px);
  }

  48% {
    transform: rotate(-2deg) translateX(-4px);
  }

  66% {
    transform: rotate(1.1deg) translateX(3px);
  }

  84% {
    transform: rotate(-0.6deg) translateX(-1px);
  }
}

@keyframes tree-breeze {
  0%,
  100% {
    transform: rotate(0deg) skewX(0deg) translateX(0);
  }

  18% {
    transform: rotate(-0.9deg) skewX(-0.5deg) translateX(-3px);
  }

  34% {
    transform: rotate(-0.3deg) skewX(-0.15deg) translateX(-1px);
  }

  52% {
    transform: rotate(-1.2deg) skewX(-0.7deg) translateX(-4px);
  }

  74% {
    transform: rotate(0.4deg) skewX(0.3deg) translateX(2px);
  }
}

@keyframes grass-breeze {
  0%,
  100% {
    transform: skewX(0deg) translateX(0);
  }

  26% {
    transform: skewX(3.5deg) translateX(3px);
  }

  46% {
    transform: skewX(1.2deg) translateX(1px);
  }

  64% {
    transform: skewX(4.5deg) translateX(4px);
  }

  84% {
    transform: skewX(-1.6deg) translateX(-2px);
  }
}

@keyframes flower-breeze {
  0%,
  100% {
    transform: rotate(0deg) skewX(0deg) translateX(0);
  }

  28% {
    transform: rotate(1.8deg) skewX(1deg) translateX(3px);
  }

  50% {
    transform: rotate(0.5deg) skewX(0.3deg) translateX(1px);
  }

  70% {
    transform: rotate(2.2deg) skewX(1.3deg) translateX(3px);
  }

  88% {
    transform: rotate(-0.9deg) skewX(-0.6deg) translateX(-1px);
  }
}

@keyframes leaf-breeze {
  0%,
  100% {
    transform: translateX(0) rotate(0deg) skewX(0deg);
  }

  20% {
    transform: translateX(-4px) rotate(-2deg) skewX(-1.2deg);
  }

  42% {
    transform: translateX(-1px) rotate(-0.6deg) skewX(-0.4deg);
  }

  60% {
    transform: translateX(4px) rotate(1.8deg) skewX(1deg);
  }

  82% {
    transform: translateX(-2px) rotate(-1.1deg) skewX(-0.5deg);
  }
}

@keyframes river-flow {
  0%,
  100% {
    opacity: 0.88;
    transform: translateX(0) translateY(0) scaleX(1);
  }

  24% {
    opacity: 1;
    transform: translateX(-18px) translateY(3px) scaleX(1.02);
  }

  48% {
    opacity: 0.9;
    transform: translateX(13px) translateY(-3px) scaleX(0.99);
  }

  72% {
    opacity: 1;
    transform: translateX(-9px) translateY(2px) scaleX(1.012);
  }
}

@keyframes scene5-decor-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes caption-caret {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes idle-arrow-bob-right {
  0%,
  100% {
    transform: translateX(0) translateY(0);
  }

  50% {
    transform: translateX(12px) translateY(-2px);
  }
}

@keyframes idle-arrow-bob-left {
  0%,
  100% {
    transform: translateX(0) translateY(0);
  }

  50% {
    transform: translateX(-12px) translateY(-2px);
  }
}

/* ── 결과 화면 (아레나 셸 안에서 스크롤되는 풀커버 패널) ── */
.result-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 84px 24px 40px;
  overflow-y: auto;
  text-align: center;
  background: radial-gradient(ellipse at 50% 30%, #1c1a17 0%, #0a0908 78%);
  color: #fff;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 520ms ease;
}

.result-screen.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.result-screen > * {
  flex-shrink: 0;
}

/* 스크롤바를 어두운 무드에 맞춘다 (결과 화면 + 질문 카드) */
.result-screen,
.questionnaire-form {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 235, 190, 0.18) transparent;
}

.result-screen::-webkit-scrollbar,
.questionnaire-form::-webkit-scrollbar {
  width: 6px;
}

.result-screen::-webkit-scrollbar-track,
.questionnaire-form::-webkit-scrollbar-track {
  background: transparent;
}

.result-screen::-webkit-scrollbar-thumb,
.questionnaire-form::-webkit-scrollbar-thumb {
  background: rgba(255, 235, 190, 0.16);
  border-radius: 999px;
}

.result-screen::-webkit-scrollbar-thumb:hover,
.questionnaire-form::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 235, 190, 0.28);
}

/* 결과 화면이 떠 있는 동안: info 버튼은 숨기고, 나머지 헤더 버튼(사운드/언어/초기화/나가기)은
   결과 화면 위로 노출시켜 계속 조작할 수 있게 한다. */
.arena.is-result-active .gh-header-left {
  display: none;
}

.arena.is-result-active .gh-header-right {
  z-index: 40;
}

.result-screen-media {
  width: min(160px, 40vw);
  margin-bottom: 6px;
}

.result-screen-media img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
}

.result-text {
  margin: 0;
  max-width: 32em;
  font-size: clamp(1.2rem, 3.4vw, 1.5rem);
  line-height: 1.5;
  color: rgba(255, 228, 146, 0.95);
  white-space: pre-line;
}

.result-item-name {
  font-weight: 700;
  color: #ffd977;
}

.result-recommend {
  margin: 0 0 6px;
  max-width: 30em;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  font-style: italic;
}

.result-quote {
  margin: 0 0 6px;
  max-width: 26em;
}

.result-quote-text {
  margin: 0 0 4px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: rgba(255, 228, 146, 0.85);
}

.result-quote-author {
  font-size: 0.78rem;
  font-style: normal;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
}

.result-share-row {
  display: flex;
  justify-content: center;
}

.result-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease;
}

.result-share-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
}

.result-share-btn:active {
  transform: translateY(1px) scale(0.98);
}

.result-share-btn.is-copied {
  border-color: rgba(255, 228, 146, 0.6);
  background: rgba(255, 228, 146, 0.12);
  color: rgba(255, 228, 146, 0.95);
}

.result-share-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.result-other-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 6px 0 4px;
}

.result-other-items-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
}

.result-other-items-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.result-other-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.result-other-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-other-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

.result-divider {
  width: min(280px, 70%);
  height: 1px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.12);
}

.result-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 200ms ease, background 200ms ease;
}

.result-cta:active {
  transform: translateY(1px) scale(0.98);
}

.result-cta-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.result-cta--book {
  color: #1c1408;
  background: linear-gradient(180deg, #ffe8a6, #f0c565);
  box-shadow: 0 4px 18px rgba(255, 205, 120, 0.35);
  animation: result-cta-glow 2.6s ease-in-out infinite;
}

.result-cta--book:hover {
  filter: brightness(1.05);
}

@keyframes result-cta-glow {
  0%, 100% {
    box-shadow: 0 4px 18px rgba(255, 205, 120, 0.35);
  }
  50% {
    box-shadow: 0 4px 26px rgba(255, 205, 120, 0.6);
  }
}

.result-cta-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  justify-content: center;
}

.result-cta-row .result-cta {
  flex: 0 1 auto;
  min-width: 0;
  padding: 13px 16px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.result-cta--video {
  color: rgba(255, 232, 168, 0.95);
  background: rgba(255, 228, 146, 0.08);
  border: 1px solid rgba(255, 228, 146, 0.5);
}

.result-cta--video:hover {
  background: rgba(255, 228, 146, 0.18);
}

.result-book-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.result-tagline {
  margin: 0;
  max-width: 22em;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
  white-space: pre-line;
}

.result-book-cover {
  display: block;
  width: 100%;
  max-width: 180px;
  border-radius: 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

/* 씬5: 로딩 중 배경을 살짝 눌러서 씬 배경 → 로딩 상태 전환이 뚜렷하게 보이게 한다 */
.result-dim {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: radial-gradient(ellipse at 50% 40%, rgba(6, 5, 4, 0.55) 0%, rgba(4, 3, 3, 0.78) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.result-dim[hidden] {
  display: none;
}

.result-dim.is-visible {
  opacity: 1;
}

/* 씬5: 결과가 준비되는 동안 조작이 필요 없다는 걸 알려주는 로딩 표시.
   스피너와 문구가 한 묶음으로 화면 중앙에 뜬다. */
.result-loading {
  position: absolute;
  left: 50%;
  top: 40%;
  z-index: 6;
  display: flex;
  width: max-content;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 320ms ease;
}

.result-loading[hidden] {
  display: none;
}

.result-loading.is-visible {
  opacity: 1;
}

.result-loading-label {
  display: flex;
  align-items: baseline;
  white-space: nowrap;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(10, 9, 8, 0.74);
  border: 1px solid rgba(255, 228, 146, 0.28);
  color: rgba(255, 236, 190, 0.92);
  font-family: "RoundedFixedsys", "Noto Sans KR", monospace;
  font-size: clamp(0.85rem, 2.2vw, 1rem);
}

.result-loading-dots span {
  display: inline-block;
  animation: result-loading-dot 1.2s ease-in-out infinite;
}

.result-loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.result-loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes result-loading-dot {
  0%,
  60%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* 금빛 링이 돌고, 중앙에서 4가지 사물이 번갈아 보이는 스피너 */
.result-loading-spinner {
  position: relative;
  width: clamp(96px, 20vw, 140px);
  aspect-ratio: 1;
}

/* 사물 뒤에 어두운 원판을 깔아 배경과 분리한다 */
.result-loading-spinner::before {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 17, 12, 0.85) 0%, rgba(10, 9, 8, 0.45) 68%, transparent 100%);
}

.result-loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 228, 146, 0.16);
  border-top-color: rgba(255, 232, 168, 0.85);
  box-shadow: 0 0 18px rgba(255, 228, 146, 0.12);
  animation: result-ring-spin 1.1s linear infinite;
}

@keyframes result-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

.result-loading-items {
  position: absolute;
  inset: 24%;
}

.result-loading-items img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
  /* 로딩 시간(3.4s) 동안 4가지가 한 바퀴 돌도록 0.85s 간격으로 교대 */
  animation: result-item-cycle 3.4s ease-in-out infinite;
}

.result-loading-items img:nth-child(2) {
  animation-delay: 0.85s;
}

.result-loading-items img:nth-child(3) {
  animation-delay: 1.7s;
}

.result-loading-items img:nth-child(4) {
  animation-delay: 2.55s;
}

@keyframes result-item-cycle {
  0%,
  22% {
    opacity: 1;
    transform: scale(1);
  }

  28%,
  94% {
    opacity: 0;
    transform: scale(0.88);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.monologue {
  position: absolute;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  z-index: 6;
  pointer-events: none;
  text-align: center;
  width: max-content;
  max-width: min(280px, 78%);
  padding: 14px 18px;
  background: rgba(12, 10, 8, 0.88);
  border: 3px solid rgba(240, 236, 228, 0.85);
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 700ms ease;
  font-family: "RoundedFixedsys", "Noto Sans KR", monospace;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: normal;
  font-style: normal;
  letter-spacing: 0.02em;
  line-height: 1.6;
  color: rgba(240, 236, 228, 0.95);
  text-shadow: none;
}

.monologue.is-popping {
  animation: monologue-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes monologue-pop {
  0% {
    transform: translateX(-50%) scale(0.35);
  }

  55% {
    transform: translateX(-50%) scale(1.12);
  }

  75% {
    transform: translateX(-50%) scale(0.94);
  }

  100% {
    transform: translateX(-50%) scale(1);
  }
}

.monologue::before,
.monologue::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.monologue::after {
  bottom: -10px;
  border-top: 10px solid rgba(240, 236, 228, 0.85);
}

.monologue::before {
  bottom: -6px;
  z-index: 1;
  border-left-width: 6px;
  border-right-width: 6px;
  border-top: 8px solid rgba(12, 10, 8, 0.88);
}

.monologue.is-visible {
  opacity: 1;
}

.spotlight {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--spot-x, 50%) var(--spot-y, 50%),
    transparent 0,
    transparent var(--spot-r-inner, 90px),
    rgba(0, 0, 0, 0.88) var(--spot-r-outer, 200px)
  );
}

.arena.is-scene-five .spotlight,
.arena.is-transitioning .spotlight {
  opacity: 0;
}

.questionnaire-panel[hidden] {
  display: none;
}

.questionnaire-panel {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 7, 6, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.questionnaire-panel.is-visible {
  opacity: 1;
}

.questionnaire-card {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(86%, 560px);
  padding: 26px 26px 20px;
  border-radius: 24px;
  background: radial-gradient(ellipse at 50% 15%, #1c1a17 0%, #0a0908 78%);
  border: 1px solid rgba(255, 228, 146, 0.35);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 205, 130, 0.14);
  color: #f0ece4;
  transform: translateY(12px);
  transition: transform 220ms ease;
}

.questionnaire-panel.is-visible .questionnaire-card {
  transform: translateY(0);
}

.questionnaire-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.questionnaire-question {
  border: 0;
  margin: 0;
  padding: 0;
}

.questionnaire-question-prompt {
  padding: 0;
  margin: 0 0 18px;
  font-family: "RoundedFixedsys", "Noto Sans KR", monospace;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  line-height: 1.6;
  font-weight: normal;
  color: rgba(255, 232, 168, 0.95);
}

/* 질문 번호 배지: 홈의 층 문패 배지(.home-floor-badge)와 같은 결로, 본문보다
   작고 굵고 옅게 앞에 붙는다. 여기선 질문 본문이 픽셀체라 배지만 산세리프로
   빼서 서체까지 대비를 주고, 알약 배경으로 문장에 섞여 읽히지 않게 한다. */
.questionnaire-question-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 9px 3px;
  border-radius: 999px;
  background: rgba(255, 228, 146, 0.13);
  border: 1px solid rgba(255, 228, 146, 0.3);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 0.7em;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: rgba(255, 232, 168, 0.78);
  vertical-align: 0.1em;
}

.questionnaire-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.questionnaire-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 14px;
  background: rgba(255, 228, 146, 0.06);
  border: 1px solid rgba(255, 228, 146, 0.18);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.questionnaire-option:hover {
  background: rgba(255, 228, 146, 0.12);
  border-color: rgba(255, 228, 146, 0.35);
}

.questionnaire-option:has(input:checked) {
  background: rgba(255, 228, 146, 0.18);
  border-color: rgba(255, 228, 146, 0.6);
}

.questionnaire-option input {
  accent-color: #ffd98a;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.questionnaire-option-text {
  font-family: "RoundedFixedsys", "Noto Sans KR", monospace;
  font-size: 0.94rem;
  font-weight: normal;
  line-height: 1.6;
  color: rgba(240, 236, 228, 0.92);
}

.questionnaire-feedback {
  min-height: 1.2em;
  margin: 12px 0 0;
  font-family: "RoundedFixedsys", "Noto Sans KR", monospace;
  font-size: 0.82rem;
  font-weight: normal;
  color: rgba(240, 236, 228, 0.5);
}

.questionnaire-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 228, 146, 0.15);
}

.questionnaire-submit {
  padding: 12px 28px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(180deg, #ffe8a6, #f0c565);
  color: #1c1408;
  font-family: "RoundedFixedsys", "Noto Sans KR", monospace;
  font-size: 0.92rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.questionnaire-submit:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.questionnaire-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.arena.is-question-active .idle-guide {
  display: none;
}

.character {
  position: absolute;
  z-index: 2;
  width: clamp(44px, 15.8%, 80px);
  height: auto;
  transform-origin: center bottom;
  transition: transform 80ms linear, opacity 220ms ease;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.24));
}

.arena.is-transitioning .character {
  opacity: 0;
}


.arena.is-scene-five .character {
  opacity: 0;
  pointer-events: none;
}

.character-sprite {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* ── Media section (사진 + 유튜브) ── */
.media-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.book-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: 10px;
  background: #ddd;
}

.yt-panel {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: #111;
  overflow: hidden;
}

.yt-panel-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}

.yt-panel-media iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-panel-title {
  margin: 8px 10px 3px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.yt-panel-channel {
  margin: 0 10px 10px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ── Work note ── */
.work-note-card {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff8cf;
  border: 1px solid rgba(38, 38, 38, 0.08);
}

.work-note-kicker {
  margin: 0 0 10px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.68;
}

.work-note-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.8;
  color: rgba(38, 38, 38, 0.82);
}

.work-note-card p + p {
  margin-top: 10px;
}

/* ── Order button ── */
.order-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  border-radius: 14px;
  padding: 16px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: #111;
  cursor: pointer;
  text-decoration: none;
}

.order-cta:hover { filter: brightness(1.08); }
.order-cta:active { transform: translateY(1px); }

/* ── Touch controls ── */
.touch-controls {
  display: flex;
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  padding: 0 26px;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 10;
}

.touch-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  transition: background 120ms ease, transform 80ms ease;
}

.touch-btn svg {
  pointer-events: none;
}

.touch-btn:active {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(0.91);
}

/* 이동 안내가 가리키는 쪽 버튼만 밝힌다 */
.touch-btn--highlight {
  border-color: rgba(255, 228, 146, 0.9);
  background: rgba(255, 228, 146, 0.28);
  box-shadow: 0 0 0 5px rgba(255, 228, 146, 0.2), 0 4px 18px rgba(255, 205, 130, 0.4);
  animation: touch-btn-glow 1.3s ease-in-out infinite;
}

@keyframes touch-btn-glow {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.touch-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.idle-guide {
  bottom: 72px;
}

.arena.is-scene-five .touch-controls,
.arena.is-transitioning-to-five .touch-controls {
  display: none;
}

/* ── Mobile layout ──
   화면 폭 전체로 카드를 채우는 --gs-max-width/.game-shell 분기점은
   shared/game-shell.css로 옮겨서 모든 방이 공유한다. 여기는 in-the-dark
   전용(아레나 비율, 배경 등)만 남긴다. */
@media (max-width: 560px) {
  :root {
    --arena-aspect: 9 / 16;
  }

  /* body.gs-page의 배경은 shared/game-shell.css의 --gs-page-bg(다크 톤)를
     그대로 쓴다 — 예전엔 여기서 밝은 회색 그러데이션으로 덮어썼는데,
     화면비가 안 맞아 카드 위/아래에 --gs-page-bg가 비치는 지금 레이아웃과
     톤이 어긋나 어색한 띠로 보였다. */

  .top-leave-bar,
  .game-card,
  .media-section,
  .work-note-card,
  .order-cta {
    width: 100%;
  }

  .arena {
    min-height: min(78svh, 960px);
    border-radius: 0;
  }

  .media-section {
    gap: 6px;
  }

  .book-grid {
    gap: 6px;
  }

  .touch-controls {
    bottom: calc(28px + env(safe-area-inset-bottom));
    padding: 0 24px;
  }

  .touch-btn {
    width: 58px;
    height: 58px;
    background: rgba(255, 255, 255, 0.22);
  }

  .touch-btn svg {
    width: 26px;
    height: 26px;
  }

  .idle-guide {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .result-other-item {
    width: 46px;
    height: 46px;
    padding: 6px;
  }

  .questionnaire-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
    margin: 6px auto;
    padding: 18px 16px 14px;
    border-radius: 16px;
  }

  .questionnaire-question-prompt {
    font-size: 0.96rem;
    margin-bottom: 14px;
  }

  .questionnaire-option {
    padding: 11px 13px;
    border-radius: 12px;
  }

  .questionnaire-option-text {
    font-size: 0.86rem;
  }

  .questionnaire-submit {
    padding: 10px 22px;
    font-size: 0.86rem;
  }

}
