.ncae-lab {
  width: min(520px, calc(100% - 20px));
  margin: 24px auto 56px;
  color: #fff6d9;
}

.ncae-head {
  margin-bottom: 16px;
  text-align: center;
}

.ncae-kicker {
  margin: 0 0 6px;
  color: #dbb75e;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.ncae-title {
  margin: 0 0 8px;
  color: #fff0b8;
  font-size: clamp(1.35rem, 5vw, 1.9rem);
}

.ncae-guide {
  margin: 0;
  color: #dfd2a7;
  line-height: 1.7;
}

.ncae-stage {
  --character-width: 68px;
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  min-height: 600px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(236, 204, 113, 0.4);
  border-radius: 26px;
  background: #251706;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.38);
  touch-action: manipulation;
  cursor: crosshair;
}

.ncae-room {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.ncae-floor-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.02) 32%,
    rgba(0, 0, 0, 0.12) 100%
  );
}


.ncae-object {
  position: absolute;
  z-index: 4;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ncae-object img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.22));
}

.ncae-object-action {
  pointer-events: auto;
  cursor: pointer;
}

.ncae-object-action:focus-visible {
  outline: 3px solid rgba(255, 225, 132, 0.96);
  outline-offset: 5px;
  border-radius: 16px;
}

.ncae-object-action:active img {
  transform: scale(0.98);
}

/* 配信ゾーン：左方向への動きを見せる */
.ncae-object-streaming {
  left: 22%;
  top: 21.5%;
  width: 35%;
  transform: translate(-50%, -50%);
}

/* マイク：棚から離し、階段手前の床で輪郭を見せる */
.ncae-object-microphone {
  left: 80%;
  top: 35%;
  width: 24%;
  transform: translate(-50%, -50%);
}

/* テーブルは少し左へ。中央通路を残す */
.ncae-object-table {
  left: 20%;
  top: 50%;
  width: 35%;
  transform: translate(-50%, -50%);
}

/* コーヒーはテーブル手前側。入口として見つけやすく */
.ncae-object-coffee {
  z-index: 8;
  left: 20%;
  top: 46%;
  width: 12%;
  transform: translate(-50%, -50%);
  animation: ncae-coffee-idle 2.8s ease-in-out infinite;
}

/* ソファーは右側へ離し、中央へ軽く向ける */
.ncae-object-chair {
  z-index: 5;
  left: 72%;
  top: 58.5%;
  width: 24%;
  transform: translate(-50%, -50%) rotate(-4deg);
}

/* 台本は窓下の左寄り。左方向の創作導線 */
.ncae-object-notebook {
  z-index: 7;
  left: 45%;
  top: 25%;
  width: 15%;
  transform: translate(-50%, -50%) rotate(-3deg);
}

/* ぬいぐるみは右下のライト付きテーブル上 */
.ncae-object-plush {
  z-index: 7;
  left: 84%;
  top: 89%;
  width: 15%;
  transform: translate(-50%, -50%);
}

@keyframes ncae-coffee-idle {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-2px);
  }
}

.ncae-character {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 50%;
  width: var(--character-width);
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform:
    translate(-50%, -50%)
    translate3d(var(--ncae-x, 0px), var(--ncae-y, 0px), 0);
  transform-origin: 50% 100%;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ncae-character-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 12px 15px rgba(0, 0, 0, 0.38));
}

.ncae-character.is-walking-horizontal .ncae-character-image {
  animation: ncae-walk-horizontal 0.56s ease-in-out infinite;
}

.ncae-character.is-walking-vertical .ncae-character-image {
  animation: ncae-walk-vertical 0.68s ease-in-out infinite;
}

.ncae-character.is-walking-diagonal .ncae-character-image {
  animation: ncae-walk-diagonal 0.62s ease-in-out infinite;
}

.ncae-character.is-near-arrival .ncae-character-image {
  animation-duration: 0.82s;
  animation-timing-function: ease-out;
}

.ncae-character.is-arrived .ncae-character-image {
  animation: ncae-arrive 0.42s ease;
}

.ncae-character.is-turning .ncae-character-image {
  animation: ncae-turn 0.22s ease;
}

.ncae-character.is-ready .ncae-character-image {
  animation: ncae-ready 0.36s ease;
}

.ncae-character.is-tapped .ncae-character-image {
  animation: ncae-tap 0.42s ease;
}

@keyframes ncae-walk-horizontal {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(-1.1deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(-3px) rotate(1.1deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes ncae-walk-vertical {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-2px);
  }
  55% {
    transform: translateY(0);
  }
  80% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes ncae-walk-diagonal {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-2.5px) rotate(-0.7deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(-2.5px) rotate(0.7deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes ncae-arrive {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(2px) scale(0.975); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes ncae-turn {
  0% { transform: scaleX(0.94) scaleY(1); }
  100% { transform: scaleX(1) scaleY(1); }
}

@keyframes ncae-ready {
  0%, 100% { transform: translateY(0) scale(1); }
  42% { transform: translateY(-4px) scale(1.025); }
}

@keyframes ncae-tap {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-7px) scale(1.04); }
}

.ncae-character:focus-visible {
  outline: 3px solid rgba(255, 225, 132, 0.96);
  outline-offset: 4px;
  border-radius: 16px;
}

.ncae-alert {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 18px;
  width: min(88%, 390px);
  padding: 11px 15px;
  transform: translateX(-50%);
  border: 1px solid rgba(240, 209, 126, 0.5);
  border-radius: 999px;
  background: rgba(28, 18, 7, 0.84);
  color: #fff0ba;
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

@media (max-width: 520px) {
  .ncae-stage {
    --character-width: 60px;
    min-height: 560px;
  }
}


/* ==============================
   v0.2.4 座標確認オーバーレイ
   赤：ちび猫One〜停止地点
   金：アイテム本体の中心座標
============================== */
.ncae-debug-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.ncae-debug-marker {
  position: absolute;
  transform: translate(-50%, -50%);
}
.ncae-debug-marker-stop {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 45, 45, .96);
  border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(255,45,45,.22);
}
.ncae-debug-marker-stop::before,
.ncae-debug-marker-stop::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255,45,45,.95);
  transform: translate(-50%,-50%);
}
.ncae-debug-marker-stop::before { width: 2px; height: 34px; }
.ncae-debug-marker-stop::after { width: 34px; height: 2px; }
.ncae-debug-marker-item {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #f3c65f;
  border: 2px solid #fff8d8;
  box-shadow: 0 0 0 4px rgba(243,198,95,.28);
}
.ncae-debug-label {
  position: absolute;
  left: 14px;
  top: -15px;
  min-width: 108px;
  padding: 5px 7px;
  border-radius: 9px;
  color: #fff;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 5px 14px rgba(0,0,0,.2);
}
.ncae-debug-marker-stop .ncae-debug-label { background: rgba(95,18,18,.88); }
.ncae-debug-marker-item .ncae-debug-label { background: rgba(84,61,12,.9); color:#fff9df; }
.ncae-debug-label strong { display:block; font-size:11px; }
.ncae-debug-legend {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fffaf1;
  border: 1px solid rgba(154,110,24,.22);
  font-size: 12px;
  color: #5c4a2a;
}
.ncae-debug-legend span { display:inline-flex; align-items:center; margin-right:14px; gap:6px; }
.ncae-debug-legend i { width:11px; height:11px; border-radius:50%; display:inline-block; }
.ncae-debug-legend .stop i { background:#ff2d2d; }
.ncae-debug-legend .item i { background:#f3c65f; }


/* ==============================
   v0.3.0 晴れ・雨・夜 背景切替
============================== */
.ncae-weather-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 auto 14px;
  max-width: 560px;
}

.ncae-weather-switch button {
  appearance: none;
  border: 1px solid rgba(131, 94, 59, 0.25);
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(255, 250, 242, 0.92);
  color: #5b4432;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(87, 58, 35, 0.08);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.ncae-weather-switch button:active {
  transform: translateY(1px) scale(0.99);
}

.ncae-weather-switch button.is-active {
  background: rgba(66, 45, 34, 0.94);
  color: #fff8ec;
  box-shadow: 0 8px 20px rgba(61, 40, 28, 0.20);
}

.ncae-room {
  transition: opacity 240ms ease, filter 240ms ease;
}

.ncae-stage[data-ncae-scene="night"] .ncae-floor-shade {
  background: linear-gradient(to bottom, rgba(18, 10, 6, 0.02), rgba(18, 10, 6, 0.16));
}

.ncae-stage[data-ncae-scene="rain"] .ncae-floor-shade {
  background: linear-gradient(to bottom, rgba(62, 72, 88, 0.02), rgba(44, 48, 58, 0.08));
}

.ncae-stage[data-ncae-scene="sunny"] .ncae-floor-shade {
  background: linear-gradient(to bottom, rgba(255, 244, 216, 0.00), rgba(255, 229, 181, 0.04));
}


/* =========================================================
   v0.3.1 Scene Lighting Engine
   背景画像は固定し、シーンごとの光だけを独立レイヤーで重ねる。
========================================================= */
.ncae-scene-lighting {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ncae-light,
.ncae-night-sparkles {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.75s ease;
}

/* 晴れ：窓から入る柔らかな自然光。家具を白飛びさせない。 */
.ncae-light-sunny-window {
  left: 8%;
  top: 2%;
  width: 78%;
  height: 54%;
  transform: rotate(-7deg);
  background: linear-gradient(
    128deg,
    rgba(255, 251, 220, 0.00) 4%,
    rgba(255, 247, 202, 0.24) 36%,
    rgba(255, 243, 183, 0.10) 61%,
    rgba(255, 243, 183, 0.00) 82%
  );
  filter: blur(12px);
}

/* 雨：台本と窓辺ソファーにだけ灯る、静かな琥珀色。 */
.ncae-light-rain-notebook {
  left: 30%;
  top: 17%;
  width: 48%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 218, 150, 0.24) 0%,
    rgba(255, 205, 125, 0.12) 38%,
    rgba(255, 196, 105, 0.00) 76%
  );
  filter: blur(10px);
  animation: ncae-rain-light-breathe 5.6s ease-in-out infinite;
}

/* 雨：コーヒー周辺のぬくもり。主張は弱くする。 */
.ncae-light-rain-coffee {
  left: 2%;
  top: 38%;
  width: 38%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 220, 154, 0.16) 0%,
    rgba(255, 207, 128, 0.07) 42%,
    rgba(255, 207, 128, 0.00) 78%
  );
  filter: blur(12px);
}

