@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&display=swap');

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

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

@keyframes vnSpriteIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes vnBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.vn-choice-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.vn-sprite-pos-btns {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid #ecece8;
  border-radius: 7px;
  background: #f6f6f3;
}

.vn-sprite-pos-btn {
  width: 24px;
  height: 22px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #8a8a84;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.vn-sprite-pos-btn:hover {
  background: #ecece8;
  color: #333;
}

.vn-sprite-pos-btn--active {
  background: #fff;
  color: #1c1c1a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.vn-play-click-layer {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 1;
}

.vn-play-dialogue {
  position: absolute;
  left: 50%;
  bottom: 4vh;
  transform: translateX(-50%);
  width: min(880px, 92vw);
  cursor: pointer;
  z-index: 2;
  pointer-events: auto;
}

.vn-play-dialogue-name {
  position: absolute;
  left: 26px;
  bottom: 100%;
  z-index: 4;
  display: inline-block;
  margin: 0 0 -1px;
  padding: 6px 18px;
  border-radius: 9px 9px 0 0;
  background: rgba(10, 10, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.vn-play-dialogue:has(.vn-play-dialogue-name) .vn-play-dialogue-box {
  border-top-left-radius: 0;
}

.vn-play-dialogue-box {
  background: rgba(10, 10, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 20px 28px 22px 24px;
  backdrop-filter: blur(10px);
  min-height: 84px;
  box-sizing: border-box;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.vn-play-dialogue-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.vn-play-dialogue-avatar__initial {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  color: #fff;
}

.vn-play-dialogue-text {
  flex: 1;
  min-width: 0;
}

.vn-play-dialogue-line {
  font-size: 18px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
}

.vn-play-dialogue-caret {
  width: 9px;
  height: 18px;
  background: rgba(255, 255, 255, 0.7);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: vnBlink 0.9s infinite;
}

.vn-play-dialogue-hint {
  margin-top: 8px;
  text-align: right;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.1em;
}

.vn-play-composition {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 8;
  pointer-events: none;
  --vn-sprite-top: 56px;
  --vn-dialogue-reserve: calc(4vh + min(190px, 22vh));
}

.vn-play-sprites {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--vn-sprite-top);
  bottom: var(--vn-dialogue-reserve);
  width: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.vn-play-sprite {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(24vw, 220px);
  height: 100%;
  max-height: 100%;
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.vn-play-sprite--left {
  left: clamp(8px, 3vw, 24px);
  z-index: 2;
}

.vn-play-sprite--center {
  left: 50%;
  width: min(26vw, 240px);
  transform: translateX(-50%);
  z-index: 3;
}

.vn-play-sprite--right {
  right: clamp(8px, 3vw, 24px);
  z-index: 2;
}

.vn-play-sprite--speaking {
  z-index: 5;
}

@keyframes vnSpriteShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes vnSpriteBounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-14px); }
  70% { transform: translateY(-4px); }
}

@keyframes vnSpriteFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes vnSpriteSlideLeft {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes vnSpriteSlideRight {
  from { transform: translateX(-40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes vnSpriteSlideLeftCenter {
  from { transform: translateX(calc(-50% + 40px)); opacity: 0; }
  to { transform: translateX(-50%); opacity: 1; }
}

@keyframes vnSpriteSlideRightCenter {
  from { transform: translateX(calc(-50% - 40px)); opacity: 0; }
  to { transform: translateX(-50%); opacity: 1; }
}

.vn-play-sprite.vn-sprite-anim--shake {
  animation: vnSpriteShake 0.55s ease-in-out;
}

.vn-play-sprite.vn-sprite-anim--bounce {
  animation: vnSpriteBounce 0.65s ease-out;
}

.vn-play-sprite.vn-sprite-anim--fadeIn {
  animation: vnSpriteFadeIn 0.5s ease-out;
}

.vn-play-sprite--center.vn-sprite-anim--slideLeft {
  animation: vnSpriteSlideLeftCenter 0.55s ease-out both;
}

.vn-play-sprite--center.vn-sprite-anim--slideRight {
  animation: vnSpriteSlideRightCenter 0.55s ease-out both;
}
.vn-play-sprite--left.vn-sprite-anim--slideLeft,
.vn-play-sprite--right.vn-sprite-anim--slideLeft {
  animation: vnSpriteSlideLeft 0.55s ease-out both;
}

.vn-play-sprite--left.vn-sprite-anim--slideRight,
.vn-play-sprite--right.vn-sprite-anim--slideRight {
  animation: vnSpriteSlideRight 0.55s ease-out both;
}

.vn-play-sprite-img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.32));
}

.vn-play-sprite-ph {
  width: 100%;
  height: min(200px, 72%);
  max-height: 200px;
  border-radius: 100px 100px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 16%;
  box-sizing: border-box;
}

.vn-play-sprite-ph__initial {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.88);
}

.vn-play-sprite-ph__emo {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-family: monospace;
}

.vn-play-choices {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-height: min(58vh, 520px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 48px 5vw max(20px, env(safe-area-inset-bottom, 20px));
  box-sizing: border-box;
  background: linear-gradient(
    to top,
    rgba(8, 8, 14, 0.94) 0%,
    rgba(8, 8, 14, 0.82) 55%,
    rgba(8, 8, 14, 0.35) 85%,
    transparent 100%
  );
  pointer-events: auto;
  animation: vnFadeIn 0.4s ease;
  -webkit-overflow-scrolling: touch;
}

.vn-play-choices button,
.vn-play-choices .vn-choice-disabled {
  width: min(620px, 90vw);
  flex-shrink: 0;
}

.vn-play-choices button {
  pointer-events: auto;
}

.vn-play-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.vn-play-icon-btn {
  pointer-events: auto;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 10, 16, 0.62);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}

.vn-play-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.42);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.34);
}

