/* Base styles for PC/Mobile */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #000;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 0 !important;
}

/* Sticky header */
.game-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 68, 68, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: content-box;
  height: 40px;
  padding: 10px;
  gap: 12px;
}

/* Header left navigation */
.header-left {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Home button */
.home-btn {
  background-color: rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 68, 68, 0.6);
  color: #fff;
  font-size: 24px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease-out;
}

.home-btn:active {
  transform: scale(0.9) !important;
  transition: transform 0.1s ease;
}

/* Sound toggle button */
.sound-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 5px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sound-toggle:hover {
  background-color: rgba(255, 68, 68, 0.2);
  color: #ff4444;
}

.sound-toggle.muted {
  color: #666;
}

/* ========== Animation Keyframes ========== */

/* Content animations removed for SEO-friendly static rendering */

/* Horror shake effect */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Ending glow effect */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 68, 68, 0.8);
  }
}

/* Scene container */
.scene-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  /* Only apply transitions to necessary properties to avoid flickering */
  transition: opacity 0.3s ease-out, transform 0.3s ease-out, box-shadow 0.3s ease;
  /* Minimum height to prevent container collapse when content is cleared */
  min-height: 200px;
  /* Reserve space for header */
  margin-top: 61px;
  padding-top: 1px;
}
.home-container {
  padding-top: 0;
  margin-top: 0;
}
.home-ad {
  margin-top: 20px;
}

/* Title styles */
.scene-title {
  font-size: 20px;
  margin: 0;
  color: #ff4444;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-header .scene-title {
  font-size: 20px;
  margin: 0;
  color: #ff4444;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Scene description */
.scene-desc {
  font-size: 16px;
  line-height: 1.8;
  margin: 15px 20px;
  color: #eee;
}

/* Scene image */
.scene-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
  display: block;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 68, 68, 0.3);
}

/* Scene video */
.scene-video {
  border-radius: 8px;
  margin: 15px 20px;
  display: block;
  width: calc(100% - 40px);          /* 根据浏览器宽度拉伸 */
  height: auto;         /* 自动按比例调整 */
  aspect-ratio: 16 / 9; /* 固定宽高比 */
  object-fit: cover;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 68, 68, 0.3);
  background-color: #000;
}

/* Dialog container */
.dialog-container {
  background-color: rgba(50, 50, 50, 0.7);
  border-radius: 8px;
  padding: 1px 15px;
  margin: 15px 20px;
}

.dialog-item {
  margin: 12px 0;
  line-height: 1.6;
  opacity: 1;
}

/* Dialog role and content styling */
.dialog-role {
  font-weight: 600;
  color: #ff4444;
  margin-right: 5px;
}

.dialog-content {
  color: #fff;
}

/* Content block - flexible content container */
.content-block {
  margin: 20px 0;
  padding: 15px;
  border-radius: 8px;
}

/* Different content types */
.content-text {
  background-color: rgba(50, 50, 50, 0.3);
  color: #eee;
  line-height: 1.8;
}

.content-highlight {
  background-color: rgba(255, 68, 68, 0.1);
  border-left: 3px solid #ff4444;
  padding-left: 20px;
}

/* Narration container - unique style for narration */
.narration-container {
  margin: 15px 15px;
  padding: 20px;
  text-align: left;
  position: relative;
}

.narration-content {
  display: block;
  font-style: italic;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  margin: 0 10px;
  padding: 15px 25px;
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.15) 0%, rgba(50, 50, 50, 0.15) 100%);
  border-left: 2px solid rgba(255, 255, 255, 0.2);
  border-right: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Narration decorative elements */
.narration-container::before,
.narration-container::after {
  content: '"';
  font-size: 48px;
  color: rgba(255, 68, 68, 0.8);
  position: absolute;
  font-family: Georgia, serif;
  line-height: 1;
}

.narration-container::before {
  left: 10px;
  top: 10px;
}

.narration-container::after {
  right: 10px;
  bottom: 10px;
}

