﻿    :root {
      --rt-stage-fade-out-duration: 1.18s;
      --rt-stage-fade-in-duration: 1.32s;
      --rt-card-gather-duration: 1420ms;
      --rt-first-review-appear-duration: 980ms;
      --rt-route-dialogue-fade-duration: 720ms;
      --rt-leave-shop-dialogue-fade-duration: 980ms;
      --rt-initial-dialogue-fade-duration: 980ms;
      --rt-final-review-return-duration: 1180ms;
      --rt-scene-next-slot-height: 2.6rem;
      --rt-scene-next-slot-height-sm: 3rem;
    }

    body {
      margin: 0;
      padding: 0;
      overflow-x: hidden;
      -webkit-font-smoothing: antialiased;
    }
    .hide-scrollbar {
      -ms-overflow-style: none;
      scrollbar-width: none;
    }
    .hide-scrollbar::-webkit-scrollbar {
      display: none;
    }
    @keyframes float {
      0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
      25% { opacity: 0.8; }
      50% { transform: translateY(-100px) translateX(20px) scale(1.2); }
      75% { opacity: 0.8; }
      100% { transform: translateY(-200px) translateX(-20px) scale(1); opacity: 0; }
    }
    .animate-float {
      animation-name: float;
      animation-iteration-count: infinite;
      animation-timing-function: ease-in-out;
    }
    .magic-text-glow {
      text-shadow: 0 0 15px rgba(249, 115, 22, 0.4), 0 0 5px rgba(255, 255, 255, 0.5);
    }
    @keyframes flyUp {
      0% { transform: translateY(0) scale(1.2); opacity: 1; z-index: 100; }
      100% { transform: translateY(-300px) scale(0.5) rotate(15deg); opacity: 0; z-index: 100; }
    }
    @keyframes flyDown {
      0% { transform: translateY(0) scale(1.05); opacity: 1; z-index: 100; }
      100% { transform: translateY(300px) scale(0.5) rotate(-15deg); opacity: 0; z-index: 100; }
    }
    @keyframes dropIn {
      0% { transform: translateY(-40px) scale(1.05); opacity: 0; }
      100% { transform: translateY(0) scale(1); opacity: 1; }
    }
    
    /* ▼▼ 滑らかな画面遷移用のアニメーション ▼▼ */
    @keyframes fadeOutStage {
      0% { opacity: 1; filter: blur(0px); }
      100% { opacity: 0; filter: blur(4px); }
    }
    @keyframes fadeInStage {
      0% { opacity: 0; filter: blur(4px); }
      100% { opacity: 1; filter: blur(0px); }
    }
    .animate-fadeOut {
      animation: fadeOutStage var(--rt-stage-fade-out-duration, 1.18s) ease-out forwards !important;
      pointer-events: none;
      will-change: opacity, filter;
      transform: translateZ(0);
    }
    .animate-fadeInStage {
      animation: fadeInStage var(--rt-stage-fade-in-duration, 1.32s) ease-out forwards;
      will-change: opacity, filter;
      transform: translateZ(0);
    }
    
    .animate-fly-up {
      animation: flyUp 0.6s ease-in-out forwards !important;
      pointer-events: none;
      will-change: transform, opacity;
      transform: translateZ(0);
    }
    .animate-fly-down {
      animation: flyDown 0.6s ease-in-out forwards !important;
      pointer-events: none;
      will-change: transform, opacity;
      transform: translateZ(0);
    }
    .animate-drop-in {
      animation: dropIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
      will-change: transform, opacity;
      transform: translateZ(0);
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    .animate-fadeIn {
      animation: fadeIn 0.4s ease-out forwards;
      will-change: opacity;
    }

    /* ▼▼ 確認モーダル用の専用フェードアニメーション ▼▼ */
    @keyframes fadeInModal {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    @keyframes fadeOutModal {
      from { opacity: 1; }
      to { opacity: 0; }
    }
    .animate-fadeInModal {
      animation: fadeInModal 0.3s ease-out forwards;
      will-change: opacity;
    }
    .animate-fadeOutModal {
      animation: fadeOutModal 0.3s ease-in forwards;
      will-change: opacity;
    }

    /* ▼▼ 木目調ボタンと魔法のオーラエフェクト ▼▼ */
    @keyframes magicAura {
      0% { box-shadow: 0 0 15px 2px rgba(251, 146, 60, 0.4), inset 0 0 10px rgba(0,0,0,0.5); }
      50% { box-shadow: 0 0 25px 8px rgba(253, 224, 71, 0.8), inset 0 0 10px rgba(0,0,0,0.5); border-color: rgba(253, 224, 71, 0.8); color: #fef08a; }
      100% { box-shadow: 0 0 15px 2px rgba(251, 146, 60, 0.4), inset 0 0 10px rgba(0,0,0,0.5); }
    }
    .animate-magicAura {
      animation: magicAura 1s ease-in-out infinite;
    }

    /* ▼▼ 手札カード用の魔法のオーラエフェクト ▼▼ */
    @keyframes cardAura {
      0% { box-shadow: 0 0 10px rgba(253, 224, 71, 0.4), 0 0 5px rgba(251, 146, 60, 0.3); border-color: rgba(253, 224, 71, 0.5); }
      50% { box-shadow: 0 0 20px rgba(253, 224, 71, 0.8), 0 0 10px rgba(251, 146, 60, 0.6); border-color: rgba(253, 224, 71, 0.9); }
      100% { box-shadow: 0 0 10px rgba(253, 224, 71, 0.4), 0 0 5px rgba(251, 146, 60, 0.3); border-color: rgba(253, 224, 71, 0.5); }
    }
    .animate-cardAura {
      animation: cardAura 2.5s ease-in-out infinite;
    }

    @keyframes cardAuraSelected {
      0% { box-shadow: 0 0 30px rgba(253, 224, 71, 0.8), 0 0 15px rgba(251, 146, 60, 0.6); border-color: rgba(253, 224, 71, 0.9); }
      50% { box-shadow: 0 0 50px rgba(253, 224, 71, 1), 0 0 25px rgba(251, 146, 60, 0.9); border-color: rgba(255, 255, 255, 1); }
      100% { box-shadow: 0 0 30px rgba(253, 224, 71, 0.8), 0 0 15px rgba(251, 146, 60, 0.6); border-color: rgba(253, 224, 71, 0.9); }
    }
    .animate-cardAuraSelected {
      animation: cardAuraSelected 1.5s ease-in-out infinite;
    }
    
    /* 共通木目ボタンベース */
    .wood-btn {
      position: relative;
      overflow: hidden;
      border-width: 2px;
      transition: all 0.3s ease;
    }

    /* ダークな木目ボタン（主要アクション用） */
    .wood-btn-dark {
      background-color: #5d4037; 
      border-color: #3e2723;
      color: #ffffff;
      text-shadow: 1px 1px 3px rgba(0,0,0,0.9), 0 0 5px rgba(0,0,0,0.8);
      box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 5px 15px rgba(0,0,0,0.3);
    }
    .wood-btn-dark:hover:not(:disabled) {
      box-shadow: inset 0 0 12px rgba(0,0,0,0.7), 0 5px 20px rgba(251, 146, 60, 0.4);
    }
    .wood-btn-dark:hover:not(:disabled) .wood-texture {
      filter: brightness(0.9);
    }
    .wood-btn-dark:disabled {
      background-color: #78716c;
      border-color: #57534e;
      color: #d6d3d1;
      text-shadow: none;
      box-shadow: none;
    }
    .wood-btn-dark:disabled .wood-texture {
      filter: grayscale(1) brightness(0.6);
      opacity: 0.5;
    }

    /* ライトな木目ボタン（サブアクション、戻る用） */
    .wood-btn-light {
      background-color: #f4ebd8; 
      border-color: #8c7355;
      color: #3e2723;
      font-weight: bold;
      text-shadow: 0 1px 1px rgba(255,255,255,0.8);
      box-shadow: inset 0 0 5px rgba(255,255,255,0.6), 0 3px 8px rgba(0,0,0,0.15);
    }
    .wood-btn-light:hover:not(:disabled) {
      background-color: #e8dcc4;
      box-shadow: inset 0 0 8px rgba(0,0,0,0.1), 0 4px 12px rgba(249, 115, 22, 0.2);
    }
    .wood-btn-light:hover:not(:disabled) .wood-texture {
      filter: brightness(0.9);
    }
    .wood-btn-light:disabled {
      background-color: #d6d3d1;
      border-color: #a8a29e;
      color: #78716c;
      text-shadow: none;
      box-shadow: none;
    }
    .wood-btn-light:disabled .wood-texture {
      filter: grayscale(1) opacity(0.3);
    }

    /* 共通木目テクスチャ */
    .wood-texture {
      position: absolute;
      inset: 0;
      pointer-events: none;
      background-image: url("https://ninin-cc.github.io/img/rt/mokuzai.jpg");
      background-size: cover;
      background-position: center;
      transition: filter 0.3s ease;
      z-index: 0;
    }
    .wood-btn-dark .wood-texture {
      mix-blend-mode: normal; 
      opacity: 0.8; 
    }
    .wood-btn-light .wood-texture {
      mix-blend-mode: luminosity;
      opacity: 0.2; 
    }

    /* 文字を読みやすくする影のユーティリティ */
    .text-glow-soft {
      text-shadow: 0 0 4px #e8dcc4, 0 0 8px #e8dcc4, 0 0 12px #e8dcc4;
    }

#main-stage {
  backface-visibility: hidden;
}

#dock-stage {
  contain: layout style;
  overflow: visible;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#dock-stage > div,
#dock-stage .max-w-4xl {
  overflow: visible;
}

.initial-card-review-overlay,
.initial-card-review-panel,
.initial-hand-display-card,
.trade-dialogue-surface {
  backface-visibility: hidden;
}
.rules-guide-block {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(1px);
  transition:
    opacity 760ms ease,
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 760ms ease;
  will-change: opacity, transform, filter;
}

.rules-guide-block.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .rules-guide-block {
    transition: none;
    transform: none;
    filter: none;
  }
}
@keyframes initialHandGather {
  0% {
    opacity: 0;
    transform: translate(var(--initial-hand-x), var(--initial-hand-y)) scale(0.62) rotate(var(--initial-hand-rotate));
    filter: blur(2px);
  }
  68% {
    opacity: 1;
    transform: translate(0, 0) scale(1.04) rotate(0deg);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

.initial-hand-card {
  --initial-hand-x: 0px;
  --initial-hand-y: -180px;
  --initial-hand-rotate: 0deg;
  opacity: 0;
  transform-origin: center bottom;
  animation: initialHandGather 920ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc((var(--initial-hand-order, 1) - 1) * 120ms + 180ms);
  will-change: transform, opacity, filter;
}

.initial-hand-card-1 {
  --initial-hand-order: 1;
  --initial-hand-x: -150px;
  --initial-hand-y: -210px;
  --initial-hand-rotate: -16deg;
}

.initial-hand-card-2 {
  --initial-hand-order: 2;
  --initial-hand-x: -28px;
  --initial-hand-y: -235px;
  --initial-hand-rotate: -5deg;
}

.initial-hand-card-3 {
  --initial-hand-order: 3;
  --initial-hand-x: 130px;
  --initial-hand-y: -215px;
  --initial-hand-rotate: 14deg;
}

.initial-hand-card-4 {
  --initial-hand-order: 4;
  --initial-hand-x: -92px;
  --initial-hand-y: -150px;
  --initial-hand-rotate: -10deg;
}

.initial-hand-card-5 {
  --initial-hand-order: 5;
  --initial-hand-x: 92px;
  --initial-hand-y: -150px;
  --initial-hand-rotate: 10deg;
}

@media (max-width: 480px) {
  .initial-hand-card-1 { --initial-hand-x: -86px; --initial-hand-y: -170px; }
  .initial-hand-card-2 { --initial-hand-x: -14px; --initial-hand-y: -190px; }
  .initial-hand-card-3 { --initial-hand-x: 78px; --initial-hand-y: -170px; }
  .initial-hand-card-4 { --initial-hand-x: -58px; --initial-hand-y: -125px; }
  .initial-hand-card-5 { --initial-hand-x: 58px; --initial-hand-y: -125px; }
}
@keyframes initialHandToDock {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
    filter: blur(0);
  }
  58% {
    opacity: 1;
    transform: translate(var(--initial-hand-dock-x), var(--initial-hand-dock-y)) scale(0.82) rotate(var(--initial-hand-dock-rotate));
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(var(--initial-hand-dock-x), calc(var(--initial-hand-dock-y) + 76px)) scale(0.62) rotate(var(--initial-hand-dock-rotate));
    filter: blur(1px);
  }
}

.initial-hand-card.is-collecting {
  --initial-hand-dock-x: 0px;
  --initial-hand-dock-y: 180px;
  --initial-hand-dock-rotate: 0deg;
  opacity: 1;
  animation: initialHandToDock 720ms cubic-bezier(0.2, 0.9, 0.24, 1) forwards;
  animation-delay: calc((5 - var(--initial-hand-order, 1)) * 36ms);
  pointer-events: none;
}

.initial-hand-card-1.is-collecting {
  --initial-hand-dock-x: 118px;
  --initial-hand-dock-y: 210px;
  --initial-hand-dock-rotate: 8deg;
}

.initial-hand-card-2.is-collecting {
  --initial-hand-dock-x: 58px;
  --initial-hand-dock-y: 210px;
  --initial-hand-dock-rotate: 4deg;
}

.initial-hand-card-3.is-collecting {
  --initial-hand-dock-x: -10px;
  --initial-hand-dock-y: 210px;
  --initial-hand-dock-rotate: 0deg;
}

.initial-hand-card-4.is-collecting {
  --initial-hand-dock-x: -54px;
  --initial-hand-dock-y: 126px;
  --initial-hand-dock-rotate: -4deg;
}

.initial-hand-card-5.is-collecting {
  --initial-hand-dock-x: -118px;
  --initial-hand-dock-y: 126px;
  --initial-hand-dock-rotate: -8deg;
}

@media (max-width: 480px) {
  .initial-hand-card.is-collecting {
    --initial-hand-dock-y: 150px;
  }
  .initial-hand-card-1.is-collecting { --initial-hand-dock-x: 76px; --initial-hand-dock-y: 184px; }
  .initial-hand-card-2.is-collecting { --initial-hand-dock-x: 36px; --initial-hand-dock-y: 184px; }
  .initial-hand-card-3.is-collecting { --initial-hand-dock-x: -4px; --initial-hand-dock-y: 184px; }
  .initial-hand-card-4.is-collecting { --initial-hand-dock-x: -34px; --initial-hand-dock-y: 118px; }
  .initial-hand-card-5.is-collecting { --initial-hand-dock-x: -76px; --initial-hand-dock-y: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  .initial-hand-card {
    opacity: 1;
    transform: none;
    animation: none;
    filter: none;
  }
}

@keyframes rulesNextBlink {
  0%, 100% { opacity: 0.35; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(4px); }
}
.selection-guide-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(120, 53, 15, 0.35);
  border-radius: 999px;
  background: rgba(244, 235, 216, 0.92);
  color: #3f2a16;
  font-family: serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  box-shadow: 0 4px 12px rgba(41, 24, 12, 0.16);
}

.selection-guide-label-dock {
  align-self: center;
  margin-top: 0.45rem;
  margin-bottom: -0.25rem;
  background: rgba(244, 235, 216, 0.95);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

@media (min-width: 640px) {
  .selection-guide-label {
    min-height: 1.75rem;
    padding: 0.3rem 1rem;
    font-size: 13px;
  }
}

.trade-card-direction-label {
  position: relative;
  z-index: 2;
}

.trade-card-direction-column-receive {
  transform: translateY(0.9em);
}

.trade-card-direction-column-release {
  transform: translateY(-0.9em);
}

.rules-next-cue {
  margin-top: 1rem;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(124, 45, 18, 0.82);
}

@media (min-width: 640px) {
  .rules-next-cue {
    margin-top: 1.5rem;
    font-size: 14px;
  }
}

.rules-next-arrow {
  display: inline-block;
  animation: rulesNextBlink 1.1s ease-in-out infinite;
}


.start-scene-image {
  object-position: 52% center;
}

@media (max-width: 640px) {
  .start-scene-image {
    object-position: 52% center;
  }
}


.dialog-panel-translucent {
  background-color: rgba(232, 220, 196, 0.76) !important;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.dialog-surface-translucent {
  background-color: rgba(244, 235, 216, 0.78) !important;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transform: translateZ(0);
}

.dialog-tail-translucent {
  background-color: rgba(244, 235, 216, 0.78) !important;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.dialog-meta-top {
  background-color: rgba(244, 235, 216, 0.78) !important;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.dialog-meta-bottom {
  background-color: rgba(232, 220, 196, 0.76) !important;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.dialog-wash-translucent {
  background: linear-gradient(
    to right,
    rgba(232, 220, 196, 0.78) 0%,
    rgba(232, 220, 196, 0.66) 62%,
    rgba(232, 220, 196, 0) 100%
  ) !important;
}


@keyframes manualNextBlink {
  0%, 100% { opacity: 0.28; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(4px); }
}

.manual-next-cursor {
  position: absolute;
  right: 1rem;
  bottom: 0.8rem;
  color: rgba(124, 45, 18, 0.82);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  animation: manualNextBlink 1.15s ease-in-out infinite;
}

.rules-next-cue { text-align: right; }

.rules-next-arrow {
  display: inline-block;
  margin-left: 0.45em;
  animation: manualNextBlink 1.15s ease-in-out infinite;
}

.trade-reflection-banner {
  align-self: center;
  width: min(92%, 42rem);
  margin: 0.2rem auto 0.35rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(231, 184, 116, 0.4);
  background: rgba(40, 20, 5, 0.58);
  color: #f8ead1;
  border-radius: 0.25rem;
  text-align: center;
  font-family: serif;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 18px rgba(0,0,0,0.28);
}

.trade-reflection-label {
  display: inline-block;
  margin-right: 0.8em;
  color: #fed7aa;
  letter-spacing: 0.16em;
}

.trade-reflection-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.trade-reflection-copy {
  max-width: 34rem;
  color: #f8ead1;
  font-family: serif;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.7;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.75);
}

@keyframes finalDecisionGlow {
  0% { transform: scale(1); filter: brightness(1); box-shadow: 0 0 22px rgba(251,146,60,0.35), 0 0 10px rgba(253,224,71,0.35); }
  45% { transform: scale(1.05); filter: brightness(1.16) saturate(1.08); box-shadow: 0 0 52px rgba(253,224,71,0.95), 0 0 30px rgba(251,146,60,0.85), 0 0 90px rgba(255,247,237,0.7); }
  100% { transform: scale(1.02); filter: brightness(1.08); box-shadow: 0 0 36px rgba(253,224,71,0.72), 0 0 22px rgba(251,146,60,0.62); }
}

.animate-finalDecisionGlow { animation: finalDecisionGlow 1.6s ease-in-out forwards; }
.animate-fadeOutModal { animation-duration: 0.62s; }

.real-tavern-message {
  border: 1px solid rgba(120, 53, 15, 0.36);
  border-radius: 0.35rem;
  background: linear-gradient(135deg, rgba(244,235,216,0.92), rgba(232,220,196,0.8)), url("https://ninin-cc.github.io/img/rt/mokuzai.jpg");
  background-size: cover;
  box-shadow: 0 12px 28px rgba(67,20,7,0.16), inset 0 0 24px rgba(255,255,255,0.28);
  overflow: hidden;
}

.real-tavern-message::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 12% 0%, rgba(251,146,60,0.18), transparent 36%);
}

.real-tavern-message-inner {
  position: relative;
  padding: 1.15rem 1.2rem;
}

.real-tavern-kicker {
  margin: 0 0 0.45rem;
  color: #9a3412;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.real-tavern-message h3 {
  margin: 0 0 0.75rem;
  color: #2f2418;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.real-tavern-message p {
  margin: 0.55rem 0 0;
  color: #3b2f24;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.9;
}

.reality-question-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.25rem;
  color: #9a3412;
}

.reality-question-bridge::before,
.reality-question-bridge::after {
  content: "";
  width: min(22%, 7rem);
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(154, 52, 18, 0.4));
}

.reality-question-bridge::after {
  background: linear-gradient(to left, transparent, rgba(154, 52, 18, 0.4));
}

.reality-question-bridge span {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin: 0 0.75rem;
  border: 1px solid rgba(154, 52, 18, 0.32);
  border-radius: 999px;
  background: rgba(244, 235, 216, 0.86);
  box-shadow: 0 5px 14px rgba(67, 20, 7, 0.12);
  font-size: 0.72rem;
}

.reality-question-card {
  border: 1px solid rgba(120, 53, 15, 0.48);
  border-radius: 0.35rem;
  background:
    radial-gradient(circle at 88% 8%, rgba(251, 146, 60, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(244, 235, 216, 0.97), rgba(222, 202, 168, 0.9));
  box-shadow: 0 14px 32px rgba(67, 20, 7, 0.18), inset 0 0 26px rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.reality-question-card-inner {
  position: relative;
  padding: 1.25rem 1.2rem 1.35rem;
}

.reality-question-card-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.2rem;
  right: 1.2rem;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(154, 52, 18, 0.6), transparent);
}

.reality-question-kicker {
  margin: 0 0 0.4rem;
  color: #9a3412;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.reality-question-card h3 {
  margin: 0;
  color: #2f2418;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.reality-question-intro {
  margin: 0.8rem 0 0;
  color: #514034;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.85;
}

.reality-question-prompt {
  margin: 1rem 0 0;
  padding: 0.9rem 0.95rem;
  border-left: 3px solid rgba(154, 52, 18, 0.7);
  background: rgba(255, 250, 240, 0.48);
  color: #35291f;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.9;
}

.reality-question-prompt span {
  display: block;
  margin-bottom: 0.25rem;
  color: #7c2d12;
}

.reality-question-context {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin: 0.9rem 0 0;
}

.reality-question-context > div {
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(120, 53, 15, 0.22);
  border-radius: 0.28rem;
  background: rgba(232, 220, 196, 0.64);
}

.reality-question-context dt {
  display: inline-block;
  margin: 0 0 0.35rem;
  padding-bottom: 0.12rem;
  border-bottom: 1px solid rgba(154, 52, 18, 0.4);
  color: #9a3412;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.reality-question-context dd {
  margin: 0;
  color: #4b3a2c;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.75;
}

.reality-question-action {
  position: relative;
  margin-top: 1.15rem;
  padding: 1rem 1rem 1.05rem;
  border: 1px solid rgba(154, 52, 18, 0.34);
  border-radius: 0.3rem;
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.72), rgba(232, 220, 196, 0.62));
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.22);
}