.vn-play-icon-btn:active {
  transform: translateY(0) scale(0.96);
}

.vn-play-icon-btn--active {
  background: rgba(91, 91, 214, 0.55);
  border-color: rgba(160, 160, 255, 0.72);
  color: #fff;
  box-shadow: 0 4px 20px rgba(91, 91, 214, 0.35);
}

.vn-play-icon-svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.vn-play-icon-svg--muted {
  color: rgba(255, 255, 255, 0.88);
}

.vn-play-icon-btn--sound-off {
  color: rgba(232, 160, 160, 0.95);
}

.vn-play-icon-btn--sound-off:hover {
  color: #f0b0b0;
}

.vn-play-icon-btn--menu {
  color: rgba(255, 255, 255, 0.9);
}

.vn-play-toast {
  position: absolute;
  top: 68px;
  right: 12px;
  z-index: 34;
  max-width: min(320px, 70vw);
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e8d9a0;
  font-size: 13px;
  animation: vnFadeIn 0.3s ease;
  pointer-events: none;
}

.vn-play-menu-overlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  background: rgba(5, 5, 8, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: vnFadeIn 0.2s ease;
}

.vn-play-menu-drawer {
  --vn-menu-accent: #d4b483;
  --vn-menu-accent-soft: rgba(212, 180, 131, 0.22);
  --vn-menu-accent-glow: rgba(212, 180, 131, 0.35);
  --vn-menu-surface: rgba(255, 255, 255, 0.05);
  --vn-menu-surface-hover: rgba(255, 255, 255, 0.09);
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background:
    radial-gradient(ellipse 120% 80% at 0% 0%, rgba(91, 76, 140, 0.18), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 100%, rgba(212, 180, 131, 0.08), transparent 50%),
    linear-gradient(168deg, #16141f 0%, #0e1018 48%, #12101a 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  animation: vnMenuSlideIn 0.24s ease;
}

@keyframes vnMenuSlideIn {
  from {
    transform: translateX(-100%);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.vn-play-menu-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
}

.vn-play-menu-header__brand {
  flex: 1;
  min-width: 0;
}

.vn-play-menu-header__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vn-play-menu-scene {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vn-menu-accent);
  line-height: 1.45;
  word-break: break-word;
  opacity: 0.85;
}

.vn-play-menu-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.vn-play-menu-close svg {
  width: 18px;
  height: 18px;
}

.vn-play-menu-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.vn-play-menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 180, 131, 0.35) transparent;
}

.vn-play-menu-body::-webkit-scrollbar {
  width: 5px;
}

.vn-play-menu-body::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(212, 180, 131, 0.35);
}

.vn-menu-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vn-menu-section--footer {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.vn-menu-section__label {
  padding: 0 8px 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.vn-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--vn-menu-surface);
  color: rgba(255, 255, 255, 0.92);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.vn-menu-row:hover {
  background: var(--vn-menu-surface-hover);
  border-color: rgba(255, 255, 255, 0.08);
}

.vn-menu-row:active {
  transform: scale(0.985);
}

.vn-menu-row--quiet {
  background: transparent;
}

.vn-menu-row--quiet:hover {
  background: rgba(255, 255, 255, 0.05);
}

.vn-menu-row__icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vn-menu-row__icon svg {
  width: 20px;
  height: 20px;
}

.vn-menu-row__icon--gold {
  background: var(--vn-menu-accent-soft);
  color: var(--vn-menu-accent);
}

.vn-menu-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vn-menu-row__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
}

.vn-menu-row__sub {
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vn-menu-row__badge {
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--vn-menu-accent-soft);
  color: var(--vn-menu-accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
}

.vn-menu-row__chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.28);
}

.vn-menu-row__chevron svg {
  width: 18px;
  height: 18px;
}

.vn-menu-row--toggle.vn-skip-active,
.vn-menu-row--toggle.vn-autoplay-active {
  background: rgba(107, 92, 168, 0.2);
  border-color: rgba(140, 125, 200, 0.25);
}

.vn-menu-row--toggle.vn-skip-active .vn-menu-row__title,
.vn-menu-row--toggle.vn-autoplay-active .vn-menu-row__title {
  color: #fff;
}

.vn-menu-switch {
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  transition: background 0.2s ease;
}

.vn-menu-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}

.vn-menu-row--toggle.vn-skip-active .vn-menu-switch,
.vn-menu-row--toggle.vn-autoplay-active .vn-menu-switch {
  background: var(--vn-menu-accent-glow);
}

.vn-menu-row--toggle.vn-skip-active .vn-menu-switch__thumb,
.vn-menu-row--toggle.vn-autoplay-active .vn-menu-switch__thumb {
  transform: translateX(18px);
}

.vn-menu-speed {
  margin-top: 4px;
  padding: 4px 4px 0;
}

.vn-menu-speed__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 8px;
  padding: 0 6px;
}

.vn-menu-speed__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.vn-menu-speed__btn {
  min-height: 38px;
  padding: 0 6px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.vn-menu-speed__btn:hover {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.06);
}

