@font-face {
  font-family: "Yeon Sung Local";
  src: url("../assets/fonts/YeonSung-Regular.ttf?v=20261121") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-midnight: #0d1021;
  --bg-surface: #181c32;
  --bg-card: #1f2442;
  --red-dancheong: #ff5e6c;
  --gold-talisman: #f7b731;
  --cyan-moon: #4ecdc4;
  --purple-occult: #a55eea;
  --ivory-hanji: #f5f2eb;
  --text-muted: #9da5c4;
  --border-glow: rgba(255, 94, 108, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", sans-serif;
  background-color: #070812;
  color: var(--ivory-hanji);
  min-height: 100vh;
  line-height: 1.55;
}

/* Faint Wolhadang Shrine Ambient Background across all inner screens */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("../assets/wolhadang_intro_wide.jpg?v=2k");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.22;
  filter: saturate(0.9) contrast(1.05);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 94, 108, 0.12), transparent 48%),
    radial-gradient(circle at 80% 90%, rgba(78, 205, 196, 0.09), transparent 45%),
    radial-gradient(ellipse 80% 75% at 50% 40%, rgba(11, 13, 27, 0.35) 0%, rgba(8, 10, 21, 0.78) 72%, rgba(5, 6, 14, 0.94) 100%);
  pointer-events: none;
}

.wolhadang-app {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

/* Header */
.w-header {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  margin-bottom: 12px;
}

.btn-top-back {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  color: #eef1fa;
  flex-shrink: 0;
}

.btn-top-back.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.result-bottom-actions {
  display: flex;
  justify-content: center;
  margin: 18px 0 6px;
}

.btn-top-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border-color: rgba(247, 183, 49, 0.55);
  color: #ffeaa7;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn-top-home:hover {
  transform: translateY(-1px);
  border-color: #f7b731;
  background: rgba(247, 183, 49, 0.14);
}

.btn-top-home .top-home-icon {
  color: #ffd86b;
  filter: drop-shadow(0 0 6px rgba(247, 183, 49, 0.85));
  flex-shrink: 0;
}

.btn-top-home.is-hidden-home,
.wolhadang-app:has(#screen-intro.active) .btn-top-home {
  display: none;
}

.w-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.w-lantern {
  font-size: 28px;
  filter: drop-shadow(0 0 10px rgba(255, 94, 108, 0.8));
}

.w-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.w-sub {
  font-size: 0.75rem;
  color: var(--cyan-moon);
}

.w-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.w-ui-icon {
  display: inline-block;
  width: 1.26em;
  height: 1.26em;
  vertical-align: -0.24em;
  margin-right: 6px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.btn-lang {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(14, 16, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
}

.btn-lang:focus-visible {
  box-shadow: 0 0 0 2px rgba(247, 183, 49, 0.65);
}

.lang-dropdown {
  position: relative;
  display: inline-flex;
}

.btn-lang-select {
  color: var(--gold-talisman);
  gap: 4px;
}

.lang-caret {
  opacity: 0.85;
  transition: transform 0.18s ease;
}

.btn-lang-select[aria-expanded="true"] .lang-caret {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 124px;
  background: rgba(16, 19, 36, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(247, 183, 49, 0.35);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 60;
}

.lang-menu.hidden {
  display: none;
}

.lang-option {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #dce0f0;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lang-option.active {
  background: rgba(247, 183, 49, 0.18);
  color: var(--gold-talisman);
}

.btn-lang .active {
  color: var(--gold-talisman);
}

.btn-office-link {
  text-decoration: none;
  background: rgba(78, 205, 196, 0.14);
  border: 1px solid rgba(78, 205, 196, 0.35);
  color: var(--cyan-moon);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Screens */
.w-screen {
  display: none;
  animation: fadeIn 0.35s ease;
}

.w-screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* SCREEN 1: Full-Viewport Intro with Outpainted Wide Artwork (Zero Blur, Crisp Line Art) */
#screen-intro.active {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #040308;
}

.intro-hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #040308;
}

.intro-scene-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 1.35s ease, filter 1.35s ease;
}

.intro-hero.door-opening .intro-scene-stage {
  transform: scale(1.22);
  filter: brightness(1.35);
}

.intro-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Only a subtle bottom gradient behind the text/button for readability — keeps the Hanok, clouds, and ground fog 100% sharp! */
.intro-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(4, 3, 8, 0.25) 0%,
    transparent 18%,
    transparent 62%,
    rgba(6, 7, 16, 0.68) 84%,
    rgba(4, 5, 12, 0.90) 100%
  );
}

.peeking-eyes {
  position: absolute;
  top: 52.2%;
  left: 52.4%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  gap: 5px;
  pointer-events: none;
  animation: blinkEyes 4s infinite;
}

.peeking-eyes .eye {
  width: 6px;
  height: 3px;
  background: #ffeaa7;
  border-radius: 50%;
  box-shadow: 0 0 12px #f7b731, 0 0 22px #ff5e6c;
}

@keyframes blinkEyes {
  0%, 45%, 55%, 100% { transform: translate(-50%, -50%) scaleY(1); }
  50% { transform: translate(-50%, -50%) scaleY(0.1); }
}

.intro-overlay-content {
  position: relative;
  z-index: 6;
  width: 100%;
  max-width: 720px;
  text-align: center;
  padding: 24px 24px 44px;
}

.midnight-badge {
  display: inline-block;
  background: rgba(255, 94, 108, 0.2);
  border: 1px solid var(--red-dancheong);
  color: #ff8a94;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.intro-headline {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  font-weight: 900;
  margin-bottom: 12px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.9);
}