.reality-question-action::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(154, 52, 18, 0.72), transparent);
}

.reality-question-action > p:last-child {
  margin: 0;
  color: #35291f;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.85;
}

@media (min-width: 640px) {
  .manual-next-cursor { right: 1.4rem; bottom: 1.1rem; font-size: 1.35rem; }
  .trade-reflection-copy { font-size: 0.82rem; }
  .real-tavern-message-inner { padding: 1.35rem 1.6rem; }
  .real-tavern-message h3 { font-size: 1.16rem; }
  .real-tavern-message p { font-size: 0.94rem; }
  .reality-question-card-inner { padding: 1.55rem 1.7rem 1.65rem; }
  .reality-question-card h3 { font-size: 1.4rem; }
  .reality-question-intro { font-size: 0.9rem; }
  .reality-question-prompt { padding: 1rem 1.15rem; font-size: 1rem; }
  .reality-question-context { grid-template-columns: 0.9fr 1.35fr; gap: 0.85rem; }
  .reality-question-context dd { font-size: 0.84rem; }
  .reality-question-action { padding: 1.1rem 1.2rem 1.15rem; }
  .reality-question-action > p:last-child { font-size: 1rem; }
}


.dialog-wash-translucent-rules-left {
  background: linear-gradient(
    to right,
    rgba(232, 220, 196, 0) 0%,
    rgba(232, 220, 196, 0.64) 38%,
    rgba(232, 220, 196, 0.78) 100%
  ) !important;
}