.vn-menu-speed__btn--active {
  background: var(--vn-menu-accent-soft);
  color: var(--vn-menu-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.vn-toolbar-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.3);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.vn-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.vn-skip-active,
.vn-autoplay-active {
  background: rgba(91, 91, 214, 0.45);
  border-color: rgba(140, 140, 255, 0.55);
  color: #fff;
}

.vn-speed-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: rgba(14, 14, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
}

.vn-speed-preset {
  min-height: 44px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.vn-speed-preset:hover {
  background: rgba(255, 255, 255, 0.1);
}

.vn-speed-preset--active {
  background: rgba(91, 91, 214, 0.35);
  color: #fff;
}

.vn-continue-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.vn-continue-panel {
  width: min(420px, 92vw);
  background: rgba(14, 14, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 28px 24px;
  text-align: center;
}

.vn-continue-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: #fff;
  margin-bottom: 22px;
}

.vn-continue-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.vn-continue-btn {
  min-height: 44px;
  padding: 0 24px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.vn-continue-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.vn-continue-btn--primary {
  border: none;
  background: #fff;
  color: #111;
  font-weight: 600;
}

.vn-continue-btn--primary:hover {
  filter: brightness(0.9);
}

.vn-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.vn-player-name-sub {
  margin: -8px 0 16px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}

.vn-player-name-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 16px;
  outline: none;
}

.vn-player-name-input:focus {
  border-color: rgba(255, 255, 255, 0.55);
}

.vn-player-name-error {
  margin: 0 0 12px;
  color: #f0a0a0;
  font-size: 13px;
}

.vn-menu-player-name {
  padding: 10px 14px 4px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.vn-login-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(91, 91, 214, 0.18), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(40, 80, 120, 0.2), transparent 45%),
    #0b0b0f;
  font-family: 'Golos Text', system-ui, sans-serif;
  color: #fff;
}

.vn-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.vn-login-panel {
  width: min(400px, 100%);
  padding: 32px 28px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 14, 20, 0.92);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.vn-login-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #5b5bd6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.vn-login-title {
  margin: 0 0 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
}

.vn-login-sub {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.45;
}

.vn-login-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.vn-login-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 16px;
}

.vn-login-input:focus {
  outline: none;
  border-color: rgba(91, 91, 214, 0.8);
}

.vn-login-error {
  margin: 0 0 12px;
  color: #f0a0a0;
  font-size: 13px;
}

.vn-login-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 24px;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.vn-login-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.vn-login-btn:hover:not(:disabled) {
  filter: brightness(0.96);
}

/* Player endings gallery */
.vn-endings-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.vn-endings-panel {
  width: min(560px, 94vw);
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-sizing: border-box;
}

.vn-endings-header {
  position: relative;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vn-endings-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: #fff;
}

.vn-endings-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
}

.vn-endings-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}

.vn-endings-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.vn-endings-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vn-endings-row {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.vn-endings-row--opened .vn-endings-row-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.vn-endings-row-date {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.vn-endings-row--locked {
  opacity: 0.55;
  border-style: dashed;
}

.vn-endings-row--locked .vn-endings-row-title {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.12em;
}

/* Player affinity overlay */
.vn-affinity-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.vn-affinity-panel {
  width: min(420px, 94vw);
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-sizing: border-box;
}

.vn-affinity-header {
  position: relative;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vn-affinity-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: #fff;
}

.vn-affinity-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 18px;
  cursor: pointer;
}

.vn-affinity-list {
  overflow-y: auto;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vn-affinity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vn-affinity-row__name {
  font-size: 15px;
  color: #fff;
}

.vn-affinity-row__value {
  font-size: 18px;
  font-weight: 600;
  color: #e8a0c8;
  min-width: 2ch;
  text-align: right;
}

/* Phase 6: journal overlay */
.vn-journal-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.vn-journal-panel {
  width: min(560px, 94vw);
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-sizing: border-box;
}

.vn-journal-header {
  position: relative;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vn-journal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: #fff;
}

.vn-journal-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.vn-journal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}

.vn-journal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.vn-journal-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vn-journal-empty {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.vn-journal-row {
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vn-journal-row-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.vn-journal-row-text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

/* Phase 6: routes overlay */
.vn-routes-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.vn-routes-panel {
  width: min(520px, 94vw);
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-sizing: border-box;
}

.vn-routes-header {
  position: relative;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vn-routes-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: #fff;
}

.vn-routes-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}

.vn-routes-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.vn-routes-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vn-routes-empty {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.vn-routes-row {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vn-routes-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vn-routes-row-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.vn-routes-row-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.vn-routes-row-percent {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.vn-routes-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.vn-routes-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.vn-routes-row-meta {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

/* Phase 6: achievements overlay */
.vn-achievements-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.vn-achievements-panel {
  width: min(560px, 94vw);
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-sizing: border-box;
}

.vn-achievements-header {
  position: relative;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vn-achievements-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: #fff;
}

.vn-achievements-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.vn-achievements-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}

.vn-achievements-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.vn-achievements-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vn-achievements-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vn-achievements-row--opened {
  background: rgba(255, 215, 120, 0.08);
  border-color: rgba(255, 215, 120, 0.2);
}

.vn-achievements-row--locked {
  background: rgba(255, 255, 255, 0.03);
  opacity: 0.65;
}

.vn-achievements-row-icon {
  font-size: 22px;
  flex: 0 0 auto;
  line-height: 1;
}

.vn-achievements-row-main {
  flex: 1;
  min-width: 0;
}

.vn-achievements-row-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.vn-achievements-row-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.6);
}

/* Player CG gallery */
.vn-cg-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.vn-cg-panel {
  width: min(640px, 94vw);
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-sizing: border-box;
}

.vn-cg-header {
  position: relative;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vn-cg-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: #fff;
}

.vn-cg-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
}

.vn-cg-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 18px;
  cursor: pointer;
}

.vn-cg-grid {
  overflow-y: auto;
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.vn-cg-row {
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vn-cg-row--locked {
  min-height: 100px;
  align-items: center;
  justify-content: center;
}

.vn-cg-row--locked .vn-cg-row-title {
  color: rgba(255, 255, 255, 0.35);
  font-size: 18px;
}

.vn-cg-row-title {
  font-size: 13px;
  color: #fff;
  line-height: 1.3;
}

.vn-cg-row-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.vn-cg-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
}

.vn-play-icon-btn--rollback {
  min-width: 44px;
  min-height: 44px;
  font-size: 18px;
  font-weight: 600;
}

.vn-rollback-disabled {
  opacity: 0.4;
  pointer-events: none;
}

::selection {
  background: #5b5bd633;
}

input,
textarea,
select,
button {
  font-family: 'Golos Text', sans-serif;
}

/* ——— Library page ——— */
.vn-lib-page {
  min-height: 100vh;
  font-family: 'Golos Text', sans-serif;
  background: #f5f5f3;
  color: #1c1c1a;
  padding: 0 0 96px;
}

.vn-lib-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 8px;
}

.vn-lib-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
}

