/* CSS Variables for Cyberpunk Theme */
:root {
  --primary-red: hsl(345, 82%, 60%);
  --primary-orange: hsl(25, 89%, 54%);
  --primary-blue: hsl(203, 98%, 64%);
  --bg-dark: hsl(240, 43%, 16%);
  --bg-darker: hsl(221, 43%, 19%);
  --text-light: hsl(0, 0%, 95%);
  --text-gray: hsl(0, 0%, 60%);
  --border-glow: hsl(345, 82%, 60%);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Screen Management */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

/* Cyber Text Effect */
.cyber-text {
  color: var(--primary-red);
  text-shadow: 0 0 10px var(--primary-red), 0 0 20px var(--primary-red);
  font-weight: bold;
}

/* Animations */
@keyframes neonPulse {
  0%, 100% { text-shadow: 0 0 10px var(--primary-red), 0 0 20px var(--primary-red); }
  50% { text-shadow: 0 0 20px var(--primary-red), 0 0 30px var(--primary-red), 0 0 40px var(--primary-red); }
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-neon-pulse {
  animation: neonPulse 2s ease-in-out infinite;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* LOGIN SCREEN STYLES */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  border: 2px solid var(--border-glow);
  border-radius: 12px;
  padding: 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 0 30px rgba(255, 40, 80, 0.3);
  animation: fadeIn 0.8s ease-out;
  position: relative;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.welcome-message {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
  text-align: center;
}

.welcome-message p {
  color: var(--text-gray);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.welcome-message a {
  color: var(--primary-red);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.3s ease;
}

.welcome-message a:hover {
  color: var(--primary-orange);
  text-shadow: 0 0 5px var(--primary-orange);
}

.game-title-line1 {
  font-size: 2rem;
  color: var(--primary-red);
  text-shadow: 0 0 15px var(--primary-red);
  font-weight: bold;
  margin-bottom: 8px;
  animation: neonPulse 2s ease-in-out infinite;
}

.game-title-line2 {
  font-size: 1.5rem;
  color: var(--primary-orange);
  text-shadow: 0 0 10px var(--primary-orange);
  font-weight: bold;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-gray);
  font-size: 0.9rem;
}

.input-group input {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 2px solid var(--text-gray);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 10px rgba(255, 40, 80, 0.3);
}

.button-group {
  display: flex;
  gap: 12px;
}

/* BUTTON STYLES */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px; /* Minimum touch target size for mobile */
  touch-action: manipulation; /* Optimize for touch */
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-orange) 100%);
  color: white;
  flex: 1;
}

.btn-primary:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 40, 80, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
  flex: 1;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-blue);
  color: white;
  transform: scale(1.05);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-orange);
  color: var(--primary-orange);
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-orange);
  color: black;
}

.btn-backtrack {
  background: transparent;
  border: 2px solid var(--text-gray);
  color: var(--text-gray);
  margin-top: 20px;
}

.btn-backtrack:hover:not(:disabled) {
  border-color: var(--primary-red);
  color: var(--primary-red);
}

.btn-backtrack:disabled {
  border-color: #444;
  color: #444;
}

.btn-use-tool {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-orange) 100%);
  color: white;
}

.btn-use-tool:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 40, 80, 0.4);
}

.btn-icon {
  font-size: 1rem;
}