@keyframes manualNextDrift {
  0% {
    opacity: 0.25;
    transform: translateY(0);
  }
  68% {
    opacity: 1;
    transform: translateY(8px);
  }
  100% {
    opacity: 0.2;
    transform: translateY(13px);
  }
}

.rules-next-cue {
  margin-top: 0.75rem !important;
  text-align: center !important;
  font-size: 1.12rem !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
}

.rules-next-arrow,
.manual-next-cursor {
  animation: manualNextDrift 1.45s cubic-bezier(0.22, 0.9, 0.28, 1) infinite !important;
}

.manual-next-cursor {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  display: block;
  width: fit-content;
  margin: 0.75rem auto 0;
  padding: 0.15rem 0.45rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}


.rules-back-link-wrap {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rules-back-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.15rem 0.25rem;
  color: rgba(68, 64, 60, 0.72);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.rules-back-link:hover,
.rules-back-link:focus-visible {
  color: rgba(124, 45, 18, 0.95);
  text-decoration-color: currentColor;
  outline: none;
}

@media (min-width: 640px) {
  .rules-back-link-wrap {
    margin-top: 0.6rem;
  }

  .rules-back-link {
    font-size: 0.78rem;
  }
}


.initial-card-review-panel {
  appearance: none;
  border: 1px solid rgba(120, 53, 15, 0.5);
  background: rgba(244, 235, 216, 0.9);
  background-image: var(--parchment-texture, none);
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(28, 25, 23, 0.45), inset 0 0 24px rgba(120, 53, 15, 0.12);
  padding: 1rem 1.1rem 1.15rem;
  color: #2f2418;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  cursor: pointer;
  transform-origin: center;
  animation: initialReviewRise 420ms cubic-bezier(0.2, 0.9, 0.24, 1) both;
}

@keyframes initialReviewRise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.initial-card-review-count {
  margin-bottom: 0.55rem;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: rgba(124, 45, 18, 0.86);
}

.initial-card-review-card {
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.initial-card-review-scale {
  width: 11.5rem !important;
  height: 17rem !important;
}

.initial-card-review-hint {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(68, 64, 60, 0.78);
}

@media (max-width: 639px) {
  .initial-card-review-scale {
    width: 10rem !important;
    height: 14.8rem !important;
  }
}


.initial-card-review-start {
  appearance: none;
  border: 1px solid rgba(120, 53, 15, 0.42);
  background: rgba(244, 235, 216, 0.84);
  color: rgba(68, 64, 60, 0.9);
  border-radius: 4px;
  padding: 0.65rem 1rem;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  box-shadow: 0 8px 22px rgba(67, 20, 7, 0.16);
  cursor: pointer;
}

.initial-card-review-start:hover,
.initial-card-review-start:focus-visible {
  color: rgba(124, 45, 18, 0.98);
  border-color: rgba(124, 45, 18, 0.66);
  outline: none;
}

@keyframes initialReviewFloatFromHand {
  0% {
    opacity: 0.72;
    transform: translate(var(--review-start-x), var(--review-start-y)) scale(0.48) rotate(var(--review-start-rotate));
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
}

@keyframes initialReviewReturnToHand {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0.18;
    transform: translate(var(--review-start-x), var(--review-start-y)) scale(0.48) rotate(var(--review-start-rotate));
  }
}

.initial-card-review-panel {
  --review-start-x: -8rem;
  --review-start-y: -5.5rem;
  --review-start-rotate: -8deg;
  background: rgba(244, 235, 216, 0.86) !important;
  pointer-events: auto;
  animation: initialReviewFloatFromHand 560ms cubic-bezier(0.18, 0.95, 0.22, 1) both !important;
}

.initial-card-review-panel.is-returning {
  pointer-events: none;
  animation: initialReviewReturnToHand 380ms cubic-bezier(0.28, 0, 0.34, 1) both !important;
}

.initial-card-review-from-1 { --review-start-x: -9.4rem; --review-start-y: -7.8rem; --review-start-rotate: -12deg; }
.initial-card-review-from-2 { --review-start-x: -2.8rem; --review-start-y: -8.4rem; --review-start-rotate: -4deg; }
.initial-card-review-from-3 { --review-start-x: 4.8rem; --review-start-y: -7.7rem; --review-start-rotate: 10deg; }
.initial-card-review-from-4 { --review-start-x: -5.2rem; --review-start-y: 2rem; --review-start-rotate: -8deg; }
.initial-card-review-from-5 { --review-start-x: 5.2rem; --review-start-y: 2rem; --review-start-rotate: 8deg; }

.initial-card-review-readable .font-black {
  font-size: 1.65rem !important;
  line-height: 1.08 !important;
  padding-top: 0.95rem !important;
  margin-bottom: 0.45rem !important;
}

.initial-card-review-readable .line-clamp-4 {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  font-size: 0.98rem !important;
  line-height: 1.5 !important;
  padding-left: 0.7rem !important;
  padding-right: 0.7rem !important;
}

.initial-card-review-readable .tracking-widest {
  font-size: 0.72rem !important;
}

@media (max-width: 639px) {
  .initial-card-review-from-1 { --review-start-x: -5.4rem; --review-start-y: -7.2rem; }
  .initial-card-review-from-2 { --review-start-x: 0; --review-start-y: -7.8rem; }
  .initial-card-review-from-3 { --review-start-x: 5.4rem; --review-start-y: -7.2rem; }
  .initial-card-review-from-4 { --review-start-x: -3.8rem; --review-start-y: 1.8rem; }
  .initial-card-review-from-5 { --review-start-x: 3.8rem; --review-start-y: 1.8rem; }

  .initial-card-review-readable .font-black {
    font-size: 1.42rem !important;
  }

  .initial-card-review-readable .line-clamp-4 {
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
  }
}




@keyframes afterTradeTypewriter {
  from { max-width: 0; }
  to { max-width: 100%; }
}

.after-trade-typewriter {
  display: inline;
  overflow: visible;
  vertical-align: baseline;
  white-space: normal;
  max-width: none;
  animation: afterTradeTextFade var(--typewriter-duration, 1.8s) ease-out forwards;
  opacity: 0;
}

@keyframes afterTradeTextFade {
  0% {
    opacity: 0;
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}


.rules-next-cue-final {
  margin-top: 1rem !important;
  font-size: 0.96rem !important;
  letter-spacing: 0.12em !important;
  color: rgba(124, 45, 18, 0.95) !important;
}

.rules-next-text {
  font-weight: 900;
}

.rules-next-play {
  display: inline-block;
  margin-left: 0.45em;
  animation: manualNextDrift 1.45s cubic-bezier(0.22, 0.9, 0.28, 1) infinite;
}



.dialogue-inline-next-cue {
  appearance: none;
  display: block;
  width: fit-content;
  margin: 0.9rem auto 0;
  border: 0;
  background: transparent;
  color: rgba(124, 45, 18, 0.95);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-align: center;
  animation: fadeInStage 420ms ease-out both;
}

.dialogue-inline-next-cue:hover,
.dialogue-inline-next-cue:focus-visible {
  color: rgba(154, 52, 18, 1);
  outline: none;
}


@keyframes initialReviewSlideIn {
  from {
    opacity: 0;
    transform: translateX(42px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes initialReviewSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-46px) scale(0.98);
  }
}

.initial-card-review-panel {
  animation: none !important;
}

.initial-card-review-panel.is-first-review {
  animation: initialReviewSoftAppear var(--rt-first-review-appear-duration, 220ms) ease-out both !important;
}

.initial-card-review-panel.is-slide-review {
  animation: initialReviewSlideIn 360ms cubic-bezier(0.2, 0.88, 0.24, 1) both !important;
}

.initial-card-review-panel.is-returning {
  pointer-events: none;
  animation: initialReviewSlideOut 320ms cubic-bezier(0.28, 0, 0.34, 1) both !important;
}

.initial-hand-review-muted .initial-hand-display-card {
  opacity: 0.34;
  filter: grayscale(1) saturate(0.35);
  transform: scale(0.96);
}

.manual-next-cursor,
.dialogue-inline-next-cue {
  margin-left: 0 !important;
  margin-right: auto !important;
  text-align: left !important;
}

.dialogue-inline-next-cue {
  padding-left: 0 !important;
}


.initial-card-review-overlay {
  background: rgba(41, 37, 36, 0.52);
  backdrop-filter: grayscale(1) saturate(0.35) blur(1px);
  -webkit-backdrop-filter: grayscale(1) saturate(0.35) blur(1px);
}

.rules-guide-block,
.dialogue-text-unified {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif !important;
  font-weight: 900 !important;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 250, 240, 0.38);
  overflow-wrap: normal;
  word-break: keep-all;
  line-break: strict;
}


.character-dialogue-body {
  width: 100% !important;
  max-width: none !important;
  overflow: visible;
}

.character-dialogue-body-refrem {
  width: 72% !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  padding-left: calc(1rem + 4ch) !important;
}

.character-dialogue-body-haruka {
  width: 72% !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}

@media (max-width: 640px) {
  .character-dialogue-body-refrem,
  .character-dialogue-body-haruka {
    width: 78% !important;
  }

  .character-dialogue-body-refrem {
    padding-left: calc(0.75rem + 4ch) !important;
  }
}

.character-dialogue-surface {
  overflow: visible;
}

.character-dialogue-body .rules-guide-block,
.character-dialogue-body .dialogue-text-unified,
.character-dialogue-surface .dialogue-text-unified {
  overflow-wrap: normal !important;
  word-break: keep-all !important;
}

.character-dialogue-body p,
.character-dialogue-surface p.dialogue-text-unified,
.character-dialogue-surface .dialogue-text-unified p {
  white-space: nowrap;
}
.trade-dialogue-surface {
  min-height: 5.2rem;
  overflow: visible;
}

.trade-dialogue-surface > p {
  min-height: 3.35em;
}

@media (min-width: 640px) {
  .trade-dialogue-surface {
    min-height: 5.8rem;
  }
}


.initial-hand-review-gathering .initial-hand-display-card {
  pointer-events: none;
  animation: initialCardGatherToFirst var(--rt-card-gather-duration, 1420ms) cubic-bezier(0.18, 0.9, 0.2, 1) forwards !important;
}

.initial-hand-review-gathering .initial-hand-slot-1 {
  --gather-x: 0px;
  --gather-y: 0px;
  --gather-rotate: -5deg;
}

.initial-hand-review-gathering .initial-hand-slot-2 {
  --gather-x: -112px;
  --gather-y: 0px;
  --gather-rotate: -2deg;
}

.initial-hand-review-gathering .initial-hand-slot-3 {
  --gather-x: -224px;
  --gather-y: 0px;
  --gather-rotate: 3deg;
}

.initial-hand-review-gathering .initial-hand-slot-4 {
  --gather-x: -40px;
  --gather-y: -154px;
  --gather-rotate: -8deg;
}

.initial-hand-review-gathering .initial-hand-slot-5 {
  --gather-x: -152px;
  --gather-y: -154px;
  --gather-rotate: 7deg;
}

@keyframes initialCardGatherToFirst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
    filter: none;
  }
  74% {
    opacity: 0.98;
    filter: none;
  }
  100% {
    opacity: 0;
    transform: translate(var(--gather-x), var(--gather-y)) scale(0.64) rotate(var(--gather-rotate));
    filter: grayscale(0.25);
  }
}