/* 夜：マイクへ落ちる控えめなスポットライト。 */
.ncae-light-night-microphone {
  left: 59%;
  top: 13%;
  width: 39%;
  height: 48%;
  clip-path: polygon(42% 0%, 64% 0%, 96% 100%, 7% 100%);
  background: linear-gradient(
    180deg,
    rgba(255, 238, 188, 0.03) 0%,
    rgba(255, 226, 158, 0.14) 47%,
    rgba(255, 215, 135, 0.26) 100%
  );
  filter: blur(8px);
  transform: rotate(2deg);
  transform-origin: 50% 0%;
  animation: ncae-night-spot-breathe 6.4s ease-in-out infinite;
}

/* 夜：右下のライトとぬいぐるみを包む小さな光。 */
.ncae-light-night-plush {
  right: -7%;
  bottom: -2%;
  width: 43%;
  height: 32%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 210, 117, 0.29) 0%,
    rgba(255, 181, 78, 0.11) 47%,
    rgba(255, 181, 78, 0.00) 78%
  );
  filter: blur(9px);
}

/* 夜：家具の縁が光を拾う程度の、非常に弱いきらめき。 */
.ncae-night-sparkles {
  inset: 0;
  background-image:
    radial-gradient(circle at 22% 33%, rgba(255,244,205,.62) 0 1px, transparent 1.8px),
    radial-gradient(circle at 48% 28%, rgba(255,231,166,.50) 0 1px, transparent 1.8px),
    radial-gradient(circle at 78% 37%, rgba(255,239,190,.58) 0 1px, transparent 1.8px),
    radial-gradient(circle at 73% 61%, rgba(255,222,144,.45) 0 1px, transparent 1.8px),
    radial-gradient(circle at 85% 82%, rgba(255,235,176,.55) 0 1px, transparent 1.8px),
    radial-gradient(circle at 31% 57%, rgba(255,235,176,.38) 0 1px, transparent 1.8px);
  animation: ncae-night-sparkle 4.8s ease-in-out infinite alternate;
}

.ncae-stage[data-ncae-scene="sunny"] .ncae-light-sunny-window {
  opacity: 1;
}

.ncae-stage[data-ncae-scene="rain"] .ncae-light-rain-notebook,
.ncae-stage[data-ncae-scene="rain"] .ncae-light-rain-coffee {
  opacity: 1;
}

.ncae-stage[data-ncae-scene="night"] .ncae-light-night-microphone,
.ncae-stage[data-ncae-scene="night"] .ncae-light-night-plush,
.ncae-stage[data-ncae-scene="night"] .ncae-night-sparkles {
  opacity: 1;
}

/* シーンごとの家具のなじませ方。位置とサイズは一切変更しない。 */
.ncae-stage[data-ncae-scene="sunny"] .ncae-object img {
  filter: drop-shadow(0 10px 12px rgba(94, 58, 19, 0.18));
}

.ncae-stage[data-ncae-scene="rain"] .ncae-object img {
  filter:
    drop-shadow(0 10px 13px rgba(26, 35, 38, 0.25))
    saturate(0.96)
    brightness(0.99);
}

.ncae-stage[data-ncae-scene="night"] .ncae-object img {
  filter:
    drop-shadow(0 11px 14px rgba(0, 0, 0, 0.38))
    brightness(0.91)
    saturate(0.94);
}

.ncae-stage[data-ncae-scene="night"] .ncae-object-microphone img {
  filter:
    drop-shadow(0 0 8px rgba(255, 223, 160, 0.32))
    drop-shadow(0 11px 14px rgba(0, 0, 0, 0.34))
    brightness(1.02);
}

.ncae-stage[data-ncae-scene="night"] .ncae-object-plush img {
  filter:
    drop-shadow(0 0 8px rgba(255, 196, 95, 0.26))
    drop-shadow(0 10px 13px rgba(0, 0, 0, 0.30))
    brightness(0.98);
}

@keyframes ncae-rain-light-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

@keyframes ncae-night-spot-breathe {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

@keyframes ncae-night-sparkle {
  0% { filter: brightness(0.78); }
  100% { filter: brightness(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  .ncae-light-rain-notebook,
  .ncae-light-night-microphone,
  .ncae-night-sparkles {
    animation: none !important;
  }
}


/* =========================================================
   v0.3.2 Lighting Tune Override
   晴れは維持。雨と夜だけ範囲・濃度・粒数を再調整。
========================================================= */
.ncae-light-rain-notebook {
  left: 39%;
  top: 16%;
  width: 31%;
  height: 22%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 220, 157, 0.18) 0%,
    rgba(255, 207, 130, 0.075) 42%,
    rgba(255, 196, 105, 0) 76%
  );
  filter: blur(14px);
  animation-duration: 6.8s;
}

.ncae-light-rain-coffee {
  left: 9%;
  top: 43%;
  width: 24%;
  height: 19%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 220, 154, 0.105) 0%,
    rgba(255, 207, 128, 0.038) 48%,
    rgba(255, 207, 128, 0) 80%
  );
  filter: blur(15px);
}

.ncae-light-night-microphone {
  left: 70%;
  top: 18%;
  width: 18%;
  height: 37%;
  clip-path: polygon(43% 0%, 59% 0%, 77% 100%, 23% 100%);
  background: linear-gradient(
    180deg,
    rgba(255, 238, 188, 0) 0%,
    rgba(255, 226, 158, 0.055) 46%,
    rgba(255, 215, 135, 0.16) 100%
  );
  filter: blur(15px);
  transform: rotate(1deg);
  animation-duration: 7.2s;
}

.ncae-light-night-plush {
  right: -2%;
  bottom: 0;
  width: 34%;
  height: 25%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 210, 117, 0.20) 0%,
    rgba(255, 181, 78, 0.075) 48%,
    rgba(255, 181, 78, 0) 79%
  );
  filter: blur(13px);
}

.ncae-night-sparkles {
  background-image:
    radial-gradient(circle at 77% 37%, rgba(255,239,190,.40) 0 0.8px, transparent 1.55px),
    radial-gradient(circle at 84% 82%, rgba(255,235,176,.36) 0 0.8px, transparent 1.55px),
    radial-gradient(circle at 29% 56%, rgba(255,235,176,.22) 0 0.7px, transparent 1.45px);
  animation-duration: 6.6s;
}

@keyframes ncae-night-spot-breathe {
  0%, 100% { opacity: 0.66; }
  50% { opacity: 0.84; }
}

@keyframes ncae-night-sparkle {
  0% { filter: brightness(0.84); opacity: 0.42; }
  100% { filter: brightness(1.06); opacity: 0.70; }
}


/* =========================================================
   v0.3.3 Scene Light Preset Final
   背景と光を完全連動。
   夜のマイク光は「短く・太く・局所」に限定する。
========================================================= */

/* 晴れ：自然光だけ。追加の局所光は出さない。 */
.ncae-stage[data-ncae-scene="sunny"] .ncae-light-rain-notebook,
.ncae-stage[data-ncae-scene="sunny"] .ncae-light-rain-coffee,
.ncae-stage[data-ncae-scene="sunny"] .ncae-light-night-microphone,
.ncae-stage[data-ncae-scene="sunny"] .ncae-light-night-plush,
.ncae-stage[data-ncae-scene="sunny"] .ncae-night-sparkles {
  opacity: 0 !important;
}

/* 雨：台本・窓辺・コーヒーだけ。夜の光は出さない。 */
.ncae-stage[data-ncae-scene="rain"] .ncae-light-sunny-window,
.ncae-stage[data-ncae-scene="rain"] .ncae-light-night-microphone,
.ncae-stage[data-ncae-scene="rain"] .ncae-light-night-plush,
.ncae-stage[data-ncae-scene="rain"] .ncae-night-sparkles {
  opacity: 0 !important;
}