/* GAME SCREEN STYLES */
.game-header {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  border-bottom: 2px solid var(--border-glow);
  padding: 20px;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.header-title {
  font-size: 1.5rem;
  color: var(--primary-red);
  text-shadow: 0 0 10px var(--primary-red);
}

.header-stats {
  display: flex;
  gap: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.stat-icon {
  font-size: 1.2rem;
  color: var(--primary-red);
}

.header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* MAIN GAME CONTENT */
.game-main {
  flex: 1;
  padding: 30px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.story-container {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border-glow);
  border-radius: 12px;
  padding: 30px;
  backdrop-filter: blur(10px);
}

.story-title {
  font-size: 2rem;
  color: var(--primary-red);
  margin-bottom: 20px;
  text-align: center;
}

.story-text {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 30px;
  color: var(--text-light);
}

.choices-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.story-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-btn {
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  border: 2px solid var(--primary-blue);
  border-radius: 8px;
  color: var(--text-light);
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.choice-btn:hover {
  border-color: var(--primary-red);
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-orange) 100%);
  transform: translateX(10px);
}

/* FOOTER STYLES */
.game-footer {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  border-top: 2px solid var(--border-glow);
  padding: 30px 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content h3 {
  font-size: 1.2rem;
  color: var(--primary-red);
  margin-bottom: 20px;
  text-shadow: 0 0 10px var(--primary-red);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rule-icon {
  font-size: 1.2rem;
  color: var(--primary-red);
  margin-top: 2px;
}

.rule-item strong {
  color: var(--text-light);
}

.rule-item div {
  color: var(--text-gray);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* MODAL STYLES */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  border: 2px solid var(--border-glow);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-glow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-title-group {
  flex: 1;
}

.modal-title-group h2 {
  margin: 0 0 5px 0;
}

.map-note {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
}

.modal-header h2 {
  color: var(--primary-red);
  text-shadow: 0 0 10px var(--primary-red);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-gray);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--primary-red);
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

/* WORLD RULES CONTENT */
.world-rules-content {
  border: 2px solid var(--border-glow);
  border-radius: 8px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
}

.world-rules-content pre {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text-gray);
  font-family: inherit;
  font-size: 0.9rem;
}

/* STORY MAP STYLES */
.story-map-content {
  min-height: 300px;
}

@keyframes currentNodePulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 40, 80, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 40, 80, 0.6);
  }
}

/* BONUS MODAL STYLES */
.bonus-modal {
  animation: bonusModalAppear 0.5s ease-out;
}

.bonus-content {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  border: 3px solid var(--primary-red);
  box-shadow: 0 0 30px rgba(255, 40, 80, 0.5), inset 0 0 20px rgba(255, 40, 80, 0.1);
  animation: bonusContentGlow 2s ease-in-out infinite alternate;
}

.bonus-header {
  padding: 20px;
  border-bottom: 2px solid var(--primary-red);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, rgba(255, 40, 80, 0.1) 0%, rgba(255, 40, 80, 0.05) 100%);
}

.bonus-icon {
  font-size: 2.5rem;
  animation: bonusIconBounce 1s ease-in-out infinite;
  transition: all 0.3s ease;
}

.bonus-icon[style*="color: #ff4444"] {
  animation: bombShake 0.5s ease-in-out infinite;
  text-shadow: 0 0 10px #ff4444;
}

.bonus-icon[style*="color: #44ff44"] {
  text-shadow: 0 0 10px #44ff44;
}

.bonus-icon[style*="color: #ffaa44"] {
  text-shadow: 0 0 10px #ffaa44;
}

.bonus-header h2 {
  color: var(--primary-red);
  text-shadow: 0 0 15px var(--primary-red);
  font-size: 1.5rem;
  margin: 0;
  flex: 1;
  text-align: center;
}

.bonus-message {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--primary-red);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-light);
  animation: bonusMessagePulse 2s ease-in-out infinite;
}