.initial-card-gather-overlay {
  animation: gatherOverlayIn 300ms ease-out both;
}

@keyframes gatherOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.initial-card-stack-float {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 9rem;
  height: 12.5rem;
  transform-origin: center;
  animation: stackFloatToCenter 1120ms cubic-bezier(0.16, 0.9, 0.24, 1) both;
}

.initial-card-stack-float span {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 1px solid rgba(120, 53, 15, 0.52);
  background-image: url("https://ninin-cc.github.io/img/rt/card.jpg");
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 44px rgba(28, 25, 23, 0.38);
  transform: translate(calc(var(--stack-i, 0) * 2px), calc(var(--stack-i, 0) * -3px)) rotate(calc(var(--stack-i, 0) * -1.5deg));
}

.initial-card-stack-float span:nth-child(1) { --stack-i: 0; }
.initial-card-stack-float span:nth-child(2) { --stack-i: 1; }
.initial-card-stack-float span:nth-child(3) { --stack-i: 2; }
.initial-card-stack-float span:nth-child(4) { --stack-i: 3; }
.initial-card-stack-float span:nth-child(5) { --stack-i: 4; }

@keyframes stackFloatToCenter {
  0% {
    opacity: 0;
    transform: translate(-156px, 118px) scale(0.52) rotate(-8deg);
    filter: blur(1px);
  }
  26% {
    opacity: 1;
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.96) rotate(0deg);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.08) rotate(0deg);
    filter: blur(0);
  }
}

@media (max-width: 639px) {
  .initial-hand-review-gathering .initial-hand-slot-2 { --gather-x: -104px; }
  .initial-hand-review-gathering .initial-hand-slot-3 { --gather-x: -208px; }
  .initial-hand-review-gathering .initial-hand-slot-4 { --gather-x: -52px; --gather-y: -144px; }
  .initial-hand-review-gathering .initial-hand-slot-5 { --gather-x: -156px; --gather-y: -144px; }

  .initial-card-stack-float {
    width: 7.6rem;
    height: 10.7rem;
  }

  @keyframes stackFloatToCenter {
    0% {
      opacity: 0;
      transform: translate(-116px, 110px) scale(0.5) rotate(-8deg);
      filter: blur(1px);
    }
    26% { opacity: 1; }
    78% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(0.96) rotate(0deg);
      filter: blur(0);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(1.08) rotate(0deg);
      filter: blur(0);
    }
  }
}


@keyframes initialReviewSoftAppear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.route-dialogue-panel .rules-guide-block {
  transform: none;
  transition:
    opacity var(--rt-route-dialogue-fade-duration, 720ms) ease,
    filter var(--rt-route-dialogue-fade-duration, 720ms) ease;
}

.leave-shop-dialogue-panel .rules-guide-block {
  transform: none;
  transition:
    opacity var(--rt-leave-shop-dialogue-fade-duration, 980ms) ease,
    filter var(--rt-leave-shop-dialogue-fade-duration, 980ms) ease;
}

.scene-next-slot {
  min-height: var(--rt-scene-next-slot-height, 2.6rem);
  display: flex;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .scene-next-slot {
    min-height: var(--rt-scene-next-slot-height-sm, 3rem);
  }
}


.initial-card-review-panel.is-final-returning {
  animation: initialReviewFinalFadeOut var(--rt-final-review-return-duration, 1180ms) ease-in-out both !important;
}

@keyframes initialReviewFinalFadeOut {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    filter: blur(5px);
    transform: translateX(0) scale(0.985);
  }
}

.initial-hand-dialogue-panel .rules-guide-block {
  transition:
    opacity var(--rt-initial-dialogue-fade-duration, 980ms) ease,
    transform var(--rt-initial-dialogue-fade-duration, 980ms) ease,
    filter var(--rt-initial-dialogue-fade-duration, 980ms) ease;
}


@keyframes roletradeBlindReveal {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0.2;
    filter: blur(1px);
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    filter: blur(0);
  }
}

.rules-opening-statement-wrap {
  width: min(100%, 46rem);
  margin-inline: auto;
}

.roletrade-opening-statement {
  display: inline-block;
  white-space: nowrap;
  text-align: center;
  font-size: clamp(1rem, 2.25vw, 1.55rem);
  line-height: 2.05;
  letter-spacing: 0.04em;
}

.rules-guide-block.is-visible .roletrade-opening-statement {
  animation: roletradeBlindReveal 1.05s cubic-bezier(0.18, 0.85, 0.25, 1) both;
  will-change: clip-path, opacity, filter;
}

@media (max-width: 640px) {
  .roletrade-opening-statement {
    font-size: clamp(0.78rem, 3.45vw, 0.94rem);
    line-height: 1.9;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    line-break: strict;
  }
}