/* 夜：マイクと右下ライトだけ。雨・晴れの光は出さない。 */
.ncae-stage[data-ncae-scene="night"] .ncae-light-sunny-window,
.ncae-stage[data-ncae-scene="night"] .ncae-light-rain-notebook,
.ncae-stage[data-ncae-scene="night"] .ncae-light-rain-coffee {
  opacity: 0 !important;
}

/* 夜：マイク位置だけに落ちる、短く太い局所ライト。 */
.ncae-light-night-microphone {
  left: 69.5%;
  top: 24.5%;
  width: 21%;
  height: 20%;
  border-radius: 46% 46% 52% 52% / 26% 26% 74% 74%;
  clip-path: none;
  transform: rotate(0deg);
  background:
    radial-gradient(
      ellipse at 52% 70%,
      rgba(255, 221, 148, 0.25) 0%,
      rgba(255, 215, 135, 0.14) 34%,
      rgba(255, 207, 119, 0.055) 58%,
      rgba(255, 207, 119, 0) 80%
    ),
    linear-gradient(
      180deg,
      rgba(255, 239, 193, 0.055) 0%,
      rgba(255, 226, 158, 0.10) 42%,
      rgba(255, 211, 128, 0.16) 100%
    );
  filter: blur(13px);
  animation-duration: 7.8s;
}

/* 夜：ソファー側へ光が流れないよう、右寄りに限定。 */
.ncae-stage[data-ncae-scene="night"] .ncae-light-night-microphone {
  opacity: 0.78;
}

/* 夜：マイク本体は光を拾うが、家具全体は光らせすぎない。 */
.ncae-stage[data-ncae-scene="night"] .ncae-object-microphone img {
  filter:
    drop-shadow(0 0 10px rgba(255, 223, 160, 0.38))
    drop-shadow(0 10px 13px rgba(0, 0, 0, 0.34))
    brightness(1.035);
}

/* 夜：粒はさらに弱く、背景の静けさを優先。 */
.ncae-night-sparkles {
  background-image:
    radial-gradient(circle at 78% 36%, rgba(255,239,190,.28) 0 0.7px, transparent 1.45px),
    radial-gradient(circle at 85% 82%, rgba(255,235,176,.24) 0 0.7px, transparent 1.45px);
  animation-duration: 8.2s;
}

@keyframes ncae-night-spot-breathe {
  0%, 100% { opacity: 0.72; transform: scale(0.985); }
  50% { opacity: 0.82; transform: scale(1.015); }
}

@keyframes ncae-night-sparkle {
  0% { filter: brightness(0.88); opacity: 0.24; }
  100% { filter: brightness(1.03); opacity: 0.42; }
}


/* =========================================================
   v0.4.0 Conversation Engine Foundation
========================================================= */
body.ncae-conversation-lock {
  overflow: hidden;
}

.ncae-conversation[hidden] {
  display: none !important;
}

.ncae-conversation {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: end center;
  padding: 18px;
  opacity: 0;
  transition: opacity 180ms ease;
}

.ncae-conversation.is-open {
  opacity: 1;
}

.ncae-conversation-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 23, 0.54);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.ncae-conversation-panel {
  position: relative;
  width: min(100%, 520px);
  max-height: min(76vh, 620px);
  overflow: auto;
  padding: 24px 20px 20px;
  border: 1px solid rgba(132, 91, 66, 0.22);
  border-radius: 25px 25px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(248, 239, 227, 0.98));
  box-shadow: 0 24px 70px rgba(24, 14, 19, 0.34);
  transform: translateY(18px);
  transition: transform 220ms ease;
}

.ncae-conversation.is-open .ncae-conversation-panel {
  transform: translateY(0);
}

.ncae-conversation-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(92, 62, 52, 0.09);
  color: #5c4036;
  font-size: 24px;
  line-height: 1;
}

.ncae-conversation-kicker {
  margin: 0 42px 8px 0;
  color: #9a725d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.ncae-conversation-speaker {
  margin: 0 0 12px;
  color: #4d352f;
  font-size: 20px;
}

.ncae-conversation-line {
  min-height: 3.4em;
  margin: 0 0 18px;
  color: #493b37;
  font-size: 16px;
  line-height: 1.8;
}

.ncae-conversation-choices {
  display: grid;
  gap: 10px;
}

.ncae-conversation-choice,
.ncae-conversation-finish {
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  border: 1px solid rgba(119, 81, 67, 0.20);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: #4c3731;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 7px 18px rgba(85, 53, 43, 0.08);
}

.ncae-conversation-choice:active,
.ncae-conversation-finish:active {
  transform: translateY(1px);
}

.ncae-conversation-choice:focus-visible,
.ncae-conversation-finish:focus-visible,
.ncae-conversation-close:focus-visible {
  outline: 3px solid rgba(139, 101, 184, 0.42);
  outline-offset: 2px;
}

.ncae-conversation-finish {
  margin-top: 6px;
  background: #6f557e;
  color: #fff;
  text-align: center;
}

@media (min-width: 700px) {
  .ncae-conversation {
    place-items: center;
  }

  .ncae-conversation-panel {
    border-radius: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ncae-conversation,
  .ncae-conversation-panel {
    transition: none !important;
  }
}


/* ==============================
   v0.5.0 Emotion / Memory Engine
============================== */
.ncae-memory-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 12px;
  padding: 5px 10px;
  border: 1px solid rgba(161, 108, 78, 0.22);
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.84);
  color: #7f5140;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.ncae-conversation-choice.is-remembered::after {
  content: "記憶済み";
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(143, 93, 121, 0.12);
  color: #80506a;
  font-size: 10px;
  font-weight: 700;
}


/* =========================================================
   v0.5.1 きずな段階・特別選択肢
========================================================= */
.ncae-conversation-choice.is-special {
  border-color: rgba(190, 137, 55, 0.55);
  background: linear-gradient(180deg, rgba(255, 250, 231, 0.98), rgba(255, 239, 198, 0.98));
  box-shadow: 0 8px 20px rgba(133, 86, 25, 0.12);
}

.ncae-conversation-choice.is-locked,
.ncae-conversation-choice.is-locked:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  color: #7f756b;
  border-style: dashed;
  background: rgba(244, 239, 230, 0.92);
  box-shadow: none;
  transform: none;
}


/* =========================================================
   v0.5.2 きずな連動・表情リアクション基礎
========================================================= */
.ncae-character {
  --ncae-expression-glow: rgba(255, 255, 255, 0);
}

.ncae-character-image {
  transition: filter 240ms ease, transform 240ms ease;
}

.ncae-expression-mark {
  position: absolute;
  z-index: 4;
  top: 4%;
  right: 2%;
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 251, 247, 0.94);
  color: #705060;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(77, 46, 53, 0.18);
  transform: translateY(3px) scale(0.92);
  opacity: 0.82;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease, background 220ms ease;
}

.ncae-character::after {
  content: "";
  position: absolute;
  inset: 5% 11% 7%;
  z-index: -1;
  border-radius: 48%;
  background: radial-gradient(circle, var(--ncae-expression-glow), transparent 68%);
  filter: blur(5px);
  opacity: 0.9;
  pointer-events: none;
  transition: background 260ms ease, opacity 260ms ease;
}

.ncae-character[data-expression="calm"] .ncae-expression-mark {
  opacity: 0.62;
}

.ncae-character[data-expression="smile"] {
  --ncae-expression-glow: rgba(255, 226, 145, 0.27);
}

.ncae-character[data-expression="smile"] .ncae-character-image {
  filter: brightness(1.025) saturate(1.04);
}

.ncae-character[data-expression="warm"] {
  --ncae-expression-glow: rgba(255, 190, 185, 0.30);
}

.ncae-character[data-expression="warm"] .ncae-expression-mark,
.ncae-character[data-expression="blush"] .ncae-expression-mark,
.ncae-character[data-expression="deep"] .ncae-expression-mark,
.ncae-character[data-expression="touched"] .ncae-expression-mark {
  background: rgba(255, 239, 242, 0.96);
  color: #a64f69;
}

.ncae-character[data-expression="blush"] {
  --ncae-expression-glow: rgba(255, 153, 178, 0.36);
}

.ncae-character[data-expression="blush"] .ncae-character-image {
  filter: brightness(1.04) saturate(1.08) sepia(0.025);
}

.ncae-character[data-expression="deep"] {
  --ncae-expression-glow: rgba(211, 176, 255, 0.40);
}

.ncae-character[data-expression="deep"] .ncae-character-image {
  filter: brightness(1.055) saturate(1.10);
}

.ncae-character[data-expression="happy"] .ncae-expression-mark,
.ncae-character[data-expression="touched"] .ncae-expression-mark {
  transform: translateY(-2px) scale(1.12);
  opacity: 1;
}

.ncae-character[data-expression="happy"] .ncae-character-image {
  filter: brightness(1.055) saturate(1.09);
  transform: translateY(-1.5%);
}

.ncae-character[data-expression="touched"] {
  --ncae-expression-glow: rgba(255, 137, 174, 0.45);
}

.ncae-character[data-expression="touched"] .ncae-character-image {
  filter: brightness(1.06) saturate(1.12);
  transform: translateY(-1.5%) scale(1.015);
}