.vn-lib-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.vn-lib-main {
  padding: 8px 24px 24px;
}

.vn-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vn-lib-card {
  background: #fff;
  border: 1px solid #e4e4e0;
  border-radius: 12px;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vn-lib-card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.vn-lib-card-meta {
  margin: 0;
  font-size: 13px;
  color: #8a8a84;
}

.vn-lib-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.vn-lib-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e4e4e0;
  background: #fff;
  color: #1c1c1a;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.vn-lib-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.vn-lib-btn--primary {
  border: none;
  color: #fff;
  font-weight: 600;
}

.vn-lib-btn--primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.vn-lib-btn--ghost:hover:not(:disabled) {
  background: #f2f2ef;
}

.vn-lib-btn--danger {
  border-color: transparent;
  background: transparent;
}

.vn-lib-btn--danger:hover:not(:disabled) {
  border-color: #e4c4c4;
  background: #fff5f5;
}

.vn-lib-state {
  text-align: center;
  padding: 48px 24px;
  color: #55554f;
}

.vn-lib-state--error p {
  margin: 0 0 16px;
  color: #c04040;
}

.vn-lib-muted {
  font-size: 14px;
  color: #8a8a84;
  margin: 8px 0 20px;
}

.vn-lib-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid #e4e4e0;
  border-top-color: #5b5bd6;
  border-radius: 50%;
  animation: vnLibSpin 0.8s linear infinite;
}

@keyframes vnLibSpin {
  to {
    transform: rotate(360deg);
  }
}

.vn-lib-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 24px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(91, 91, 214, 0.35);
  z-index: 100;
}

.vn-lib-fab:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.vn-lib-fab:hover:not(:disabled) {
  filter: brightness(1.08);
}

.vn-lib-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  max-width: min(90vw, 420px);
  padding: 14px 20px;
  background: #1c1c1a;
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 200;
  animation: vnFadeIn 0.25s ease;
}

.vn-pe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 26, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 12px;
  box-sizing: border-box;
}

.vn-pe-modal {
  width: min(980px, 98vw);
  max-height: 94vh;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.vn-pe-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #ecece8;
}

.vn-pe-title {
  font-size: 17px;
  font-weight: 600;
  color: #1c1c1a;
}

.vn-pe-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: #8a8a84;
  line-height: 1.4;
}

.vn-pe-icon-btn {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: #b0b0aa;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
}

.vn-pe-icon-btn:hover {
  color: #1c1c1a;
  background: #f4f4f0;
}

.vn-pe-body {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  gap: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.vn-pe-sidebar {
  padding: 14px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid #ecece8;
}

.vn-pe-sidebar--image {
  border-right: none;
  border-left: 1px solid #ecece8;
}

.vn-pe-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a0a09a;
  margin-top: 4px;
}

.vn-pe-tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.vn-pe-tool-btn {
  min-height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid #e4e4e0;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.vn-pe-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #55554f;
}

.vn-pe-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.vn-pe-color {
  width: 100%;
  height: 44px;
  border: 1px solid #e4e4e0;
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  box-sizing: border-box;
}

.vn-pe-range {
  width: 100%;
  accent-color: #5b5bd6;
}

.vn-pe-field-val {
  font-size: 11px;
  color: #8a8a84;
  text-align: right;
}

.vn-pe-num {
  width: 64px;
  height: 40px;
  border: 1px solid #e4e4e0;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 13px;
}

.vn-pe-size-row {
  display: flex;
  gap: 8px;
}

.vn-pe-preset-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vn-pe-preset-btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #e4e4e0;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.vn-pe-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.vn-pe-swatch {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  box-sizing: border-box;
}

.vn-pe-swatch:hover {
  transform: scale(1.1);
}

.vn-pe-canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 280px;
  overflow: auto;
  background: #f8f8f6;
}

.vn-pe-canvas-stage {
  padding: 10px;
  background: repeating-conic-gradient(#ecece8 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  border-radius: 12px;
  border: 1px solid #e4e4e0;
}

.vn-pe-canvas {
  display: block;
  object-fit: fill;
  image-rendering: pixelated;
  touch-action: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  user-select: none;
  -webkit-user-drag: none;
}

.vn-pe-crop-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.vn-pe-file-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #e4e4e0;
  border-radius: 8px;
  background: #fbfbfa;
  font-size: 12.5px;
  color: #55554f;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

.vn-pe-file-btn input {
  display: none;
}

.vn-pe-file-btn:hover {
  border-color: #5b5bd6;
  color: #5b5bd6;
}

.vn-pe-action {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #e4e4e0;
  background: #fff;
  font-size: 12.5px;
  color: #55554f;
  cursor: pointer;
  font-family: inherit;
}

.vn-pe-action--primary {
  border: none;
  color: #fff;
  font-weight: 600;
}

.vn-pe-action--danger {
  color: #c04040;
  border-color: #f0d0d0;
}

.vn-pe-fit-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vn-pe-fit-btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #e4e4e0;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.vn-pe-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 18px 16px;
  border-top: 1px solid #ecece8;
}

.vn-pe-footer-btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid #e4e4e0;
  background: #fff;
  color: #55554f;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.vn-pe-footer-btn--primary {
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0 24px;
}

@media (max-width: 820px) {
  .vn-pe-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .vn-pe-sidebar {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid #ecece8;
  }

  .vn-pe-modal {
    max-height: 96vh;
    overflow-y: auto;
  }
}

