.story-game-modal{width:min(950px,94vw);max-height:92dvh;padding:0;border:1px solid #d6ddd7;border-radius:20px;background:#fbfcf8;color:#263b36;box-shadow:0 30px 120px #142b3c55}
.story-game-modal::backdrop{background:#102b3488;backdrop-filter:blur(5px)}
.story-game-modal>header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:var(--space-5, 20px);padding:18px 24px;background:#fbfcf8;border-bottom:1px solid #d6ddd7}
.story-game-modal>header h2{margin:0;min-width:0;flex:1;font-family:Georgia,serif;font-size:26px}
.story-game-modal>header button{flex:0 0 auto;display:inline-grid;place-items:center;width:40px;height:40px;border:0;border-radius:50%;font-size:26px;line-height:1;background:#e8efea;color:inherit;cursor:pointer}
.story-game-body{padding:24px;line-height:1.65}.story-game-body button{min-height:44px;cursor:pointer}.story-game-body button:disabled{cursor:default;opacity:.5}
.game-permission{display:flex;gap:12px;align-items:flex-start;margin:18px 0;padding:16px;border:1px solid #d6ddd7;border-radius:12px;background:white}
.game-permission input{margin-top:6px;min-width:20px;min-height:20px;accent-color:#386b57}
.game-review-scene{margin:18px 0;padding:20px;border-radius:14px;background:#eef2e9}.game-review-scene h4{margin:0 0 12px}.game-review-scene blockquote{margin:0;padding:12px 16px;border-left:3px solid #8ca99b}
.game-framing{font-size:14px;color:#526b61}.game-stage{height:280px;position:relative;overflow:hidden;border:2px solid #9caf9e;border-radius:16px;background:linear-gradient(#d6e8df 0 68%,#92ad7c 68% 76%,#486a42 76%);touch-action:pan-y;outline-offset:4px}
.game-stage[data-art="generic-workroom"]{background:linear-gradient(#eddfca 0 68%,#c7a980 68% 76%,#856345 76%)}
.game-stage-bg{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden}
.game-world{height:100%;position:relative;will-change:transform;z-index:1}.game-player{position:absolute;bottom:67px;width:32px;height:60px;border-radius:14px 14px 7px 7px;background:#2b5b6c;z-index:1}
.game-player:before{content:"";position:absolute;top:-24px;left:4px;width:24px;height:24px;border-radius:50%;background:#d5b894}.game-player:after{content:"";position:absolute;bottom:-12px;left:4px;width:24px;height:16px;border-left:8px solid #243943;border-right:8px solid #243943;box-sizing:border-box}
.game-npc{position:absolute;bottom:67px;min-width:82px;min-height:82px;border:0;border-radius:24px 24px 6px 6px;background:#8b5f70;color:white;padding:46px 12px 8px;font-size:13px}
.game-npc:before{content:"";position:absolute;top:10px;left:calc(50% - 12px);width:24px;height:24px;border-radius:50%;background:#d9c2a1}.game-npc:disabled{opacity:.65!important}.game-npc[hidden]{display:none}
.game-controls{display:flex;justify-content:center;gap:14px;margin:16px 0}.game-controls button{border:1px solid #a3b7a6;border-radius:12px;background:white;color:inherit;font-size:18px;padding:10px 22px;touch-action:none;user-select:none}
.game-dialogue{padding:20px;border-radius:14px;background:#e9efdf;border-left:4px solid #709478}.game-text-equivalent{margin-top:24px;padding:16px;background:white;border:1px solid #d6ddd7;border-radius:12px}.game-text-equivalent summary{cursor:pointer;font-weight:600;min-height:32px}
.game-scene-label{font-weight:600}
.story-game-frame{display:block;width:100%;height:min(740px,75dvh);min-height:520px;border:0;border-radius:16px;background:#fbfcf8}
.workspace-detail.is-debug-game { overflow: hidden; }
[data-story-game-workspace] { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
[data-story-game-actions] { display: inline-flex; align-items: center; }
[data-story-game-actions]:empty { display: none; }
[data-story-game-top-version] { display: inline-flex; align-items: center; min-width: 0; }
[data-story-game-top-version]:empty { display: none; }
.workspace-detail-top > [data-story-game-top-version] .story-game-version-tag {
  font-size: 13px;
  line-height: 1.4;
  padding: 4px 12px;
  white-space: nowrap;
}
.story-game-workspace-content,
[data-story-game-mount] { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.story-game-inline-bar { display: none; }
[data-story-game-workspace] > [data-story-game-player],
[data-story-game-mount] > [data-story-game-player] { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
[data-story-game-workspace] > .story-game-body,
[data-story-game-mount] > .story-game-body { min-height: 0; overflow: auto; }
[data-story-game-workspace] .story-game-frame,
[data-story-game-mount] .story-game-frame { height: 100%; min-height: 0; border-radius: 0; }
.game-progress { display: grid; place-content: center; justify-items: center; gap: 10px; margin: 0; padding: 16px; text-align: center; }
[data-story-game-workspace] .game-progress,
[data-story-game-mount] .game-progress { height: 100%; }
.game-progress .preview-spinner { width: 1.5em; height: 1.5em; margin: 0; }

/* Style Selection Screen */
.story-game-style-selection {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 0 20px;
}
.style-selection-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.style-selection-title {
  margin: 0;
  font-family: var(--font-serif, Fraunces, "Noto Serif SC", Georgia, serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: #1f2924;
}
.style-selection-intro {
  margin: 10px 0 0;
  font-size: 14.5px;
  color: #526059;
}
.style-selection-scope-note {
  margin: 14px auto 0;
  display: inline-block;
  max-width: 640px;
  padding: 10px 18px;
  border-radius: 16px;
  background: #eff5f1;
  border: 1px solid #dce8e0;
  font-size: 13px;
  line-height: 1.6;
  color: #384d44;
}
.story-game-version-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #d6ddd7;
  border-radius: 12px;
  background: #f4f7f2;
  font-size: 13px;
  color: #365247;
}
[data-story-game-mount] > .story-game-version-bar {
  margin: 10px 14px 0;
}
.story-game-version-tag {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2ebe4;
  color: #263b36;
}
.story-game-version-note {
  flex: 1 1 200px;
}
.style-selection-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.game-style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 2px solid #d7deda;
  border-radius: 20px;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.22s ease,
              box-shadow 0.28s ease,
              background-color 0.22s ease;
  user-select: none;
  outline-offset: 3px;
}
.game-style-card:hover {
  transform: translateY(-2px);
  border-color: #aebdb6;
  box-shadow: 0 14px 32px -12px rgba(31, 41, 36, 0.1);
}
.game-style-card.is-selected {
  border-color: #1e5263;
  background: linear-gradient(180deg, #f8fbfc 0%, #f3f8fa 100%);
  box-shadow: 0 18px 36px -14px rgba(30, 82, 99, 0.18), 0 0 0 1px #1e5263, 0 0 0 4px rgba(30, 82, 99, 0.08);
}
.style-card-preview {
  width: 100%;
}
.style-card-meta {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 16px 6px 6px;
}
.style-card-meta-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.style-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.style-card-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f3f6f4;
  font-size: 18px;
  line-height: 1;
}
.style-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: #1f2924;
}
.style-card-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  background: #dfeae2;
  color: #2c5244;
  white-space: nowrap;
}
.style-card-badge.is-highlight {
  background: #f7e6ce;
  color: #94551d;
}
.style-card-desc {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #526059;
}
.style-selection-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}
.game-start-generate-btn {
  min-width: 220px;
  padding: 14px 36px;
  border-radius: 16px;
  border: 0;
  background: #2f5d50;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 24px -8px rgba(47, 93, 80, 0.45);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.game-start-generate-btn:hover:not(:disabled) {
  background: #254b40;
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -8px rgba(47, 93, 80, 0.52);
}
.game-start-generate-btn:active:not(:disabled) {
  transform: translateY(0);
}
.style-selection-selected-hint {
  margin: 0;
  font-size: 12.5px;
  color: #6d7c74;
  text-align: center;
}
.style-selection-selected-hint strong {
  font-weight: 600;
  color: #1e5263;
}

/* Pure CSS Style Preview Trailers (Zero JS Animations) */
.preview-scroller,
.preview-visual-novel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  background-color: #1c2b30;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transform: translateZ(0);
  container-type: inline-size;
}
.preview-scroller *,
.preview-visual-novel * {
  box-sizing: border-box;
}

/* Mode 1: Scroller Preview */
.preview-scroller {
  background: linear-gradient(
    180deg,
    #6d96a1 0%,
    #9db6ad 30%,
    #d8ca9f 58%,
    #efb980 82%,
    #e59a68 100%
  );
}
.sc-sun {
  position: absolute;
  top: 13%;
  right: 17%;
  width: 15%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 249, 224, 0.96) 0%,
    rgba(255, 225, 165, 0.68) 38%,
    rgba(255, 194, 120, 0.18) 70%,
    rgba(255, 194, 120, 0) 100%
  );
  animation: sc-sun-breathe 7s ease-in-out infinite alternate;
  will-change: transform, opacity;
  z-index: 1;
}
.sc-haze {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 90% 50% at 75% 58%,
    rgba(255, 224, 168, 0.34) 0%,
    rgba(255, 210, 148, 0.08) 55%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}
.sc-track {
  position: absolute;
  left: 0;
  display: flex;
  width: 200%;
  will-change: transform;
  animation-name: sc-parallax-left;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.sc-tile {
  position: relative;
  width: 50%;
  height: 100%;
  flex-shrink: 0;
}
.sc-tile svg {
  display: block;
  width: 100%;
  height: 100%;
}
.sc-clouds-far {
  top: 6%;
  height: 28%;
  opacity: 0.55;
  animation-duration: 54s;
  z-index: 2;
}
.sc-clouds-near {
  top: 12%;
  height: 30%;
  opacity: 0.78;
  animation-duration: 34s;
  z-index: 3;
}
.sc-hills-far {
  bottom: 18%;
  height: 46%;
  animation-duration: 38s;
  z-index: 4;
}
.sc-hills-mid {
  bottom: 13%;
  height: 38%;
  animation-duration: 24s;
  z-index: 5;
}
.sc-landmarks {
  bottom: 15%;
  height: 48%;
  animation-duration: 14.5s;
  z-index: 6;
}
.sc-lamp-glow {
  position: absolute;
  left: 79.3%;
  bottom: 39%;
  width: 13%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 236, 173, 0.92) 0%,
    rgba(255, 200, 108, 0.45) 36%,
    rgba(255, 176, 84, 0) 72%
  );
  animation: sc-lamp-flicker 3.6s ease-in-out infinite;
  pointer-events: none;
}
.sc-smoke {
  position: absolute;
  left: 19.8%;
  bottom: 58%;
  width: 2.2%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(255, 245, 228, 0.42);
  filter: blur(2px);
  animation: sc-smoke-rise 4.2s ease-out infinite;
}
.sc-smoke.s2 {
  animation-delay: 2.1s;
}
.sc-orbs-track {
  bottom: 16%;
  height: 44%;
  animation-duration: 11.5s;
  z-index: 7;
}
.sc-orb {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #fff8d6;
  font-size: 13px;
  font-size: clamp(10px, 3.2cqi, 14px);
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 222, 128, 0.95), 0 0 18px rgba(255, 184, 72, 0.85);
  animation: sc-orb-bob 2.8s ease-in-out infinite;
  will-change: transform;
}
.sc-orb::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 232, 156, 0.65) 0%,
    rgba(255, 198, 92, 0.22) 48%,
    rgba(255, 198, 92, 0) 75%
  );
  animation: sc-orb-pulse 2.4s ease-in-out infinite;
}
.sc-orb.o1 { left: 26%; bottom: 32%; animation-delay: 0s; }
.sc-orb.o2 { left: 58%; bottom: 44%; animation-delay: -0.9s; }
.sc-orb.o3 { left: 87%; bottom: 28%; animation-delay: -1.7s; }
.sc-ground {
  bottom: 0;
  height: 20%;
  animation-duration: 7.5s;
  z-index: 9;
}
.sc-hero-wrap {
  position: absolute;
  left: 22%;
  bottom: 14.5%;
  width: 10.5%;
  aspect-ratio: 1 / 1.35;
  z-index: 8;
  pointer-events: none;
}
.sc-hero-shadow {
  position: absolute;
  left: 16%;
  bottom: -3%;
  width: 66%;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(13, 27, 29, 0.58) 0%, transparent 72%);
  animation: sc-shadow-bob 0.72s ease-in-out infinite;
}
.sc-hero-body {
  width: 100%;
  height: 100%;
  transform-origin: 50% 95%;
  animation: sc-hero-bob 0.72s ease-in-out infinite;
  will-change: transform;
}
.sc-hero-leg-front {
  transform-origin: 48px 82px;
  animation: sc-leg-front 0.72s ease-in-out infinite;
}
.sc-hero-leg-back {
  transform-origin: 48px 82px;
  animation: sc-leg-back 0.72s ease-in-out infinite;
}
.sc-hero-scarf {
  transform-origin: 44px 44px;
  animation: sc-scarf-flutter 1.25s ease-in-out infinite alternate;
}
.sc-hero-coat {
  transform-origin: 46px 56px;
  animation: sc-coat-sway 0.72s ease-in-out infinite alternate;
}
.sc-hud-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 38, 40, 0.56);
  border: 1px solid rgba(255, 232, 175, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fdf6e2;
  font-size: 11px;
  font-size: clamp(9.5px, 2.5cqi, 11px);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.sc-hud-pill .sc-star {
  color: #ffd97d;
  text-shadow: 0 0 8px rgba(255, 217, 125, 0.85);
  animation: sc-orb-pulse 2.2s ease-in-out infinite;
}
.sc-vignette {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background: radial-gradient(
    ellipse 82% 78% at 50% 48%,
    transparent 56%,
    rgba(17, 30, 32, 0.42) 100%
  );
}
@keyframes sc-parallax-left {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@keyframes sc-sun-breathe {
  from { transform: scale(0.96); opacity: 0.88; }
  to   { transform: scale(1.06); opacity: 1; }
}
@keyframes sc-lamp-flicker {
  0%, 100% { opacity: 0.82; transform: translate(-50%, 50%) scale(0.95); }
  50%      { opacity: 1;    transform: translate(-50%, 50%) scale(1.08); }
}
@keyframes sc-smoke-rise {
  0%   { transform: translate3d(0, 0, 0) scale(0.7); opacity: 0; }
  20%  { opacity: 0.52; }
  100% { transform: translate3d(-18px, -26px, 0) scale(2.1); opacity: 0; }
}
@keyframes sc-orb-bob {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -8px, 0); }
}
@keyframes sc-orb-pulse {
  0%, 100% { opacity: 0.72; transform: scale(0.9); }
  50%      { opacity: 1;    transform: scale(1.18); }
}
@keyframes sc-hero-bob {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0.5deg); }
  50%      { transform: translate3d(0, -3.5%, 0) rotate(-1deg); }
}
@keyframes sc-shadow-bob {
  0%, 100% { transform: scaleX(1); opacity: 0.65; }
  50%      { transform: scaleX(0.84); opacity: 0.42; }
}
@keyframes sc-leg-front {
  0%, 100% { transform: rotate(19deg); }
  50%      { transform: rotate(-17deg); }
}
@keyframes sc-leg-back {
  0%, 100% { transform: rotate(-17deg); }
  50%      { transform: rotate(19deg); }
}
@keyframes sc-scarf-flutter {
  0%   { transform: rotate(-6deg) scaleX(0.95); }
  100% { transform: rotate(9deg) scaleX(1.06); }
}
@keyframes sc-coat-sway {
  0%   { transform: rotate(-2deg); }
  100% { transform: rotate(3.5deg); }
}

/* Mode 2: Visual Novel Preview */
.preview-visual-novel {
  background: #14222f;
}
.vn-camera {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  background: linear-gradient(
    180deg,
    #12202e 0%,
    #1f3649 26%,
    #444658 48%,
    #8e584e 68%,
    #d68857 84%,
    #f2bc79 100%
  );
  animation: vn-ken-burns 20s ease-in-out infinite alternate;
  will-change: transform;
  z-index: 1;
}
.vn-stars {
  position: absolute;
  inset: 0 0 52% 0;
  background-image:
    radial-gradient(1.5px 1.5px at 14% 24%, rgba(255, 245, 224, 0.85), transparent),
    radial-gradient(1px 1px at 28% 15%, rgba(255, 245, 224, 0.65), transparent),
    radial-gradient(1.5px 1.5px at 46% 22%, rgba(255, 245, 224, 0.78), transparent),
    radial-gradient(1px 1px at 62% 14%, rgba(255, 245, 224, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 78% 28%, rgba(255, 245, 224, 0.72), transparent),
    radial-gradient(1px 1px at 88% 18%, rgba(255, 245, 224, 0.6), transparent);
  animation: vn-stars-twinkle 5.5s ease-in-out infinite alternate;
}
.vn-horizon-glow {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 82%;
  height: 56%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at 50% 78%,
    rgba(255, 206, 134, 0.72) 0%,
    rgba(232, 136, 82, 0.36) 38%,
    rgba(170, 86, 72, 0.1) 66%,
    transparent 80%
  );
  animation: vn-horizon-breathe 6.5s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
.vn-mist {
  position: absolute;
  left: -10%;
  bottom: 24%;
  width: 120%;
  height: 22%;
  background: radial-gradient(
    ellipse 60% 50% at 50% 60%,
    rgba(255, 214, 158, 0.28) 0%,
    rgba(255, 186, 128, 0.08) 55%,
    transparent 80%
  );
  animation: vn-mist-drift 12s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
.vn-scene-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.vn-window-warmth {
  animation: vn-window-flicker 4.4s ease-in-out infinite alternate;
}
.vn-window-halo {
  position: absolute;
  left: 23.5%;
  bottom: 39.5%;
  width: 19%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 205, 112, 0.56) 0%,
    rgba(240, 152, 72, 0.2) 45%,
    transparent 74%
  );
  animation: vn-window-flicker 4.4s ease-in-out infinite alternate;
  pointer-events: none;
}
.vn-tree-canopy-1 {
  transform-origin: 730px 140px;
  animation: vn-branch-sway 6.2s ease-in-out infinite alternate;
}
.vn-tree-canopy-2 {
  transform-origin: 760px 210px;
  animation: vn-branch-sway 7.8s ease-in-out infinite alternate-reverse;
}
.vn-embers {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.vn-ember {
  position: absolute;
  bottom: 18%;
  width: var(--s, 4px);
  height: var(--s, 4px);
  left: var(--x, 50%);
  border-radius: 50%;
  background: #ffe9a8;
  box-shadow: 0 0 6px 2px rgba(255, 198, 96, 0.82), 0 0 14px 4px rgba(255, 148, 66, 0.35);
  opacity: 0;
  animation: vn-ember-float var(--d, 7s) ease-in-out var(--delay, 0s) infinite;
  will-change: transform, opacity;
}
.vn-hotspot {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}
.vn-hotspot-core {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff3c4;
  box-shadow: 0 0 8px 2px rgba(255, 214, 122, 0.95);
}
.vn-hotspot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 224, 148, 0.85);
  animation: vn-hotspot-sonar 2.8s cubic-bezier(0.16, 0.84, 0.44, 1) infinite;
  will-change: transform, opacity;
}
.vn-hotspot-ring.r2 {
  animation-delay: 1.4s;
}
.vn-hotspot.h1 { left: 23.5%; top: 57%; }
.vn-hotspot.h2 { left: 74%;   top: 49%; }
.vn-hotspot.h3 { left: 50%;   top: 63%; }
.vn-vignette {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: radial-gradient(
    ellipse 86% 80% at 50% 45%,
    transparent 52%,
    rgba(10, 18, 25, 0.56) 100%
  );
}
.vn-dialogue {
  position: absolute;
  left: 4.5%;
  right: 4.5%;
  bottom: 4.8%;
  z-index: 8;
  padding: 12px 15px 10px;
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    rgba(16, 27, 35, 0.78) 0%,
    rgba(11, 20, 27, 0.88) 100%
  );
  border: 1px solid rgba(235, 198, 134, 0.42);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 236, 196, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.vn-nameplate {
  position: absolute;
  top: -11px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #243b49 0%, #192b36 100%);
  border: 1px solid rgba(235, 198, 134, 0.55);
  color: #f6dfb2;
  font-size: 10px;
  font-size: clamp(8.5px, 2.3cqi, 10px);
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.vn-nameplate::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f2c36b;
  box-shadow: 0 0 6px #f2c36b;
}
.vn-auto-badge {
  position: absolute;
  top: 7px;
  right: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: rgba(242, 219, 178, 0.65);
}
.vn-auto-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e9b963;
  animation: sc-orb-pulse 1.8s ease-in-out infinite;
}
.vn-text-stage {
  position: relative;
  height: 3.05em;
  margin-top: 2px;
  padding-right: 16px;
  overflow: hidden;
  font-size: 11.5px;
  font-size: clamp(9.5px, 3cqi, 12.5px);
  line-height: 1.45;
  color: #f4efe4;
  letter-spacing: 0.02em;
}
.vn-line {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  will-change: clip-path, opacity;
}
.vn-line-1 {
  animation: vn-dialogue-cycle-1 12s linear infinite;
}
.vn-line-2 {
  animation: vn-dialogue-cycle-2 12s linear infinite;
}
.vn-continue {
  position: absolute;
  right: 11px;
  bottom: 7px;
  color: #f2c56d;
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(242, 197, 109, 0.7);
  animation: vn-arrow-bounce 1.2s ease-in-out infinite;
}
@keyframes vn-ken-burns {
  0%   { transform: scale(1.01) translate3d(-1.4%, 0.4%, 0); }
  100% { transform: scale(1.08) translate3d(1.4%, -1.4%, 0); }
}
@keyframes vn-stars-twinkle {
  0%   { opacity: 0.52; }
  100% { opacity: 0.95; }
}
@keyframes vn-horizon-breathe {
  0%   { opacity: 0.76; transform: translateX(-50%) scale(0.96); }
  100% { opacity: 1;    transform: translateX(-50%) scale(1.07); }
}
@keyframes vn-mist-drift {
  0%   { transform: translate3d(-3%, 0, 0); opacity: 0.65; }
  100% { transform: translate3d(3%, -4%, 0); opacity: 0.95; }
}
@keyframes vn-window-flicker {
  0%, 100% { opacity: 0.84; }
  45%      { opacity: 1; }
  72%      { opacity: 0.9; }
}
@keyframes vn-branch-sway {
  0%   { transform: rotate(-1.6deg); }
  100% { transform: rotate(1.8deg); }
}
@keyframes vn-ember-float {
  0%   { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
  18%  { opacity: 0.92; }
  52%  { transform: translate3d(var(--drift, 14px), -55px, 0) scale(1); opacity: 0.78; }
  82%  { opacity: 0.85; }
  100% { transform: translate3d(calc(var(--drift, 14px) * -0.6), -118px, 0) scale(0.45); opacity: 0; }
}
@keyframes vn-hotspot-sonar {
  0%   { transform: scale(0.35); opacity: 0.95; }
  100% { transform: scale(1.95); opacity: 0; }
}
@keyframes vn-dialogue-cycle-1 {
  0%   { opacity: 1; clip-path: inset(0 100% 0 0); }
  16%  { opacity: 1; clip-path: inset(0 0% 0 0); }
  44%  { opacity: 1; clip-path: inset(0 0% 0 0); }
  49%  { opacity: 0; clip-path: inset(0 0% 0 0); }
  100% { opacity: 0; clip-path: inset(0 100% 0 0); }
}
@keyframes vn-dialogue-cycle-2 {
  0%, 50% { opacity: 0; clip-path: inset(0 100% 0 0); }
  51%     { opacity: 1; clip-path: inset(0 100% 0 0); }
  67%     { opacity: 1; clip-path: inset(0 0% 0 0); }
  94%     { opacity: 1; clip-path: inset(0 0% 0 0); }
  99%     { opacity: 0; clip-path: inset(0 0% 0 0); }
  100%    { opacity: 0; clip-path: inset(0 100% 0 0); }
}
@keyframes vn-arrow-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.78; }
  50%      { transform: translateY(3px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .preview-scroller *,
  .preview-visual-novel * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .vn-line-1 {
    opacity: 1 !important;
    clip-path: inset(0 0 0 0) !important;
  }
  .vn-line-2 {
    opacity: 0 !important;
  }
}

/* AVG Mode Player Styles */
.avg-player {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 480px;
  background: #14110f;
  color: #f5ebd6;
  font-family: "PingFang SC", "Noto Serif SC", "Songti SC", Georgia, serif;
  overflow: hidden;
  user-select: none;
}
.avg-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: linear-gradient(to bottom, rgba(20, 17, 15, 0.85) 0%, rgba(20, 17, 15, 0) 100%);
  pointer-events: none;
}
.avg-top-bar > * {
  pointer-events: auto;
}
.avg-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avg-act-badge {
  background: rgba(24, 19, 16, 0.75);
  border: 1px solid rgba(226, 168, 87, 0.4);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 13px;
  color: #e2a857;
  font-weight: 600;
}
.avg-top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avg-ctrl-btn {
  background: rgba(24, 19, 16, 0.75);
  border: 1px solid rgba(245, 235, 214, 0.25);
  color: #f5ebd6;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.avg-ctrl-btn:hover {
  background: rgba(226, 168, 87, 0.2);
  border-color: #e2a857;
}
.avg-ctrl-btn.is-active {
  background: #e2a857;
  color: #14110f;
  font-weight: 600;
}
.avg-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.avg-background {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.avg-bg-illustration,
.avg-bg-atlas,
.avg-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}
.avg-hint-bar {
  position: absolute;
  top: 56px;
  left: 18px;
  right: 18px;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.avg-location-pill,
.avg-hint-text {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.78);
  border: 1px solid rgba(226, 168, 87, 0.35);
  color: #f5ebd6;
  font-size: 12px;
  line-height: 1.4;
  backdrop-filter: blur(6px);
}
.avg-location-pill {
  color: #e2a857;
  font-weight: 600;
}
.avg-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #e2a857;
  background: rgba(24, 19, 16, 0.55);
  color: #ffdf9a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: avgPulse 2.4s infinite;
  z-index: 5;
}
.avg-hotspot.is-visited {
  border-color: rgba(245, 235, 214, 0.55);
  background: rgba(24, 19, 16, 0.45);
  color: #cfe3c4;
  animation: none;
}
.avg-hotspot-dot {
  font-size: 15px;
  line-height: 1;
}
.avg-hotspot-label {
  position: absolute;
  top: 50px;
  white-space: nowrap;
  background: rgba(24, 19, 16, 0.9);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid rgba(226, 168, 87, 0.45);
  color: #f5ebd6;
  pointer-events: none;
}
@keyframes avgPulse {
  0% { box-shadow: 0 0 0 0 rgba(226, 168, 87, 0.65); }
  70% { box-shadow: 0 0 0 16px rgba(226, 168, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 168, 87, 0); }
}
.avg-dialogue-box {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, 94%);
  background: rgba(24, 19, 16, 0.88);
  border: 1px solid rgba(226, 168, 87, 0.4);
  border-radius: 14px;
  padding: 20px 24px 14px;
  box-shadow: 0 16px 40px rgba(14, 20, 18, 0.56);
  z-index: 10;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.avg-speaker-plate {
  display: inline-block;
  background: #e2a857;
  color: #14110f;
  padding: 2px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}