@media (prefers-reduced-motion: reduce) {
  .ncae-character-image,
  .ncae-expression-mark,
  .ncae-character::after {
    transition: none !important;
  }
}


/* v0.6.0 アイテム別ショートイベント */
.ncae-conversation-choice.is-event {
  border-style: solid;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(117, 76, 47, 0.12);
}

.ncae-conversation-choice.is-event::before {
  content: "✦ ";
}

.ncae-conversation-choice.is-event-next {
  font-weight: 700;
}


/* =========================================================
   v0.6.1 Visible Item Event Card
========================================================= */
.ncae-conversation.is-item-event {
  place-items: center;
  padding: 24px 18px;
}

.ncae-conversation.is-item-event .ncae-conversation-backdrop {
  background:
    radial-gradient(circle at 50% 42%, rgba(126, 87, 146, 0.20), transparent 38%),
    rgba(18, 12, 22, 0.76);
  backdrop-filter: blur(9px) saturate(0.9);
  -webkit-backdrop-filter: blur(9px) saturate(0.9);
}

.ncae-conversation-panel.is-item-event {
  width: min(100%, 470px);
  max-height: min(72vh, 560px);
  padding: 34px 24px 24px;
  overflow: hidden auto;
  border: 1px solid rgba(232, 200, 255, 0.50);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(155deg, rgba(255, 251, 245, 0.985), rgba(237, 224, 244, 0.985));
  box-shadow:
    0 30px 90px rgba(16, 8, 22, 0.52),
    0 0 0 6px rgba(255,255,255,0.08),
    inset 0 1px 0 rgba(255,255,255,0.92);
  text-align: center;
}

.ncae-conversation-panel.is-item-event::before {
  content: "✦";
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: linear-gradient(145deg, #8d6ca2, #6f557e);
  color: #fff;
  font-size: 26px;
  box-shadow: 0 12px 28px rgba(84, 51, 101, 0.28);
}

.ncae-conversation-panel.is-item-event .ncae-conversation-kicker {
  margin: 0 36px 10px;
  color: #7b5b8d;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-align: center;
}

.ncae-conversation-panel.is-item-event .ncae-memory-status {
  margin-inline: auto;
  opacity: 0.72;
}

.ncae-conversation-panel.is-item-event .ncae-conversation-speaker {
  margin: 14px 0 16px;
  color: #49324f;
  font-size: clamp(24px, 6vw, 31px);
  line-height: 1.35;
}

.ncae-conversation-panel.is-item-event .ncae-conversation-line {
  min-height: 5.8em;
  margin: 0 0 22px;
  padding: 18px 16px;
  border-top: 1px solid rgba(114, 79, 128, 0.15);
  border-bottom: 1px solid rgba(114, 79, 128, 0.15);
  color: #473d48;
  font-size: 16px;
  line-height: 2;
  text-align: left;
}

.ncae-conversation-panel.is-item-event .ncae-conversation-choice.is-event-next {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #7b5c8d, #5d466b);
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 26px rgba(73, 47, 86, 0.22);
}

.ncae-conversation-panel.is-item-event .ncae-conversation-finish {
  min-height: 52px;
  border: 0;
  background: linear-gradient(135deg, #6f557e, #513b5e);
  box-shadow: 0 12px 26px rgba(73, 47, 86, 0.22);
}

@media (max-width: 520px) {
  .ncae-conversation-panel.is-item-event {
    width: 100%;
    max-height: 78vh;
    padding: 28px 18px 20px;
  }

  .ncae-conversation-panel.is-item-event::before {
    width: 54px;
    height: 54px;
    font-size: 23px;
  }
}


/* =========================================================
   v0.6.2 アイテム固有イベント：光・色・短い演出
========================================================= */
.ncae-conversation.is-item-event .ncae-conversation-backdrop {
  background:
    radial-gradient(circle at 50% 46%, rgba(255,255,255,0.10), transparent 34%),
    rgba(13, 8, 18, 0.80);
  backdrop-filter: blur(5px) saturate(0.82);
}

.ncae-conversation-panel.is-item-event {
  --ncae-event-a: #8d6ca2;
  --ncae-event-b: #5d466b;
  --ncae-event-glow: rgba(173, 123, 205, 0.28);
  isolation: isolate;
  animation: ncae-event-panel-in 540ms cubic-bezier(.2,.85,.25,1) both;
}

.ncae-conversation-panel.is-item-event::before {
  content: var(--ncae-event-icon, "✦");
  position: relative;
  z-index: 2;
  background: linear-gradient(145deg, var(--ncae-event-a), var(--ncae-event-b));
  box-shadow:
    0 12px 28px color-mix(in srgb, var(--ncae-event-b) 30%, transparent),
    0 0 0 7px color-mix(in srgb, var(--ncae-event-a) 12%, transparent);
  animation: ncae-event-icon-pulse 2.2s ease-in-out infinite;
}

.ncae-conversation-panel.is-item-event::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -26%;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 34%, var(--ncae-event-glow), transparent 28%),
    radial-gradient(circle at 24% 72%, color-mix(in srgb, var(--ncae-event-a) 14%, transparent), transparent 22%),
    radial-gradient(circle at 78% 70%, color-mix(in srgb, var(--ncae-event-b) 13%, transparent), transparent 22%);
  filter: blur(8px);
  animation: ncae-event-ambient 4.8s ease-in-out infinite alternate;
}

.ncae-conversation-panel.is-item-event[data-item-event="coffee"] {
  --ncae-event-a: #c68a55;
  --ncae-event-b: #7b4c32;
  --ncae-event-glow: rgba(255, 191, 122, 0.34);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,246,220,0.96), transparent 39%),
    linear-gradient(155deg, rgba(255,250,240,0.99), rgba(238,219,197,0.99));
}

.ncae-conversation-panel.is-item-event[data-item-event="notebook"] {
  --ncae-event-a: #7e91b5;
  --ncae-event-b: #53627f;
  --ncae-event-glow: rgba(170, 192, 235, 0.30);
  background:
    radial-gradient(circle at 50% 0%, rgba(242,247,255,0.96), transparent 40%),
    linear-gradient(155deg, rgba(252,250,244,0.99), rgba(220,226,238,0.99));
}

.ncae-conversation-panel.is-item-event[data-item-event="chair"] {
  --ncae-event-a: #b98d9f;
  --ncae-event-b: #785969;
  --ncae-event-glow: rgba(235, 169, 196, 0.29);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,244,247,0.97), transparent 40%),
    linear-gradient(155deg, rgba(255,251,246,0.99), rgba(237,220,228,0.99));
}

.ncae-conversation-panel.is-item-event[data-item-event="microphone"] {
  --ncae-event-a: #8b7fc6;
  --ncae-event-b: #4f467d;
  --ncae-event-glow: rgba(156, 143, 234, 0.33);
  background:
    radial-gradient(circle at 50% 0%, rgba(238,237,255,0.94), transparent 40%),
    linear-gradient(155deg, rgba(250,248,255,0.99), rgba(218,213,238,0.99));
}

.ncae-conversation-panel.is-item-event[data-item-event="plush"] {
  --ncae-event-a: #d1a35f;
  --ncae-event-b: #826a43;
  --ncae-event-glow: rgba(255, 210, 129, 0.31);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,248,218,0.96), transparent 40%),
    linear-gradient(155deg, rgba(255,252,241,0.99), rgba(235,226,202,0.99));
}

.ncae-conversation-panel.is-item-event[data-item-event="streaming"] {
  --ncae-event-a: #6e9baa;
  --ncae-event-b: #405f6a;
  --ncae-event-glow: rgba(110, 199, 218, 0.27);
  background:
    radial-gradient(circle at 50% 0%, rgba(230,250,255,0.94), transparent 40%),
    linear-gradient(155deg, rgba(248,253,253,0.99), rgba(211,229,232,0.99));
}

.ncae-conversation-panel.is-item-event .ncae-conversation-speaker {
  text-shadow: 0 8px 24px var(--ncae-event-glow);
}

.ncae-conversation-panel.is-item-event .ncae-conversation-choice.is-event-next,
.ncae-conversation-panel.is-item-event .ncae-conversation-finish {
  background: linear-gradient(135deg, var(--ncae-event-a), var(--ncae-event-b));
}

.ncae-stage[data-ncae-event]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 52%, rgba(255,255,255,0.12), transparent 38%);
  animation: ncae-stage-event-flash 900ms ease-out both;
}

.ncae-stage[data-ncae-event="coffee"]::after {
  background: radial-gradient(circle at 31% 56%, rgba(255,196,126,0.30), transparent 21%);
}
.ncae-stage[data-ncae-event="notebook"]::after {
  background: radial-gradient(circle at 55% 30%, rgba(180,205,255,0.27), transparent 22%);
}
.ncae-stage[data-ncae-event="chair"]::after {
  background: radial-gradient(circle at 72% 59%, rgba(255,184,213,0.24), transparent 22%);
}
.ncae-stage[data-ncae-event="microphone"]::after {
  background: radial-gradient(circle at 69% 37%, rgba(186,174,255,0.30), transparent 20%);
}
.ncae-stage[data-ncae-event="plush"]::after {
  background: radial-gradient(circle at 84% 86%, rgba(255,218,140,0.27), transparent 20%);
}
.ncae-stage[data-ncae-event="streaming"]::after {
  background: radial-gradient(circle at 26% 31%, rgba(143,221,238,0.25), transparent 22%);
}