/* Player & editor images — data URLs must use src=, not CSS url() (DC splits on ';'). */
.vn-play-stage {
  position: fixed;
  inset: 0;
  transition: opacity 0.4s ease, background 0.9s ease;
}

.vn-scene-fade-out {
  opacity: 0;
}

.vn-scene-fade-in {
  opacity: 0;
}

.vn-play-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.vn-play-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.vn-bg-thumb {
  width: 44px;
  height: 30px;
  border-radius: 6px;
  flex: 0 0 auto;
  border: 1px solid #e4e4e0;
  object-fit: cover;
}

.vn-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.vn-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.vn-editor-sidebar-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 250px;
  min-height: 0;
  overflow: hidden;
  transition: width 0.22s ease;
}

.vn-editor-sidebar-wrap--collapsed {
  width: 32px;
}

.vn-editor-sidebar {
  width: 250px;
  height: 100%;
  flex: 0 0 auto;
  background: #fbfbfa;
  border-right: 1px solid #e4e4e0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: opacity 0.16s ease, transform 0.22s ease;
}

.vn-editor-sidebar-wrap--collapsed .vn-editor-sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
}

.vn-editor-sidebar-toggle {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 6;
  width: 32px;
  height: 64px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #e4e4e0;
  border-left: none;
  border-radius: 0 10px 10px 0;
  background: #fff;
  color: #8a8a84;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 0 8px rgba(20, 20, 30, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vn-editor-sidebar-toggle::before {
  content: '‹';
}

.vn-editor-sidebar-toggle:hover {
  background: #f2f2ef;
  color: #55554f;
}

.vn-editor-sidebar-wrap--collapsed .vn-editor-sidebar-toggle::before {
  content: '›';
}

.vn-editor-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 8px 8px 0;
  flex: 0 0 auto;
}

.vn-editor-tab {
  height: 32px;
  min-height: 32px;
  border: none;
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1.1;
  cursor: pointer;
  font-weight: 500;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vn-editor-scene-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.vn-editor-scene-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vn-editor-filter-chip {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #e4e4e0;
  border-radius: 999px;
  background: #fff;
  color: #55554f;
  font-size: 11.5px;
  cursor: pointer;
}

.vn-editor-filter-chip:hover {
  border-color: #b9b9b2;
}

.vn-editor-filter-chip--active {
  background: #eeeefb;
  border-color: #5b5bd6;
  color: #3a3a8a;
  font-weight: 600;
}

.vn-editor-scene-search-wrap {
  position: relative;
}

.vn-editor-scene-search {
  width: 100%;
  box-sizing: border-box;
  height: 32px;
  border: 1px solid #e4e4e0;
  border-radius: 8px;
  padding: 0 32px 0 10px;
  font-size: 12.5px;
  outline: none;
  background: #fff;
}

.vn-editor-scene-search:focus {
  border-color: #5b5bd6;
}

.vn-editor-scene-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: #a0a09a;
  cursor: pointer;
  font-size: 12px;
}

.vn-editor-minigame-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
}

.vn-editor-minigame-badge--sm {
  font-size: 9.5px;
  padding: 1px 6px;
}

.vn-editor-graph-node--minigame {
  box-shadow: 0 2px 10px rgba(91, 91, 214, 0.12);
}

.vn-editor-canvas-hud {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e4e4e0;
  font-size: 11px;
  color: #55554f;
  box-shadow: 0 2px 8px rgba(20, 20, 30, 0.06);
}

.vn-editor-canvas-hud__clear {
  border: none;
  background: none;
  color: #5b5bd6;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.vn-editor-graph-canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.vn-editor-graph-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.vn-editor-canvas-toolbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e4e4e0;
  box-shadow: 0 2px 10px rgba(20, 20, 30, 0.08);
}

.vn-editor-canvas-toolbar__btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #e4e4e0;
  border-radius: 7px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #44443e;
  cursor: pointer;
  line-height: 1;
}

.vn-editor-canvas-toolbar__btn:hover {
  border-color: #5b5bd6;
  color: #5b5bd6;
}

.vn-editor-canvas-toolbar__btn--icon {
  min-width: 30px;
  width: 30px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.vn-editor-canvas-toolbar__zoom {
  min-width: 44px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 600;
  color: #6a6a64;
  text-align: center;
  user-select: none;
}

.vn-editor-canvas-toolbar__btn--primary {
  font-size: 11px;
  font-weight: 600;
  padding: 0 10px;
  color: #5b5bd6;
  border-color: #d8d8f4;
  background: #f8f8ff;
}

.vn-editor-canvas-toolbar__btn--primary:hover {
  background: #5b5bd6;
  color: #fff;
  border-color: #5b5bd6;
}

.vn-editor-canvas-toolbar__sep {
  width: 1px;
  height: 20px;
  background: #ecece8;
  margin: 0 2px;
}

.vn-editor-canvas-tip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  right: 220px;
  font-size: 11px;
  color: #9a9a94;
  background: #ffffffcc;
  padding: 5px 9px;
  border-radius: 6px;
  pointer-events: none;
  max-width: calc(100% - 24px);
  line-height: 1.35;
}

.vn-editor-inspector-minigame-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid #e4e4e0;
  border-radius: 10px;
  background: #fff;
}

.vn-editor-inspector-minigame-field--active {
  background: linear-gradient(180deg, #fafaff 0%, #fff 100%);
}

.vn-editor-inspector-minigame-select {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  border: 1px solid #e4e4e0;
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  padding: 0 10px;
  cursor: pointer;
  color: #1c1c1a;
}

.vn-editor-inspector-minigame-hint {
  font-size: 11px;
  color: #8a8a84;
  line-height: 1.4;
}

.vn-editor-minigame-test-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid #5b5bd6;
  border-radius: 6px;
  background: #fff;
  color: #5b5bd6;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.vn-editor-minigame-test-btn:hover {
  background: #5b5bd6;
  color: #fff;
}