.intro-desc {
  color: #d1d6eb;
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0 auto 24px;
}

.btn-primary-occult {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(135deg, #ff5e6c, #c0392b);
  color: #fff;
  border: 2px solid #ffeaa7;
  border-radius: 14px;
  padding: 15px 28px;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255, 94, 108, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hanok-knocker-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(35, 3, 8, 0.9)) brightness(1.06);
  transition: transform 0.2s ease;
}

.btn-primary-occult:hover .hanok-knocker-icon {
  transform: scale(1.08) rotate(-4deg);
}

.btn-primary-occult:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 34px rgba(255, 94, 108, 0.65);
}

.btn-primary-occult.full-width {
  width: 100%;
}

/* SCREEN 2: Lobby */
.section-head {
  text-align: center;
  margin-bottom: 20px;
}

.step-pill {
  display: inline-block;
  background: rgba(247, 183, 49, 0.16);
  border: 1px solid rgba(247, 183, 49, 0.45);
  color: var(--gold-talisman);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.section-head h2 {
  font-size: 1.55rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lineup-banner {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  border: none;
  margin: 0 auto 18px;
  box-shadow: none;
  background: transparent;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: none;
  max-height: none;
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0%, #000 8%, #000 86%, transparent 100%),
    linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(180deg, transparent 0%, #000 8%, #000 86%, transparent 100%),
    linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
  mask-composite: intersect;
}

.lineup-base-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center center;
  display: block;
}

.lineup-idle-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center center;
  z-index: 1;
  pointer-events: none;
}

/* Pixel-Verified Contour Polygon Seams for All 4 Characters' Idle Motion (True 16:9 full-width coordinates):
   - lineup-idle-1 (hover_manwol.mp4): Hongyeon lively idle motion, contoured around her right scissor blade (30.6%) & red thread (28.6%)
   - lineup-idle-2 (hover_meokkaebi.mp4): Yeopjeon lively idle motion, contoured around his hat brim (52.5%) & sword (50.5%), staying 100% left of Manwol's bottom blue flame
   - lineup-idle-3 (hover_hongyeon.mp4): Manwol & Meokkaebi lively idle motion, keeping 100% of Manwol's top, middle, and bottom blue flames intact */
.lineup-idle-1 {
  clip-path: polygon(
    0% 0%,
    29.1% 0%,
    29.1% 20%,
    30.6% 24%,
    30.6% 34%,
    28.6% 38%,
    28.6% 56%,
    29.3% 60%,
    29.3% 100%,
    0% 100%
  );
}

.lineup-idle-2 {
  clip-path: polygon(
    29.0% 0%,
    52.5% 0%,
    52.5% 38%,
    50.6% 41%,
    50.6% 80%,
    49.6% 85%,
    49.6% 100%,
    29.2% 100%,
    29.2% 60%,
    28.5% 56%,
    28.5% 38%,
    30.5% 34%,
    30.5% 24%,
    29.0% 20%
  );
}

.lineup-idle-3 {
  clip-path: polygon(
    52.4% 0%,
    100% 0%,
    100% 100%,
    49.5% 100%,
    49.5% 85%,
    50.5% 80%,
    50.5% 41%,
    52.4% 38%
  );
}

.lineup-hover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center center;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.lineup-hover-video.active {
  opacity: 1;
}

/* Invisible 4-character hover hitboxes over the unified banner (NO visible dividing lines!) */
.lineup-hitboxes {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 3;
}

.lineup-zone {
  position: relative;
  height: 100%;
  cursor: pointer;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 3% 0;
}

@media (max-width: 820px) {
  .character-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 18px 0 0;
  }
}

@media (max-width: 480px) {
  .character-grid {
    grid-template-columns: 1fr;
  }
}

.char-card {
  position: relative;
  background: transparent;
  border: none;
  border-top: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  padding: 16px 8px 12px;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.char-card:hover,
.char-card.is-hovered {
  transform: translateY(-4px);
  border-top-color: var(--char-color, var(--gold-talisman));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, transparent 100%);
  box-shadow: none;
}

.char-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Sprite crop from 4-character sheet */
.portrait-crop {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-image: url("../assets/wolhadang_characters_v2.jpg");
  background-size: 400% auto;
  background-repeat: no-repeat;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.crop-hongyeon { background-position: 3% 28%; border-color: #ff5e6c; }
.crop-yeopjeon { background-position: 35% 28%; border-color: #f7b731; }
.crop-manwol   { background-position: 67% 28%; border-color: #4ecdc4; }
.crop-meokkaebi{ background-position: 98% 35%; border-color: #a55eea; }

.char-room-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 3px;
}

.char-card-top .portrait-crop {
  width: 52px;
  height: 52px;
}

.char-title-wrap {
  min-width: 0;
}

.char-card h3 {
  font-size: 1.02rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 3px;
  white-space: nowrap;
}

.char-name-sub {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 700;
  opacity: 0.92;
}

.char-quote {
  font-size: 0.85rem;
  color: #cdd3e8;
  background: transparent;
  padding: 2px 0 2px 10px;
  border-radius: 0;
  border-left: 2px solid var(--red-dancheong);
  line-height: 1.55;
}

.char-ritual-tag {
  margin-top: auto;
  padding-top: 4px;
  font-size: 0.78rem;
  color: var(--gold-talisman);
  font-weight: 700;
}

/* SCREEN 3: Character-Driven Interactive Shrine Consultation & Birth Input */
.hidden {
  display: none !important;
}

.input-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-back {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--ivory-hanji);
  padding: 8px 14px;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.84rem;
}

.shrine-scroll-stage {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* TOP: Large Custom-Generated Shaman Presenting the Scroll (Frameless / No Card) */
.shaman-presenter-hero {
  position: relative;
  width: 100%;
  max-width: 820px;
  border-radius: 0;
  overflow: visible;
  border: none;
  box-shadow: none;
  background: transparent;
}

.shaman-portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 430px;
  overflow: hidden;
  background: transparent;
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0%, #000 8%, #000 78%, transparent 100%),
    linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(180deg, transparent 0%, #000 8%, #000 78%, transparent 100%),
    linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%);
  mask-composite: intersect;
}

.shaman-stage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  animation: shamanHeroBreathe 4.2s ease-in-out infinite alternate;
  transition: transform 0.28s ease, filter 0.28s ease;
}

.shaman-portrait-frame.reacting .shaman-stage-img {
  transform: scale(1.045);
  filter: brightness(1.14) saturate(1.15);
}

@keyframes shamanHeroBreathe {
  0%   { transform: scale(1) translateY(0); }
  100% { transform: scale(1.02) translateY(-2px); }
}

.shaman-hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 52%, rgba(7, 6, 13, 0.72) 100%);
}