@keyframes ncae-event-panel-in {
  from { opacity: 0; transform: translateY(18px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ncae-event-icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@keyframes ncae-event-ambient {
  from { transform: scale(0.96) rotate(-1deg); opacity: 0.72; }
  to { transform: scale(1.04) rotate(1deg); opacity: 1; }
}

@keyframes ncae-stage-event-flash {
  0% { opacity: 0; }
  28% { opacity: 1; }
  100% { opacity: 0.34; }
}

@media (prefers-reduced-motion: reduce) {
  .ncae-conversation-panel.is-item-event,
  .ncae-conversation-panel.is-item-event::before,
  .ncae-conversation-panel.is-item-event::after,
  .ncae-stage[data-ncae-event]::after {
    animation: none !important;
  }
}


/* =========================================================
   v0.6.3 明確なイベント開始演出
========================================================= */
.ncae-conversation.is-event-announcing .ncae-conversation-panel {
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}

.ncae-event-announcement {
  position: fixed;
  z-index: 1000002;
  left: 50%;
  top: 50%;
  width: min(86vw, 430px);
  transform: translate(-50%, -50%);
  padding: 30px 24px 28px;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.23), transparent 42%),
    linear-gradient(145deg, rgba(53,35,65,0.97), rgba(20,13,27,0.98));
  color: #fff;
  text-align: center;
  box-shadow:
    0 30px 100px rgba(0,0,0,0.62),
    0 0 0 8px rgba(255,255,255,0.05);
  animation: ncae-event-announcement-in 480ms cubic-bezier(.18,.88,.2,1.12) both;
}

.ncae-event-announcement.is-leaving {
  animation: ncae-event-announcement-out 360ms ease-in both;
}

.ncae-event-announcement-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: linear-gradient(145deg, #cfa3ef, #6e4f82);
  font-size: 36px;
  box-shadow: 0 14px 34px rgba(177,117,219,0.34);
}

.ncae-event-announcement-label {
  margin-bottom: 10px;
  color: #eacfff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.ncae-event-announcement-title {
  font-size: clamp(25px, 6.2vw, 34px);
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 10px 30px rgba(0,0,0,0.34);
}

.ncae-object.is-event-focus {
  z-index: 20 !important;
  animation: ncae-event-object-focus 1.5s ease-in-out infinite;
  filter: brightness(1.14) saturate(1.15) drop-shadow(0 0 18px rgba(255,236,176,0.92));
}

@keyframes ncae-event-announcement-in {
  from { opacity: 0; transform: translate(-50%, -44%) scale(0.78); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes ncae-event-announcement-out {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -55%) scale(1.06); }
}

@keyframes ncae-event-object-focus {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.045); }
}

@media (max-width: 520px) {
  .ncae-event-announcement {
    width: min(88vw, 390px);
    padding: 26px 18px 24px;
  }

  .ncae-event-announcement-icon {
    width: 66px;
    height: 66px;
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ncae-event-announcement,
  .ncae-event-announcement.is-leaving,
  .ncae-object.is-event-focus {
    animation: none !important;
  }
}

/* =========================================================
   v0.8.0 Time System / Game Dialogue Window
========================================================= */
.ncae-time-status {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(100%, 620px);
  margin: 0 auto 12px;
  padding: 10px 13px;
  border: 1px solid rgba(94, 78, 116, 0.18);
  border-radius: 14px;
  background: rgba(247, 244, 255, 0.9);
  color: #514963;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.ncae-time-icon {
  flex: 0 0 auto;
  font-size: 20px;
}

.ncae-time-label {
  min-width: 0;
}

.ncae-conversation-panel:not(.is-item-event) {
  width: min(100%, 620px);
  padding: 18px 16px 16px;
  border: 2px solid rgba(221, 205, 255, 0.78);
  border-radius: 18px 18px 10px 10px;
  background:
    linear-gradient(180deg, rgba(35, 29, 56, 0.98), rgba(19, 18, 34, 0.98));
  box-shadow:
    0 0 0 3px rgba(33, 27, 52, 0.82),
    0 20px 60px rgba(10, 7, 22, 0.52);
  color: #fff;
}

.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-kicker {
  color: rgba(218, 207, 255, 0.72);
}

.ncae-conversation-panel:not(.is-item-event) .ncae-memory-status {
  border-color: rgba(218, 207, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #efeaff;
}

.ncae-dialogue-window {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  margin: 2px 0 14px;
}

.ncae-dialogue-portrait {
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 128px;
  overflow: hidden;
  border: 1px solid rgba(232, 223, 255, 0.28);
  border-radius: 12px 12px 6px 6px;
  background: radial-gradient(circle at 50% 30%, rgba(154, 127, 219, 0.32), rgba(255, 255, 255, 0.04) 70%);
}

.ncae-dialogue-portrait img {
  display: block;
  width: 92px;
  max-width: none;
  height: auto;
  transform: translateY(5px);
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.35));
}

.ncae-dialogue-body {
  position: relative;
  min-height: 128px;
  padding: 18px 16px 24px;
  border: 1px solid rgba(235, 228, 255, 0.28);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
}

.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-speaker {
  display: inline-block;
  margin: -30px 0 10px -4px;
  padding: 5px 13px;
  border: 1px solid rgba(235, 228, 255, 0.5);
  border-radius: 7px;
  background: #6d5597;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-line {
  min-height: 4.8em;
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.8;
  cursor: pointer;
}

.ncae-conversation-line.is-typing::after {
  content: "▋";
  margin-left: 2px;
  animation: ncae-dialogue-cursor 0.75s steps(1) infinite;
}

.ncae-dialogue-next {
  position: absolute;
  right: 10px;
  bottom: 5px;
  color: #dcd1ff;
  font-size: 11px;
  animation: ncae-dialogue-next 0.9s ease-in-out infinite;
}

.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-choice {
  border-color: rgba(221, 209, 255, 0.27);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  box-shadow: none;
}

.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-choice:active {
  background: rgba(255, 255, 255, 0.16);
}

.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-finish {
  background: #74599d;
}

.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ncae-conversation-panel.is-item-event .ncae-dialogue-window {
  display: block;
  margin: 0;
}

.ncae-conversation-panel.is-item-event .ncae-dialogue-portrait,
.ncae-conversation-panel.is-item-event .ncae-dialogue-next {
  display: none;
}

.ncae-conversation-panel.is-item-event .ncae-dialogue-body {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

@keyframes ncae-dialogue-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes ncae-dialogue-next {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(3px); opacity: 1; }
}

@media (max-width: 480px) {
  .ncae-conversation {
    padding: 10px;
  }

  .ncae-conversation-panel:not(.is-item-event) {
    padding: 15px 12px 12px;
  }

  .ncae-dialogue-window {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 8px;
  }

  .ncae-dialogue-portrait,
  .ncae-dialogue-body {
    min-height: 116px;
  }

  .ncae-dialogue-portrait img {
    width: 78px;
  }

  .ncae-dialogue-body {
    padding: 17px 12px 22px;
  }

  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-line {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ncae-dialogue-next,
  .ncae-conversation-line.is-typing::after {
    animation: none !important;
  }
}

/* v0.8.1: WordPressの自動目次をゲーム会話画面へ混入させない */
.ncae-conversation-panel .ez-toc-container,
.ncae-conversation-panel #ez-toc-container,
.ncae-conversation-panel .lwptoc,
.ncae-conversation-panel .toc,
.ncae-conversation-panel .toc-container,
.ncae-conversation-panel .table-of-contents,
.ncae-conversation-panel nav[aria-label*="目次"],
.ncae-conversation-panel nav[aria-label*="Table of Contents"] {
  display: none !important;
}


/* v0.8.2: 時間帯・天候連動ルームBGM */
.ncae-bgm-control {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 10px 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(103, 79, 131, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  color: #59476e;
}

.ncae-bgm-toggle {
  appearance: none;
  border: 1px solid rgba(103, 79, 131, 0.32);
  border-radius: 999px;
  padding: 7px 13px;
  background: #6d5689;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ncae-bgm-toggle[aria-pressed="false"] {
  background: #817b87;
}

.ncae-bgm-now {
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .ncae-bgm-control {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }

  .ncae-bgm-toggle {
    width: 100%;
  }
}


.ncae-version-switcher-wrap {
  margin-top: 14px;
  padding: 14px 12px 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(26, 19, 41, 0.96), rgba(38, 31, 61, 0.96));
  border: 1px solid rgba(255,255,255,0.08);
}

.ncae-version-switcher-title {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.78);
}

.ncae-version-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ncae-version-button {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.03);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1;
}