.vn-editor-menu-panel {
  position: fixed;
  max-height: 320px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #ddddd7;
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(20, 20, 30, 0.18);
  padding: 4px;
  box-sizing: border-box;
  z-index: 91;
}

.vn-editor-menu-search-wrap {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  padding: 4px 4px 6px;
  border-bottom: 1px solid #ecece8;
}

.vn-editor-menu-search {
  width: 100%;
  height: 32px;
  border: 1px solid #e4e4e0;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 12.5px;
  outline: none;
  box-sizing: border-box;
  background: #fbfbfa;
  color: #1c1c1a;
}

.vn-editor-menu-search:focus {
  border-color: #5b5bd6;
  background: #fff;
}

.vn-editor-menu-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: #8a8a84;
  text-align: center;
}

.vn-editor-menu-item {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vn-editor-menu-item:hover {
  background: #f0f0fa !important;
}

.vn-editor-item-thumb {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  flex: 0 0 auto;
  border: 1px solid #e4e4e0;
  background: #f4f1ea;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vn-editor-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

/* Player backlog (history) — same stacking as inventory, above stage content */
.vn-backlog-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px 20px;
  box-sizing: border-box;
}

.vn-backlog-panel {
  width: min(680px, 94vw);
  max-height: 80vh;
  background: rgba(14, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.vn-backlog-header {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
}

.vn-backlog-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  color: #fff;
}

.vn-backlog-close {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}

.vn-backlog-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.vn-backlog-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vn-backlog-entry-name {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
}

.vn-backlog-entry-text {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}

/* Player inventory */
.vn-inv-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.vn-inv-panel {
  width: min(560px, 94vw);
  max-height: 82vh;
  overflow-y: auto;
  background: rgba(14, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 20px 22px;
  box-sizing: border-box;
}

.vn-inv-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.vn-inv-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: #fff;
}

.vn-inv-close {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}

.vn-inv-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.vn-inv-empty {
  padding: 24px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

.vn-inv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vn-inv-row {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.vn-inv-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.vn-inv-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(232, 217, 160, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vn-inv-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.vn-inv-thumb-ph {
  font-size: 28px;
  color: #e8d9a0;
}

.vn-inv-row-body {
  flex: 1;
  min-width: 0;
}

.vn-inv-row-name {
  font-size: 16px;
  color: #fff;
  font-weight: 600;
}

.vn-inv-row-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.58);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vn-inv-row-desc--muted {
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
}

.vn-inv-row-chevron {
  flex: 0 0 auto;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1;
}

/* Item detail card */
.vn-item-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(5, 5, 8, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.vn-item-card {
  position: relative;
  width: min(420px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 22px 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 16, 24, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

.vn-item-card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
  font-size: 18px;
  border-radius: 10px;
  cursor: pointer;
}

.vn-item-card-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.vn-item-card-media {
  width: min(280px, 72vw);
  aspect-ratio: 1;
  margin: 8px auto 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(232, 217, 160, 0.06);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vn-item-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.vn-item-card-ph {
  font-size: 72px;
  color: #e8d9a0;
  opacity: 0.85;
}

.vn-item-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.2;
}

.vn-item-card-desc {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  white-space: pre-wrap;
}

.vn-item-card-desc--muted {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  text-align: center;
}

.vn-choice-disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* Phase 4 */
.vn-choice-timer {
  width: min(520px, 92vw);
  margin: 0 auto 10px;
  height: 8px;
  min-height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
}
.vn-choice-timer-bar {
  height: 100%;
  background: #3f9e63;
  transition: width 0.1s linear;
}
.vn-choice-timer--warn { background: #e6c200; }
.vn-choice-timer--danger { background: #d64545; }

.vn-qte-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 40;
}

/* Phase 5: unified minigame overlay */
.vn-minigame-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.88);
  display: flex;
  flex-direction: column;
  z-index: 40;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.vn-minigame-header {
  padding: 16px 20px 8px;
  text-align: center;
}
.vn-minigame-prompt { font-size: 20px; color: #fff; }
.vn-minigame-timer {
  width: min(360px, 80vw);
  height: 8px;
  margin: 12px auto 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
}
.vn-minigame-timer-fill {
  height: 100%;
  background: #d64545;
  transition: width 0.05s linear;
}
.vn-minigame-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px 24px;
  overflow: auto;
}
.vn-minigame-footer-stat {
  font-size: 16px;
  color: #e8d9a0;
  font-weight: 600;
}
.vn-minigame-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.vn-minigame-btn--primary { background: #5b5bd6; font-weight: 600; }

.vn-minigame--qte .vn-qte-inner {
  position: static;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.vn-puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(320px, 90vw);
}
.vn-puzzle-tile {
  min-height: 80px;
  min-width: 44px;
  border: none;
  border-radius: 8px;
  background: #3a3a50;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
}
.vn-puzzle-tile--empty { visibility: hidden; pointer-events: none; }

.vn-craft-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.vn-craft-slot {
  min-width: 72px;
  min-height: 72px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  padding: 8px;
}
.vn-craft-slot--empty { color: rgba(255, 255, 255, 0.4); }
.vn-craft-inv {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 100%;
}
.vn-craft-inv-item {
  min-height: 44px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.vn-craft-inv-badge { color: #e8d9a0; margin-left: 4px; }
.vn-craft-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.vn-cipher-slots {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.vn-cipher-slot {
  width: 48px;
  height: 56px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  font-weight: 700;
}
.vn-cipher-error { color: #ff8a8a; font-size: 14px; }
.vn-cipher-numpad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 320px;
}
.vn-cipher-numpad-key {
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
}
.vn-cipher-actions { display: flex; gap: 10px; }
.vn-cipher-attempts { color: #e8d9a0; font-size: 15px; }
.vn-cipher-history { max-height: 120px; overflow: auto; width: 100%; max-width: 280px; }
.vn-cipher-history-row { color: #ccc; font-size: 14px; padding: 4px 0; }

.vn-memory-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 8px;
  width: min(400px, 95vw);
}
.vn-memory-card {
  min-height: 56px;
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  background: #4a4a6a;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
.vn-memory-card--face-up { background: #5b5bd6; }
.vn-memory-card--matched { background: #3f9e63; opacity: 0.85; }

.vn-hotspot-scene {
  width: min(480px, 95vw);
  height: min(360px, 55vh);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
}
.vn-hotspot-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.vn-sequence-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.vn-sequence-arrows {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.vn-sequence-arrow {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 10px;
  background: #4a4a6a;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}
.vn-sequence-arrow:disabled {
  opacity: 0.55;
  cursor: default;
}
.vn-sequence-arrow--highlight {
  background: #d6a85b;
  box-shadow: 0 0 12px rgba(214, 168, 91, 0.6);
}

.vn-scramble-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.vn-scramble-built {
  font-size: 24px;
  letter-spacing: 0.2em;
  color: #fff;
  min-height: 32px;
}
.vn-scramble-letters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.vn-scramble-letter {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: #5b5bd6;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.vn-scramble-letter--used {
  visibility: hidden;
  pointer-events: none;
}

.vn-match-board {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.vn-match-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
}
.vn-match-item {
  min-height: 40px;
  padding: 8px 12px;
  border: 2px solid #4a4a6a;
  border-radius: 8px;
  background: #3a3a52;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.vn-match-item--selected {
  border-color: #d6a85b;
  background: #5a4a32;
}
.vn-match-item--matched {
  border-color: #3f9e63;
  background: #2a4a38;
  opacity: 0.75;
  cursor: default;
}

.vn-sort-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, 95vw);
}
.vn-sort-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.vn-sort-item {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border: 2px solid #4a4a6a;
  border-radius: 8px;
  background: #3a3a52;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}
.vn-sort-item--selected {
  border-color: #8ac97a;
  background: #3a523a;
}
.vn-sort-moves {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vn-sort-move-btn {
  width: 36px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: #4a4a6a;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.vn-sort-move-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Hotspot editor (inspector) */
.vn-hotspot-editor-panel {
  background: #fff;
  border: 1px solid #e4e4e0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vn-hotspot-editor-title {
  font-size: 11px;
  font-weight: 600;
  color: #8a8a84;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vn-hotspot-editor-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #9a9a94;
}
.vn-hotspot-editor-source-btn {
  height: 30px;
  border: 1px solid #e4e4e0;
  border-radius: 7px;
  background: #fff;
  font-size: 12.5px;
  padding: 0 10px;
  cursor: pointer;
  text-align: left;
}
.vn-hotspot-editor-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.vn-hotspot-editor-upload-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border: 1px dashed #c9c9c3;
  border-radius: 7px;
  font-size: 12px;
  color: #6ec9a8;
  cursor: pointer;
  font-weight: 600;
}
.vn-hotspot-editor-upload-label:hover {
  border-color: #6ec9a8;
  background: #f6fffb;
}
.vn-hotspot-editor-clear-btn {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #e4e4e0;
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
  color: #8a8a84;
  cursor: pointer;
}
.vn-hotspot-editor-empty {
  padding: 20px 12px;
  border-radius: 8px;
  background: #f6f6f4;
  font-size: 12px;
  color: #9a9a94;
  text-align: center;
  line-height: 1.45;
}
.vn-hotspot-editor-wrap {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a20;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
}
.vn-hotspot-editor-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}
.vn-hotspot-editor-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.vn-hotspot-editor-zone {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid rgba(110, 201, 168, 0.95);
  background: rgba(110, 201, 168, 0.18);
  border-radius: 4px;
  pointer-events: auto;
  cursor: move;
}
.vn-hotspot-editor-zone--active {
  border-color: #5b5bd6;
  background: rgba(91, 91, 214, 0.22);
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(91, 91, 214, 0.35);
}
.vn-hotspot-editor-zone-marker {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #5b5bd6;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.vn-hotspot-editor-input {
  border: 1px solid #e4e4e0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}
.vn-hotspot-editor-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #55554f;
}
.vn-hotspot-editor-timer input {
  width: 88px;
  border: 1px solid #e4e4e0;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
}
.vn-hotspot-editor-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
}
.vn-hotspot-editor-check input {
  width: 15px;
  height: 15px;
}
.vn-hotspot-editor-targets-head {
  font-size: 11px;
  font-weight: 600;
  color: #8a8a84;
  margin-top: 2px;
}
.vn-hotspot-target-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.vn-hotspot-target-row--active {
  border-color: #d8d8f4;
  background: #f8f8ff;
}
.vn-hotspot-target-select {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #e4e4e0;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: #5b5bd6;
  cursor: pointer;
  flex-shrink: 0;
}
.vn-hotspot-target-row--active .vn-hotspot-target-select {
  background: #5b5bd6;
  color: #fff;
  border-color: #5b5bd6;
}
.vn-hotspot-target-label {
  flex: 1;
  min-width: 0;
  border: 1px solid #e4e4e0;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
}
.vn-hotspot-target-coords {
  font-size: 10px;
  color: #a0a09a;
  white-space: nowrap;
  flex-shrink: 0;
}
.vn-hotspot-target-del {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: #c04040;
  cursor: pointer;
  flex-shrink: 0;
}
.vn-hotspot-editor-add {
  height: 30px;
  border: 1px dashed #c9c9c3;
  border-radius: 7px;
  background: none;
  font-size: 12px;
  color: #6ec9a8;
  cursor: pointer;
  font-weight: 600;
}
.vn-hotspot-editor-add:hover {
  border-color: #6ec9a8;
  background: #f6fffb;
}

.vn-qte-prompt { font-size: 20px; color: #fff; }
.vn-qte-counter { font-size: 28px; font-weight: 600; color: #e8d9a0; }
.vn-qte-btn {
  min-width: 88px;
  min-height: 88px;
  padding: 0 32px;
  border-radius: 50%;
  border: none;
  background: #5b5bd6;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}
.vn-qte-btn--pulse { transform: scale(1.08); transition: transform 0.12s ease; }
.vn-qte-time-bar {
  width: min(360px, 80vw);
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
}
.vn-qte-time-bar-fill {
  height: 100%;
  background: #d64545;
  transition: width 0.05s linear;
}

.vn-cg-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vn-cg-fullscreen-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 16px;
  box-sizing: border-box;
}
.vn-cg-fullscreen-img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
}
.vn-cg-fullscreen-title {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 56px;
  color: #fff;
  font-size: 18px;
}
.vn-cg-fullscreen-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}

.vn-inv-badge {
  position: absolute;
  right: -4px;
  top: -4px;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #5b5bd6;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.vn-inv-thumb { position: relative; }

.vn-cg-unlock-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(20, 20, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  z-index: 55;
}
.vn-cg-unlock-banner-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: none;
  background: #5b5bd6;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.vn-cg-unlock-banner-btn--muted {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Phase 6: location hub & shop overlays */
.vn-hub-overlay,
.vn-shop-overlay {
  position: absolute;
  inset: 0;
  z-index: 22;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.vn-hub-panel,
.vn-shop-panel {
  width: min(520px, 94vw);
  max-height: 82vh;
  overflow-y: auto;
  background: rgba(14, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 20px 22px;
  box-sizing: border-box;
}

.vn-hub-header,
.vn-shop-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.vn-hub-title,
.vn-shop-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: #fff;
}

.vn-shop-balance {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.vn-hub-close,
.vn-shop-close {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}

.vn-hub-close:hover,
.vn-shop-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.vn-hub-list,
.vn-shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vn-hub-loc,
.vn-shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}

.vn-hub-loc:hover:not(.vn-hub-loc--locked),
.vn-shop-item:hover:not(.vn-shop-item--disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.vn-hub-loc--locked,
.vn-shop-item--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vn-hub-loc-label {
  flex: 1;
  min-width: 0;
}

.vn-hub-loc-chevron {
  color: rgba(255, 255, 255, 0.35);
  font-size: 18px;
}

.vn-shop-item-body {
  flex: 1;
  min-width: 0;
}

.vn-shop-item-name {
  font-weight: 600;
}

.vn-shop-item-stock {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.vn-shop-item-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: #e8d9a0;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .vn-hub-loc,
  .vn-shop-item {
    min-height: 48px;
    padding: 14px 16px;
    font-size: 16px;
  }
}

/* Phase 7 — editor media library */
.vn-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.vn-media-card {
  min-height: 180px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #e4e4e0;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vn-media-card__thumb-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f0ed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vn-media-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vn-media-card__audio-icon {
  font-size: 28px;
  line-height: 1;
}

.vn-media-card__name {
  width: 100%;
  border: 1px solid #e4e4e0;
  border-radius: 6px;
  padding: 5px 6px;
  font-size: 11.5px;
  outline: none;
  box-sizing: border-box;
}

.vn-media-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 10.5px;
  color: #8a8a84;
}

.vn-media-card__badge {
  padding: 1px 6px;
  border-radius: 4px;
  background: #eeeefb;
  color: #5b5bd6;
  font-weight: 500;
}

.vn-media-card__actions {
  display: flex;
  gap: 4px;
  margin-top: auto;
}

.vn-media-card__btn {
  flex: 1;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid #e4e4e0;
  border-radius: 7px;
  background: #fbfbfa;
  color: #55554f;
  font-size: 11px;
  cursor: pointer;
  padding: 0 4px;
}

.vn-media-card__btn:hover {
  border-color: #c9c9c3;
  background: #f2f2ef;
}

.vn-media-card__btn--danger {
  color: #c04040;
  flex: 0 0 44px;
}

.vn-media-dropzone {
  border: 2px dashed #c9c9c3;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  background: #fafaf8;
  transition: border-color 0.15s, background 0.15s;
}

.vn-media-dropzone--over {
  border-color: #5b5bd6;
  background: #eeeefb;
}

.vn-media-uploading {
  opacity: 0.55;
  pointer-events: none;
}

.vn-media-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 7px;
  border: 1px solid #e4e4e0;
  background: #fff;
  color: #55554f;
  font-size: 13px;
  cursor: pointer;
}

.vn-media-upload-btn:hover {
  border-color: #5b5bd6;
  color: #5b5bd6;
}

.vn-media-upload-spinner {
  margin-top: 8px;
  font-size: 12px;
  color: #8a8a84;
}

.vn-media-toolbar-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid #e4e4e0;
  background: #fff;
  color: #55554f;
  font-size: 12px;
  cursor: pointer;
}

.vn-media-toolbar-btn:hover {
  border-color: #5b5bd6;
  color: #5b5bd6;
}

.vn-media-conflict-modal {
  width: min(420px, 100%);
  max-height: 80vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(20, 20, 30, 0.18);
}

.vn-media-conflict-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #55554f;
  max-height: 200px;
  overflow: auto;
}

.vn-media-conflict-list code {
  font-size: 11px;
  word-break: break-all;
}

.vn-lib-export-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #55554f;
  cursor: pointer;
  white-space: nowrap;
  margin-right: 8px;
}

.vn-lib-export-check input {
  width: 16px;
  height: 16px;
  accent-color: #5b5bd6;
}