.avg-speaker-role {
  display: inline-block;
  font-size: 12px;
  color: #a89f91;
  margin-left: 8px;
}
.avg-dialogue-text {
  font-size: 17px;
  line-height: 1.7;
  color: #f5ebd6;
  min-height: 52px;
  white-space: pre-wrap;
}
.avg-dialogue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(245, 235, 214, 0.12);
}
.avg-continue-hint {
  font-size: 12px;
  color: #e2a857;
  text-align: center;
  flex: 1 1 auto;
  animation: avgBlink 1.8s infinite;
}
.avg-nav-btn {
  background: rgba(245, 235, 214, 0.1);
  border: 1px solid rgba(245, 235, 214, 0.25);
  color: #f5ebd6;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.avg-nav-btn:hover:not(:disabled) {
  border-color: #e2a857;
  background: rgba(226, 168, 87, 0.2);
}
.avg-nav-btn.is-primary {
  background: rgba(226, 168, 87, 0.22);
  border-color: #e2a857;
  color: #ffe3aa;
  font-weight: 600;
}
.avg-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
@keyframes avgBlink {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.avg-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(226, 168, 87, 0.3);
}
.avg-branch-btn {
  background: rgba(226, 168, 87, 0.15);
  border: 1px solid #e2a857;
  color: #f5ebd6;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.avg-branch-btn.is-visited {
  border-color: rgba(182, 214, 168, 0.65);
  background: rgba(130, 175, 118, 0.18);
}
.avg-branch-btn.is-primary {
  background: #e2a857;
  color: #14110f;
  font-weight: 600;
}
.avg-branch-btn:hover {
  background: #e2a857;
  color: #14110f;
  font-weight: 600;
}
.avg-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(380px, 85%);
  background: rgba(20, 17, 15, 0.95);
  border-left: 1px solid rgba(226, 168, 87, 0.4);
  z-index: 30;
  padding: 24px;
  overflow-y: auto;
  box-shadow: -10px 0 30px rgba(14, 20, 18, 0.65);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.avg-drawer.is-open {
  transform: translateX(0);
}
.avg-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(226, 168, 87, 0.3);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.avg-drawer-title {
  margin: 0;
  font-size: 18px;
  color: #e2a857;
}
.avg-drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #f5ebd6;
  cursor: pointer;
}
.avg-drawer-item {
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid #e2a857;
}
.avg-drawer-item-title {
  font-weight: 600;
  font-size: 14px;
  color: #e2a857;
  margin-bottom: 4px;
}
.avg-drawer-item-desc {
  font-size: 13px;
  color: #d1c7b7;
  line-height: 1.5;
}
.avg-ui-hidden .avg-top-bar,
.avg-ui-hidden .avg-hint-bar,
.avg-ui-hidden .avg-dialogue-box {
  opacity: 0;
  pointer-events: none;
}