.roletrade-opening-top-copy {
  width: min(100%, 38rem);
  margin: 1.1rem auto 0;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(120, 113, 108, 0.5);
  border-radius: 0.38rem;
  background: rgba(244, 235, 216, 0.78);
  box-shadow: 0 8px 18px rgba(67, 20, 7, 0.12), inset 0 0 18px rgba(255, 255, 255, 0.24);
  text-align: left;
  color: #1c1917;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(0.78rem, 1.65vw, 0.95rem);
  line-height: 1.78;
  letter-spacing: 0.02em;
}

.roletrade-opening-top-copy p {
  margin: 0;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 250, 240, 0.38);
  overflow-wrap: normal;
  word-break: keep-all;
  line-break: strict;
}

.roletrade-opening-top-copy p + p {
  margin-top: 0.72rem;
}

.roletrade-opening-top-lead {
  padding-bottom: 0.66rem;
  border-bottom: 1px solid rgba(120, 113, 108, 0.46);
}

.roletrade-opening-top-emphasis {
  color: #9a3412;
  font-weight: 950;
  font-size: clamp(0.92rem, 2vw, 1.2rem);
}

@media (max-width: 640px) {
  .roletrade-opening-top-copy {
    margin-top: 0.8rem;
    padding: 0.8rem 0.82rem;
    font-size: 0.74rem;
    line-height: 1.66;
  }

  .roletrade-opening-top-copy p + p {
    margin-top: 0.56rem;
  }

  .roletrade-opening-top-emphasis {
    font-size: 0.92rem;
  }
}


.traveler-offer-stack {
  position: relative;
  width: min(100%, 15.75rem);
  height: 8rem;
  margin-inline: auto;
  transform: translateZ(0);
}

.traveler-offer-stack-card {
  position: absolute;
  top: 0;
  left: 50%;
  transition: transform 420ms ease, z-index 420ms ease;
}

.traveler-offer-stack-card-2-0 { transform: translateX(calc(-50% - 1.55rem)) rotate(-4deg); z-index: 1; }
.traveler-offer-stack-card-2-1 { transform: translateX(calc(-50% + 1.55rem)) rotate(4deg); z-index: 2; }
.traveler-offer-stack-card-3-0 { transform: translateX(calc(-50% - 2.35rem)) rotate(-6deg); z-index: 1; }
.traveler-offer-stack-card-3-1 { transform: translateX(-50%) rotate(0deg); z-index: 2; }
.traveler-offer-stack-card-3-2 { transform: translateX(calc(-50% + 2.35rem)) rotate(6deg); z-index: 3; }
.traveler-offer-stack-card.is-selected { z-index: 20; }

.requested-trade-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  width: 100%;
}

.requested-trade-choice {
  width: 7em;
  min-width: 7em;
  max-width: 7em;
}

@media (min-width: 640px) {
  .traveler-offer-stack {
    width: 18.75rem;
    height: 9.5rem;
  }

  .traveler-offer-stack-card-2-0 { transform: translateX(calc(-50% - 1.9rem)) rotate(-4deg); }
  .traveler-offer-stack-card-2-1 { transform: translateX(calc(-50% + 1.9rem)) rotate(4deg); }
  .traveler-offer-stack-card-3-0 { transform: translateX(calc(-50% - 2.8rem)) rotate(-6deg); }
  .traveler-offer-stack-card-3-2 { transform: translateX(calc(-50% + 2.8rem)) rotate(6deg); }
}


/* Page 6: keep the route title and story text balanced on narrow screens. */
.route-scene-title {
  text-wrap: balance;
}

@media (max-width: 640px) {
  .route-scene-title {
    font-size: clamp(1.05rem, 5.4vw, 1.22rem) !important;
    letter-spacing: 0.08em !important;
    line-height: 1.45;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .route-dialogue-panel {
    text-wrap: pretty;
  }

  .route-dialogue-panel .rules-guide-block {
    overflow-wrap: normal;
    word-break: keep-all;
    line-break: strict;
  }

  .route-dialogue-panel .rules-guide-block p {
    display: inline;
    white-space: normal;
    text-wrap: pretty;
  }

  .route-dialogue-panel .rules-guide-block p + p::before {
    content: " ";
  }

  .route-dialogue-panel .rules-guide-block div[class*="h-"] {
    display: block;
    height: 0.85rem;
  }
}


/* R5/6 requested-card exchange tuning. */
.requested-trade-message {
  white-space: nowrap !important;
  overflow: visible;
  font-size: clamp(0.58rem, 2.65vw, 0.86rem) !important;
  letter-spacing: 0.005em !important;
  line-height: 1.65 !important;
}

.requested-trade-actions {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.55rem;
  margin-bottom: 0.65rem;
}

.requested-hand-card-wrap {
  transform: translateY(-0.35rem);
}

.requested-hand-card-stable {
  transform: translateY(-0.35rem) scale(1.04) !important;
}

.requested-hand-card-stable:hover {
  transform: translateY(-0.35rem) scale(1.04) !important;
}

@media (max-width: 640px) {
  .requested-trade-choice {
    width: 6.4em;
    min-width: 6.4em;
    max-width: 6.4em;
  }
}


/* Traveler dialogue should wrap inside its parchment frame. */
.trade-dialogue-surface > .dialogue-text-unified,
.trade-dialogue-surface .requested-trade-message {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-break: strict;
  max-width: 100%;
  overflow: visible;
}

.trade-dialogue-surface .requested-trade-message {
  font-size: clamp(0.68rem, 2.7vw, 0.88rem) !important;
  line-height: 1.75 !important;
}


.dev-page-jump-panel {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0.9rem;
  border: 1px dashed rgba(120, 53, 15, 0.42);
  border-radius: 0.35rem;
  background: rgba(244, 235, 216, 0.78);
  box-shadow: 0 8px 18px rgba(68, 32, 12, 0.08);
}

.dev-page-jump-title {
  margin-bottom: 0.65rem;
  color: rgba(68, 32, 12, 0.78);
  font-family: serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-align: center;
}

.dev-page-jump-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.8rem, 1fr));
  gap: 0.35rem;
}

.dev-page-jump-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  padding: 0.35rem 0.25rem;
  border: 1px solid rgba(120, 53, 15, 0.25);
  border-radius: 0.25rem;
  background: rgba(255, 248, 234, 0.72);
  color: #5f3217;
  font-family: serif;
  line-height: 1.25;
  transition: background-color 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.dev-page-jump-link:hover,
.dev-page-jump-link:focus-visible {
  background: rgba(232, 220, 196, 0.96);
  border-color: rgba(120, 53, 15, 0.58);
  transform: translateY(-1px);
}

.dev-page-jump-page {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dev-page-jump-label {
  margin-top: 0.1rem;
  font-size: 0.58rem;
  font-weight: 700;
  opacity: 0.78;
}


/* Page 4: Haruka's six cards as two loose three-card bundles. */
.initial-shop-bundles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.initial-shop-bundle-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(1.15rem, 5.2vw, 3.2rem);
  width: 100%;
}

.initial-shop-bundle {
  position: relative;
  width: clamp(8.8rem, 40vw, 12.2rem);
  height: clamp(7.3rem, 33vw, 10.2rem);
  transform: translateZ(0);
}

.initial-shop-bundle-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transition: transform 420ms ease, z-index 420ms ease, filter 420ms ease;
}

.initial-shop-bundle-card-0 { transform: translate(calc(-50% - 2.1rem), -50%) rotate(-7deg); z-index: 1; }
.initial-shop-bundle-card-1 { transform: translate(-50%, calc(-50% - 0.22rem)) rotate(0deg); z-index: 2; }
.initial-shop-bundle-card-2 { transform: translate(calc(-50% + 2.1rem), -50%) rotate(7deg); z-index: 3; }
.initial-shop-bundle-card.is-selected { z-index: 30; filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.5)); }

@media (min-width: 640px) {
  .initial-shop-bundle-card-0 { transform: translate(calc(-50% - 2.75rem), -50%) rotate(-7deg); }
  .initial-shop-bundle-card-2 { transform: translate(calc(-50% + 2.75rem), -50%) rotate(7deg); }
}

@media (max-width: 380px) {
  .initial-shop-bundle-row { gap: 0.8rem; }
  .initial-shop-bundle { width: 8.15rem; height: 6.9rem; }
  .initial-shop-bundle-card-0 { transform: translate(calc(-50% - 1.72rem), -50%) rotate(-7deg); }
  .initial-shop-bundle-card-2 { transform: translate(calc(-50% + 1.72rem), -50%) rotate(7deg); }
}

/* Page 5-2: move from Refrem and Haruka's room toward the left door. */
.exit-to-tavern-scene {
  min-height: min(72vh, 34rem);
  background: #e8dcc4;
}

.exit-to-tavern-pan {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: 40% center;
  background-size: 152% auto;
  filter: brightness(1.02) saturate(1.02);
  will-change: background-position, background-size, filter;
}

.exit-to-tavern-scene.is-moving .exit-to-tavern-pan {
  animation: exitToTavernPan 7.2s cubic-bezier(0.18, 0.78, 0.16, 1) both;
}

.exit-to-tavern-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 46%, rgba(255, 244, 210, 0.24), transparent 23%),
    linear-gradient(90deg, rgba(232, 220, 196, 0.12), rgba(232, 220, 196, 0.34));
  box-shadow: inset 0 0 120px rgba(67, 20, 7, 0.38);
  pointer-events: none;
}

.exit-to-tavern-start {
  position: absolute;
  z-index: 4;
  left: clamp(0.9rem, 6vw, 3rem);
  top: clamp(10.5rem, 54%, 20rem);
  width: min(13rem, 48vw);
  box-shadow: 0 12px 26px rgba(67, 20, 7, 0.28);
}

.exit-to-tavern-scene.is-moving .exit-to-tavern-start {
  opacity: 0;
  transform: translateY(-0.35rem);
  pointer-events: none;
}