.shaman-stage-badge {
  display: none;
}

.shaman-dialogue-box {
  position: relative;
  z-index: 3;
  margin: -34px auto 14px;
  max-width: 720px;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  padding: 4px 16px;
  box-shadow: none;
  text-align: center;
}

.dialogue-speaker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--char-color, var(--gold-talisman));
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
  margin-bottom: 4px;
}

.dialogue-text {
  font-size: 0.98rem;
  color: #f6f2e9;
  line-height: 1.55;
  font-weight: 600;
  word-break: keep-all;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.98), 0 0 26px rgba(0, 0, 0, 0.9);
}

/* SCROLL ROLLER BAR (Handed down from Shaman to Paper below) */
.scroll-roller-bar {
  position: relative;
  z-index: 4;
  width: 98%;
  height: 24px;
  margin-top: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-roller-bar.bottom {
  width: 104%;
  margin-top: 20px;
  margin-bottom: -14px;
}

/* SCROLL ROLLER BAR (3D Carved Ebony & Brass Gilded Scroll Rod) */
.scroll-roller-bar {
  position: relative;
  z-index: 4;
  width: 99%;
  height: 28px;
  margin-top: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-roller-bar.bottom {
  width: 99%;
  margin-top: -2px;
  margin-bottom: 0;
}

.roller-rod {
  position: relative;
  flex: 1;
  height: 16px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 94, 108, 0.05) 0px, rgba(255, 94, 108, 0.05) 2px, transparent 2px, transparent 16px),
    linear-gradient(180deg, #27151a 0%, #3d2128 24%, #170c10 68%, #070406 100%);
  border-top: 1px solid rgba(220, 72, 88, 0.45);
  border-bottom: 1.5px solid #040204;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.95),
    inset 0 2px 3px rgba(255, 160, 170, 0.14),
    inset 0 -3px 5px rgba(0, 0, 0, 0.9);
}

.roller-cap {
  position: relative;
  width: 22px;
  height: 26px;
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.55) 0%, transparent 25%, transparent 75%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, #9e7a56 0%, #6b4b2f 32%, #3a2414 70%, #1c1008 100%);
  border: 1px solid rgba(212, 162, 114, 0.55);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.9),
    inset 0 1px 2px rgba(255, 224, 190, 0.35);
}

.roller-cap::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(20, 10, 6, 0.85);
  box-shadow: 1px 0 0 rgba(255, 200, 150, 0.25);
}

.roller-knot {
  position: absolute;
  background:
    linear-gradient(180deg, rgba(255, 130, 140, 0.14) 0%, transparent 50%),
    linear-gradient(135deg, #6b0c16 0%, #2b0408 100%);
  border: 1.5px solid #c93444;
  outline: 1px solid rgba(255, 71, 87, 0.28);
  outline-offset: 2px;
  color: #f7dce0;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 3px 16px;
  border-radius: 999px;
  letter-spacing: 0.14em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.92),
    0 0 18px rgba(220, 38, 58, 0.35),
    inset 0 1px 2px rgba(255, 170, 180, 0.25);
}

/* BOTTOM: Eerie Dark-Occult Netherworld Scroll (음산한 저승 명부 + 핏빛·청록 귀기 + 비단 배접) */
.hanji-scroll-paper {
  position: relative;
  z-index: 2;
  width: 93%;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.82) 0%, transparent 30px, transparent calc(100% - 26px), rgba(0, 0, 0, 0.78) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, transparent 28px, transparent calc(100% - 28px), rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(90deg,
      rgba(68, 10, 18, 0.72) 0px, rgba(68, 10, 18, 0.72) 14px,
      rgba(196, 48, 64, 0.55) 14px, rgba(196, 48, 64, 0.55) 16px,
      transparent 16px, transparent calc(100% - 16px),
      rgba(196, 48, 64, 0.55) calc(100% - 16px), rgba(196, 48, 64, 0.55) calc(100% - 14px),
      rgba(68, 10, 18, 0.72) calc(100% - 14px), rgba(68, 10, 18, 0.72) 100%),
    repeating-linear-gradient(90deg, transparent 0px, transparent 58px, rgba(255, 94, 108, 0.03) 58px, rgba(255, 94, 108, 0.03) 59px),
    radial-gradient(circle at 50% 0%, rgba(195, 28, 48, 0.14), transparent 48%),
    radial-gradient(circle at 18% 72%, rgba(72, 219, 251, 0.055), transparent 45%),
    radial-gradient(circle at 82% 28%, rgba(195, 28, 48, 0.08), transparent 45%),
    linear-gradient(180deg, #0c0914 0%, #07050c 55%, #0a0711 100%);
  color: #e6dfd5;
  border-left: 2px solid rgba(196, 48, 64, 0.55);
  border-right: 2px solid rgba(196, 48, 64, 0.55);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.95),
    0 0 46px rgba(179, 24, 42, 0.2),
    inset 0 0 50px rgba(0, 0, 0, 0.72);
  padding: 28px 34px 28px;
  transform-origin: top center;
  animation: unrollHanji 0.5s cubic-bezier(0.22, 1, 0.36, 1), eerieScrollPulse 5.5s ease-in-out infinite alternate;
}