/* Mobile adaptation for narration */
@media (max-width: 768px) {
  .narration-container {
    padding: 15px;
  }

  .narration-content {
    font-size: 14px;
    padding: 10px;
  }

  .narration-container::before,
  .narration-container::after {
    font-size: 36px;
  }

  .narration-container::before {
    left: 5px;
    top: 5px;
  }

  .narration-container::after {
    right: 5px;
    bottom: 5px;
  }
}

.dialog-content {
  display: inline;
}

.dialog-role {
  color: #44bfff;
  font-weight: bold;
}

/* Choice buttons */
.choice-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px;
}

.choice-btn {
  padding: 15px 20px 15px 55px;
  background-color: rgba(70, 70, 70, 0.8);
  border: 2px solid rgba(255, 68, 68, 0.5);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  /* Only apply transitions to interactive properties */
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  opacity: 1;
}

/* Radio-style circular marker - all options have this */
.choice-btn::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: transparent;
  transition: all 0.3s ease;
  z-index: 1;
  box-sizing: border-box;
}

/* No animations needed - content is static for SEO */

/* Remove ripple effect, use simple click feedback */
.choice-btn:active {
  transform: scale(0.98);
}

/* Mobile button size adaptation */
@media (max-width: 768px) {
  .choice-btn {
    padding: 18px 15px 18px 52px;
    font-size: 16px;
    min-height: 60px;
  }

  .scene-desc {
    font-size: 15px;
  }

  /* Mobile countdown adaptation */
  .countdown-container {
    width: 95%;
    padding: 5px 15px;
    top: 60px;
  }

  .countdown-title {
    font-size: 14px;
    /*margin-bottom: 8px;*/
  }

  .countdown-time {
    font-size: 20px;
    /*margin-bottom: 10px;*/
  }

  .countdown-progress-bar {
    height: 5px;
  }

  /* Mobile header adaptation */
  .game-header {
    gap: 8px;
  }

  /* Mobile left navigation adaptation */
  .header-left {
    gap: 8px;
    flex-shrink: 0;
  }

  .home-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  /* Mobile menu adaptation */
  .menu-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .menu-dropdown {
    min-width: 160px;
  }

  /* Mobile history record adaptation */
  .history-view {
    padding: 20px 15px;
  }

  .history-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .history-list {
    max-height: 50vh;
  }

  .history-item {
    padding: 12px;
  }

  .history-route {
    font-size: 13px;
  }
}

/* Old hover and active styles removed, using clearer styles below */

/* Countdown progress bar container */
.countdown-container {
  position: fixed;
  top: 60px; /* Reserve space for header */
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #ff4444;
  border-radius: 12px;
  padding: 10px 20px;
  box-shadow: 0 5px 30px rgba(255, 68, 68, 0.6), 0 0 50px rgba(255, 0, 0, 0.3);
  z-index: 99999;
  display: none;
  /* Remove animation delay to display countdown immediately */
  animation: countdownPulse 1s ease-in-out infinite;
}

.countdown-container.active {
  display: block;
}

/* Countdown title */
.countdown-title {
  color: #ff4444;
  font-size: 16px;
  font-weight: bold;
  /*margin-bottom: 10px;*/
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: textFlicker 0.5s ease-in-out infinite;
}

/* Countdown time display */
.countdown-time {
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  /*margin-bottom: 12px;*/
  font-family: 'Courier New', monospace;
}

/* Progress bar shell */
.countdown-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(50, 50, 50, 0.8);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Progress bar fill */
.countdown-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff4444 0%, #ff6666 50%, #ff4444 100%);
  background-size: 200% 100%;
  border-radius: 10px;
  transition: width 0.1s linear;
  position: relative;
  animation: progressShimmer 2s linear infinite;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

/* Progress bar glint effect */
.countdown-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressGlint 3s ease-in-out infinite;
}

/* Progress bar animation - background flow */
@keyframes progressShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

/* Progress bar animation - glint */
@keyframes progressGlint {
  0%, 100% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
}