/* Trailer / Preview Animation During Generation */
.story-game-trailer {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 760px;
  width: 100%;
  margin: auto;
  padding: 20px 18px;
  box-sizing: border-box;
}
.trailer-stage {
  position: relative;
  height: 290px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #d6ddd7;
  box-shadow: 0 18px 42px rgba(20, 43, 60, 0.14);
  background: #1a1613;
}
.trailer-overlay-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.78);
  border: 1px solid rgba(226, 168, 87, 0.45);
  color: #f5ebd6;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.trailer-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2a857;
  animation: trailerPulseDot 1.6s ease-in-out infinite;
}
.trailer-style-chip {
  padding-left: 8px;
  border-left: 1px solid rgba(245, 235, 214, 0.25);
  color: #e2a857;
}
@keyframes trailerPulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* AVG Trailer Scene */
.trailer-avg-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 35%, #463223 0%, #241b16 55%, #120e0c 100%);
  overflow: hidden;
}
.trailer-avg-pan {
  position: absolute;
  inset: -8%;
  animation: trailerAvgPan 14s ease-in-out infinite alternate;
}
@keyframes trailerAvgPan {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.08) translate(-2%, -1.5%); }
}
.trailer-avg-glow {
  position: absolute;
  top: 18%;
  left: 48%;
  width: 240px;
  height: 240px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 168, 87, 0.35) 0%, rgba(226, 168, 87, 0) 70%);
}
.trailer-avg-horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(226, 168, 87, 0.35), transparent);
}
.trailer-avg-silhouette {
  position: absolute;
  bottom: 24%;
  background: rgba(18, 14, 12, 0.72);
}
.trailer-avg-silhouette.is-house {
  left: 24%;
  width: 110px;
  height: 68px;
  clip-path: polygon(0 45%, 50% 0, 100% 45%, 100% 100%, 0 100%);
}
.trailer-avg-silhouette.is-tree {
  right: 22%;
  width: 58px;
  height: 92px;
  border-radius: 50% 50% 18% 18%;
}
.trailer-avg-ember {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(247, 210, 142, 0.85);
  box-shadow: 0 0 10px rgba(226, 168, 87, 0.9);
  animation: trailerEmberFloat 6s ease-in-out infinite;
}
.trailer-avg-ember.is-e1 { left: 20%; bottom: 32%; animation-delay: 0s; }
.trailer-avg-ember.is-e2 { left: 54%; bottom: 42%; animation-delay: 1.8s; }
.trailer-avg-ember.is-e3 { left: 76%; bottom: 30%; animation-delay: 3.1s; }
@keyframes trailerEmberFloat {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  30% { opacity: 0.95; }
  100% { transform: translateY(-85px) scale(1.1); opacity: 0; }
}
.trailer-avg-hotspot {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #e2a857;
  background: rgba(226, 168, 87, 0.28);
  animation: avgPulse 2.4s infinite;
}
.trailer-avg-hotspot.is-h1 { left: 29%; top: 48%; }
.trailer-avg-hotspot.is-h2 { left: 68%; top: 40%; animation-delay: 1.2s; }
.trailer-avg-dialogue {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 4;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(24, 19, 16, 0.88);
  border: 1px solid rgba(226, 168, 87, 0.4);
  color: #f5ebd6;
  backdrop-filter: blur(8px);
}
.trailer-avg-speaker {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  background: #e2a857;
  color: #14110f;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}
.trailer-cursor {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 12px;
  color: #e2a857;
  animation: avgBlink 1.2s infinite;
}

/* Scroller Trailer Scene */
.trailer-scroller-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #d7ebe2 0%, #eef2e5 60%, #99b587 60%, #4b6d46 100%);
  overflow: hidden;
}
.trailer-scroller-sky {
  position: absolute;
  inset: 0 0 40% 0;
}
.trailer-cloud {
  position: absolute;
  width: 96px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  animation: trailerCloudDrift 16s linear infinite;
}
.trailer-cloud.is-c1 { top: 24%; left: 100%; animation-delay: -4s; }
.trailer-cloud.is-c2 { top: 42%; left: 100%; width: 72px; height: 22px; animation-delay: -11s; }
@keyframes trailerCloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(-900px); }
}
.trailer-scroller-hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 36%;
  height: 64px;
  background: radial-gradient(120px 60px at 20% 100%, #86a37c 98%, transparent),
    radial-gradient(160px 75px at 55% 100%, #76956d 98%, transparent),
    radial-gradient(130px 55px at 86% 100%, #86a37c 98%, transparent);
  opacity: 0.7;
}
.trailer-scroller-midground {
  position: absolute;
  left: 0;
  width: 200%;
  bottom: 30%;
  height: 82px;
  animation: trailerParallaxScroll 11s linear infinite;
}
@keyframes trailerParallaxScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.trailer-landmark {
  position: absolute;
  bottom: 0;
  background: #355346;
  border-radius: 10px 10px 0 0;
  opacity: 0.75;
}
.trailer-landmark.is-l1 { left: 18%; width: 32px; height: 56px; border-radius: 50% 50% 4px 4px; }
.trailer-landmark.is-l2 { left: 48%; width: 64px; height: 48px; }
.trailer-landmark.is-l3 { left: 76%; width: 36px; height: 62px; border-radius: 50% 50% 4px 4px; }
.trailer-memory-orb {
  position: absolute;
  bottom: 58px;
  font-size: 16px;
  color: #d9822b;
  animation: trailerFloatOrb 2.2s ease-in-out infinite;
}
.trailer-memory-orb.is-o1 { left: 34%; }
.trailer-memory-orb.is-o2 { left: 66%; animation-delay: 1s; }
@keyframes trailerFloatOrb {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.trailer-scroller-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: linear-gradient(180deg, #5d8054 0%, #3d5a39 100%);
  border-top: 3px solid #b4c8a6;
}
.trailer-scroller-hero {
  position: absolute;
  left: 22%;
  bottom: 30%;
  width: 26px;
  height: 46px;
  border-radius: 10px 10px 4px 4px;
  background: #2b5b6c;
  animation: trailerWalkBob 0.65s ease-in-out infinite;
}
.trailer-scroller-hero::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d5b894;
}
@keyframes trailerWalkBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.trailer-scroller-caption-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(251, 252, 248, 0.92);
  border: 1px solid rgba(53, 83, 70, 0.25);
  color: #263b36;
}

.trailer-caption {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  transition: opacity 0.22s ease;
}
.trailer-caption.is-fading {
  opacity: 0.25;
}

/* Trailer Status Panel & Pipeline Steps */
.trailer-status-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 14px;
  background: #fbfcf8;
  border: 1px solid #d6ddd7;
  text-align: center;
}
.trailer-status-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.trailer-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #263b36;
}
.trailer-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #526b61;
}
.trailer-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.trailer-step {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef2e9;
  color: #6b7f74;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}
.trailer-step.is-done {
  background: #e1ece3;
  color: #2e5d45;
  border-color: #a3c2ab;
}
.trailer-step.is-active {
  background: #2b5b6c;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(43, 91, 108, 0.28);
}

.game-error-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  padding: 20px;
}
.game-error-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
@media (prefers-reduced-motion: reduce) {
  .trailer-avg-pan,
  .trailer-avg-ember,
  .trailer-avg-hotspot,
  .trailer-cloud,
  .trailer-scroller-midground,
  .trailer-scroller-hero,
  .trailer-memory-orb,
  .trailer-live-dot,
  .trailer-cursor {
    animation: none;
  }
}
@media (max-width: 760px) {
  .story-shell:has(#chat-scroll) .workspace-detail.is-debug-game { flex-basis: 70%; max-height: 70%; }
}
@media(max-width:600px){.story-game-body{padding:16px}.story-game-modal>header{padding:16px}.game-stage{height:240px}.game-player,.game-npc{bottom:55px}.game-controls button{padding:10px 18px}}
@media(prefers-reduced-motion:reduce){.game-world{will-change:auto}}

.story-game-page{max-width:1100px;margin:0 auto;padding:var(--space-6,24px) clamp(16px,4vw,48px) 64px}.game-page-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px;padding-bottom:20px;border-bottom:1px solid var(--line,#d5ddd6)}.game-page-header a{font-size:24px;font-family:var(--font-serif,Georgia,serif);font-weight:700;color:var(--ink,#263b36);text-decoration:none}.game-example-notice{padding:12px 18px;border-radius:var(--radius-md,12px);background:var(--sage,#eaf0e4);color:var(--green-dark,#395444)}.story-game-page .story-game-frame{height:min(760px,80dvh);min-height:560px}.game-sharing{display:grid;gap:var(--form-gap,16px);margin-top:24px;padding:var(--space-6,24px);border:1px solid var(--line,#d5ddd6);border-radius:var(--radius-xl,18px);background:var(--white,#fbfcf8)}.game-sharing h2,.game-sharing p{margin:0}.game-sharing form{display:grid;gap:var(--form-gap,16px)}.game-sharing label{display:grid;gap:var(--field-gap,8px);color:var(--green-dark,#314b40)}.game-sharing input,.game-sharing select{display:block;box-sizing:border-box;width:100%;max-width:650px;min-height:var(--control-height,46px);padding:var(--control-padding,10px 12px);border:var(--control-border,1px solid #9caf9e);border-radius:var(--control-radius,10px);background:var(--control-bg,white);color:var(--control-ink,#263b36);font:inherit;font-size:var(--control-font-size,16px)}.game-sharing button{justify-self:start;min-height:44px;border:1px solid var(--line-strong,#9caf9e);border-radius:var(--control-radius,10px);padding:10px 16px;background:var(--sage,#e8eee1);color:var(--green-dark,#263b36);font:inherit}.game-sharing li{display:flex;gap:12px;align-items:center;justify-content:space-between;margin:12px 0}.game-sharing ul{padding:0;list-style:none}
.game-scene-option { padding: 12px 0; border-bottom: 1px solid #d9d2c4; }
.game-scene-option label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.game-scene-option input { min-width: 22px; min-height: 22px; margin-top: 3px; }
.game-scene-option small { display: inline-block; margin-inline-start: 10px; color: #45604b; }
.game-scene-option p { margin: 6px 0 8px 32px; }
.game-scene-option blockquote { margin: 12px; white-space: pre-wrap; }
[data-scene-selection] fieldset { margin: 18px 0; padding: 12px 18px; border: 1px solid #d9d2c4; border-radius: 12px; }
[data-scene-selection] legend { padding: 0 6px; font-weight: 650; }
[data-scene-count] { width: 86px; margin: 8px 16px; padding: 10px; }
.game-cost-hint { padding: 12px; background: #f3eedf; border-radius: 8px; color: #57472c; }