@keyframes eerieScrollPulse {
  0%   { box-shadow: 0 30px 70px rgba(0, 0, 0, 0.95), 0 0 34px rgba(179, 24, 42, 0.16), inset 0 0 50px rgba(0, 0, 0, 0.72); }
  100% { box-shadow: 0 30px 70px rgba(0, 0, 0, 0.95), 0 0 52px rgba(72, 219, 251, 0.12), inset 0 0 50px rgba(0, 0, 0, 0.72); }
}

/* 4-Corner Crimson Talisman Filigree Brackets */
.hanji-scroll-paper::before {
  content: "";
  position: absolute;
  inset: 10px 22px;
  pointer-events: none;
  border: 1px solid rgba(196, 48, 64, 0.22);
  background:
    linear-gradient(90deg, #d63647, #d63647) top left / 20px 2px no-repeat,
    linear-gradient(180deg, #d63647, #d63647) top left / 2px 20px no-repeat,
    linear-gradient(90deg, #d63647, #d63647) top right / 20px 2px no-repeat,
    linear-gradient(180deg, #d63647, #d63647) top right / 2px 20px no-repeat,
    linear-gradient(90deg, #d63647, #d63647) bottom left / 20px 2px no-repeat,
    linear-gradient(180deg, #d63647, #d63647) bottom left / 2px 20px no-repeat,
    linear-gradient(90deg, #d63647, #d63647) bottom right / 20px 2px no-repeat,
    linear-gradient(180deg, #d63647, #d63647) bottom right / 2px 20px no-repeat;
  opacity: 0.8;
}

@keyframes unrollHanji {
  from { opacity: 0; transform: scaleY(0.86) translateY(-14px); }
  to   { opacity: 1; transform: scaleY(1) translateY(0); }
}

.hanji-paper-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid rgba(196, 48, 64, 0.32);
  padding-bottom: 14px;
  margin-bottom: 18px;
  position: relative;
}

.hanji-paper-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(72, 219, 251, 0.22), transparent);
}

.hanji-scroll-paper h3 {
  font-size: clamp(0.98rem, 4.1vw, 1.18rem);
  font-weight: 900;
  color: #f3e9e4;
  text-shadow: 0 0 14px rgba(255, 71, 87, 0.38);
  margin-bottom: 4px;
  white-space: nowrap;
}

.hanji-scroll-paper .form-hint {
  font-size: 0.8rem;
  color: #938ba8;
  margin-bottom: 0;
}

/* Glowing Cinnabar Ilju Seal on the Dark Scroll */
.hanji-ilju-stamp {
  flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 71, 87, 0.24), rgba(90, 10, 18, 0.38));
  border: 1.5px solid #e83e50;
  outline: 1px solid rgba(255, 71, 87, 0.28);
  outline-offset: 2px;
  color: #ffb8c0;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 900;
  transform: rotate(-2.5deg);
  box-shadow: 0 0 20px rgba(232, 62, 80, 0.35), inset 0 0 12px rgba(232, 62, 80, 0.18);
}

.form-row {
  margin-bottom: 20px;
}

.form-row.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.form-row.two-col > div {
  min-width: 0;
}

.hanji-scroll-paper .form-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  color: #e8838f;
}

.hanji-scroll-paper .form-row label::before {
  content: "◈";
  font-size: 0.72rem;
  color: #ff4757;
  text-shadow: 0 0 8px rgba(255, 71, 87, 0.65);
}

/* Carved Obsidian Input Frame with Crimson Talisman Corners */
.hanji-scroll-paper .form-row input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  background:
    linear-gradient(90deg, rgba(214, 54, 71, 0.65), rgba(214, 54, 71, 0.65)) top left / 11px 1.5px no-repeat,
    linear-gradient(180deg, rgba(214, 54, 71, 0.65), rgba(214, 54, 71, 0.65)) top left / 1.5px 11px no-repeat,
    linear-gradient(90deg, rgba(214, 54, 71, 0.65), rgba(214, 54, 71, 0.65)) top right / 11px 1.5px no-repeat,
    linear-gradient(180deg, rgba(214, 54, 71, 0.65), rgba(214, 54, 71, 0.65)) top right / 1.5px 11px no-repeat,
    linear-gradient(180deg, rgba(4, 3, 9, 0.96) 0%, rgba(11, 9, 20, 0.92) 100%);
  border: 1px solid rgba(196, 48, 64, 0.28);
  border-bottom: 2px solid rgba(214, 54, 71, 0.8);
  border-radius: 6px;
  padding: 13px 15px;
  color: #f7efe8;
  color-scheme: dark;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.92),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 3px 10px rgba(0, 0, 0, 0.55);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.hanji-scroll-paper .form-row input:focus {
  outline: none;
  border-color: #ff4757;
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.92),
    0 0 22px rgba(255, 71, 87, 0.35);
}