/* Bonus Modal Animations */
@keyframes bonusModalAppear {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes bonusContentGlow {
  0% {
    box-shadow: 0 0 30px rgba(255, 40, 80, 0.5), inset 0 0 20px rgba(255, 40, 80, 0.1);
  }
  100% {
    box-shadow: 0 0 40px rgba(255, 40, 80, 0.7), inset 0 0 30px rgba(255, 40, 80, 0.2);
  }
}

@keyframes bonusIconBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes bonusMessagePulse {
  0%, 100% {
    border-color: var(--primary-red);
    box-shadow: 0 0 10px rgba(255, 40, 80, 0.3);
  }
  50% {
    border-color: var(--primary-orange);
    box-shadow: 0 0 15px rgba(255, 170, 68, 0.5);
  }
}

/* NODE PREVIEW STYLES */
.node-preview-section {
  margin: 20px 0;
  border: 2px solid var(--border-glow);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.node-preview-section h3 {
  background: linear-gradient(90deg, rgba(255, 40, 80, 0.1) 0%, rgba(255, 40, 80, 0.05) 100%);
  color: var(--primary-red);
  text-shadow: 0 0 10px var(--primary-red);
  padding: 12px 20px;
  margin: 0;
  border-bottom: 1px solid var(--border-glow);
  font-size: 1.1rem;
}

.node-preview-note {
  color: var(--text-gray);
  font-size: 0.8rem;
  margin: 8px 20px 0 20px;
  font-style: italic;
  line-height: 1.3;
}

.node-preview-content {
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.node-preview-content .node-title {
  color: var(--primary-blue);
  text-shadow: 0 0 8px var(--primary-blue);
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.node-preview-content .node-text {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.node-preview-content .node-choices {
  margin-top: 15px;
}

.node-preview-content .choice-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.node-preview-content .choice-item.player-choice {
  background: linear-gradient(90deg, rgba(255, 40, 80, 0.2) 0%, rgba(255, 40, 80, 0.1) 100%);
  border: 2px solid var(--primary-red);
  box-shadow: 0 0 15px rgba(255, 40, 80, 0.3);
}



.node-preview-content .choice-text {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.4;
}

.node-preview-content .no-choice-data {
  color: var(--text-gray);
  font-style: italic;
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
}

.ending-preview-content {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text-light);
  line-height: 1.6;
  font-size: 0.95rem;
}

@keyframes bombShake {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-2deg);
  }
  50% {
    transform: scale(1.2) rotate(0deg);
  }
  75% {
    transform: scale(1.1) rotate(2deg);
  }
}

.bonus-content {
  background: linear-gradient(135deg, #1a0033 0%, #330066 50%, #1a0033 100%);
  border: 3px solid var(--primary-orange);
  box-shadow: 
    0 0 30px rgba(255, 165, 0, 0.5),
    0 0 60px rgba(255, 165, 0, 0.3),
    inset 0 0 20px rgba(255, 165, 0, 0.1);
  animation: bonusContentGlow 2s ease-in-out infinite alternate;
}

.bonus-header {
  padding: 20px;
  border-bottom: 2px solid var(--primary-orange);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, rgba(255, 165, 0, 0.1) 0%, rgba(255, 165, 0, 0.05) 100%);
}

.bonus-icon {
  font-size: 2.5rem;
  animation: bonusIconBounce 1s ease-in-out infinite;
  filter: drop-shadow(0 0 10px var(--primary-orange));
}

.bonus-header h2 {
  color: var(--primary-orange);
  text-shadow: 0 0 15px var(--primary-orange);
  font-weight: bold;
  margin: 0;
  flex: 1;
  text-align: center;
}



/* Confetti animations removed */

/* Special ending text highlighting */
.special-ending-highlight {
  background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
  background-size: 200% 200%;
  animation: specialEndingGlow 2s ease-in-out infinite;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  color: #000;
}

@keyframes specialEndingGlow {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  }
}

.sr-highlight {
  background: linear-gradient(45deg, #c0c0c0, #e5e5e5, #c0c0c0);
  background-size: 200% 200%;
  animation: srGlow 2s ease-in-out infinite;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(192, 192, 192, 0.8);
  color: #333;
}

@keyframes srGlow {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.6);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 30px rgba(192, 192, 192, 0.8);
  }
}

.ssr-highlight {
  background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
  background-size: 200% 200%;
  animation: ssrGlow 2s ease-in-out infinite;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  color: #000;
}

@keyframes ssrGlow {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  }
}

