/* Navigation Styles */
.app-navigation {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(26, 26, 29, 0.95);
  border-bottom: 2px solid rgba(232, 212, 160, 0.3);
  backdrop-filter: blur(10px);
  z-index: 10000;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  font-size: 1.8rem;
  color: #ffd700;
}

.nav-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 5px;
}

.nav-link {
  padding: 10px 20px;
  color: #e8d4a0;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-link:hover {
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
}

.nav-link.active {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  font-weight: 600;
}

/* Base Styles */
body {
  font-family: 'Georgia', serif;
  background: linear-gradient(135deg, #0e0e10 0%, #1a1a2e 100%);
  color: #f8f4e3;
  margin: 0;
  padding: 2rem;
  padding-top: 80px; /* Space for fixed nav */
  min-height: 100vh;
}

body.landing-page {
  padding-top: 70px;
}

/* Admin/Worldbuilder Common Styles */
.admin-container {
  max-width: 1800px;
  margin: 0 auto;
}

.admin-container .header {
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 2px solid rgba(232, 212, 160, 0.3);
  text-align: center;
}

.admin-container .header h1 {
  color: #ffd700;
  margin: 0 0 10px;
  font-size: 2.2rem;
}

.admin-container .header p {
  color: #b8b8b8;
  margin: 0;
  font-size: 1rem;
}

.panel {
  background: rgba(26, 26, 29, 0.9);
  border: 2px solid rgba(232, 212, 160, 0.3);
  border-radius: 12px;
  padding: 25px;
  max-height: 80vh;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.panel h2 {
  color: #ffd700;
  font-size: 1.3rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(232, 212, 160, 0.2);
}

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

.form-group label {
  display: block;
  color: #e8d4a0;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: rgba(42, 42, 46, 0.8);
  border: 1px solid rgba(232, 212, 160, 0.3);
  color: #e8e8e8;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
}

.form-hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 5px;
}

.button {
  background: linear-gradient(135deg, #4a5a4e 0%, #2a3a2e 100%);
  color: #e8d4a0;
  border: 2px solid rgba(232, 212, 160, 0.4);
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.button:hover {
  background: linear-gradient(135deg, #5a6a5e 0%, #3a4a3e 100%);
  border-color: #ffd700;
  color: #ffd700;
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  color: #1a1a2e;
  border-color: #ffd700;
}

.button-success {
  background: linear-gradient(135deg, #50ff50 0%, #00cc00 100%);
  color: #1a1a2e;
  border-color: #50ff50;
}

.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.json-preview {
  background: #0d0d0d;
  color: #e8e8e8;
  padding: 20px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  border: 1px solid rgba(255, 215, 0, 0.2);
  max-height: 500px;
  overflow-y: auto;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state h3 {
  color: #e8d4a0;
  margin-bottom: 10px;
}

.tab-navigation {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  background: rgba(42, 42, 46, 0.5);
  padding: 15px 20px;
  border-radius: 12px;
  border: 2px solid rgba(232, 212, 160, 0.2);
}

.meta-tag {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #ffd700;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  display: inline-block;
}

.icon-button {
  background: rgba(42, 42, 46, 0.8);
  border: 1px solid rgba(232, 212, 160, 0.3);
  color: #e8d4a0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.icon-button:hover {
  border-color: #ffd700;
  color: #ffd700;
}

.icon-button.danger:hover {
  border-color: #ff4444;
  color: #ff4444;
}

/* Worldbuilder Specific Styles */
.mode-selector-panel {
  background: rgba(42, 42, 46, 0.5);
  padding: 20px 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  border: 2px solid rgba(232, 212, 160, 0.3);
}

.mode-description {
  margin-top: 15px;
  padding: 12px;
  background: rgba(30, 30, 34, 0.5);
  border-radius: 6px;
  color: #b8b8b8;
  font-size: 0.9rem;
}

.mode-btn {
  padding: 10px 20px;
  font-size: 0.95rem;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.mode-btn.active {
  opacity: 1;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #1a1a2e;
  border-color: #ffd700;
}

.entity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(80vh - 120px);
  overflow-y: auto;
}

.entity-card {
  background: rgba(42, 42, 46, 0.6);
  border: 1px solid rgba(232, 212, 160, 0.2);
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.entity-card:hover {
  background: rgba(42, 42, 46, 0.9);
  border-color: #ffd700;
  transform: translateX(3px);
}

.entity-card h3 {
  color: #ffd700;
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
}

.entity-card p {
  color: #b8b8b8;
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.mode-specific {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(232, 212, 160, 0.2);
}

/* Word Bank Styles */
.wordbank-card {
  background: rgba(42, 42, 46, 0.6);
  border: 2px solid rgba(232, 212, 160, 0.2);
  border-radius: 10px;
  padding: 18px;
  transition: all 0.3s ease;
}

.wordbank-card:hover {
  background: rgba(42, 42, 46, 0.9);
  border-color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

/* Entity Badge Styles */
.entity-badges {
  display: flex;
  gap: 4px;
  align-items: center;
}

.entity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: help;
  transition: transform 0.2s ease;
}

.entity-badge:hover {
  transform: scale(1.3);
}

.entity-badge-character {
  background: rgba(138, 43, 226, 0.3);
  border: 1.5px solid rgba(186, 104, 200, 0.6);
  color: #ba68c8;
}

.entity-badge-location {
  background: rgba(66, 135, 245, 0.3);
  border: 1.5px solid rgba(107, 157, 255, 0.6);
  color: #6b9dff;
}

.entity-badge-item {
  background: rgba(80, 255, 80, 0.3);
  border: 1.5px solid rgba(80, 255, 80, 0.6);
  color: #50ff50;
}

/* Dialogue Manager Styles */
.dialogue-card {
  background: rgba(42, 42, 46, 0.6);
  border: 2px solid rgba(232, 212, 160, 0.2);
  border-radius: 10px;
  padding: 18px;
  transition: all 0.3s ease;
}

.dialogue-card:hover {
  background: rgba(42, 42, 46, 0.9);
  border-color: #ba68c8;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(186, 104, 200, 0.2);
}

/* World Data Browser Styles */
.world-data-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #888;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-family: inherit;
}

.world-data-tab:hover {
  color: #e8d4a0;
  background: rgba(232, 212, 160, 0.05);
}

.world-data-tab.active {
  color: #ffd700;
  border-bottom-color: #ffd700;
  background: rgba(232, 212, 160, 0.1);
}

.world-data-item {
  background: rgba(42, 42, 46, 0.4);
  border: 1.5px solid rgba(232, 212, 160, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.world-data-item:hover {
  background: rgba(42, 42, 46, 0.7);
  border-color: #ffd700;
  transform: translateX(5px);
}

.world-data-item.character {
  border-left: 4px solid #ba68c8;
}

.world-data-item.location {
  border-left: 4px solid #6b9dff;
}

.world-data-item.item {
  border-left: 4px solid #50ff50;
}

/* Navigation Menu (Open World) */
.navigation-menu {
  margin: 25px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(30, 30, 34, 0.95) 0%, rgba(42, 42, 46, 0.95) 100%);
  border: 2px solid rgba(107, 157, 255, 0.4);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(107, 157, 255, 0.2);
}

.navigation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(107, 157, 255, 0.2);
}

.travel-destinations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.travel-option {
  padding: 15px;
  background: rgba(42, 42, 46, 0.6);
  border: 2px solid rgba(107, 157, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.travel-option:hover {
  background: rgba(42, 42, 46, 0.9);
  border-color: #6b9dff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(107, 157, 255, 0.3);
}

.travel-option.visited {
  border-color: rgba(80, 255, 80, 0.3);
}

.travel-option.undiscovered {
  opacity: 0.4;
  cursor: not-allowed;
}

.travel-option-name {
  color: #6b9dff;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.travel-option-type {
  color: #888;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.travel-option-description {
  color: #b8b8b8;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.travel-option-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid;
}

.status-badge.visited {
  background: rgba(80, 255, 80, 0.1);
  border-color: rgba(80, 255, 80, 0.3);
  color: #50ff50;
}

.status-badge.new {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
  color: #ffd700;
}

.toggle-travel-button {
  margin-left: 15px;
  padding: 14px 24px;
  background: linear-gradient(135deg, rgba(107, 157, 255, 0.2) 0%, rgba(66, 135, 245, 0.2) 100%);
  border: 2px solid #6b9dff;
  border-radius: 10px;
  color: #6b9dff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-travel-button:hover {
  background: linear-gradient(135deg, rgba(107, 157, 255, 0.4) 0%, rgba(66, 135, 245, 0.4) 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(107, 157, 255, 0.4);
}

/* Game Container */
.game-container {
  max-width: 1200px;
  margin: 0 auto;
}

.main-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.story-section {
  flex: 1;
  min-width: 0;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  color: #e8d4a0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.instruction {
  font-size: 0.9rem;
  color: #b8a878;
  margin: 0;
  font-style: italic;
}

/* Audio Visualizer */
.audio-visualizer-container {
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  height: 80px;
  background: rgba(26, 26, 29, 0.9);
  border: 2px solid rgba(232, 212, 160, 0.2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s ease;
}

.audio-visualizer-container:hover {
  border-color: rgba(232, 212, 160, 0.3);
}

#audio-visualizer {
  width: 100%;
  height: 100%;
  display: block;
}

/* Story Wrapper */
.story-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

/* Story Container */
#story {
  background: rgba(26, 26, 29, 0.9);
  padding: 2rem 2.5rem;
  border-radius: 12px 12px 0 0;
  min-height: 200px;
  line-height: 1.8;
  font-size: 1.15rem;
  cursor: text;
  border: 2px solid rgba(232, 212, 160, 0.2);
  border-bottom: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#story:focus {
  outline: none;
  border-color: rgba(232, 212, 160, 0.4);
}

#story.equipment-mode-active {
  cursor: crosshair;
  border-color: rgba(50, 205, 50, 0.4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 20px rgba(50, 205, 50, 0.3);
}

/* Cooldown Bar Container */
.cooldown-bar-container {
  background: rgba(26, 26, 29, 0.9);
  border: 2px solid rgba(232, 212, 160, 0.2);
  border-top: 1px solid rgba(232, 212, 160, 0.1);
  border-radius: 0 0 12px 12px;
  padding: 0;
  height: 8px;
  overflow: hidden;
  position: relative;
}

.cooldown-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffd700 0%, #ff8c00 50%, #ff4500 100%);
  width: 100%;
  transition: width linear;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  position: relative;
}

.cooldown-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.cooldown-bar.paused {
  opacity: 0.3;
  box-shadow: none;
}

.cooldown-bar.active {
  opacity: 1;
}

/* Editable Words */
.word-editable {
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 1px dashed transparent;
  padding: 2px 4px;
  margin: 0 1px;
  border-radius: 3px;
  position: relative;
  min-width: 20px; /* Ensure empty words are visible and clickable */
  min-height: 1.2em; /* Maintain height even when empty */
  display: inline-block;
  vertical-align: baseline;
}

/* Empty word placeholder - show when only zero-width space or truly empty */
.word-editable:empty::after {
  content: '___';
  color: rgba(232, 212, 160, 0.3);
  font-style: italic;
  pointer-events: none;
  position: absolute;
  left: 4px;
}

/* Active empty word shows more prominent placeholder */
.word-active:empty::after {
  color: rgba(100, 150, 255, 0.5);
  content: '___';
}

/* When word only contains zero-width space and NOT active, show placeholder */
.word-editable[data-empty="true"]:not(.word-active)::after {
  content: '___';
  color: rgba(232, 212, 160, 0.3);
  font-style: italic;
  pointer-events: none;
  position: absolute;
  left: 4px;
}

/* Active empty word (being edited) - show placeholder with stronger color */
.word-active[data-empty="true"]::after {
  content: '___';
  color: rgba(100, 150, 255, 0.5);
  font-style: italic;
  pointer-events: none;
  position: absolute;
  left: 4px;
}

/* When editing with actual content but not confirmed, show dashed border */
.word-active[data-empty="true"]:not(:empty) {
  border: 2px dashed rgba(100, 150, 255, 0.6);
  border-radius: 4px;
}

/* Hide placeholder when there's actual text content visible */
.word-active[data-empty="true"]:not(:empty)::after {
  display: none;
}

/* Single words have higher z-index priority over phrases */
.word-single {
  z-index: 10;
}

.word-phrase {
  z-index: 5;
}

/* High importance words - always visible with gold styling */
.word-high {
  color: #ffd700;
  font-weight: 600;
  background-color: rgba(255, 215, 0, 0.1);
  border-bottom: 2px solid rgba(255, 215, 0, 0.5);
}

.word-high:hover {
  color: #ffed4e;
  background-color: rgba(255, 215, 0, 0.25);
  border-bottom-color: rgba(255, 215, 0, 0.8);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* Low importance words - always visible with subtle bronze styling */
.word-low {
  color: #d4af77;
  font-weight: 500;
  background-color: rgba(212, 175, 119, 0.08);
  border-bottom: 1px solid rgba(212, 175, 119, 0.4);
}

.word-low:hover {
  color: #e8c48e;
  background-color: rgba(212, 175, 119, 0.2);
  border-bottom-color: rgba(212, 175, 119, 0.7);
  box-shadow: 0 0 6px rgba(212, 175, 119, 0.3);
}

/* Single words take precedence - higher z-index on hover */
.word-single:hover {
  z-index: 20 !important;
}

/* Hide phrase hover when a single word inside is being hovered */
.word-phrase:has(.word-single:hover) {
  color: inherit !important;
  background-color: transparent !important;
  border-bottom-color: transparent !important;
}

.word-phrase:has(.word-single:hover)::after {
  width: 0% !important;
}

/* Active editing state */
.word-active {
  background-color: rgba(100, 150, 255, 0.3) !important;
  border: 1px solid rgba(100, 150, 255, 0.6);
  border-radius: 4px;
  padding: 2px 6px;
  outline: none;
  box-shadow: 0 0 8px rgba(100, 150, 255, 0.4);
  z-index: 100 !important;
}

.word-active.word-high {
  color: #ffd700 !important;
  font-weight: 600 !important;
  background-color: rgba(255, 215, 0, 0.35) !important;
  border-color: rgba(255, 215, 0, 0.8);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.word-active.word-high::after {
  width: 100%;
}

.word-active.word-low {
  color: #d4af77 !important;
  background-color: rgba(212, 175, 119, 0.35) !important;
  border-color: rgba(212, 175, 119, 0.8);
  box-shadow: 0 0 8px rgba(212, 175, 119, 0.4);
}

.word-active.word-low::after {
  width: 100%;
}

/* Equipment interaction states */
.word-editable.equipment-compatible {
  color: #7cfc00 !important;
  font-weight: 600 !important;
  border: 2px solid rgba(50, 205, 50, 0.6) !important;
  background-color: rgba(50, 205, 50, 0.1) !important;
  animation: pulse-green 1.5s infinite;
  cursor: crosshair !important;
}

.word-editable.equipment-compatible::after {
  width: 100%;
  background: #7cfc00;
}

.word-editable.equipment-incompatible {
  opacity: 0.3;
  filter: grayscale(0.8);
  cursor: not-allowed !important;
}

@keyframes pulse-green {
  0%, 100% {
    box-shadow: 0 0 5px rgba(50, 205, 50, 0.4);
  }
  50% {
    box-shadow: 0 0 15px rgba(50, 205, 50, 0.8);
  }
}

/* Story Controls */
.story-controls {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.continue-button {
  background: linear-gradient(135deg, #4a5a4e 0%, #2a3a2e 100%);
  color: #e8d4a0;
  border: 2px solid rgba(232, 212, 160, 0.4);
  padding: 0.85rem 2.5rem;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.continue-button:hover {
  background: linear-gradient(135deg, #5a6a5e 0%, #3a4a3e 100%);
  border-color: rgba(255, 215, 0, 0.6);
  color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.3);
}

.continue-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.continue-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Choice Buttons */
.choice-buttons-container {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.4s ease;
}

.choice-button {
  background: linear-gradient(135deg, #3a4a5e 0%, #2a3a4e 100%);
  color: #e8d4a0;
  border: 2px solid rgba(232, 212, 160, 0.4);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.3px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}

.choice-button:hover {
  background: linear-gradient(135deg, #4a5a6e 0%, #3a4a5e 100%);
  border-color: rgba(255, 215, 0, 0.6);
  color: #ffd700;
  transform: translateX(8px);
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.3);
}

.choice-button:active {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.choice-button-icon {
  font-size: 1.3rem;
  min-width: 1.5rem;
  text-align: center;
}

.choice-button-content {
  flex: 1;
}

.choice-button-label {
  font-size: 0.75rem;
  color: #b8a878;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.choice-button-text {
  font-size: 1rem;
  color: inherit;
}

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

/* Suggestion Box */
#suggestions {
  position: absolute;
  background: linear-gradient(135deg, #2a2a2e 0%, #1a1a1e 100%);
  color: #fff;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 0.95rem;
  display: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  border: 1px solid rgba(232, 212, 160, 0.3);
  z-index: 1000;
  min-width: 150px;
}

.suggestion-item {
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-radius: 4px;
  margin: 2px 4px;
}

.suggestion-item:hover,
.suggestion-item.suggestion-selected {
  background: rgba(232, 212, 160, 0.2);
  color: #ffd700;
}

.suggestion-item.suggestion-selected {
  border-left: 3px solid #ffd700;
  padding-left: 13px;
}

/* Controls */
.controls {
  margin-top: 2rem;
  text-align: center;
}

button {
  background: linear-gradient(135deg, #4a4a5e 0%, #2a2a3e 100%);
  color: #e8d4a0;
  border: 2px solid rgba(232, 212, 160, 0.3);
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  background: linear-gradient(135deg, #5a5a6e 0%, #3a3a4e 100%);
  border-color: rgba(232, 212, 160, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

button:active {
  transform: translateY(0);
}

/* Word Bank */
.word-bank {
  flex: 0 0 350px;
  background: rgba(26, 26, 29, 0.95);
  border: 2px solid rgba(232, 212, 160, 0.3);
  border-radius: 12px;
  overflow: hidden;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}

.word-bank-header {
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  padding: 1rem 1.5rem;
  border-bottom: 2px solid rgba(232, 212, 160, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.word-bank-header h3 {
  margin: 0;
  color: #ffd700;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.toggle-btn {
  background: none;
  border: none;
  color: #e8d4a0;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: transform 0.3s;
}

.toggle-btn:hover {
  color: #ffd700;
}

.word-bank.collapsed .toggle-btn {
  transform: rotate(-90deg);
}

.word-bank.collapsed .word-bank-content {
  display: none;
}

.word-bank-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.word-bank-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(232, 212, 160, 0.2);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #b8a878;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  border-radius: 6px;
}

.tab-btn:hover {
  background: rgba(232, 212, 160, 0.1);
  color: #e8d4a0;
}

.tab-btn.active {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  font-weight: 600;
}

.word-bank-stats {
  font-size: 0.85rem;
  color: #b8a878;
  margin-bottom: 1rem;
  text-align: center;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
}

.word-card {
  background: linear-gradient(135deg, #3a3a4e 0%, #2a2a3e 100%);
  border: 2px solid rgba(232, 212, 160, 0.3);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.word-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.word-card.active {
  background: linear-gradient(135deg, #5a5a6e 0%, #4a4a5e 100%);
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.word-card.greyed {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

.word-card.greyed:hover {
  transform: none;
  border-color: rgba(232, 212, 160, 0.3);
  box-shadow: none;
}

.word-card-word {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e8d4a0;
  margin-bottom: 0.25rem;
}

.word-card.active .word-card-word {
  color: #ffd700;
}

.word-card-meta {
  font-size: 0.7rem;
  color: #888;
  margin-top: 0.25rem;
}

.word-card-uses {
  position: absolute;
  top: 4px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  color: #ffd700;
}

.word-card-icon {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.9rem;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.word-chip {
  background: rgba(232, 212, 160, 0.2);
  border: 1px solid rgba(232, 212, 160, 0.4);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #e8d4a0;
  cursor: pointer;
  transition: all 0.2s;
}

.word-chip:hover {
  background: rgba(255, 215, 0, 0.3);
  border-color: rgba(255, 215, 0, 0.6);
  color: #ffd700;
}

.empty-message {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 2rem 1rem;
  margin: 0;
}

/* Action Menu Styles */
#suggestions.action-menu {
  padding: 0;
  min-width: 250px;
  max-width: 350px;
}

.action-menu-header {
  background: rgba(255, 215, 0, 0.15);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  font-size: 0.9rem;
  color: #e8d4a0;
  text-align: center;
}

.action-menu-header strong {
  color: #ffd700;
  font-weight: 700;
}

.action-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin: 0.25rem 0.5rem;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-item:hover,
.action-item.action-selected {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.action-icon {
  font-size: 1.5rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.action-info {
  flex: 1;
}

.action-label {
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.action-description {
  font-size: 0.85rem;
  color: #b8a878;
  line-height: 1.3;
}

/* Word Transformation Styles */
.word-transformed {
  position: relative;
  animation: transform-pulse 0.6s ease-out;
}

@keyframes transform-pulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.15);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.word-transformed.transform-unlocked {
  color: #7cfc00 !important;
  text-shadow: 0 0 8px rgba(124, 252, 0, 0.5);
}

.word-transformed.transform-illuminated {
  color: #ffeb3b !important;
  text-shadow: 0 0 10px rgba(255, 235, 59, 0.7);
}

.transform-indicator {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.9em;
  animation: indicator-bounce 2s infinite;
}

@keyframes indicator-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Interaction Message Overlay */
.interaction-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(42, 42, 46, 0.98) 0%, rgba(26, 26, 30, 0.98) 100%);
  border: 2px solid rgba(255, 215, 0, 0.6);
  border-radius: 12px;
  padding: 1.5rem 2.5rem;
  font-size: 1.1rem;
  color: #e8d4a0;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4);
  z-index: 10000;
  animation: message-appear 0.3s ease-out;
  max-width: 80%;
  line-height: 1.6;
}

@keyframes message-appear {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.interaction-message.fade-out {
  animation: message-fade-out 0.5s ease-out forwards;
}

@keyframes message-fade-out {
  from {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
}

/* Theme Toggle Switch */
.theme-toggle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 28px;
}

.theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 2px solid rgba(232, 212, 160, 0.4);
  transition: all 0.3s;
  border-radius: 28px;
}

.theme-toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: #e8d4a0;
  transition: all 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-toggle input:checked + .theme-toggle-slider {
  background: linear-gradient(135deg, #4a5a4e 0%, #2a3a2e 100%);
  border-color: rgba(255, 215, 0, 0.5);
}

.theme-toggle input:checked + .theme-toggle-slider::before {
  transform: translateX(32px);
  background: #ffd700;
}

.theme-toggle-slider:hover {
  border-color: rgba(255, 215, 0, 0.6);
}

.theme-labels {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.theme-label {
  color: #888;
  transition: all 0.3s;
  cursor: pointer;
}

.theme-label.active {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* ========================================
   CLASSIC TERMINAL THEME
   ======================================== */

body.classic-theme {
  font-family: 'Courier New', 'Courier', monospace;
  background: #000000;
  color: #00ff00;
}

body.classic-theme .header h1 {
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  letter-spacing: 2px;
}

body.classic-theme .instruction {
  color: #00cc00;
  font-style: normal;
}

body.classic-theme .audio-visualizer-container {
  background: #000000;
  border: 2px dashed #00ff00;
  border-radius: 0;
  box-shadow: none;
}

body.classic-theme .audio-visualizer-container:hover {
  border-color: #00ff00;
}

body.classic-theme #story {
  background: #000000;
  border: 2px dashed #00ff00;
  border-radius: 0;
  color: #00ff00;
  font-family: 'Courier New', monospace;
  box-shadow: none;
  text-shadow: none;
}

body.classic-theme #story:focus,
body.classic-theme #story.equipment-mode-active {
  border-color: #00ff00;
  box-shadow: none;
}

body.classic-theme .cooldown-bar-container {
  background: #000000;
  border: 2px dashed #00ff00;
  border-radius: 0;
}

body.classic-theme .cooldown-bar {
  background: #00ff00;
  box-shadow: none;
}

body.classic-theme .word-high {
  color: #00ff00;
  background-color: rgba(0, 255, 0, 0.15);
  border-bottom: 2px solid #00ff00;
  text-shadow: none;
}

body.classic-theme .word-high:hover {
  color: #00ff00;
  background-color: rgba(0, 255, 0, 0.3);
  border-bottom-color: #00ff00;
  text-shadow: 0 0 5px #00ff00;
}

body.classic-theme .word-low {
  color: #00cc00;
  background-color: rgba(0, 204, 0, 0.1);
  border-bottom: 1px solid #00cc00;
  text-shadow: none;
}

body.classic-theme .word-low:hover {
  color: #00cc00;
  background-color: rgba(0, 204, 0, 0.2);
  border-bottom-color: #00cc00;
  text-shadow: 0 0 5px #00cc00;
}

body.classic-theme .word-active {
  background-color: rgba(0, 255, 0, 0.3) !important;
  border: 1px dashed #00ff00 !important;
  box-shadow: none;
}

body.classic-theme .word-active.word-high,
body.classic-theme .word-active.word-low {
  color: #00ff00 !important;
  background-color: rgba(0, 255, 0, 0.4) !important;
}

body.classic-theme .continue-button {
  background: #000000;
  color: #00ff00;
  border: 2px dashed #00ff00;
  border-radius: 0;
  font-family: 'Courier New', monospace;
  text-shadow: none;
  box-shadow: none;
}

body.classic-theme .continue-button:hover {
  background: #003300;
  color: #00ff00;
  border-color: #00ff00;
  box-shadow: none;
  text-shadow: none;
}

body.classic-theme .choice-button {
  background: #000000;
  color: #00ff00;
  border: 2px dashed #00ff00;
  border-radius: 0;
  font-family: 'Courier New', monospace;
  text-shadow: none;
  box-shadow: none;
}

body.classic-theme .choice-button:hover {
  background: #003300;
  color: #00ff00;
  border-color: #00ff00;
  transform: translateX(4px);
  box-shadow: none;
  text-shadow: none;
}

body.classic-theme .choice-button-label {
  color: #00ff00;
}

body.classic-theme #suggestions {
  background: #000000;
  border: 2px dashed #00ff00;
  border-radius: 0;
  box-shadow: none;
}

body.classic-theme .suggestion-item {
  color: #00ff00;
  border-radius: 0;
}

body.classic-theme .suggestion-item:hover,
body.classic-theme .suggestion-item.suggestion-selected {
  background: rgba(0, 255, 0, 0.2);
  color: #00ff00;
  border-left-color: #00ff00;
}

body.classic-theme button {
  background: #000000;
  color: #00ff00;
  border: 2px dashed #00ff00;
  border-radius: 0;
  font-family: 'Courier New', monospace;
  box-shadow: none;
}

body.classic-theme button:hover {
  background: #003300;
  border-color: #00ff00;
  box-shadow: none;
}

body.classic-theme .word-bank {
  background: #000000;
  border: 2px dashed #00ff00;
  border-radius: 0;
  box-shadow: none;
}

body.classic-theme .word-bank-header {
  background: #001100;
  border-bottom: 2px dashed #00ff00;
}

body.classic-theme .word-bank-header h3 {
  color: #00ff00;
  text-shadow: none;
}

body.classic-theme .toggle-btn {
  color: #00ff00;
}

body.classic-theme .toggle-btn:hover {
  color: #00ff00;
  text-shadow: none;
}

body.classic-theme .tab-btn {
  color: #00cc00;
  border-radius: 0;
}

body.classic-theme .tab-btn:hover {
  background: rgba(0, 255, 0, 0.1);
  color: #00ff00;
}

body.classic-theme .tab-btn.active {
  background: rgba(0, 255, 0, 0.2);
  color: #00ff00;
  border: 1px dashed #00ff00;
}

body.classic-theme .word-bank-stats {
  color: #00cc00;
}

body.classic-theme .word-card {
  background: #001100;
  border: 2px dashed #00ff00;
  border-radius: 0;
  box-shadow: none;
}

body.classic-theme .word-card:hover {
  border-color: #00ff00;
  box-shadow: none;
  background: #002200;
}

body.classic-theme .word-card.active {
  background: #003300;
  border-color: #00ff00;
  box-shadow: none;
}

body.classic-theme .word-card-word {
  color: #00ff00;
  text-shadow: none;
}

body.classic-theme .word-card.active .word-card-word {
  color: #00ff00;
  text-shadow: none;
}

body.classic-theme .word-card-meta {
  color: #00aa00;
}

body.classic-theme .word-card-uses {
  background: rgba(0, 0, 0, 0.8);
  color: #00ff00;
  border: 1px dashed #00ff00;
}

body.classic-theme .word-chip {
  background: rgba(0, 255, 0, 0.1);
  border: 1px dashed #00ff00;
  color: #00ff00;
  border-radius: 0;
}

body.classic-theme .word-chip:hover {
  background: rgba(0, 255, 0, 0.2);
  border-color: #00ff00;
  box-shadow: none;
}

body.classic-theme .empty-message {
  color: #006600;
}

body.classic-theme .action-menu-header {
  background: rgba(0, 255, 0, 0.1);
  border-bottom: 2px dashed #00ff00;
  color: #00ff00;
}

body.classic-theme .action-menu-header strong {
  color: #00ff00;
}

body.classic-theme .action-item {
  background: rgba(0, 255, 0, 0.05);
  border: 1px dashed #00ff00;
  border-radius: 0;
}

body.classic-theme .action-item:hover,
body.classic-theme .action-item.action-selected {
  background: rgba(0, 255, 0, 0.15);
  border-color: #00ff00;
  box-shadow: none;
}

body.classic-theme .action-label {
  color: #00ff00;
}

body.classic-theme .action-description {
  color: #00cc00;
}

body.classic-theme .word-transformed.transform-unlocked {
  color: #00ff00 !important;
  text-shadow: none;
}

body.classic-theme .word-transformed.transform-illuminated {
  color: #00ff00 !important;
  text-shadow: none;
}

body.classic-theme .interaction-message {
  background: rgba(0, 0, 0, 0.95);
  border: 2px dashed #00ff00;
  border-radius: 0;
  color: #00ff00;
  box-shadow: none;
  text-shadow: none;
}

body.classic-theme .word-editable.equipment-compatible {
  color: #00ff00 !important;
  border: 2px dashed #00ff00 !important;
  background-color: rgba(0, 255, 0, 0.2) !important;
  box-shadow: none;
}

body.classic-theme .word-editable.equipment-incompatible {
  opacity: 0.3;
  color: #004400 !important;
}

/* Theme toggle in classic mode */
body.classic-theme .theme-toggle-slider {
  background: #000000;
  border: 2px dashed #00ff00;
}

body.classic-theme .theme-toggle-slider::before {
  background: #00ff00;
  box-shadow: none;
}

body.classic-theme .theme-toggle input:checked + .theme-toggle-slider::before {
  background: #00ff00;
}

body.classic-theme .theme-label {
  color: #006600;
  font-family: 'Courier New', monospace;
}

body.classic-theme .theme-label.active {
  color: #00ff00;
  text-shadow: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-content {
    flex-direction: column;
  }

  .word-bank {
    flex: 1;
    max-width: 100%;
  }

  .theme-toggle-container {
    margin-top: 1rem;
  }
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  #story {
    padding: 1.5rem;
    font-size: 1rem;
  }

  .cooldown-bar-container {
    height: 6px;
  }

  .word-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .header > div {
    flex-direction: column !important;
    gap: 1rem;
  }

  .theme-toggle-container {
    margin-top: 0.5rem;
  }
}