/* Interactive 12-Shijin Clean Minimal Grid (No heavy card shadows or pin dots) */
.shijin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 8px;
}

.shijin-btn {
  position: relative;
  min-height: 56px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  padding: 10px 8px;
  color: #efe8f6;
  cursor: pointer;
  text-align: center;
  box-shadow: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.shijin-btn::before {
  display: none;
}

.shijin-btn:hover {
  border-color: rgba(255, 94, 108, 0.65);
  background: rgba(255, 94, 108, 0.08);
}

.shijin-btn.active {
  background: rgba(255, 71, 87, 0.2);
  border-color: #ff6b78;
  color: #fff5f6;
  box-shadow: 0 0 14px rgba(255, 71, 87, 0.25);
}

.shijin-name {
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.shijin-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbc2df;
  letter-spacing: -0.01em;
}

.shijin-btn.active .shijin-time {
  color: #ffdce0;
}

.worry-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hanji-scroll-paper .worry-chip {
  background:
    linear-gradient(180deg, rgba(255, 110, 125, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, #171226 0%, #0d0a16 100%);
  border: 1px solid rgba(196, 48, 64, 0.3);
  color: #ebe3f5;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.15s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.hanji-scroll-paper .worry-chip:hover {
  transform: translateY(-2px);
  border-color: #ff4757;
  background: linear-gradient(180deg, #241933 0%, #140e20 100%);
}

.hanji-scroll-paper .worry-chip.active {
  background: linear-gradient(135deg, #9b1524 0%, #4f0810 100%);
  border-color: #ff6b78;
  color: #fff5f6;
  box-shadow:
    0 0 18px rgba(255, 71, 87, 0.48),
    inset 0 1px 0 rgba(255, 210, 215, 0.35);
}

.hanji-scroll-paper .btn-primary-occult {
  border: 1.5px solid rgba(255, 120, 132, 0.8);
  box-shadow:
    0 12px 30px rgba(220, 38, 58, 0.5),
    inset 0 1px 0 rgba(255, 215, 220, 0.4),
    inset 0 0 0 2px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.04em;
}

/* SCREEN 4: Supernatural Interactive Ritual Stage (Frameless Open Altar) */
.ritual-stage-box {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 0;
  text-align: center;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: none;
}

.ritual-hud-top {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 640px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 8px 4px 12px;
}

.ritual-shaman-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.ritual-shaman-mini .portrait-crop {
  width: 56px;
  height: 56px;
}

/* Action Sprite Crops from wolhadang_ritual_climax_v2.jpg (2x2 grid) */
.action-crop {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background-image: url("../assets/wolhadang_ritual_climax_v2.jpg");
  background-size: 208% 208%;
  background-repeat: no-repeat;
  border: 2px solid var(--gold-talisman);
  flex-shrink: 0;
  animation: shamanFloat 2.2s ease-in-out infinite alternate;
}

.action-hongyeon { background-position: 2% 2%; border-color: #ff5e6c; box-shadow: 0 0 16px rgba(255, 94, 108, 0.65); }
.action-yeopjeon { background-position: 98% 2%; border-color: #f7b731; box-shadow: 0 0 16px rgba(247, 183, 49, 0.65); }
.action-manwol   { background-position: 2% 98%; border-color: #4ecdc4; box-shadow: 0 0 16px rgba(78, 205, 196, 0.65); }
.action-meokkaebi{ background-position: 98% 98%; border-color: #a55eea; box-shadow: 0 0 16px rgba(165, 94, 234, 0.65); }

@keyframes shamanFloat {
  from { transform: translateY(-3px) scale(0.98); }
  to { transform: translateY(3px) scale(1.05); }
}

/* Cinematic Shaman Ritual Motion Cutscene Overlay (Frameless, No Black Box) */
.ritual-cutscene-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

/* Hide underlying altar elements while cutscene overlay is active so no dark backdrop is needed */
.ritual-stage-box:has(.ritual-cutscene-overlay:not(.hidden-cutscene)) .ritual-hud-top,
.ritual-stage-box:has(.ritual-cutscene-overlay:not(.hidden-cutscene)) .ritual-canvas-container,
.ritual-stage-box:has(.ritual-cutscene-overlay:not(.hidden-cutscene)) .ritual-bottom-bar {
  opacity: 0;
  pointer-events: none;
}

.ritual-cutscene-overlay.hidden-cutscene {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.cutscene-top-bar {
  width: 100%;
  max-width: 620px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cutscene-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 94, 108, 0.18);
  border: 1px solid rgba(255, 94, 108, 0.5);
  color: #ff9aa2;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.cutscene-stage-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 620 / 350;
  height: auto;
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
  background: transparent;
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0%, #000 10%, #000 88%, transparent 100%),
    linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(180deg, transparent 0%, #000 10%, #000 88%, transparent 100%),
    linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-composite: intersect;
}

#cutscene-motion-canvas,
#cutscene-video-player {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#cutscene-video-player.hidden {
  display: none;
}

.cutscene-subtitles-box {
  width: 100%;
  max-width: 620px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 10px 8px;
  text-align: center;
}

.cutscene-chant {
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffeaa7;
  margin-bottom: 10px;
  min-height: 1.5em;
}

.btn-takeover-ritual {
  background: linear-gradient(135deg, #f7b731, #ff5e6c);
  color: #14080e;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: clamp(0.84rem, 3.6vw, 0.94rem);
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(247, 183, 49, 0.6);
  transition: transform 0.15s ease;
}

.btn-takeover-ritual:hover {
  transform: scale(1.04);
}

.btn-replay-cutscene {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ivory-hanji);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ritual-shaman-mini strong {
  display: block;
  font-size: 0.9rem;
  color: var(--gold-talisman);
}

.ritual-shaman-mini span {
  font-size: 0.78rem;
  color: #dce0f0;
}

.spirit-gauge-wrap {
  min-width: 160px;
  text-align: right;
}

.spirit-gauge-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--cyan-moon);
  margin-bottom: 4px;
  white-space: nowrap;
}

.spirit-gauge-track {
  width: 160px;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(78, 205, 196, 0.35);
}

.spirit-gauge-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #a55eea, #ff5e6c, #f7b731, #4ecdc4);
  transition: width 0.18s ease;
  box-shadow: 0 0 12px #4ecdc4;
}

.ritual-canvas-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 10px auto;
  border-radius: 0;
  overflow: visible;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

#ritual-interactive-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
}

.ritual-bottom-bar {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ritual-live-prompt {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffeaa7;
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
}

.ritual-climax-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: radial-gradient(circle, rgba(255, 234, 167, 0.95) 0%, rgba(255, 94, 108, 0.88) 45%, rgba(13, 16, 33, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.ritual-climax-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.climax-sigil {
  font-size: 3.4rem;
  color: #1a0b1e;
  font-weight: 900;
  animation: pulseSigil 0.7s infinite alternate;
}

.climax-text {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}

@keyframes pulseSigil {
  from { transform: scale(0.92) rotate(-4deg); }
  to { transform: scale(1.12) rotate(4deg); }
}

/* SCREEN 5: Result & Talisman — De-Carded Open Editorial Flow (CONF-012) */
.result-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

/* Frameless top container — no outer heavy box wrapping inner boxes */
.fortune-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 0 28px;
  margin-bottom: 24px;
  box-shadow: none;
}

.fortune-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.fortune-header-text h2 {
  font-size: 1.4rem;
  line-height: 1.35;
  margin-top: 4px;
}

.shaman-tag {
  font-size: 0.85rem;
  color: var(--gold-talisman);
  font-weight: 800;
}

/* Open Editorial Blockquote instead of enclosed box */
.savage-oracle-box {
  background: linear-gradient(90deg, rgba(255, 94, 108, 0.12) 0%, transparent 100%);
  border: none;
  border-left: 3px solid var(--red-dancheong);
  border-radius: 0;
  padding: 14px 16px 14px 20px;
  margin-bottom: 24px;
}

.oracle-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ff9aa3;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.savage-oracle-box blockquote {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.62;
}

/* Clean 1-Row Editorial Meta Strip (No separate boxes) */
.result-quick-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 16px 0;
  margin-bottom: 26px;
  border-top: 1px solid rgba(247, 183, 49, 0.22);
  border-bottom: 1px solid rgba(247, 183, 49, 0.22);
}

.summary-chip {
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 4px 18px;
}

.summary-chip:first-child {
  padding-left: 4px;
}

.summary-chip:last-child {
  border-right: none;
  padding-right: 4px;
}

.summary-chip-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.summary-chip-value {
  display: block;
  font-size: 0.96rem;
  font-weight: 800;
  color: #f4f6ff;
  line-height: 1.38;
}

/* Minimal Underline Editorial Tabs (No outer pill box) */
.result-tabs {
  display: flex;
  gap: 24px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  padding: 0;
  margin-bottom: 22px;
}

.result-tab-btn {
  border: none;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.98rem;
  font-weight: 800;
  padding: 12px 4px;
  margin-bottom: -1px;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.result-tab-btn:hover {
  color: #fff;
}

.result-tab-btn.active {
  background: transparent;
  color: var(--gold-talisman);
  border-bottom-color: var(--gold-talisman);
  box-shadow: none;
}

.result-tab-panel {
  display: none;
}

.result-tab-panel.active {
  display: block;
}

/* Open Two-Column Balance & Omen Section (No enclosing cards) */
.dual-engine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 8px;
}

.engine-box {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 0;
}

.engine-box h4 {
  font-size: 0.98rem;
  color: var(--cyan-moon);
  margin-bottom: 14px;
}

.saju-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.saju-pill {
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
}

.elem-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  margin-bottom: 9px;
}

.elem-row span.label {
  width: 118px;
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--text-muted);
}

.elem-track {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.elem-fill {
  height: 100%;
  border-radius: 999px;
}

.ritual-outcome-badge {
  display: inline-block;
  background: rgba(247, 183, 49, 0.14);
  color: var(--gold-talisman);
  border-left: 3px solid var(--gold-talisman);
  padding: 6px 14px;
  border-radius: 0;
  font-weight: 800;
  font-size: 0.94rem;
  margin-bottom: 12px;
}

.ritual-outcome-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #e6e9f5;
}

/* 4-Pillar Manse-ryeok Chart — Open Table Layout (No nested card boxes) */
.manseryeok-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 0 24px;
  margin-bottom: 12px;
}

.manseryeok-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.manseryeok-head h4 {
  font-size: 1.02rem;
  color: var(--gold-talisman);
}

.ilju-badge {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--cyan-moon);
  color: var(--cyan-moon);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 0;
}

.four-pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  text-align: center;
  border-top: 1px solid rgba(247, 183, 49, 0.25);
  border-bottom: 1px solid rgba(247, 183, 49, 0.25);
}

.pillar-col {
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 16px 8px;
}

.pillar-col:last-child {
  border-right: none;
}

.pillar-col.day-master {
  background: linear-gradient(180deg, rgba(247, 183, 49, 0.08) 0%, transparent 100%);
}

.pillar-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.ten-god-top,
.ten-god-bot {
  font-size: 0.82rem;
  font-weight: 700;
  color: #d7def2;
  margin: 5px 0;
}

.ganji-box {
  width: 68px;
  height: 60px;
  margin: 6px auto;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.ganji-box .hanja {
  font-size: 1.38rem;
  line-height: 1.1;
}

.ganji-box .hangul {
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0.92;
}

.unsung-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--gold-talisman);
  background: transparent;
  padding: 2px 4px;
  font-weight: 700;
}

/* Deep Reading Chapters Stack — Borderless Horizontal-Divider List */
.deep-chapters-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chapter-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  overflow: visible;
}