/* Countdown container pulse animation */
@keyframes countdownPulse {
  0%, 100% {
    box-shadow: 0 5px 30px rgba(255, 68, 68, 0.6), 0 0 50px rgba(255, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 5px 35px rgba(255, 68, 68, 0.8), 0 0 60px rgba(255, 0, 0, 0.5);
  }
}

/* Text flicker animation */
@keyframes textFlicker {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
  }
  50% {
    opacity: 0.9;
    text-shadow: 0 0 15px rgba(255, 68, 68, 1);
  }
}

/* Slide in from top animation */
@keyframes slideInTop {
  from {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Countdown warning state (when remaining time < 30%) */
.countdown-container.warning {
  border-color: #ff6666;
  animation: countdownWarning 0.5s ease-in-out infinite;
}

.countdown-container.warning .countdown-progress-fill {
  background: linear-gradient(90deg, #ff6666 0%, #ff8888 50%, #ff6666 100%);
}

/* Countdown danger state (when remaining time < 10%) */
.countdown-container.danger {
  border-color: #ff0000;
  animation: countdownDanger 0.3s ease-in-out infinite;
}

.countdown-container.danger .countdown-progress-fill {
  background: linear-gradient(90deg, #ff0000 0%, #ff3333 50%, #ff0000 100%);
}

.countdown-container.danger .countdown-title {
  color: #ff0000;
  animation: textFlicker 0.2s ease-in-out infinite;
}

/* Warning animation */
@keyframes countdownWarning {
  0%, 100% {
    box-shadow: 0 5px 30px rgba(255, 100, 100, 0.7), 0 0 60px rgba(255, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 5px 40px rgba(255, 100, 100, 0.9), 0 0 80px rgba(255, 0, 0, 0.6);
  }
}

/* Danger animation */
@keyframes countdownDanger {
  0%, 100% {
    box-shadow: 0 5px 40px rgba(255, 0, 0, 0.9), 0 0 100px rgba(255, 0, 0, 0.7);
    transform: translateX(-50%) translateY(0) scale(1);
  }
  50% {
    box-shadow: 0 5px 50px rgba(255, 0, 0, 1), 0 0 120px rgba(255, 0, 0, 0.9);
    transform: translateX(-50%) translateY(0) scale(1.02);
  }
}

/* Game menu */
.game-menu {
  position: relative;
  z-index: 1001;
  display: none;
}

.menu-btn {
  background-color: rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 68, 68, 0.6);
  color: #fff;
  font-size: 24px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease-out;
}
.menu-btn:active {
  background-color: rgba(0, 0, 0, 0.8);
}

.menu-btn:hover {
  background-color: rgba(255, 68, 68, 0.8);
  border-color: #ff4444;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.menu-dropdown {
  position: absolute;
  top: 60px;
  left: 0;
  background-color: rgba(0, 0, 0, 0.95);
  border: 2px solid rgba(255, 68, 68, 0.6);
  border-radius: 10px;
  padding: 10px;
  min-width: 180px;
  display: none;
  flex-direction: column;
  gap: 8px;
  animation: slideDown 0.3s ease-out;
}

.menu-dropdown.active {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-item {
  background-color: rgba(70, 70, 70, 0.8);
  border: 1px solid rgba(255, 68, 68, 0.3);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: 14px;
}

.menu-item:hover {
  background-color: rgba(255, 68, 68, 0.6);
  border-color: #ff4444;
  transform: translateX(5px);
}

/* Variable indicator container - positioned in header */
.variable-indicators {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 10px;
  z-index: 1001;
}

.variable-indicator {
  background-color: rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 68, 68, 0.6);
  border-radius: 20px;
  padding: 8px 15px;
  font-size: 14px;
  color: #fff;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

.variable-label {
  color: #ff6666;
  font-weight: bold;
}

.variable-value {
  color: #fff;
  font-family: 'Courier New', monospace;
  min-width: 20px;
  text-align: center;
}

/* Animation effect when variable changes */
.variable-indicator.variable-change {
  animation: variableFlash 0.5s ease-in-out;
  transform: scale(1.1);
}

@keyframes variableFlash {
  0%, 100% {
    border-color: rgba(255, 68, 68, 0.6);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
  }
  50% {
    border-color: rgba(255, 68, 68, 1);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
  }
}

/* Mobile adaptation */
@media (max-width: 768px) {
  .variable-indicators {
    gap: 6px;
  }

  .variable-indicator {
    padding: 5px 10px;
    font-size: 11px;
  }
}

/* History record page */
.history-view {
  padding: 30px;
  animation: fadeIn 0.6s ease-out;
}

.history-title {
  font-size: 28px;
  color: #ff4444;
  margin-bottom: 30px;
  text-align: center;
  animation: slideInLeft 0.5s ease-out;
}

.history-list {
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 30px;
  scrollbar-width: thin;
  scrollbar-color: #ff4444 rgba(50, 50, 50, 0.5);
}

.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-track {
  background: rgba(50, 50, 50, 0.5);
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: #ff4444;
  border-radius: 4px;
}

.history-item {
  background-color: rgba(50, 50, 50, 0.6);
  border-left: 3px solid #ff4444;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
  animation: slideUpFade 0.3s ease-out;
  animation-fill-mode: backwards;
}

.history-item:nth-child(1) { animation-delay: 0s; }
.history-item:nth-child(2) { animation-delay: 0.05s; }
.history-item:nth-child(3) { animation-delay: 0.1s; }
.history-item:nth-child(4) { animation-delay: 0.15s; }
.history-item:nth-child(5) { animation-delay: 0.2s; }

.history-step {
  color: #44bfff;
  font-weight: bold;
  margin-bottom: 5px;
}

.history-route {
  color: #eee;
  font-size: 14px;
  line-height: 1.6;
}

.history-choice {
  color: #ff6666;
  font-weight: bold;
}

.back-btn {
  padding: 15px 30px;
  background-color: rgba(70, 70, 70, 0.8);
  border: 2px solid #888;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  margin: 0 auto;
}

.back-btn:hover {
  background-color: rgba(100, 100, 100, 0.9);
  border-color: #aaa;
  transform: scale(1.05);
}

/* Home page styles */
.home-page {
  width: 100vw;
  max-width: 800px;
  height: 100vh;
  overflow: hidden;
  animation: fadeIn 0.8s ease-out;
  z-index: 2000;
}

/* Hide header when home page is displayed */
body:has(.home-page) .game-header {
  display: none;
}

.home-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
  /* filter: brightness(0.7); */
  animation: scaleIn 1s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(1.1);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.home-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

.home-content {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  padding-top: 550px;
  text-align: center;
  overflow-x: hidden;
  overflow-y: auto;
  /* Improve scroll performance */
  -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
  will-change: scroll-position; /* Hint browser for optimization */
  transform: translateZ(0); /* Enable hardware acceleration */
  overscroll-behavior: contain; /* Prevent scroll chaining */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.home-content::-webkit-scrollbar {
  display: none;
} 

.home-welcome-page .home-content {
  padding-top: 550px;
}

.home-title {
  position: absolute;
  left: 110vw;
  top: 0;
  font-size: 48px;
  color: #fff;
  margin-bottom: 40px;
  /* text-shadow: 0 0 20px rgba(255, 68, 68, 0.8), 0 0 40px rgba(255, 68, 68, 0.5); */
  /* animation: glowPulse 2s ease-in-out infinite, slideInLeft 0.8s ease-out; */
  font-weight: bold;
  letter-spacing: 2px;
}

.home-description {
  position: absolute;
  left: 35px;
  right: 0;
  top: 254px;
  text-align: left;
  font-size: 24px;
}

.save-info-card {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 68, 68, 0.6);
  border-radius: 15px;
  padding: 10px 20px;
  margin-bottom: 20px;
  width: 300px;
  animation: popIn 0.6s ease-out 0.3s backwards;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  text-align: left;
}

.save-info-title {
  margin: 10px 0;
  font-size: 24px;
  color: #ff4444;
  font-weight: bold;
}

.save-info-item {
  font-size: 16px;
  color: #eee;
  margin: 12px 0;
  line-height: 1.6;
}

.save-info-item strong {
  color: #44bfff;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.8s ease-out 0.6s backwards;
}

.home-buttons .load-btn {
  border-radius: 10px;
  width: 300px;
  animation: slideInUp 0.6s ease-out 0.7s backwards;
}

.start-game-btn {
  background: linear-gradient(135deg, #ff4444 0%, #ff6666 100%);
  color: #fff;
  border: 2px solid #ff4444;
  border-radius: 10px;
  padding: 18px 50px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: glowPulse 2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.start-game-btn:hover {
  background: linear-gradient(135deg, #ff6666 0%, #ff8888 100%);
  transform: scale(1.05);
  box-shadow: 0 5px 30px rgba(255, 68, 68, 0.8);
}

.start-game-btn:active {
  transform: scale(0.98);
}

/* Load menu */
.load-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 30px;
  animation: fadeIn 0.8s ease-out;
}

.load-title {
  font-size: 32px;
  color: #ff4444;
  margin-bottom: 40px;
  animation: slideInLeft 0.6s ease-out;
}

.save-info {
  background-color: rgba(50, 50, 50, 0.7);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 40px;
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  animation: popIn 0.6s ease-out 0.3s backwards;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide in from left animation */
@keyframes slideInLeft {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Slide in from bottom with scale animation for buttons */
@keyframes slideInUp {
  from {
    transform: translateY(30px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.save-info p {
  margin: 15px 0;
  font-size: 16px;
  line-height: 1.8;
  color: #eee;
}

.save-info strong {
  color: #44bfff;
}

.load-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeIn 0.6s ease-out 0.6s backwards;
}

.load-btn {
  padding: 18px 40px;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: slideInUp 0.6s ease-out backwards;
}

.continue-btn {
  background-color: #ff4444;
  color: #fff;
  border: 2px solid #ff4444;
}

.continue-btn:hover {
  background-color: #ff6666;
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(255, 68, 68, 0.6);
}

.new-game-btn {
  background-color: rgba(70, 70, 70, 0.8);
  color: #fff;
  border: 2px solid #888;
}

.new-game-btn:hover {
  background-color: rgba(100, 100, 100, 0.9);
  border-color: #aaa;
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(150, 150, 150, 0.3);
}

.load-btn:active {
  transform: scale(0.98);
}

@media (max-width: 768px) {
  .scene-container {
    padding-bottom: 33vw;
  }
  .scene-container.home-container {
    padding-bottom: 0;
  }
  .home-title {
    left: 110vw;
    font-size: 48px;
    margin-bottom: 40px;
  }
  
  .home-description {
    left: 5vw;
    font-size: 4.6vw;
  }

  .home-page.home-welcome-page .home-background {
    background-position: center top;
  }

  .home-page .home-description {
    top: 12vw;
  }
  .home-page.home-welcome-page .home-description {
    top: 28vw;
  }

  .home-page .home-background {
    background-position: center -60px;
  }
  .home-page.home-welcome-page .home-background {
    background-position: center top;
  }
  .home-page .home-content {
    padding-top: 54vw;
    padding-bottom: 33vw;
  }
  .home-page.home-welcome-page .home-content {
    padding-top: 74vw;
  }
  

  .home-title {
    font-size: 32px;
    margin-bottom: 30px;
  }

  .save-info-title {
    font-size: 20px;
  }

  .save-info-item {
    font-size: 14px;
    margin: 10px 0;
  }

  .home-buttons {
    gap: 15px;
    width: 100%;
  }

  .start-game-btn,
  .home-buttons .load-btn {
    padding: 15px 30px;
    font-size: 18px;
  }

  .load-menu {
    padding: 40px 20px;
  }

  .load-title {
    font-size: 26px;
    margin-bottom: 30px;
  }

  .save-info {
    padding: 10px 20px;
  }

  .load-buttons {
    flex-direction: column;
    gap: 15px;
  }
}

/* Ending page */
.ending-container {
  text-align: center;
  padding: 50px 20px;
  animation: fadeIn 1s ease-out;
}

.ending-title {
  font-size: 30px;
  color: #ff4444;
  margin-bottom: 30px;
  animation: glowPulse 2s ease-in-out infinite;
}

.restart-btn {
  padding: 15px 30px;
  background-color: #ff4444;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  margin-top: 30px;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.restart-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease-out, height 0.5s ease-out, opacity 0.5s ease-out;
  opacity: 0;
}

.restart-btn:active::before {
  width: 300px;
  height: 300px;
  opacity: 1;
}

.restart-btn:hover {
  background-color: #ff6666;
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(255, 68, 68, 0.6);
}

.restart-btn:active {
  transform: scale(0.98);
}

/* Scene fade out effect (used when switching) */
.scene-container.fade-out {
  opacity: 0;
  transform: scale(0.98);
}

/* Typewriter effect cursor */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background-color: #ff4444;
  margin-left: 2px;
  animation: blink 0.7s infinite;
}

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

/* Hover hint when dialog content has typewriter effect */
.dialog-content[style*="cursor: pointer"] {
  display: inline;
}

.dialog-content[style*="cursor: pointer"]:hover {
  opacity: 0.9;
}

.dialog-content[style*="cursor: pointer"]::after {
  content: "（点击跳过）";
  display: inline-block;
  font-size: 0.75em;
  color: rgba(255, 255, 255, 0.4);
  margin-left: 8px;
  animation: fadeIn 0.8s ease-out 1.5s backwards;
}

/* Disabled button style (prevent repeated clicks and other options for selected chapters) */
.choice-btn:disabled {
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(255, 68, 68, 0.2);
  background-color: rgba(50, 50, 50, 0.5);
  color: rgba(150, 150, 150, 0.6);
}

.choice-btn:disabled::before {
  border-color: rgba(255, 255, 255, 0.2);
  background: transparent;
}

/* Selected state choice button */
.choice-btn.selected {
  background-color: rgba(255, 68, 68, 0.3) !important;
  border: 2px solid #ff4444 !important;
  box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.4),
              0 4px 20px rgba(255, 68, 68, 0.5);
  color: #fff !important;
  font-weight: 600;
}

/* Selected state Radio circular marker - filled with red background */
.choice-btn.selected::before {
  border-color: #ff4444 !important;
  background: #ff4444 !important;
  box-shadow: 0 0 12px rgba(255, 68, 68, 1),
              0 0 24px rgba(255, 68, 68, 0.6);
  width: 22px;
  height: 22px;
  left: 19px;
  animation: radioSelected 0.3s ease-out;
}

/* Selected state Radio inner white dot - positioned at radio marker center */
.choice-btn.selected::after {
  width: 8px !important;
  height: 8px !important;
  background: #fff !important;
  box-shadow: 0 0 8px rgba(255, 255, 255, 1),
              inset 0 1px 2px rgba(0, 0, 0, 0.15);
  opacity: 1 !important;
  animation: radioDotAppear 0.3s ease-out;
}

/* Radio dot appear animation */
@keyframes radioDotAppear {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* Radio selected animation */
@keyframes radioSelected {
  from {
    transform: translateY(-50%) scale(0.8);
    opacity: 0.5;
  }
  to {
    transform: translateY(-50%) scale(1);
    opacity: 1;
  }
}

/* Selected state hover effect */
.choice-btn.selected:hover {
  background-color: rgba(255, 68, 68, 0.3) !important;
  border-color: #ff6666 !important;
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.35),
              0 6px 20px rgba(255, 68, 68, 0.5);
}

.choice-btn.selected:hover::before {
  box-shadow: 0 0 16px rgba(255, 68, 68, 1),
              0 0 32px rgba(255, 68, 68, 0.7);
  border-color: #ff6666 !important;
  background: #ff6666 !important;
}

.choice-btn.selected:hover::after {
  box-shadow: 0 0 10px rgba(255, 255, 255, 1),
              inset 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Unselected state hover effect */
.choice-btn:not(.selected):hover {
  background-color: rgba(255, 68, 68, 0.1);
  border-color: rgba(255, 68, 68, 0.7);
}

.choice-btn:not(.selected):hover::before {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

/* ========== Chapter Navigation Bar ========== */

/* Navigation container - hidden, buttons are positioned individually */
/* .chapter-navigation {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 999;
  display: block;
} */

/* Navigation button (works for both button and a tags) - positioned individually */
.nav-btn {
  box-sizing: content-box;
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid rgba(255, 68, 68, 0.5);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: auto;
  height: 78px;
  justify-content: center;
  text-decoration: none;
  pointer-events: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 68, 68, 0.15);
  white-space: nowrap;
  /* Ensure a tags look like buttons */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.75);
  border-color: rgba(255, 68, 68, 0.8);
  box-shadow: 0 6px 16px rgba(255, 68, 68, 0.3), 0 0 25px rgba(255, 68, 68, 0.2);
}

.nav-btn:active {
  transform: translateY(0) scale(1);
}

/* Navigation button icon - make arrows more prominent */
.nav-icon {
  font-size: 24px;
  font-weight: bold;
  color: #ff4444;
  text-shadow: 0 0 8px rgba(255, 68, 68, 0.8);
  line-height: 1;
}

/* Navigation button text - ensure it's always visible */
.nav-text {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  padding: 0 8px 8px 8px;
}

/* Disabled state - visible but clearly unclickable */
.nav-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: auto;
  border: 2px solid rgba(255, 68, 68, 0.3);
  background: rgba(50, 50, 50, 0.7);
  color: rgba(200, 200, 200, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: fixed;
  /* Ensure disabled links don't look clickable */
  text-decoration: none;
}

/* Visual hint for disabled state - add diagonal lines or semi-transparent overlay */
.nav-btn.disabled::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0, 0, 0, 0.1) 10px,
    rgba(0, 0, 0, 0.1) 20px
  );
  pointer-events: none;
  opacity: 0.3;
}

.prev-btn.disabled::after {
  border-radius: 0 20px 20px 0;
}

.next-btn.disabled::after {
  border-radius: 20px 0 0 20px;
}

.nav-btn.disabled:active {
  transform: none;
}

.nav-btn.disabled .nav-icon,
.nav-btn.disabled .nav-text {
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

/* Hidden state */
.nav-btn.hidden {
  display: none;
}

/* Previous button - fixed on left side, vertically centered, close to edge, rounded on right */
.prev-btn {
  left: 0;
  bottom: 250px;
  /* top: 50%;
  transform: translateY(-50%); */
  border-left: none;
  border-radius: 0 20px 20px 0;
}

.prev-btn:active {
  transform: translateY(-50%) scale(1);
}

.prev-btn.disabled:hover {
  transform: translateY(-50%);
}

/* Next button - fixed on right side, vertically centered, close to edge, rounded on left */
.next-btn {
  right: 0;
  bottom: 250px;
  /* top: 50%;
  transform: translateY(-50%); */
  border-right: none;
  border-radius: 20px 0 0 20px;
}

.next-btn:active {
  transform: translateY(-50%) scale(1);
}

.next-btn.disabled:hover {
  transform: translateY(-50%);
}

.ads-btn {
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ads-btn img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ad-container {
  flex-shrink: 0;
  width: 100%;
  min-height: 294px;
  background: url('../assets/ads.png') no-repeat center center;
  background-size: 300px 250px;
}
.home-page .ad-container {
  margin: 20px 0;
}
.ads_img {
  width: 300px;
  height: 250px;
  margin: 0 auto;
}

/* Navigation buttons are now on left/right sides, no bottom padding needed */
/* Removed bottom padding as buttons no longer cover bottom content */

/* Toast message styles */
.navigation-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 68, 68, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  animation: toastSlideUp 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.navigation-toast.fade-out {
  animation: toastSlideDown 0.3s ease-out;
}

@keyframes toastSlideDown {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}