.ncae-version-button.is-active {
  background: linear-gradient(135deg, #8f66ff, #6d57d4);
  border-color: rgba(255,255,255,0.38);
}


/* =========================================================
   v0.8.10.49 女性向け会話・きずな可視化 試作
========================================================= */
.ncae-bond-card {
  margin: 0 0 14px;
  padding: 11px 12px 10px;
  border: 1px solid rgba(229, 211, 255, 0.25);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(177, 137, 224, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ncae-bond-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.ncae-bond-relation {
  color: #fff3fc;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.ncae-bond-value {
  flex: 0 0 auto;
  color: #eadfff;
  font-size: 11px;
  font-weight: 700;
}

.ncae-bond-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 6, 18, 0.45);
}

.ncae-bond-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #cda7ff, #ffb7d8 58%, #ffe2aa);
  box-shadow: 0 0 10px rgba(255, 187, 222, 0.42);
  transition: width 360ms ease;
}

.ncae-bond-next {
  margin-top: 7px;
  color: rgba(244, 236, 255, 0.84);
  font-size: 11px;
  line-height: 1.5;
}

.ncae-bond-card .ncae-memory-status {
  display: block;
  min-height: 0;
  margin: 5px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 235, 246, 0.75);
  font-size: 10px;
  font-weight: 700;
}

.ncae-conversation-panel.is-item-event .ncae-bond-card {
  display: none;
}

@media (max-width: 520px) {
  .ncae-bond-card-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}


/* v0.8.10.50 きずな獲得タイミング可視化 */
.ncae-bond-rule { margin-top:7px; font-size:11px; line-height:1.5; color:rgba(90,54,82,.76); text-align:center; }
.ncae-bond-gain { margin-top:8px; padding:8px 10px; border:1px solid rgba(230,160,201,.65); border-radius:999px; background:rgba(255,244,251,.96); box-shadow:0 5px 16px rgba(145,75,120,.13); color:#7c3567; font-size:12px; font-weight:700; line-height:1.4; text-align:center; opacity:0; transform:translateY(5px) scale(.97); }
.ncae-bond-gain.is-showing { animation:ncae-bond-gain-pop 2.4s ease both; }
.ncae-bond-track.is-gaining { animation:ncae-bond-track-glow .9s ease; }
@keyframes ncae-bond-gain-pop { 0%{opacity:0;transform:translateY(7px) scale(.96)} 14%,75%{opacity:1;transform:translateY(0) scale(1)} 100%{opacity:0;transform:translateY(-4px) scale(.99)} }
@keyframes ncae-bond-track-glow { 0%,100%{box-shadow:none} 45%{box-shadow:0 0 0 4px rgba(231,139,193,.22),0 0 14px rgba(231,139,193,.35)} }


/* =========================================================
   v0.8.10.51 — ゲーム内セーブポイント
   ========================================================= */
.ncae-savepoint {
  width: min(94%, 680px);
  margin: 12px auto 0;
  padding: 14px;
  border: 1px solid rgba(120, 86, 52, 0.28);
  border-radius: 16px;
  background: rgba(255, 250, 241, 0.92);
  box-sizing: border-box;
}

.ncae-savepoint-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ncae-savepoint-title {
  font-weight: 700;
  color: #5b3c29;
}

.ncae-savepoint-description {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.55;
  color: #765d4b;
}

.ncae-savepoint-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(118, 80, 46, 0.1);
  color: #69472f;
  font-size: 11px;
  white-space: nowrap;
}

.ncae-savepoint-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.ncae-savepoint-button {
  min-height: 42px;
  border: 1px solid rgba(110, 73, 43, 0.3);
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ncae-savepoint-button.is-save {
  background: #775035;
  color: #fffaf3;
}

.ncae-savepoint-button.is-load {
  background: #fffaf3;
  color: #66432d;
}

.ncae-savepoint-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ncae-savepoint-message {
  min-height: 1.4em;
  margin-top: 8px;
  font-size: 12px;
  color: #765d4b;
  text-align: center;
}

@media (max-width: 520px) {
  .ncae-savepoint-head {
    display: block;
  }

  .ncae-savepoint-status {
    display: inline-block;
    margin-top: 8px;
  }
}


/* =========================================================
   v0.8.10.53 — 今日の交流・気分・表情連動
   ========================================================= */
.ncae-daily-status,
.ncae-mood-status {
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(150, 101, 135, 0.2);
  border-radius: 12px;
  background: rgba(255, 250, 253, 0.78);
}

.ncae-daily-row,
.ncae-mood-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #653e5a;
  font-size: 12px;
}

.ncae-daily-hint {
  margin-top: 4px;
  color: rgba(90, 54, 82, 0.72);
  font-size: 11px;
  line-height: 1.45;
}

.ncae-mood-track {
  position: relative;
  height: 8px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 83, 113, 0.14);
}

.ncae-mood-fill {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c69bb7, #e9a3c8);
  transition: width 0.35s ease;
}

.ncae-dialogue-portrait img {
  transition: opacity 0.16s ease, transform 0.2s ease;
}

.ncae-dialogue-portrait img[data-mood="good"] {
  transform: translateY(-1px) scale(1.015);
}

.ncae-dialogue-portrait img[data-mood="happy"] {
  transform: translateY(-2px) scale(1.03);
}


/* =========================================================
   v0.8.10.57 モバイル会話画面の選択しやすさ改善
   ========================================================= */
@media (max-width: 520px) {
  .ncae-conversation {
    place-items: start center;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 8px;
  }

  .ncae-conversation-panel {
    max-height: min(84vh, 760px);
  }

  .ncae-conversation-panel:not(.is-item-event) {
    padding: 12px 10px 10px;
  }

  .ncae-bond-card {
    margin: 0 0 10px;
    padding: 8px 9px 8px;
  }

  .ncae-bond-next,
  .ncae-bond-rule,
  .ncae-bond-card .ncae-memory-status,
  .ncae-daily-hint,
  .ncae-daily-row,
  .ncae-mood-row {
    font-size: 10px;
  }

  .ncae-daily-status,
  .ncae-mood-status {
    margin-top: 6px;
    padding: 7px 8px;
  }

  .ncae-dialogue-window {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 7px;
    margin: 0 0 10px;
  }

  .ncae-dialogue-portrait,
  .ncae-dialogue-body {
    min-height: 102px;
  }

  .ncae-dialogue-portrait img {
    width: 66px;
  }

  .ncae-dialogue-body {
    padding: 14px 10px 18px;
  }

  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-speaker {
    margin: -24px 0 8px -2px;
    padding: 4px 10px;
    font-size: 14px;
  }

  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-line {
    min-height: 4.2em;
    font-size: 14px;
    line-height: 1.65;
  }

  .ncae-conversation-choices {
    gap: 8px;
  }

  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-choice,
  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-finish {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.4;
  }
}


/* =========================================================
   v0.8.10.59 — 会話枠内ちびキャラの全身収まり調整
   ========================================================= */
.ncae-dialogue-portrait {
  padding: 4px 3px 0;
  box-sizing: border-box;
}

.ncae-dialogue-portrait img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: calc(100% - 2px) !important;
  object-fit: contain;
  object-position: center bottom;
  transform: none !important;
}

/* 気分差分では画像を拡大せず、枠外へはみ出さない */
.ncae-dialogue-portrait img[data-mood="good"],
.ncae-dialogue-portrait img[data-mood="happy"] {
  transform: none !important;
}

@media (max-width: 520px) {
  .ncae-dialogue-portrait {
    padding: 3px 2px 0;
  }

  .ncae-dialogue-portrait img {
    max-width: 100% !important;
    max-height: calc(100% - 1px) !important;
  }
}


/* =========================================================
   v0.8.10.61 — 会話キャラクター一括サイズ統一
   ========================================================= */
.ncae-dialogue-window {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
}

.ncae-dialogue-portrait,
.ncae-dialogue-body {
  min-height: 154px;
}

.ncae-dialogue-portrait {
  --ncae-portrait-scale: 1.14;
  --ncae-portrait-offset-x: 0px;
  --ncae-portrait-offset-y: 0px;
  padding: 4px 3px 0;
}

.ncae-dialogue-portrait img {
  width: auto !important;
  height: auto !important;
  max-width: 94% !important;
  max-height: 94% !important;
  object-fit: contain;
  object-position: center bottom;
  transform:
    translate(
      var(--ncae-portrait-offset-x),
      var(--ncae-portrait-offset-y)
    )
    scale(var(--ncae-portrait-scale)) !important;
  transform-origin: center bottom;
}

/* 気分差分も同じ基準サイズを維持する */
.ncae-dialogue-portrait img[data-mood="good"],
.ncae-dialogue-portrait img[data-mood="happy"] {
  transform:
    translate(
      var(--ncae-portrait-offset-x),
      var(--ncae-portrait-offset-y)
    )
    scale(var(--ncae-portrait-scale)) !important;
}

@media (max-width: 520px) {
  .ncae-dialogue-window {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
  }

  .ncae-dialogue-portrait,
  .ncae-dialogue-body {
    min-height: 126px;
  }

  .ncae-dialogue-portrait {
    padding: 3px 2px 0;
  }

  .ncae-dialogue-portrait img {
    max-width: 94% !important;
    max-height: 94% !important;
  }
}


/* =========================================================
   v0.8.10.63 — キャラクター主役の会話ウインドウ
   ========================================================= */