/* SR/SSR Icons for ending map */
.sr-icon, .ssr-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 10;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sr-icon {
  background: linear-gradient(45deg, #c0c0c0, #e5e5e5, #c0c0c0);
  background-size: 200% 200%;
  animation: srGlow 2s ease-in-out infinite;
  color: #333;
}

.ssr-icon {
  background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
  background-size: 200% 200%;
  animation: ssrGlow 2s ease-in-out infinite;
  color: #000;
}

.bonus-message {
  background: rgba(255, 165, 0, 0.05);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-light);
  animation: bonusMessagePulse 3s ease-in-out infinite;
}

@keyframes bonusModalAppear {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes bonusContentGlow {
  0% {
    box-shadow: 
      0 0 30px rgba(255, 165, 0, 0.5),
      0 0 60px rgba(255, 165, 0, 0.3),
      inset 0 0 20px rgba(255, 165, 0, 0.1);
  }
  100% {
    box-shadow: 
      0 0 40px rgba(255, 165, 0, 0.7),
      0 0 80px rgba(255, 165, 0, 0.4),
      inset 0 0 30px rgba(255, 165, 0, 0.2);
  }
}

@keyframes bonusIconBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.1);
  }
}

@keyframes bonusMessagePulse {
  0%, 100% {
    border-color: rgba(255, 165, 0, 0.3);
    box-shadow: 0 0 5px rgba(255, 165, 0, 0.2);
  }
  50% {
    border-color: rgba(255, 165, 0, 0.6);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.4);
  }
}



.map-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.map-node {
  position: relative;
  padding: 15px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  border: 2px solid var(--text-gray);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.map-node.current {
  border-color: var(--primary-red);
  box-shadow: 0 0 15px rgba(255, 40, 80, 0.3);
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  animation: currentNodePulse 2s ease-in-out infinite;
}

.map-node.visited {
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  cursor: pointer;
}

.map-node.locked {
  border-color: var(--text-gray);
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  opacity: 0.7;
  cursor: not-allowed;
}

/* Locked map nodes (both story and ending) should not have blur effect */
.map-node.locked .map-node-title {
  color: var(--text-gray);
  transition: color 0.3s ease;
}

.map-node.highlighted {
  position: relative;
}

.map-node.highlighted::before {
  content: "🦋";
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 16px;
  background: var(--bg-dark);
  border-radius: 50%;
  padding: 2px;
}

.map-node:hover:not(.locked) {
  border-color: var(--primary-orange);
  transform: scale(1.05);
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  border: 2px solid var(--border-glow);
  border-radius: 8px;
  padding: 15px 20px;
  min-width: 300px;
  animation: fadeIn 0.3s ease-out;
}

.toast-success {
  border-color: var(--primary-blue);
}

.toast-error {
  border-color: var(--primary-red);
}

.toast-title {
  font-weight: bold;
  margin-bottom: 5px;
}

.toast-description {
  color: var(--text-gray);
  font-size: 0.9rem;
}

/* LOADING INDICATOR */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 3000;
}

.loading.active {
  display: flex;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--text-gray);
  border-top: 3px solid var(--primary-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  color: var(--text-gray);
  font-size: 1rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .header-stats {
    order: 1;
  }
  
  .header-actions {
    order: 2;
    justify-content: center;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .rules-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    margin: 10px;
    max-height: 90vh;
  }
  
  .toast-container {
    left: 10px;
    right: 10px;
  }
  
  .toast {
    min-width: auto;
  }
}

/* WARNING STYLES */
.warning {
  color: var(--primary-orange);
  font-size: 0.9rem;
  margin: 10px 0;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mt-4 {
  margin-top: 1rem;
}



/* Tools Collection Styles */
.tools-content {
  padding: 20px 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.no-tools-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-gray);
}

.no-tools-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-tools-message p {
  margin: 10px 0;
  font-size: 1.1rem;
}