.exit-to-tavern-caption {
  position: absolute;
  left: 50%;
  bottom: clamp(1.1rem, 4vw, 2rem);
  width: min(88%, 32rem);
  transform: translateX(-50%);
  border: 1px solid rgba(87, 64, 43, 0.34);
  background: rgba(244, 235, 216, 0.72);
  box-shadow: 0 12px 34px rgba(67, 20, 7, 0.18);
  padding: 0.75rem 1rem;
  font-size: clamp(0.82rem, 2.8vw, 1.05rem);
  opacity: 0;
  pointer-events: none;
}

.exit-to-tavern-scene.is-moving .exit-to-tavern-caption {
  animation: none;
}

@keyframes exitToTavernPan {
  0% {
    background-position: 40% center;
    background-size: 152% auto;
    filter: brightness(1.02) saturate(1.02);
  }
  58% {
    background-position: 27% center;
    background-size: 145% auto;
    filter: brightness(1.03) saturate(1.04);
  }
  100% {
    background-position: 0% center;
    background-size: 205% auto;
    filter: brightness(1.08) saturate(1.06);
  }
}

@keyframes exitToTavernCaption {
  0%, 16% { opacity: 0; transform: translate(-50%, 0.35rem); }
  32%, 82% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -0.25rem); }
}

@media (max-width: 640px) {
  .exit-to-tavern-scene {
    min-height: min(70vh, 30rem);
  }

  .exit-to-tavern-pan {
    background-position: 31% center;
    background-size: 205% auto;
  }

  .exit-to-tavern-start {
    left: clamp(0.8rem, 4vw, 1.35rem);
    top: 53%;
    width: min(11.2rem, 45vw);
  }

  @keyframes exitToTavernPan {
    0% { background-position: 31% center; background-size: 205% auto; filter: brightness(1.02) saturate(1.02); }
    58% { background-position: 16% center; background-size: 168% auto; filter: brightness(1.03) saturate(1.04); }
    100% { background-position: 0% center; background-size: 182% auto; filter: brightness(1.08) saturate(1.06); }
  }
}



/* TOP journey start controls and resume confirmation. */
.start-journey-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.55rem;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .start-journey-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .start-journey-save-note {
    grid-column: 1 / -1;
  }
}

.start-reset-confirm-card {
  box-shadow:
    0 24px 70px rgba(28, 16, 8, 0.38),
    inset 0 0 24px rgba(120, 53, 15, 0.08);
}


/* TOP result history controls. */
.start-history-button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(120, 53, 15, 0.35);
  background: rgba(244, 235, 216, 0.86);
  color: #3f2c1b;
  box-shadow:
    inset 0 0 16px rgba(120, 53, 15, 0.08),
    0 8px 20px rgba(28, 16, 8, 0.12);
}

.start-history-button:hover {
  background: rgba(232, 220, 196, 0.94);
  transform: translateY(-1px);
}

@media (min-width: 640px) {
  .start-history-button {
    grid-column: 1 / -1;
    max-width: 18rem;
    justify-self: center;
  }
}

.result-history-scene,
.result-history-result {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.result-history-card {
  background-color: rgba(240, 230, 210, 0.96);
  border: 1px solid rgba(87, 64, 43, 0.44);
  border-radius: 4px;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  box-shadow:
    0 18px 54px rgba(67, 20, 7, 0.24),
    inset 0 0 22px rgba(120, 53, 15, 0.08);
}

.result-history-kicker {
  margin: 0 0 0.45rem;
  color: rgba(124, 45, 18, 0.82);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-align: center;
}

.result-history-card h2 {
  margin: 0;
  color: #23170e;
  font-size: clamp(1.35rem, 5.4vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}

.result-history-lead {
  margin: 0.8rem auto 1.3rem;
  max-width: 30rem;
  color: #4c3928;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.9;
  text-align: center;
}

.result-history-list {
  display: grid;
  gap: 0.75rem;
}

.result-history-item {
  display: grid;
  gap: 0.55rem;
  width: 100%;
  border: 1px solid rgba(120, 53, 15, 0.26);
  border-radius: 4px;
  background: rgba(255, 250, 240, 0.74);
  padding: 0.9rem 1rem;
  text-align: left;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.result-history-item:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 53, 15, 0.56);
  background: rgba(255, 250, 240, 0.9);
}

.result-history-date {
  color: #7c2d12;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.result-history-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.result-history-roles span {
  border: 1px solid rgba(87, 64, 43, 0.22);
  border-radius: 999px;
  background: rgba(232, 220, 196, 0.72);
  padding: 0.18rem 0.55rem;
  color: #2f2418;
  font-size: 0.8rem;
  font-weight: 900;
}

.result-history-open {
  justify-self: end;
  color: #7c2d12;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.result-history-empty {
  border: 1px dashed rgba(120, 53, 15, 0.36);
  background: rgba(255, 250, 240, 0.6);
  padding: 1.2rem;
  color: #5d4734;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.9;
  text-align: center;
}

.result-history-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.35rem;
}

.result-history-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  color: rgba(67, 49, 34, 0.78);
  font-size: 0.76rem;
  font-weight: 900;
}

.result-history-featured {
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 7vw, 4rem);
  margin: 1.5rem 0 1.2rem;
}

.result-history-featured-card {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
}