.ncae-conversation-panel:not(.is-item-event) {
  width: min(94vw, 760px);
  padding: 14px;
  border: 1px solid rgba(235, 228, 255, 0.34);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(31, 24, 52, 0.96), rgba(20, 16, 36, 0.98));
  box-shadow: 0 22px 60px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
}
.ncae-bond-card {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  border-color: rgba(232,223,255,.16);
}
.ncae-bond-next,
.ncae-bond-rule,
.ncae-bond-card .ncae-memory-status,
.ncae-daily-hint,
.ncae-daily-status,
.ncae-mood-status { opacity: .72; }
.ncae-dialogue-window {
  grid-template-columns: minmax(150px, 34%) minmax(0,1fr);
  gap: 14px;
  align-items: stretch;
  margin: 0 0 12px;
}
.ncae-dialogue-portrait {
  position: relative;
  min-height: 250px;
  padding: 10px 8px 0;
  overflow: hidden;
  border: 1px solid rgba(235,228,255,.30);
  border-radius: 18px;
  background: radial-gradient(circle at 50% 28%, rgba(185,154,255,.34), transparent 44%), linear-gradient(180deg, rgba(117,86,174,.18), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), inset 0 -18px 30px rgba(0,0,0,.18), 0 10px 26px rgba(0,0,0,.24);
}
.ncae-dialogue-portrait::before {
  content:"";
  position:absolute;
  inset:9px;
  pointer-events:none;
  border:1px solid rgba(255,255,255,.08);
  border-radius:13px;
}
.ncae-dialogue-portrait::after {
  content:"";
  position:absolute;
  left:14%; right:14%; bottom:7px;
  height:16px;
  border-radius:50%;
  background:rgba(0,0,0,.34);
  filter:blur(7px);
  pointer-events:none;
}
.ncae-dialogue-portrait img {
  position:relative;
  z-index:1;
  max-width:98% !important;
  max-height:96% !important;
  filter:drop-shadow(0 9px 10px rgba(0,0,0,.42)) drop-shadow(0 0 12px rgba(173,143,238,.16));
}
.ncae-dialogue-body {
  min-height:250px;
  padding:24px 18px 28px;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07), 0 10px 26px rgba(0,0,0,.18);
}
.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-speaker {
  margin:-36px 0 14px -2px;
  padding:6px 14px;
  border-radius:999px;
  background:linear-gradient(135deg,#7a5aa5,#51406f);
  box-shadow:0 6px 18px rgba(0,0,0,.28);
}
.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-line {
  min-height:7em;
  font-size:17px;
  line-height:1.85;
  letter-spacing:.01em;
}
.ncae-conversation-choices { gap:9px; }
.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-choice,
.ncae-conversation-panel:not(.is-item-event) .ncae-conversation-finish {
  min-height:48px;
  border-radius:15px;
  background:linear-gradient(180deg, rgba(117,88,157,.96), rgba(81,61,113,.98));
  box-shadow:0 8px 18px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.10);
}
@media (max-width:620px) {
  .ncae-conversation { place-items:start center; padding:calc(env(safe-area-inset-top,0px) + 7px) 7px 10px; }
  .ncae-conversation-panel:not(.is-item-event) { width:min(96vw,560px); max-height:92vh; padding:10px; border-radius:18px; }
  .ncae-bond-card { margin-bottom:9px; padding:7px 9px; }
  .ncae-bond-next,
  .ncae-bond-rule,
  .ncae-bond-card .ncae-memory-status,
  .ncae-daily-hint { display:none; }
  .ncae-daily-status,
  .ncae-mood-status { margin-top:4px; padding:5px 7px; }
  .ncae-dialogue-window { grid-template-columns:minmax(118px,40%) minmax(0,1fr); gap:9px; margin-bottom:9px; }
  .ncae-dialogue-portrait,
  .ncae-dialogue-body { min-height:184px; }
  .ncae-dialogue-portrait { padding:7px 5px 0; border-radius:15px; }
  .ncae-dialogue-body { padding:19px 11px 22px; border-radius:15px; }
  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-speaker { margin:-29px 0 10px -1px; padding:5px 11px; font-size:13px; }
  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-line { min-height:7.2em; font-size:14px; line-height:1.65; }
  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-choice,
  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-finish { min-height:44px; padding:10px 11px; font-size:13px; }
}
@media (max-width:390px) {
  .ncae-dialogue-window { grid-template-columns:1fr; }
  .ncae-dialogue-portrait { min-height:210px; }
  .ncae-dialogue-body { min-height:150px; }
  .ncae-conversation-panel:not(.is-item-event) .ncae-conversation-line { min-height:4.8em; }
}


/* =========================================================
   v0.8.10.65 — Character Reaction Engine
   表情と連動する4種の小さな会話リアクション
   ========================================================= */

/* 既存の衣装倍率・位置補正を維持したままアニメーションする */
.ncae-dialogue-portrait {
  --ncae-reaction-x: 0px;
  --ncae-reaction-y: 0px;
  --ncae-reaction-scale: 1;
  isolation: isolate;
}

.ncae-dialogue-portrait img {
  transform-origin: 50% 82%;
  will-change: transform, filter;
}

/* 嬉しい：軽く弾む */
.ncae-dialogue-portrait.is-react-happy img {
  animation: ncae-dialogue-happy 760ms cubic-bezier(.22,.9,.28,1);
}

/* 照れ・心を動かされた：一度小さくなり、少し近づく */
.ncae-dialogue-portrait.is-react-shy img {
  animation: ncae-dialogue-shy 900ms cubic-bezier(.22,.8,.3,1);
}

/* 困る：控えめに左右へ揺れる */
.ncae-dialogue-portrait.is-react-troubled img {
  animation: ncae-dialogue-troubled 850ms ease-in-out;
}

/* 特別反応：少し近づき、衣装に応じた光を出す */
.ncae-dialogue-portrait.is-react-special img {
  animation: ncae-dialogue-special 1150ms cubic-bezier(.18,.86,.24,1);
}

.ncae-dialogue-portrait.is-react-special::before {
  animation: ncae-dialogue-special-glow 1350ms ease-out;
}

/* 衣装ごとの雰囲気。画像は増やさず、光だけを切り替える */
.ncae-dialogue-portrait[data-outfit="yukata"] {
  --ncae-costume-glow: rgba(167, 118, 255, .46);
}
.ncae-dialogue-portrait[data-outfit="christmas"] {
  --ncae-costume-glow: rgba(255, 235, 189, .48);
}
.ncae-dialogue-portrait[data-outfit="angel"] {
  --ncae-costume-glow: rgba(222, 242, 255, .56);
}
.ncae-dialogue-portrait[data-outfit="devil"] {
  --ncae-costume-glow: rgba(179, 76, 255, .52);
}
.ncae-dialogue-portrait[data-outfit="pajama"] {
  --ncae-costume-glow: rgba(148, 183, 255, .42);
}
.ncae-dialogue-portrait[data-outfit="prince"] {
  --ncae-costume-glow: rgba(255, 223, 150, .48);
}
.ncae-dialogue-portrait[data-outfit="live"] {
  --ncae-costume-glow: rgba(222, 130, 255, .52);
}
.ncae-dialogue-portrait[data-outfit="black_rough"] {
  --ncae-costume-glow: rgba(154, 105, 224, .44);
}
.ncae-dialogue-portrait[data-outfit="newyear_lavender_kimono"],
.ncae-dialogue-portrait[data-outfit="wakakusa_kimono"] {
  --ncae-costume-glow: rgba(241, 196, 255, .46);
}
.ncae-dialogue-portrait[data-outfit="normal"] {
  --ncae-costume-glow: rgba(176, 139, 235, .42);
}

.ncae-dialogue-portrait.is-react-special {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.13),
    inset 0 -18px 30px rgba(0,0,0,.16),
    0 10px 26px rgba(0,0,0,.24),
    0 0 28px var(--ncae-costume-glow, rgba(180,140,240,.44));
}

@keyframes ncae-dialogue-happy {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  28% { transform: translate3d(0,-9px,0) scale(1.025); }
  50% { transform: translate3d(0,1px,0) scale(.995); }
  72% { transform: translate3d(0,-4px,0) scale(1.012); }
}

@keyframes ncae-dialogue-shy {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  24% { transform: translate3d(-3px,4px,0) scale(.975) rotate(-1deg); }
  62% { transform: translate3d(2px,-2px,0) scale(1.025) rotate(.5deg); }
}

@keyframes ncae-dialogue-troubled {
  0%, 100% { transform: translate3d(0,0,0) rotate(0); }
  20% { transform: translate3d(-4px,1px,0) rotate(-1.2deg); }
  40% { transform: translate3d(4px,0,0) rotate(1.2deg); }
  60% { transform: translate3d(-3px,1px,0) rotate(-.8deg); }
  80% { transform: translate3d(2px,0,0) rotate(.5deg); }
}

@keyframes ncae-dialogue-special {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  30% { transform: translate3d(0,-3px,0) scale(1.045); }
  66% { transform: translate3d(0,-1px,0) scale(1.025); }
}