/* Tarot Card Styles */
.tarot-card {
  position: relative;
  width: 100%;
  height: 280px;
  perspective: 1000px;
  cursor: pointer;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.tarot-card:hover {
  transform: scale(1.05);
}

.tarot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  border-radius: 12px;
  overflow: hidden;
}

.tarot-card.flipped .tarot-card-inner {
  transform: rotateY(180deg);
}

.tarot-card-front,
.tarot-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.tarot-card-front {
  background: linear-gradient(135deg, #2d1b3d 0%, #4a2d5a 50%, #2d1b3d 100%);
  border: 3px solid #8b5cf6;
  box-shadow: 
    0 0 20px rgba(139, 92, 246, 0.5),
    inset 0 0 30px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

/* Enhanced Antique Pattern Background */
.tarot-card-front::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 1px, transparent 1px),
    linear-gradient(45deg, transparent 40%, rgba(139, 92, 246, 0.05) 50%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, rgba(139, 92, 246, 0.05) 50%, transparent 60%),
    repeating-linear-gradient(90deg, transparent, transparent 15px, rgba(139, 92, 246, 0.02) 15px, rgba(139, 92, 246, 0.02) 16px),
    repeating-linear-gradient(0deg, transparent, transparent 15px, rgba(139, 92, 246, 0.02) 15px, rgba(139, 92, 246, 0.02) 16px);
  background-size: 30px 30px, 30px 30px, 20px 20px, 60px 60px, 60px 60px, 32px 32px, 32px 32px;
  background-position: 0 0, 15px 15px, 10px 10px, 0 0, 0 0, 0 0, 0 0;
  animation: antiquePattern 30s linear infinite;
}

/* Mystical corner decorations */
.tarot-card-front::after {
  content: '✦';
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 1.5rem;
  color: #a855f7;
  opacity: 0.6;
  animation: mysticalTwinkle 2s ease-in-out infinite alternate;
}

.tarot-card-front .tarot-card-title::before {
  content: '✦';
  position: absolute;
  top: -15px;
  right: -15px;
  font-size: 1.2rem;
  color: #a855f7;
  opacity: 0.4;
  animation: mysticalTwinkle 2.5s ease-in-out infinite alternate-reverse;
}

@keyframes mysticalTwinkle {
  0% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 0.8; transform: scale(1.2); }
}

@keyframes antiquePattern {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.tarot-card-back {
  background: linear-gradient(135deg, #1a0f1a 0%, #2d1b3d 50%, #1a0f1a 100%);
  border: 3px solid #a855f7;
  box-shadow: 
    0 0 30px rgba(168, 85, 247, 0.6),
    inset 0 0 20px rgba(168, 85, 247, 0.1);
  transform: rotateY(180deg);
  position: relative;
  overflow: hidden;
}

/* Mystical Symbols on Back */
.tarot-card-back::before {
  content: '🔮';
  font-size: 3rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.3;
  animation: mysticalGlow 3s ease-in-out infinite alternate;
}

@keyframes mysticalGlow {
  0% { 
    opacity: 0.3;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
  }
  100% { 
    opacity: 0.6;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.8);
  }
}

.tarot-card-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #a855f7;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
  margin-bottom: 10px;
  z-index: 1;
  position: relative;
}

.tarot-card-content {
  font-size: 0.9rem;
  color: #f5deb3;
  line-height: 1.4;
  z-index: 1;
  position: relative;
}

.tarot-card-front .tarot-card-title {
  color: #a855f7;
  font-size: 1.1rem;
}

.tarot-card-front .tarot-card-content {
  color: #c084fc;
  font-size: 0.8rem;
}

/* Tool Count Display */
.tool-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #a855f7 0%, #c084fc 50%, #a855f7 100%);
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #7c3aed;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
  font-family: 'Arial', sans-serif;
}

.tool-count::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(45deg, #c084fc, #a855f7, #c084fc);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.8;
}