.chapter-card:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter-card summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-talisman);
  transition: color 0.18s ease;
}

.chapter-card summary:hover {
  color: #ffeaa7;
}

.chapter-card summary::-webkit-details-marker {
  display: none;
}

.chapter-card summary::after {
  content: "▾";
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.chapter-card[open] summary::after {
  transform: rotate(180deg);
  color: var(--gold-talisman);
}

.chapter-card-body {
  padding: 0 4px 22px 14px;
  border-left: 2px solid rgba(247, 183, 49, 0.4);
  margin-left: 4px;
  margin-bottom: 14px;
}

.chapter-card-body p {
  font-size: 0.98rem;
  color: #edf0fa;
  line-height: 1.82;
  margin-bottom: 14px;
}

.chapter-card-body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .form-row.two-col {
    grid-template-columns: 1fr;
  }
  .ritual-stage-box {
    padding: 12px 4px;
  }
  .cutscene-stage-wrap {
    aspect-ratio: 4 / 3;
  }
  .ritual-canvas-container {
    overflow: hidden;
    aspect-ratio: auto;
  }
  #ritual-interactive-canvas {
    width: 126%;
    max-width: none;
    margin-left: -13%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .ritual-hud-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .ritual-shaman-mini {
    width: 100%;
  }
  .ritual-shaman-mini strong {
    white-space: nowrap;
  }
  .spirit-gauge-wrap {
    width: 100%;
    min-width: 0;
    text-align: left;
  }
  .spirit-gauge-wrap > div:first-child {
    justify-content: space-between !important;
  }
  .spirit-gauge-track {
    width: 100%;
  }
  .hanji-paper-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .hanji-ilju-stamp {
    align-self: flex-start;
    transform: rotate(-1.5deg);
  }
  .btn-primary-occult {
    font-size: 0.9rem;
    padding: 14px 16px;
  }
  .result-quick-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .summary-chip {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 0 10px;
  }
  .summary-chip:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .four-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pillar-col:nth-child(2) {
    border-right: none;
  }
  .pillar-col:nth-child(1),
  .pillar-col:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* Open Editorial VIP Chapters (No boxy cards) */
.premium-chapter {
  background: transparent;
  border: none;
  border-left: 2.5px solid var(--cyan-moon);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 8px 4px 20px 18px;
  margin-bottom: 14px;
}

.premium-chapter:last-child {
  border-bottom: none;
}

.premium-chapter h5 {
  color: var(--cyan-moon);
  font-size: 1.02rem;
  margin-bottom: 10px;
}

.premium-chapter p {
  font-size: 0.93rem;
  color: #e4e8f7;
  line-height: 1.78;
}

/* Talisman Showcase — Open Altar Presentation (Talisman-first vertical flow) */
.talisman-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(247, 183, 49, 0.28);
  border-bottom: 1px solid rgba(247, 183, 49, 0.28);
  border-radius: 0;
  padding: 28px 4px;
  margin-bottom: 28px;
}