@keyframes ncae-dialogue-special-glow {
  0%, 100% {
    opacity: 1;
    box-shadow: inset 0 0 0 rgba(255,255,255,0);
  }
  45% {
    opacity: 1;
    box-shadow:
      inset 0 0 26px var(--ncae-costume-glow, rgba(180,140,240,.44)),
      0 0 18px var(--ncae-costume-glow, rgba(180,140,240,.34));
  }
}

/* 動きを減らす端末・設定では、表情切替だけを維持 */
@media (prefers-reduced-motion: reduce) {
  .ncae-dialogue-portrait.is-react-happy img,
  .ncae-dialogue-portrait.is-react-shy img,
  .ncae-dialogue-portrait.is-react-troubled img,
  .ncae-dialogue-portrait.is-react-special img,
  .ncae-dialogue-portrait.is-react-special::before {
    animation: none !important;
  }
}


/* v0.8.10.68 — Scene Transition */
.ncae-lab {
  position: relative;
}

.ncae-lab::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: #05040a;
  opacity: 0;
  transition: opacity .28s ease;
}

.ncae-lab.is-scene-transitioning::after {
  opacity: 1;
}

.ncae-lab.is-scene-entered .ncae-stage {
  animation: ncae-scene-enter .36s ease both;
}

@keyframes ncae-scene-enter {
  from { opacity: .25; transform: scale(1.008); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ncae-lab::after { transition: none; }
  .ncae-lab.is-scene-entered .ncae-stage { animation: none; }
}


/* v0.8.11.0 思い出メモリー／4ルート連結 */
.ncae-story-memory{margin:14px 0;padding:14px;border:1px solid rgba(255,255,255,.22);border-radius:18px;background:rgba(10,13,24,.78);color:#fff;box-shadow:0 12px 28px rgba(0,0,0,.2)}
.ncae-story-memory-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.ncae-story-memory-title{font-weight:800}.ncae-story-memory-count,.ncae-story-memory-ending{font-size:12px;opacity:.85}.ncae-story-memory-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.ncae-story-memory-card{min-height:118px;padding:0;border:1px solid rgba(255,255,255,.18);border-radius:14px;overflow:hidden;background:rgba(255,255,255,.07);color:#fff;text-align:left}.ncae-story-memory-card img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover}.ncae-story-memory-card span,.ncae-story-memory-card small{display:block;padding:6px 8px 0}.ncae-story-memory-card small{padding-top:2px;padding-bottom:8px;opacity:.72}.ncae-story-memory-card.is-locked{text-align:center;opacity:.6}.ncae-story-memory-lock{font-size:32px;padding-top:18px!important}.ncae-story-memory-ending{margin-top:9px;text-align:right}.ncae-story-memory.is-complete{border-color:rgba(255,224,135,.6)}
.ncae-story-memory-preview{position:fixed;inset:0;z-index:100000;display:none;align-items:center;justify-content:center;flex-direction:column;padding:24px;background:rgba(0,0,0,.9)}.ncae-story-memory-preview.is-open{display:flex}.ncae-story-memory-preview img{max-width:min(94vw,1000px);max-height:78vh;border-radius:14px;object-fit:contain}.ncae-story-memory-preview-title{margin-top:12px;color:#fff;font-weight:800}.ncae-story-memory-preview-close{position:absolute;top:18px;right:18px;width:44px;height:44px;border:0;border-radius:50%;font-size:28px;background:#fff;color:#111}
@media(max-width:520px){.ncae-story-memory-grid{grid-template-columns:1fr 1fr}.ncae-story-memory-card{min-height:104px}.ncae-story-memory-card span{font-size:12px}.ncae-story-memory-card small{font-size:10px}}


/* v0.8.11.2 Existing Memory Album Slot Bridge */
.ncae-integrated-memory-card{position:relative!important;overflow:hidden!important;isolation:isolate;cursor:default}
.ncae-integrated-memory-card.is-ncae-memory-unlocked{cursor:pointer}
.ncae-integrated-memory-still{position:absolute!important;z-index:1!important;left:7px!important;right:7px!important;top:7px!important;width:calc(100% - 14px)!important;height:calc(100% - 48px)!important;object-fit:cover!important;border-radius:9px!important;margin:0!important;padding:0!important;display:block!important;box-shadow:none!important}
.ncae-integrated-memory-card.is-ncae-memory-unlocked::after{content:"";position:absolute;z-index:2;left:7px;right:7px;bottom:39px;height:35px;background:linear-gradient(to bottom,rgba(0,0,0,0),rgba(0,0,0,.62));border-radius:0 0 9px 9px;pointer-events:none}
.ncae-integrated-memory-card.is-ncae-memory-unlocked>*:not([data-ncae-integrated-still]){position:relative;z-index:4}
.ncae-integrated-memory-title{position:absolute!important;z-index:5!important;left:8px!important;right:8px!important;bottom:7px!important;min-height:31px!important;margin:0!important;padding:4px 3px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;font-size:11px!important;line-height:1.25!important;color:inherit!important;background:rgba(255,247,225,.92)!important;border-radius:7px!important;box-sizing:border-box!important}
.ncae-integrated-memory-card.is-ncae-memory-unlocked:focus-visible{outline:3px solid rgba(92,45,79,.55)!important;outline-offset:2px!important}


/* v0.8.11.3 — 固定枠・美装・回想再生 */
.ncae-integrated-memory-card.is-ncae-memory-unlocked{
  cursor:pointer!important;
  background:linear-gradient(145deg,rgba(255,250,232,.98),rgba(226,197,145,.82))!important;
  box-shadow:0 8px 20px rgba(74,42,42,.14),inset 0 0 0 1px rgba(255,255,255,.65)!important;
  transition:transform .18s ease,box-shadow .18s ease!important;
}
.ncae-integrated-memory-card.is-ncae-memory-unlocked:active{transform:scale(.985)!important}
.ncae-integrated-memory-card.is-ncae-memory-unlocked::before{
  content:"▶ 回想";
  position:absolute;
  z-index:8;
  top:9px;
  right:9px;
  padding:3px 7px;
  border:1px solid rgba(255,255,255,.55);
  border-radius:999px;
  color:#fff;
  background:rgba(61,31,55,.72);
  box-shadow:0 3px 10px rgba(0,0,0,.18);
  backdrop-filter:blur(6px);
  font-size:8px;
  line-height:1.2;
  letter-spacing:.04em;
  pointer-events:none;
}
.ncae-integrated-memory-still{
  left:8px!important;right:8px!important;top:8px!important;
  width:calc(100% - 16px)!important;height:calc(100% - 49px)!important;
  object-fit:cover!important;object-position:center center!important;
  border:1px solid rgba(255,255,255,.7)!important;
  border-radius:10px!important;
  filter:saturate(1.07) contrast(1.025)!important;
  box-shadow:0 5px 13px rgba(56,31,41,.22)!important;
}
.ncae-integrated-memory-card.is-ncae-memory-unlocked::after{
  left:8px!important;right:8px!important;bottom:40px!important;height:45px!important;
  background:linear-gradient(to bottom,rgba(18,9,19,0),rgba(18,9,19,.68))!important;
  border-radius:0 0 10px 10px!important;
}
.ncae-integrated-memory-title{
  left:7px!important;right:7px!important;bottom:6px!important;
  min-height:34px!important;padding:5px 4px!important;
  color:#4f3440!important;background:rgba(255,249,229,.97)!important;
  border:1px solid rgba(164,121,83,.28)!important;border-radius:8px!important;
  box-shadow:0 2px 7px rgba(69,39,43,.10)!important;
  font-size:10.5px!important;font-weight:800!important;line-height:1.25!important;
  text-shadow:none!important;opacity:1!important;
}
.ncae-memory-placeholder-decoration{display:none!important}
@media(min-width:600px){
  .ncae-integrated-memory-title{font-size:11px!important}
  .ncae-integrated-memory-card.is-ncae-memory-unlocked::before{font-size:9px}
}


/* v0.8.11.4 — ページ完全分離・原画無加工表示 */
.ncae-integrated-memory-card.is-ncae-memory-unlocked{
  opacity:1!important;
  filter:none!important;
  mix-blend-mode:normal!important;
}
.ncae-integrated-memory-card.is-ncae-memory-unlocked .ncae-integrated-memory-still{
  z-index:20!important;
  opacity:1!important;
  filter:none!important;
  mix-blend-mode:normal!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  box-shadow:0 4px 12px rgba(56,31,41,.18)!important;
}
.ncae-integrated-memory-card.is-ncae-memory-unlocked::after{
  z-index:21!important;
  height:30px!important;
  background:linear-gradient(to bottom,rgba(18,9,19,0),rgba(18,9,19,.42))!important;
}
.ncae-integrated-memory-card.is-ncae-memory-unlocked::before{z-index:24!important}
.ncae-integrated-memory-card.is-ncae-memory-unlocked .ncae-integrated-memory-title{z-index:23!important}
.ncae-integrated-memory-card.is-ncae-memory-unlocked [data-ncae-memory-title-node]{opacity:1!important;filter:none!important}
.ncae-integrated-memory-card .ncae-memory-slot-badge{
  position:relative!important;
  z-index:26!important;
  opacity:1!important;
  filter:none!important;
}