.result-history-featured-card > span {
  border-radius: 999px;
  background: linear-gradient(90deg, #c2410c, #7c2d12);
  color: #fef3c7;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.result-history-rest {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  transform: scale(0.86);
  transform-origin: top center;
  margin-bottom: -0.75rem;
}

.result-history-answer-block {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.result-history-question {
  border: 1px solid rgba(87, 64, 43, 0.24);
  border-radius: 4px;
  background: rgba(255, 250, 240, 0.68);
  padding: 0.9rem 1rem;
}

.result-history-question .speaker {
  margin: 0 0 0.4rem;
  color: #7c2d12;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.result-history-question .question {
  margin: 0 0 0.55rem;
  color: #2f2418;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.7;
}

.result-history-question .answer {
  min-height: 3.25rem;
  border: 1px dashed rgba(87, 64, 43, 0.36);
  background: rgba(255, 255, 255, 0.52);
  padding: 0.7rem 0.8rem;
  color: #403020;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.75;
}

.result-history-question .muted {
  color: rgba(93, 71, 52, 0.62);
}

@media (max-width: 520px) {
  .result-history-featured {
    gap: 1rem;
    transform: scale(0.9);
    transform-origin: top center;
    margin-bottom: 0;
  }

  .result-history-rest {
    gap: 0.25rem;
    transform: scale(0.72);
    margin-bottom: -1.75rem;
  }

  .result-history-topline {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* Hidden character taps on Page 5-2. */
.exit-to-tavern-hotspot {
  position: absolute;
  z-index: 5;
  display: block;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.exit-to-tavern-hotspot:focus-visible {
  outline: 2px solid rgba(249, 115, 22, 0.75);
  outline-offset: 4px;
  border-radius: 999px;
}

.exit-to-tavern-hotspot-refrem {
  left: 34%;
  top: 18%;
  width: 18%;
  height: 60%;
}

.exit-to-tavern-hotspot-haruka {
  left: 54%;
  top: 20%;
  width: 17%;
  height: 58%;
}

.exit-to-tavern-speech {
  position: absolute;
  z-index: 6;
  width: min(18rem, 46vw);
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(87, 64, 43, 0.35);
  border-radius: 0.35rem;
  background: rgba(244, 235, 216, 0.88);
  box-shadow: 0 12px 30px rgba(67, 20, 7, 0.24);
  color: #2f2418;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  text-align: left;
  animation: exitHotspotSpeechIn 360ms ease both;
  pointer-events: none;
}

.exit-to-tavern-speech::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  width: 0.75rem;
  height: 0.75rem;
  background: rgba(244, 235, 216, 0.88);
  border-left: 1px solid rgba(87, 64, 43, 0.35);
  border-bottom: 1px solid rgba(87, 64, 43, 0.35);
  transform: rotate(45deg);
}

.exit-to-tavern-speech-refrem {
  left: 51%;
  top: 18%;
}

.exit-to-tavern-speech-refrem::before {
  left: -0.42rem;
}

.exit-to-tavern-speech-haruka {
  right: 46%;
  top: 21%;
}

.exit-to-tavern-speech-haruka::before {
  left: auto;
  right: -0.42rem;
  transform: rotate(225deg);
}

.exit-to-tavern-speaker {
  display: block;
  margin-bottom: 0.2rem;
  color: #7c2d12;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.exit-to-tavern-line {
  display: block;
  font-size: clamp(0.78rem, 2.6vw, 0.95rem);
  font-weight: 900;
  line-height: 1.75;
}

@keyframes exitHotspotSpeechIn {
  from {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .exit-to-tavern-hotspot-refrem {
    left: 40%;
    top: 17%;
    width: 22%;
    height: 59%;
  }

  .exit-to-tavern-hotspot-haruka {
    left: 64%;
    top: 20%;
    width: 24%;
    height: 58%;
  }

  .exit-to-tavern-speech {
    width: min(15.5rem, 62vw);
  }

  .exit-to-tavern-speech-refrem {
    left: 11%;
    top: 8%;
  }

  .exit-to-tavern-speech-refrem::before {
    left: 2rem;
    top: auto;
    bottom: -0.42rem;
    transform: rotate(-45deg);
  }

  .exit-to-tavern-speech-haruka {
    left: 7%;
    right: auto;
    top: 9%;
  }

  .exit-to-tavern-speech-haruka::before {
    left: auto;
    right: -0.42rem;
    top: 1.1rem;
    bottom: auto;
    transform: rotate(225deg);
  }
}


/* Departure cue before Page 5-2 pan animation starts. */
.exit-to-tavern-scene.is-departure-cue .exit-to-tavern-start {
  opacity: 0;
  transform: translateY(-0.35rem);
  pointer-events: none;
}

.exit-to-tavern-departure-speech {
  position: absolute;
  z-index: 7;
  width: min(16rem, 42vw);
  padding: 0.68rem 0.82rem;
  border: 1px solid rgba(87, 64, 43, 0.35);
  border-radius: 0.35rem;
  background: rgba(244, 235, 216, 0.9);
  box-shadow: 0 12px 30px rgba(67, 20, 7, 0.24);
  color: #2f2418;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  text-align: left;
  animation: exitHotspotSpeechIn 420ms ease both;
  pointer-events: none;
}

.exit-to-tavern-departure-refrem {
  left: 51%;
  top: 17%;
}

.exit-to-tavern-departure-refrem::before,
.exit-to-tavern-departure-haruka::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  width: 0.75rem;
  height: 0.75rem;
  background: rgba(244, 235, 216, 0.9);
  border-left: 1px solid rgba(87, 64, 43, 0.35);
  border-bottom: 1px solid rgba(87, 64, 43, 0.35);
}

.exit-to-tavern-departure-refrem::before {
  left: -0.42rem;
  transform: rotate(45deg);
}

.exit-to-tavern-departure-haruka {
  right: 46%;
  top: 40%;
}

.exit-to-tavern-departure-haruka::before {
  right: -0.42rem;
  transform: rotate(225deg);
}

@media (max-width: 640px) {
  .exit-to-tavern-speech {
    max-width: calc(100% - 1.5rem);
  }

  .exit-to-tavern-speech-refrem {
    left: 0.75rem;
    top: 0.75rem;
    width: min(14.25rem, 58vw);
  }

  .exit-to-tavern-speech-haruka {
    left: 0.75rem;
    right: auto;
    top: 0.75rem;
    width: min(14.25rem, 58vw);
  }

  .exit-to-tavern-departure-speech {
    width: min(13.9rem, 58vw);
  }

  .exit-to-tavern-departure-refrem {
    left: 0.75rem;
    top: 0.75rem;
  }

  .exit-to-tavern-departure-haruka {
    left: 0.75rem;
    right: auto;
    top: 7rem;
  }

  .exit-to-tavern-departure-haruka::before {
    left: auto;
    right: -0.42rem;
  }
}


/* Page 5-2 responsive stabilization: keep Refrem and Haruka centered before departure. */
.exit-to-tavern-pan {
  background-position: 52% center;
  background-size: auto 100%;
}

.exit-to-tavern-start {
  left: 50%;
  top: auto;
  bottom: clamp(1.25rem, 6vh, 3.25rem);
  width: min(15rem, calc(100% - 2rem));
  transform: translateX(-50%);
}

.exit-to-tavern-scene.is-moving .exit-to-tavern-start,
.exit-to-tavern-scene.is-departure-cue .exit-to-tavern-start {
  transform: translate(-50%, -0.35rem);
}

.exit-to-tavern-hotspot-refrem {
  left: 33%;
  top: 12%;
  width: 26%;
  height: 76%;
}

.exit-to-tavern-hotspot-haruka {
  left: 58%;
  top: 14%;
  width: 27%;
  height: 74%;
}

.exit-to-tavern-speech-refrem {
  left: clamp(0.9rem, 5vw, 2.5rem);
  top: clamp(0.9rem, 5vh, 2.2rem);
}

.exit-to-tavern-speech-haruka {
  right: 38%;
  top: clamp(0.9rem, 6vh, 2.7rem);
}

.exit-to-tavern-departure-refrem {
  left: clamp(0.9rem, 5vw, 2.5rem);
  top: clamp(0.9rem, 5vh, 2.2rem);
}

.exit-to-tavern-departure-haruka {
  right: 38%;
  top: clamp(6rem, 27vh, 11rem);
}

@keyframes exitToTavernPan {
  0% {
    background-position: 52% center;
    background-size: auto 100%;
    filter: brightness(1.02) saturate(1.02);
  }
  58% {
    background-position: 20% center;
    background-size: auto 100%;
    filter: brightness(1.03) saturate(1.04);
  }
  100% {
    background-position: 0% center;
    background-size: auto 112%;
    filter: brightness(1.08) saturate(1.06);
  }
}

@media (max-width: 760px) {
  .exit-to-tavern-scene {
    min-height: min(72vh, 32rem);
  }

  .exit-to-tavern-pan {
    background-position: 55% center;
    background-size: auto 100%;
  }

  .exit-to-tavern-hotspot-refrem {
    left: 28%;
    top: 14%;
    width: 34%;
    height: 70%;
  }

  .exit-to-tavern-hotspot-haruka {
    left: 58%;
    top: 15%;
    width: 38%;
    height: 70%;
  }

  .exit-to-tavern-speech {
    width: min(15rem, 62vw);
    max-width: calc(100% - 1.5rem);
  }

  .exit-to-tavern-speech-refrem,
  .exit-to-tavern-speech-haruka {
    left: 0.75rem;
    right: auto;
    top: 0.75rem;
  }

  .exit-to-tavern-speech-refrem::before {
    left: 2rem;
    top: auto;
    bottom: -0.42rem;
    transform: rotate(-45deg);
  }

  .exit-to-tavern-speech-haruka::before {
    left: auto;
    right: -0.42rem;
    top: 1.1rem;
    bottom: auto;
    transform: rotate(225deg);
  }

  .exit-to-tavern-departure-speech {
    width: min(14.25rem, 60vw);
  }

  .exit-to-tavern-departure-refrem {
    left: 0.75rem;
    top: 0.75rem;
  }

  .exit-to-tavern-departure-haruka {
    left: 0.75rem;
    right: auto;
    top: 7rem;
  }

  @keyframes exitToTavernPan {
    0% {
      background-position: 55% center;
      background-size: auto 100%;
      filter: brightness(1.02) saturate(1.02);
    }
    58% {
      background-position: 18% center;
      background-size: auto 100%;
      filter: brightness(1.03) saturate(1.04);
    }
    100% {
      background-position: 0% center;
      background-size: auto 112%;
      filter: brightness(1.08) saturate(1.06);
    }
  }
}


/* Page 5-2 button stays above character hotspots. */
.exit-to-tavern-start {
  z-index: 9;
}


/* Page 5-2 mobile tap targets and entrance zoom refinement. */
@media (max-width: 760px) {
  .exit-to-tavern-hotspot-refrem {
    left: 18%;
    top: 10%;
    width: 47%;
    height: 78%;
  }

  .exit-to-tavern-hotspot-haruka {
    left: 55%;
    top: 13%;
    width: 43%;
    height: 74%;
  }

  @keyframes exitToTavernPan {
    0% {
      background-position: 55% center;
      background-size: auto 100%;
      filter: brightness(1.02) saturate(1.02);
    }
    64% {
      background-position: 12% center;
      background-size: auto 104%;
      filter: brightness(1.04) saturate(1.05);
    }
    100% {
      background-position: 0% center;
      background-size: auto 128%;
      filter: brightness(1.1) saturate(1.07);
    }
  }
}

@media (min-width: 761px) {
  @keyframes exitToTavernPan {
    0% {
      background-position: 52% center;
      background-size: auto 100%;
      filter: brightness(1.02) saturate(1.02);
    }
    64% {
      background-position: 14% center;
      background-size: auto 104%;
      filter: brightness(1.04) saturate(1.05);
    }
    100% {
      background-position: 0% center;
      background-size: auto 126%;
      filter: brightness(1.1) saturate(1.07);
    }
  }
}

/* Card-frame based loose overlap for traveler offers and shop bundles. */
.traveler-offer-stack {
  --offer-card-w: 84px;
  --offer-spread-2: 2.45rem;
  --offer-spread-3: 4.7rem;
  --offer-pair-inner: 1.2rem;
  --offer-pair-outer: 4.9rem;
  width: min(100%, 15.75rem);
  height: 8.25rem;
}

.traveler-offer-stack-card-2-0 { transform: translateX(calc(-50% - var(--offer-spread-2))) rotate(-3deg); z-index: 1; }
.traveler-offer-stack-card-2-1 { transform: translateX(calc(-50% + var(--offer-spread-2))) rotate(3deg); z-index: 2; }
.traveler-offer-stack-card-3-0 { transform: translateX(calc(-50% - var(--offer-spread-3))) rotate(-4deg); z-index: 1; }
.traveler-offer-stack-card-3-1 { transform: translateX(-50%) rotate(0deg); z-index: 2; }
.traveler-offer-stack-card-3-2 { transform: translateX(calc(-50% + var(--offer-spread-3))) rotate(4deg); z-index: 3; }

.traveler-offer-stack-double-pairs {
  --offer-pair-inner: 1.2rem;
  --offer-pair-outer: 4.9rem;
}

.traveler-offer-stack-card-4-0 { transform: translateX(calc(-50% - var(--offer-pair-outer))) rotate(-4deg); z-index: 1; }
.traveler-offer-stack-card-4-1 { transform: translateX(calc(-50% - var(--offer-pair-inner))) rotate(2deg); z-index: 2; }
.traveler-offer-stack-card-4-2 { transform: translateX(calc(-50% + var(--offer-pair-inner))) rotate(-2deg); z-index: 3; }
.traveler-offer-stack-card-4-3 { transform: translateX(calc(-50% + var(--offer-pair-outer))) rotate(4deg); z-index: 4; }

.traveler-offer-stack-card.is-selected {
  z-index: 30;
  transform: translateX(-50%) translateY(-0.35rem) scale(1.08) rotate(0deg);
  filter: drop-shadow(0 0 14px rgba(249, 115, 22, 0.58));
}

.initial-shop-bundle {
  --bundle-card-w: 74px;
  --bundle-spread: 3.2rem;
  width: clamp(9.4rem, 42vw, 12.8rem);
  height: clamp(7.45rem, 33vw, 10.2rem);
}

.initial-shop-bundle-card-0 { transform: translate(calc(-50% - var(--bundle-spread)), -50%) rotate(-5deg); z-index: 1; }
.initial-shop-bundle-card-1 { transform: translate(-50%, calc(-50% - 0.22rem)) rotate(0deg); z-index: 2; }
.initial-shop-bundle-card-2 { transform: translate(calc(-50% + var(--bundle-spread)), -50%) rotate(5deg); z-index: 3; }

@media (min-width: 640px) {
  .traveler-offer-stack {
    --offer-card-w: 96px;
    --offer-spread-2: 2.75rem;
    --offer-spread-3: 5.25rem;
    width: 19rem;
    height: 9.75rem;
  }

  .traveler-offer-stack-double-pairs {
    --offer-pair-inner: 1.45rem;
    --offer-pair-outer: 5.9rem;
  }

  .initial-shop-bundle {
    --bundle-card-w: 96px;
    --bundle-spread: 3.55rem;
    width: clamp(10.8rem, 28vw, 13.25rem);
  }
}

@media (max-width: 380px) {
  .traveler-offer-stack {
    --offer-card-w: 84px;
    --offer-spread-2: 2.25rem;
    --offer-spread-3: 4.05rem;
    width: min(100%, 14.5rem);
  }

  .traveler-offer-stack-double-pairs {
    --offer-pair-inner: 1.15rem;
    --offer-pair-outer: 4.35rem;
  }

  .initial-shop-bundle {
    --bundle-spread: 2.72rem;
    width: 8.85rem;
  }
}

/* Page 5-2 character speech placement refinement. */
.exit-to-tavern-speech {
  max-width: calc(100% - 1.5rem);
}

.exit-to-tavern-speech-refrem {
  left: 49%;
  right: auto;
  top: 1.1rem;
  width: min(17rem, 39vw);
}

.exit-to-tavern-speech-refrem::before {
  left: -0.42rem;
  right: auto;
  top: 2.15rem;
  bottom: auto;
  transform: rotate(45deg);
}

.exit-to-tavern-speech-haruka {
  left: 27%;
  right: auto;
  top: clamp(8rem, 34%, 12rem);
  width: min(16.5rem, 41vw);
}

.exit-to-tavern-speech-haruka::before {
  left: auto;
  right: -0.42rem;
  top: 1.45rem;
  bottom: auto;
  transform: rotate(225deg);
}

@media (max-width: 760px) {
  .exit-to-tavern-speech {
    max-width: calc(100% - 1.25rem);
  }

  .exit-to-tavern-speech-refrem {
    left: 43%;
    right: auto;
    top: 1.35rem;
    width: min(13.4rem, 53vw);
  }

  .exit-to-tavern-speech-refrem::before {
    left: -0.38rem;
    right: auto;
    top: 2rem;
    bottom: auto;
    transform: rotate(45deg);
  }

  .exit-to-tavern-speech-haruka {
    left: 0.75rem;
    right: auto;
    top: clamp(8rem, 31%, 10.75rem);
    width: min(14.4rem, 60vw);
  }

  .exit-to-tavern-speech-haruka::before {
    left: auto;
    right: -0.38rem;
    top: 1.35rem;
    bottom: auto;
    transform: rotate(225deg);
  }
}


/* Page 5-2 departure Refrem speech alignment. */
.exit-to-tavern-departure-refrem {
  left: 49%;
  right: auto;
  top: 1.1rem;
  width: min(17rem, 39vw);
}

.exit-to-tavern-departure-refrem::before {
  left: -0.42rem;
  right: auto;
  top: 2.15rem;
  bottom: auto;
  transform: rotate(45deg);
}

@media (max-width: 760px) {
  .exit-to-tavern-departure-refrem {
    left: 43%;
    right: auto;
    top: 1.35rem;
    width: min(13.4rem, 53vw);
  }

  .exit-to-tavern-departure-refrem::before {
    left: -0.38rem;
    right: auto;
    top: 2rem;
    bottom: auto;
    transform: rotate(45deg);
  }
}


/* Page 5-2 left-door exit zoom and fade refinement. */
.exit-to-tavern-scene.is-moving .exit-to-tavern-pan {
  animation: exitToTavernPan 8.8s cubic-bezier(0.18, 0.78, 0.16, 1) both;
}

.exit-to-tavern-pan {
  will-change: background-position, background-size, filter, opacity;
}

@keyframes exitToTavernPan {
  0% {
    background-position: 52% center;
    background-size: auto 100%;
    filter: brightness(1.02) saturate(1.02);
    opacity: 1;
  }
  48% {
    background-position: 12% center;
    background-size: auto 108%;
    filter: brightness(1.04) saturate(1.05);
    opacity: 1;
  }
  78% {
    background-position: 0% center;
    background-size: auto 138%;
    filter: brightness(1.08) saturate(1.08);
    opacity: 0.94;
  }
  100% {
    background-position: 0% center;
    background-size: auto 168%;
    filter: brightness(1.18) saturate(1.08) blur(1.4px);
    opacity: 0;
  }
}

@media (max-width: 760px) {
  @keyframes exitToTavernPan {
    0% {
      background-position: 55% center;
      background-size: auto 100%;
      filter: brightness(1.02) saturate(1.02);
      opacity: 1;
    }
    48% {
      background-position: 10% center;
      background-size: auto 108%;
      filter: brightness(1.04) saturate(1.05);
      opacity: 1;
    }
    78% {
      background-position: 0% center;
      background-size: auto 138%;
      filter: brightness(1.08) saturate(1.08);
      opacity: 0.94;
    }
    100% {
      background-position: 0% center;
      background-size: auto 168%;
      filter: brightness(1.18) saturate(1.08) blur(1.4px);
      opacity: 0;
    }
  }
}


/* Page 5-2 room object gimmicks. */
.exit-to-tavern-pan {
  transition:
    background-position 1450ms cubic-bezier(0.2, 0.72, 0.18, 1),
    background-size 1450ms cubic-bezier(0.2, 0.72, 0.18, 1),
    filter 1450ms ease,
    opacity 420ms ease;
}

.exit-to-tavern-scene.is-peeking-right .exit-to-tavern-pan {
  background-position: 100% center;
  background-size: auto 100%;
  filter: brightness(1.05) saturate(1.06);
}

.exit-object-hotspot {
  position: absolute;
  z-index: 7;
  display: block;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.exit-object-hotspot:focus-visible {
  outline: 2px solid rgba(249, 115, 22, 0.72);
  outline-offset: 2px;
  border-radius: 999px;
}

.exit-object-hotspot-crystal {
  left: 24%;
  top: 52%;
  width: 14%;
  height: 18%;
}

.exit-object-hotspot-books-left {
  left: 5%;
  top: 18%;
  width: 24%;
  height: 24%;
}

.exit-object-hotspot-books-right {
  left: 74%;
  top: 13%;
  width: 19%;
  height: 31%;
}

.exit-object-hotspot-cat {
  left: 65%;
  top: 76%;
  width: 15%;
  height: 13%;
}

.exit-object-hotspot-right-edge {
  right: 0;
  top: 0;
  width: 9%;
  height: 100%;
}

.exit-to-tavern-object-note {
  position: absolute;
  z-index: 8;
  width: min(15rem, 42vw);
  padding: 0.62rem 0.78rem;
  border: 1px solid rgba(87, 64, 43, 0.35);
  border-radius: 0.35rem;
  background: rgba(244, 235, 216, 0.88);
  box-shadow: 0 12px 30px rgba(67, 20, 7, 0.22);
  color: #2f2418;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  text-align: left;
  animation: exitHotspotSpeechIn 360ms ease both;
  pointer-events: none;
}

.exit-to-tavern-object-note-crystal {
  left: 18%;
  top: 41%;
}

.exit-to-tavern-object-note-books-left {
  left: 7%;
  top: 11%;
}

.exit-to-tavern-object-note-books-right {
  right: 5%;
  top: 14%;
}

.exit-to-tavern-object-note-cat {
  left: 53%;
  top: 67%;
  width: min(8.2rem, 30vw);
}

.exit-to-tavern-object-note-right-edge {
  right: 1rem;
  top: 1rem;
}

.exit-crystal-sparkle {
  position: absolute;
  z-index: 8;
  left: 28%;
  top: 50%;
  width: 5.4rem;
  height: 5.4rem;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 245, 180, 0.75));
}

.exit-crystal-sparkle span {
  position: absolute;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.98), rgba(253,224,71,0.72) 42%, rgba(253,224,71,0) 72%);
  animation: exitCrystalTwinkle 1100ms ease-in-out infinite;
}

.exit-crystal-sparkle span:nth-child(1) {
  left: 45%;
  top: 7%;
}

.exit-crystal-sparkle span:nth-child(2) {
  left: 18%;
  top: 43%;
  animation-delay: 220ms;
}

.exit-crystal-sparkle span:nth-child(3) {
  left: 69%;
  top: 52%;
  animation-delay: 430ms;
}

@keyframes exitCrystalTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.55); }
  45% { opacity: 1; transform: scale(1.25); }
}