.talisman-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.talisman-info h3 {
  font-size: 1.24rem;
  margin-bottom: 0;
}

.talisman-desc-text {
  color: #c8cfe6;
  font-size: 0.92rem;
  line-height: 1.65;
  max-width: 44ch;
  margin: 0 auto;
}

.talisman-btn-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-secondary-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gold-talisman);
  color: #1a1202;
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
}

.talisman-canvas-wrap {
  display: flex;
  justify-content: center;
}

#result-talisman-canvas {
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 28px rgba(247, 183, 49, 0.22);
  max-width: 100%;
  height: auto;
}

/* Paywall Section — Open Editorial Section (No dashed purple box or nested inner box) */
.paywall-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 0 24px;
}

.lock-badge {
  display: inline-block;
  background: rgba(165, 94, 234, 0.2);
  color: #e0b8ff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.paywall-lock-header h3 {
  font-size: 1.24rem;
  margin-bottom: 8px;
}

.paywall-lock-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.premium-unlocked-content {
  background: transparent;
  border: none;
  border-top: 1px solid rgba(78, 205, 196, 0.35);
  border-radius: 0;
  padding: 24px 0 12px;
  margin-bottom: 20px;
}

.premium-unlocked-content.hidden {
  display: none;
}

.premium-unlocked-content h4 {
  color: var(--cyan-moon);
  font-size: 1.15rem;
  margin-bottom: 20px;
}

.premium-timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.92rem;
}

.jijanggan-tag {
  font-size: 0.76rem;
  color: #b7c0de;
  background: transparent;
  padding: 2px 4px;
  margin: 2px auto 0;
}

/* VIP Dashboard Tables & Montage Sections — Open Clean Divider Layout */
.premium-dashboard-head {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.vip-montage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.vip-montage-card {
  background: transparent;
  border-radius: 0;
  padding: 4px 0 4px 16px;
  border: none;
}

.vip-montage-card.benefactor {
  border-left: 3px solid var(--gold-talisman);
}

.vip-montage-card.vampire {
  border-left: 3px solid var(--red-dancheong);
}

.vip-montage-card h5 {
  font-size: 0.96rem;
  color: var(--gold-talisman);
  margin-bottom: 10px;
}

.vip-montage-card.vampire h5 {
  color: #ff8a94;
}

.vip-montage-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  color: #e4e8f7;
  line-height: 1.55;
}