/* Enhanced count display for larger numbers */
.tool-count[data-count="10"],
.tool-count[data-count="11"],
.tool-count[data-count="12"] {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
}

.tool-count[data-count="13"],
.tool-count[data-count="14"],
.tool-count[data-count="15"] {
  width: 30px;
  height: 30px;
  font-size: 0.75rem;
}

.tool-count[data-count="16"],
.tool-count[data-count="17"],
.tool-count[data-count="18"],
.tool-count[data-count="19"],
.tool-count[data-count="20"] {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
}



/* Card Unlock Animation */
.tarot-card.unlocking {
  animation: cardUnlock 1.5s ease-out;
}

@keyframes cardUnlock {
  0% {
    transform: scale(0.8) rotateY(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotateY(90deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) rotateY(180deg);
    opacity: 1;
  }
}

/* Tool Detail Modal Styles */
.tool-detail-content {
  background: linear-gradient(135deg, #1a0033 0%, #330066 50%, #1a0033 100%);
  border: 3px solid var(--primary-orange);
  box-shadow: 
    0 0 40px rgba(255, 165, 0, 0.6),
    inset 0 0 30px rgba(255, 165, 0, 0.1);
  max-width: 500px;
}

.tool-detail-content .modal-header {
  background: linear-gradient(90deg, rgba(255, 165, 0, 0.1) 0%, rgba(255, 165, 0, 0.05) 100%);
  border-bottom: 2px solid var(--primary-orange);
}

.tool-detail-content .modal-header h2 {
  color: var(--primary-orange);
  text-shadow: 0 0 15px var(--primary-orange);
}

.tool-detail-body {
  padding: 20px;
  background: rgba(255, 165, 0, 0.05);
  border-radius: 8px;
  margin: 20px 0;
  color: var(--text-light);
  line-height: 1.6;
  font-size: 1.1rem;
  text-align: center;
  border: 1px solid rgba(255, 165, 0, 0.3);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
  
  .tarot-card {
    height: 220px;
  }
  
  .tarot-card-title {
    font-size: 1rem;
  }
  
  .tarot-card-content {
    font-size: 0.8rem;
  }
  
  .modal-content {
    margin: 10px;
    max-height: 90vh;
  }
  
  .toast-container {
    left: 10px;
    right: 10px;
  }
  
  .toast {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .tarot-card {
    height: 200px;
  }
}

/* Bug Report Styles */
.bug-report-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  border: 2px solid #ff6b6b;
  color: white;
  transition: all 0.3s ease;
}

.bug-report-btn:hover {
  background: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%);
  border-color: #ff5252;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.bug-report-btn:active {
  transform: translateY(0);
}

.bug-report-description {
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.6;
  text-align: center;
  font-size: 1rem;
}

.bug-report-form {
  padding: 20px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-light);
  font-weight: 600;
  font-size: 1rem;
}

.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(255, 165, 0, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-light);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
  transition: all 0.3s ease;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 15px rgba(255, 165, 0, 0.3);
  background: rgba(0, 0, 0, 0.5);
}

.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.char-count {
  text-align: right;
  margin-top: 5px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.char-count.warning {
  color: #ff9800;
}

.char-count.error {
  color: #f44336;
}

.btn-loading {
  display: none;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-loading {
  display: inline;
}

/* Login bug report button positioned in upper right corner */
.login-bug-report-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 0.9rem;
  padding: 8px 12px;
  z-index: 10;
}

/* Login footer styles */
.login-footer {
  margin-top: 20px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer .bug-report-btn {
  font-size: 0.9rem;
  padding: 8px 16px;
}

/* Mobile responsive for bug report */
@media (max-width: 768px) {
  .bug-report-form {
    padding: 15px 0;
  }
  
  .form-group textarea {
    font-size: 0.9rem;
    padding: 10px;
  }
  
  .bug-report-description {
    font-size: 0.9rem;
  }
  
  .login-footer {
    margin-top: 15px;
    padding-top: 15px;
  }
}