@media (max-width: 760px) {
  .exit-object-hotspot-crystal {
    left: 20%;
    top: 51%;
    width: 19%;
    height: 16%;
  }

  .exit-object-hotspot-books-left {
    left: 0;
    top: 15%;
    width: 28%;
    height: 24%;
  }

  .exit-object-hotspot-books-right {
    left: 74%;
    top: 12%;
    width: 23%;
    height: 31%;
  }

  .exit-object-hotspot-cat {
    left: 65%;
    top: 75%;
    width: 20%;
    height: 13%;
  }

  .exit-object-hotspot-right-edge {
    width: 13%;
  }

  .exit-to-tavern-object-note {
    width: min(13.8rem, 64vw);
    max-width: calc(100% - 1.25rem);
  }

  .exit-to-tavern-object-note-crystal {
    left: 0.75rem;
    top: 42%;
  }

  .exit-to-tavern-object-note-books-left {
    left: 0.75rem;
    top: 8%;
  }

  .exit-to-tavern-object-note-books-right,
  .exit-to-tavern-object-note-right-edge {
    right: 0.75rem;
    top: 1rem;
  }

  .exit-to-tavern-object-note-cat {
    left: 0.75rem;
    top: 66%;
    width: min(8rem, 40vw);
  }

  .exit-crystal-sparkle {
    left: 23%;
    top: 49%;
    width: 4.5rem;
    height: 4.5rem;
  }
}


/* Page 5-2 sealed object gimmicks.
   Character dialogue hotspots stay active; only room-object gimmicks are hidden here. */
.exit-object-hotspot,
.exit-to-tavern-object-note,
.exit-crystal-sparkle {
  display: none !important;
  pointer-events: none !important;
}