.vip-table-wrap,
.vip-daeun-wrap {
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 20px 0 4px;
}

.vip-table-wrap h5,
.vip-daeun-wrap h5 {
  font-size: 0.98rem;
  color: var(--cyan-moon);
  margin-bottom: 14px;
}

.vip-table-scroll {
  overflow-x: auto;
}

.vip-calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 580px;
}

.vip-calendar-table th,
.vip-calendar-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}

.vip-calendar-table th:nth-child(2),
.vip-calendar-table td:nth-child(2) {
  min-width: 124px;
}

@media (max-width: 680px) {
  .vip-table-scroll {
    overflow-x: visible;
  }
  .vip-calendar-table {
    min-width: 0;
    display: block;
  }
  .vip-calendar-table thead {
    display: none;
  }
  .vip-calendar-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .vip-calendar-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px;
  }
  .vip-calendar-table td {
    border-bottom: none;
    padding: 0;
    min-width: 0 !important;
  }
  .vip-calendar-table td:nth-child(2) {
    text-align: right;
  }
  .vip-calendar-table td:nth-child(3)::before,
  .vip-calendar-table td:nth-child(4)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 3px;
  }
  .vip-calendar-table td:nth-child(5) {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
  }
}

.vip-calendar-table th {
  color: var(--gold-talisman);
  font-weight: 800;
  background: transparent;
  border-bottom: 1.5px solid rgba(247, 183, 49, 0.35);
}

.vip-tag-pill {
  display: inline-block;
  color: #cfd6ee;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.vip-daeun-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 680px) {
  .vip-daeun-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.daeun-box {
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 14px 6px;
  text-align: center;
}

.daeun-box:last-child {
  border-right: none;
}

.daeun-box.prime-daeun {
  background: linear-gradient(180deg, rgba(247, 183, 49, 0.12) 0%, transparent 100%);
  box-shadow: none;
}

.daeun-age {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.daeun-ganji {
  font-size: 1.04rem;
  font-weight: 900;
  color: #fff;
  margin: 4px 0;
}

.daeun-god {
  font-size: 0.76rem;
  color: var(--cyan-moon);
  font-weight: 700;
}

.daeun-unsung {
  font-size: 0.72rem;
  color: #c8d0e8;
  margin-top: 2px;
}

.daeun-prime-badge {
  display: inline-block;
  margin-top: 6px;
  color: var(--gold-talisman);
  font-size: 0.7rem;
  font-weight: 800;
}

/* Global Dark-Occult Footer & Legal Notice Modal */
.wolhadang-footer {
  margin-top: 28px;
  padding: 18px 16px 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  position: relative;
  z-index: 4;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: #c8c2dc;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.16s ease;
}

.footer-link-btn:hover {
  color: var(--gold-talisman);
}

.footer-sep {
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.8rem;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.5;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.legal-modal.hidden {
  display: none;
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 10, 0.82);
  backdrop-filter: blur(6px);
}

.legal-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #131024 0%, #0b0916 100%);
  border: 1.5px solid rgba(247, 183, 49, 0.45);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 32px rgba(255, 94, 108, 0.18);
  overflow: hidden;
}

.legal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-modal-head h3 {
  font-size: 1.02rem;
  font-weight: 900;
  color: #ffeaa7;
}

.legal-close-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e6e0f0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.legal-close-btn:hover {
  border-color: #ff5e6c;
  color: #fff;
}

.legal-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
}

.legal-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #b4aec9;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
}

.legal-tab-btn.active {
  background: rgba(255, 94, 108, 0.22);
  border-color: #ff5e6c;
  color: #fff;
}

.legal-modal-body {
  padding: 16px 20px 22px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #dbd6eb;
}

.legal-modal-body h4 {
  color: #ffeaa7;
  font-size: 0.92rem;
  font-weight: 900;
  margin: 12px 0 6px;
}

.legal-modal-body h4:first-child {
  margin-top: 0;
}

.legal-modal-body ul {
  padding-left: 18px;
  margin: 4px 0 10px;
}

.legal-modal-body li {
  margin-bottom: 4px;
}

/* Top Sound Button Bright Gold SVG Icon */
.btn-bgm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(247, 183, 49, 0.55);
  color: #ffeaa7;
}

.btn-bgm-toggle .bgm-note-icon {
  color: #ffd86b;
  filter: drop-shadow(0 0 6px rgba(247, 183, 49, 0.85));
  flex-shrink: 0;
  transition: color 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.btn-bgm-toggle.is-muted {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
}

.btn-bgm-toggle.is-muted .bgm-note-icon {
  color: #8b92b2;
  filter: none;
  opacity: 0.65;
}

/* Paywall CTA Price Anchoring Strikethrough & Free Event Pill */
.btn-unlock-cta > span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
}

.unlock-main-copy,
.unlock-price-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.price-strike {
  display: inline-block;
  margin: 0 6px;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: line-through;
  text-decoration-color: #ffeaa7;
  text-decoration-thickness: 2px;
  font-weight: 600;
  font-size: 0.92em;
}

.free-event-pill {
  display: inline-block;
  background: linear-gradient(135deg, #ffeaa7, #f7b731);
  color: #180b1e;
  font-weight: 900;
  font-size: 0.88em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 4px;
  box-shadow: 0 0 14px rgba(247, 183, 49, 0.75);
  vertical-align: middle;
}
