:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #12121f;
  --bg-tertiary: #1a1a2e;
  --bg-dark: #050508;
  --accent: #e94560;
  --accent-glow: #ff6b6b;
  --gold: #ffd700;
  --gold-dim: #b8860b;
  --silver: #c0c0c0;
  --magic-blue: #4fc3f7;
  --magic-purple: #ba68c8;
  --nature-green: #81c784;
  --danger-red: #e57373;
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0b0;
  --text-muted: #707070;
  --border-color: #2a2a3e;
  --border-gold: #4a3f00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Georgia', 'Palatino', serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-secondary) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  overflow: hidden;
}

/* ============ MAIN MENU ============ */
.main-menu-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.main-menu-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0a12 100%);
  overflow: hidden;
}

.main-menu-content {
  position: relative;
  z-index: 10;
  max-width: 1000px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
}

.menu-title-section {
  text-align: center;
  margin-bottom: 3rem;
}

.title-glow {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.title-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 30px var(--accent));
  animation: pulse 2s infinite;
}

.game-title {
  font-size: 1.8rem;
  font-weight: bold;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  margin: 0;
  letter-spacing: 0.05rem;
  font-family: 'Cinzel', serif;
}

.game-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-style: italic;
  letter-spacing: 0.3rem;
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.menu-btn {
  background: linear-gradient(135deg, rgba(233, 69, 96, 0.2), rgba(233, 69, 96, 0.1));
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.menu-btn:hover:not(:disabled) {
  background: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(233, 69, 96, 0.4);
}

.menu-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-text {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.2rem;
}

.btn-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

.menu-btn:hover:not(:disabled) .btn-desc {
  color: white;
}

/* Continue Section */
.continue-section {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 1.5rem;
}

.section-title {
  color: var(--gold);
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 0.1rem;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.session-card {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.session-card:hover {
  border-color: var(--accent);
  transform: translateX(5px);
}

.session-card-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.session-icon {
  font-size: 2rem;
}

.session-info {
  display: flex;
  flex-direction: column;
}

.session-name {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.session-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.delete-btn:hover {
  opacity: 1;
}

.no-sessions {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.no-sessions .hint {
  color: var(--gold-dim);
  font-style: italic;
  margin-top: 0.5rem;
}

.menu-decoration {
  position: fixed;
  font-size: 4rem;
  opacity: 0.3;
}

.menu-decoration.bottom-left {
  bottom: 2rem;
  left: 2rem;
}

.menu-decoration.bottom-right {
  bottom: 2rem;
  right: 2rem;
}

/* ============ GODDESS CHAT ============ */
.goddess-chat-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.goddess-chat-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0a12 100%);
  overflow: hidden;
}

.goddess-chat-content {
  position: relative;
  z-index: 10;
  width: 90%;
  max-width: 1000px;
  height: 90vh;
  background: rgba(26, 26, 46, 0.95);
  border: 2px solid var(--border-gold);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.2);
}

.goddess-chat-header {
  padding: 1.5rem;
  border-bottom: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 14px 14px 0 0;
}

.goddess-avatar-large {
  font-size: 3rem;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

.goddess-chat-title {
  margin: 0;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  letter-spacing: 0.2rem;
}

.goddess-chat-subtitle {
  margin: 0.25rem 0 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
}

.phase-indicator {
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid var(--gold-dim);
  border-radius: 20px;
  color: var(--gold);
  font-size: 0.85rem;
}

.goddess-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 400px;
}

.goddess-message {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  animation: fadeIn 0.3s ease;
}

.goddess-message.player {
  flex-direction: row-reverse;
}

.message-avatar {
  font-size: 2rem;
  flex-shrink: 0;
}

.message-bubble {
  max-width: 70%;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  line-height: 1.6;
}

.message-bubble.goddess {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid var(--gold-dim);
  color: var(--text-primary);
}

.message-bubble.player {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.typing-indicator {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* Name Input */
.name-input-container {
  padding: 1.5rem;
  border-top: 2px solid var(--border-gold);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 0 14px 14px;
}

.name-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.label-icon {
  font-size: 1.2rem;
}

.name-input-wrapper {
  display: flex;
  gap: 1rem;
}

.fantasy-name-input {
  flex: 1;
  background: var(--bg-dark);
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: inherit;
}

.fantasy-name-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

.btn-submit-name {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border: none;
  border-radius: 8px;
  padding: 0 2rem;
  color: var(--bg-dark);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-submit-name:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

/* Goddess Input */
.goddess-input-container {
  padding: 1.5rem;
  border-top: 2px solid var(--border-gold);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  gap: 1rem;
  border-radius: 0 0 14px 14px;
}

.goddess-input {
  flex: 1;
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  resize: none;
}

.goddess-input:focus {
  outline: none;
  border-color: var(--accent);
}

.goddess-send-btn {
  background: linear-gradient(135deg, var(--accent), #c73e54);
  border: none;
  border-radius: 8px;
  padding: 0 1.5rem;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
}

.goddess-send-btn:hover {
  background: var(--accent-glow);
  transform: translateY(-2px);
}

.goddess-send-btn:disabled {
  background: #555;
  cursor: not-allowed;
}

/* Voice Input */
.voice-input-btn {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 50px;
  justify-content: center;
}

.voice-input-btn:hover {
  border-color: var(--accent);
}

.voice-input-btn.listening {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

.mic-icon {
  font-size: 1.5rem;
}

.listening-indicator {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
}

.listening-indicator span {
  width: 3px;
  background: #ff4444;
  border-radius: 2px;
  animation: soundwave 0.5s infinite;
}

.listening-indicator span:nth-child(1) { height: 8px; animation-delay: 0s; }
.listening-indicator span:nth-child(2) { height: 15px; animation-delay: 0.1s; }
.listening-indicator span:nth-child(3) { height: 10px; animation-delay: 0.2s; }

@keyframes soundwave {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(2); }
}

/* Audio Controls */
.audio-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin-top: 0.5rem;
}

.play-btn {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.2rem;
}

.play-btn:hover {
  border-color: var(--accent);
}

.play-btn.speaking {
  background: var(--accent);
  border-color: var(--accent);
}

.audio-settings {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.speed-control,
.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.speed-control input,
.volume-control input {
  width: 80px;
  accent-color: var(--accent);
}

.goddess-hint {
  text-align: center;
  padding: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  border-top: 1px solid var(--border-color);
}

/* Interactive Options */
.interaction-options {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 2px solid var(--border-gold);
  max-height: 200px;
  overflow-y: auto;
}

.interaction-options.items-panel {
  max-height: 250px;
}

.option-prompt {
  color: var(--gold);
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  text-align: center;
}

.option-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.option-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.option-btn.accept {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(76, 175, 80, 0.1));
  border-color: #4caf50;
}

.option-btn.accept:hover {
  background: #4caf50;
  color: white;
}

.option-btn.decline {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.3), rgba(255, 152, 0, 0.1));
  border-color: #ff9800;
}

.option-btn.decline:hover {
  background: #ff9800;
  color: white;
}

.option-btn.custom {
  background: linear-gradient(135deg, rgba(138, 107, 234, 0.3), rgba(138, 107, 234, 0.1));
  border-color: #8a6bea;
}

.option-btn.custom:hover {
  background: #8a6bea;
  color: white;
}

/* Item Cards */
.item-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.item-card {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.item-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 3px 15px rgba(255, 215, 0, 0.2);
}

.item-card.custom {
  border-style: dashed;
  background: rgba(138, 107, 234, 0.1);
}

.item-card.custom:hover {
  border-color: var(--magic-purple);
  background: rgba(138, 107, 234, 0.2);
}

.item-card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.item-card-name {
  color: var(--gold);
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.item-card-desc {
  color: var(--text-secondary);
  font-size: 0.7rem;
  margin: 0.25rem 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-type {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  background: var(--bg-dark);
  border-radius: 3px;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============ REINCARNATION MENU ============ */
.reincarnation-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.reincarnation-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0a12 100%);
  overflow: hidden;
}

.celestial-sphere {
  position: absolute;
  width: 100%;
  height: 100%;
  perspective: 1000px;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.8;
  animation: twinkle 3s infinite ease-in-out;
  box-shadow: 0 0 8px #fff;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.5); }
}

.mystical-aurora {
  position: absolute;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 30% 50%, rgba(138, 107, 234, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 50%, rgba(233, 69, 96, 0.1) 0%, transparent 50%);
  animation: aurora 30s infinite linear;
}

@keyframes aurora {
  0% { transform: rotate(0deg) translate(-5%, -5%); }
  100% { transform: rotate(360deg) translate(5%, 5%); }
}

.reincarnation-circle {
  position: absolute;
  width: 600px;
  height: 600px;
  border: 2px solid rgba(255, 215, 0, 0.1);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: rotate 60s infinite linear;
}

.reincarnation-circle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  border: 2px solid rgba(138, 107, 234, 0.15);
  border-radius: 50%;
}

.reincarnation-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 2px solid rgba(233, 69, 96, 0.2);
  border-radius: 50%;
}

@keyframes rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.reincarnation-content {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  width: 95%;
  max-height: 95vh;
  overflow-y: auto;
  padding: 2rem;
}

/* Goddess Encounter */
.goddess-encounter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  padding: 2rem;
}

.goddess-avatar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-glow {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: avatarPulse 3s infinite;
}

@keyframes avatarPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 50px rgba(255, 215, 0, 0.3); }
  50% { transform: scale(1.1); box-shadow: 0 0 80px rgba(255, 215, 0, 0.5); }
}

.goddess-icon {
  font-size: 6rem;
  filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
}

.goddess-runes {
  position: absolute;
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.rune {
  position: absolute;
  font-size: 1.5rem;
  color: rgba(255, 215, 0, 0.6);
  animation: runeFloat 4s infinite ease-in-out;
  animation-delay: calc(var(--i) * 0.5s);
}

.rune:nth-child(1) { top: 0; left: 50%; }
.rune:nth-child(2) { top: 25%; right: 10%; }
.rune:nth-child(3) { top: 75%; right: 10%; }
.rune:nth-child(4) { bottom: 0; left: 50%; }
.rune:nth-child(5) { bottom: 25%; left: 10%; }
.rune:nth-child(6) { top: 75%; left: 10%; }
.rune:nth-child(7) { top: 15%; left: 20%; }
.rune:nth-child(8) { top: 15%; right: 20%; }

@keyframes runeFloat {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-10px); }
}

.goddess-dialogue {
  background: rgba(26, 26, 46, 0.9);
  border: 2px solid var(--border-gold);
  border-radius: 16px;
  padding: 2rem;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
}

.dialogue-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.goddess-name {
  margin: 0;
  color: var(--gold);
  font-size: 2rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.2rem;
}

.goddess-title {
  margin: 0.5rem 0 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
}

.dialogue-content {
  margin-bottom: 1.5rem;
}

.goddess-speech {
  line-height: 1.8;
  color: var(--text-primary);
  font-size: 1.05rem;
  white-space: pre-wrap;
}

.dialogue-options {
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.question-prompt {
  color: var(--gold-dim);
  margin: 0 0 1rem 0;
  font-style: italic;
}

.soul-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.soul-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

.dialogue-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn-speak, .btn-skip, .btn-continue, .btn-begin, .btn-back {
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  font-weight: bold;
  border: none;
}

.btn-speak {
  background: linear-gradient(135deg, var(--accent) 0%, #c73e54 100%);
  color: white;
  flex: 1;
  min-width: 200px;
}

.btn-speak:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 25px rgba(233, 69, 96, 0.4);
}

.btn-skip {
  background: transparent;
  border: 2px solid var(--gold-dim);
  color: var(--gold);
}

.btn-skip:hover {
  background: var(--gold);
  color: var(--bg-dark);
}

.btn-continue, .btn-begin {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: var(--bg-dark);
}

.btn-continue:hover, .btn-begin:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

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

.btn-back {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.question-progress {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.progress-text {
  font-style: italic;
  color: var(--gold-dim);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.3s;
}

.goddess-response {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
  font-style: italic;
  color: var(--gold);
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.question-display {
  margin-bottom: 1rem;
}

.question-number {
  display: block;
  color: var(--gold-dim);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.question-text {
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
}

.btn-speak:disabled, .btn-skip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dialogue-buttons-secondary {
  display: flex;
  gap: 0.5rem;
}

.btn-back-small {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.btn-back-small:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.prophecy-hint-revealed {
  color: var(--gold);
  margin-top: 1rem;
  font-size: 0.9rem;
  animation: pulse 2s infinite;
}

/* Stats Reveal */
.stats-reveal {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.stats-reveal h3 {
  color: var(--gold);
  margin: 0 0 1rem 0;
  text-align: center;
}

.stats-display {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stat-item {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
}

.stat-item span:first-child {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.vitals-display {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  background: var(--bg-dark);
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.class-reveal {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 6px;
  color: var(--gold);
}

/* Stats Reveal Screen */
.stats-reveal-screen {
  text-align: center;
}

.stats-display-large {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.stat-box {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.stat-box span:first-child {
  font-size: 2rem;
}

.stat-box strong {
  color: var(--gold-dim);
  font-size: 0.9rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--gold);
}

.vitals-large {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 1.5rem;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 12px;
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.vital-hp { color: #ff6b6b; }
.vital-mp { color: #4fc3f7; }

/* Blessing Selection */
.blessings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.blessing-card {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.blessing-card:hover {
  border-color: var(--gold);
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
}

.blessing-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
}

.blessing-name {
  color: var(--gold);
  font-size: 1.3rem;
  margin: 0.5rem 0;
}

.blessing-desc {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 1rem 0;
}

.blessing-effect {
  background: var(--bg-dark);
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* Gift Selection */
.gift-selection {
  text-align: center;
}

.gift-category {
  margin: 2rem 0;
  text-align: left;
}

.gift-category h3 {
  color: var(--gold);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

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

.gift-card {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gift-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.gift-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.gift-name {
  color: var(--text-primary);
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.gift-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Prophecy Screen */
.prophecy-screen {
  text-align: center;
}

.prophecy-display {
  background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(10, 10, 18, 0.9));
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 3rem;
  margin: 2rem auto;
  max-width: 700px;
  cursor: pointer;
  transition: all 0.3s;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.prophecy-display:hover {
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
}

.prophecy-text {
  font-size: 1.5rem;
  color: var(--gold);
  font-style: italic;
  line-height: 1.8;
  margin: 0;
}

.prophecy-hint {
  color: var(--text-muted);
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* Opening Message Style */
.message.opening .message-content {
  background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(10, 10, 18, 0.9));
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.message.opening strong {
  color: var(--gold);
}

/* World Selection */
.world-selection, .class-selection, .name-selection {
  text-align: center;
}

.selection-header {
  margin-bottom: 2rem;
}

.goddess-small {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.selection-header h2 {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  margin: 0.5rem 0;
  letter-spacing: 0.2rem;
}

.selection-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.worlds-grid, .classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.world-card, .class-card {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.world-card:hover, .class-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.class-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

.world-icon, .class-icon-large {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.world-name, .class-name {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  margin: 0.5rem 0;
}

.world-genre {
  color: var(--gold-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.world-desc, .class-desc {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 1rem 0;
}

.world-preview {
  background: var(--bg-dark);
  padding: 1rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  margin-top: 1rem;
}

.world-preview em {
  color: var(--text-primary);
  font-style: normal;
  font-size: 0.9rem;
}

.class-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.stats-preview, .stats-row {
  display: flex;
  justify-content: space-around;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.abilities-preview {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.selection-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

/* Name Selection */
.name-card {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.chosen-world-display {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(138, 107, 234, 0.1));
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.world-label {
  display: block;
  color: var(--gold-dim);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.chosen-world-name {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

.chosen-world-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.name-preview {
  text-align: center;
}

.preview-class {
  color: var(--gold);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.name-input {
  width: 100%;
  background: var(--bg-dark);
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text-primary);
  font-size: 1.5rem;
  text-align: center;
  font-family: 'Cinzel', serif;
}

.name-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

.name-reveal {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-gold);
}

.reveal-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.reveal-name {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  margin: 0.5rem 0;
}

.reveal-title {
  color: var(--text-secondary);
  font-size: 1rem;
}

.summary {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: left;
}

.summary h4 {
  color: var(--gold);
  margin: 0 0 1rem 0;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.summary-list li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.summary-list li:last-child {
  border-bottom: none;
}

.continue-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-gold);
}

.continue-section h3 {
  color: var(--gold);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ============ OLD MAIN MENU (keep for fallback) ============ */
.main-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.menu-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a12 100%);
  overflow: hidden;
}

.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 5s infinite ease-in-out;
  box-shadow: 0 0 10px var(--gold);
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.6; }
  50% { transform: translateY(-100px) translateX(50px); opacity: 0.3; }
}

.mystical-fog {
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(138, 107, 234, 0.1) 0%, transparent 70%);
  animation: fog 20s infinite linear;
}

@keyframes fog {
  0% { transform: translate(-10%, -10%) rotate(0deg); }
  100% { transform: translate(10%, 10%) rotate(360deg); }
}

.menu-content {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
}

.menu-title {
  text-align: center;
  margin-bottom: 3rem;
}

.title-glow {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.title-icon {
  font-size: 5rem;
  filter: drop-shadow(0 0 30px var(--accent));
  animation: pulse 2s infinite;
}

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

.game-title {
  font-size: 5rem;
  font-weight: bold;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  margin: 0;
  letter-spacing: 0.5rem;
}

.game-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-style: italic;
  letter-spacing: 0.3rem;
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.menu-section {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.1);
}

.section-title {
  color: var(--gold);
  margin: 0 0 1.5rem 0;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  text-align: center;
}

.continue-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.continue-card {
  flex: 1;
  min-width: 200px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.continue-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
}

.card-title {
  font-weight: bold;
  color: var(--text-primary);
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Character Creation */
.character-creation {
  margin-bottom: 1.5rem;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  font-weight: bold;
}

.label-icon {
  font-size: 1.2rem;
}

.fantasy-input {
  width: 100%;
  background: var(--bg-dark);
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: inherit;
}

.fantasy-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

/* Class Selection */
.class-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.class-card {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.class-card:hover {
  border-color: var(--gold-dim);
}

.class-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.3);
}

.class-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.class-name {
  font-weight: bold;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.class-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.class-stats {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  width: 100%;
}

.stat-row {
  display: flex;
  justify-content: space-around;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

/* Template Selection */
.template-selection {
  margin-top: 1.5rem;
}

.toggle-btn {
  width: 100%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  padding: 1rem;
  color: var(--gold);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

.toggle-btn:hover {
  background: var(--bg-secondary);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.template-card {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.template-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.template-icon {
  font-size: 1.5rem;
}

.template-genre {
  color: var(--gold-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.template-title {
  color: var(--gold);
  margin: 0;
  font-size: 1.2rem;
}

.template-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
}

.template-difficulty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.start-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #c73e54 100%);
  border: none;
  border-radius: 6px;
  padding: 0.75rem;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.start-adventure-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  border: none;
  border-radius: 8px;
  padding: 1.25rem;
  color: var(--bg-dark);
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.start-adventure-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

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

.menu-decoration {
  position: fixed;
  font-size: 4rem;
  opacity: 0.3;
}

.menu-decoration.bottom-left {
  bottom: 2rem;
  left: 2rem;
}

.menu-decoration.bottom-right {
  bottom: 2rem;
  right: 2rem;
}

/* ============ GAME UI ============ */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 2px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  margin-left: 2rem;
}

.sidebar-header {
  padding: 1rem;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-color);
}

.menu-back-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.menu-back-btn:hover {
  background: var(--accent);
  color: white;
}

.session-info {
  text-align: center;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-gold);
}

.session-title {
  margin: 0 0 0.25rem 0;
  color: var(--gold);
}

.session-class {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quick-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mini-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.mini-bar .bar-bg {
  flex: 1;
  height: 12px;
  background: var(--bg-dark);
  border-radius: 6px;
  overflow: hidden;
}

.mini-bar .bar-fill {
  height: 100%;
  transition: width 0.3s;
}

.mini-bar.hp .bar-fill {
  background: linear-gradient(90deg, #e57373, var(--accent));
}

.mini-bar.mp .bar-fill {
  background: linear-gradient(90deg, #64b5f6, var(--magic-blue));
}

.level-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  background: var(--bg-dark);
  border-radius: 6px;
}

.character-btn {
  width: 100%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-gold);
  color: var(--gold);
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
}

.character-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Action Bar */
.action-bar {
  background: var(--bg-dark);
  border-bottom: 2px solid var(--border-gold);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-btn {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  white-space: nowrap;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn.danger { border-color: var(--danger-red); }
.action-btn.danger:hover { background: var(--danger-red); }

.action-btn.primary { border-color: var(--accent); }
.action-btn.primary:hover { background: var(--accent); }

.action-btn.success { border-color: var(--nature-green); }
.action-btn.success:hover { background: var(--nature-green); }

.action-btn.warning { border-color: var(--gold); }
.action-btn.warning:hover { background: var(--gold); color: var(--bg-dark); }

.action-btn.combat {
  animation: combatPulse 2s infinite;
}

@keyframes combatPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(233, 69, 96, 0.3); }
  50% { box-shadow: 0 0 15px rgba(233, 69, 96, 0.6); }
}

.dice-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.dice-btn {
  background: var(--bg-tertiary);
  border: 2px solid var(--magic-purple);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--magic-purple);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dice-btn:hover {
  background: var(--magic-purple);
  color: white;
}

.dice-label {
  font-weight: bold;
}

.dice-dropdown {
  position: relative;
}

.dropdown-toggle {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-gold);
  border-radius: 6px;
  padding: 0.5rem;
  z-index: 100;
  flex-direction: column;
  gap: 0.25rem;
}

.dice-dropdown:hover .dropdown-menu {
  display: flex;
}

.dropdown-menu button {
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 0.5rem;
  cursor: pointer;
  text-align: left;
  border-radius: 4px;
}

.dropdown-menu button:hover {
  background: var(--accent);
}

.character-quick-view {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  border-left: 2px solid var(--border-color);
  margin-left: 1rem;
}

.quick-hp, .quick-mp {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.hp-icon { color: var(--danger-red); }
.mp-icon { color: var(--magic-blue); }

.sheet-btn {
  background: var(--bg-tertiary);
  border: 2px solid var(--gold);
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.2rem;
}

.help-btn {
  background: var(--bg-tertiary);
  border: 2px solid var(--magic-blue);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Chat Area */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-primary);
}

.message {
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

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

.message-user .message-content {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent);
}

.message-assistant .message-content {
  background: var(--bg-secondary);
  border-left: 3px solid var(--gold);
}

.message.system .message-content {
  background: var(--bg-dark);
  border-left: 3px solid var(--magic-blue);
}

.message.roll .message-content {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border-left: 3px solid var(--magic-purple);
}

.message-content {
  max-width: 85%;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  line-height: 1.6;
}

.message-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.chat-input-container {
  padding: 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
  display: flex;
  gap: 1rem;
}

.chat-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  resize: none;
  font-family: inherit;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

.send-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0 1.5rem;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.send-btn:hover {
  background: var(--accent-glow);
}

/* Right Panel */
.right-panel {
  width: 350px;
  background: var(--bg-secondary);
  border-left: 2px solid var(--border-gold);
  overflow-y: auto;
}

.panel-header {
  padding: 1rem;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h6 {
  margin: 0;
  color: var(--gold);
}

.panel-tabs {
  display: flex;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem;
  gap: 0.25rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 1.2rem;
}

.tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.tab-btn.active {
  background: var(--accent);
  color: white;
}

.panel-content {
  padding: 1rem;
}

.panel-section {
  margin-bottom: 1.5rem;
}

.panel-section h6 {
  color: var(--gold);
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

/* Journal */
.journal-section {
  margin-bottom: 1.25rem;
}

.journal-content {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  line-height: 1.6;
}

.journal-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.journal-entry {
  background: var(--bg-tertiary);
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border-left: 2px solid var(--nature-green);
}

.journal-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.journal-entry p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* Entity Cards */
.entity-card {
  background: var(--bg-tertiary);
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
}

.entity-card h6 {
  margin: 0 0 0.5rem 0;
  color: var(--gold);
  font-size: 0.95rem;
}

.entity-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 4px;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.badge-active { background: var(--nature-green); color: white; }
.badge-inactive { background: var(--text-muted); color: white; }
.badge-quest { background: var(--accent); color: white; }

/* ============ CHARACTER SHEET ============ */
.character-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.character-sheet {
  background: var(--bg-secondary);
  border: 3px solid var(--gold);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-dark);
  border-bottom: 2px solid var(--border-gold);
}

.sheet-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sheet-title h2 {
  margin: 0;
  color: var(--gold);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--accent);
}

.character-info {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
}

.character-portrait {
  position: relative;
  width: 100px;
  height: 100px;
}

.portrait-icon {
  font-size: 5rem;
  display: block;
}

.portrait-frame {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 3px solid var(--gold);
  border-radius: 50%;
}

.character-details {
  flex: 1;
}

.char-name {
  margin: 0 0 0.25rem 0;
  color: var(--gold);
  font-size: 1.5rem;
}

.char-class, .char-level {
  margin: 0.25rem 0;
  color: var(--text-secondary);
}

.xp-bar-container {
  position: relative;
  height: 20px;
  background: var(--bg-dark);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.xp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--magic-purple), var(--magic-blue));
  transition: width 0.3s;
}

.xp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  color: white;
  text-shadow: 0 0 3px black;
}

.vitals-section {
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.vital-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.vital-label {
  width: 80px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
}

.vital-bar-bg {
  flex: 1;
  height: 25px;
  background: var(--bg-dark);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border-color);
}

.vital-bar-fill {
  height: 100%;
  transition: width 0.3s;
}

.hp-fill {
  background: linear-gradient(90deg, #e57373, var(--accent));
}

.mp-fill {
  background: linear-gradient(90deg, #64b5f6, var(--magic-blue));
}

.vital-value {
  width: 80px;
  text-align: right;
  font-weight: bold;
}

.section-subtitle {
  color: var(--gold);
  margin: 0 0 1rem 0 !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-effect {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.status-effect.buff { border-color: var(--nature-green); }
.status-effect.debuff { border-color: var(--danger-red); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-box {
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 0.25rem;
}

.abilities-list, .equipment-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ability-item, .equip-slot {
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ability-icon, .equip-icon {
  font-size: 1.5rem;
}

/* Blessing in Character Sheet */
.blessing-section {
  padding: 1rem;
  background: rgba(255, 215, 0, 0.05);
  border: 2px solid var(--gold);
  border-radius: 8px;
  margin: 1rem 0;
}

.blessing-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.blessing-icon-large {
  font-size: 3rem;
}

.blessing-display strong {
  display: block;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.blessing-display p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Prophecy in Character Sheet */
.prophecy-section {
  padding: 1rem;
  background: rgba(138, 107, 234, 0.1);
  border: 2px solid var(--magic-purple);
  border-radius: 8px;
  margin: 1rem 0;
}

.prophecy-display-small {
  padding: 1rem;
  background: var(--bg-dark);
  border-radius: 6px;
  font-style: italic;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
}

/* Loading */
.loading-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  padding: 1rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-color);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Modal */
.modal-content {
  background: var(--bg-secondary);
  border: 2px solid var(--border-gold);
  color: var(--text-primary);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
}

.form-control {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.form-control:focus {
  border-color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-gold);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ============ TTS & AUDIO PLAYER ============ */

/* TTS Settings Button */
.tts-btn {
  background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  width: 100%;
  margin-top: 0.5rem;
}

.tts-btn:hover {
  background: linear-gradient(135deg, #3a3a5a 0%, #2a2a3e 100%);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.tts-status-indicator {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--nature-green);
  margin-top: 0.5rem;
  animation: pulse 2s infinite;
}

/* TTS Settings Modal */
.tts-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.tts-settings-modal .modal-content {
  background: var(--bg-secondary);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.15);
}

.tts-settings-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
}

.tts-settings-modal .modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--gold);
}

.tts-settings-modal .modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.tts-settings-modal .modal-close:hover {
  color: var(--danger-red);
}

.tts-settings-modal .modal-body {
  padding: 2rem;
}

.tts-settings-modal .modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  text-align: right;
}

/* TTS Status */
.tts-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.status-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.status-indicator.available {
  background: var(--nature-green);
  color: var(--bg-dark);
}

.status-indicator.unavailable {
  background: var(--danger-red);
  color: white;
}

.tts-setup-info {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.tts-setup-info h4 {
  margin: 0 0 1rem 0;
  color: var(--gold);
}

.tts-setup-info code {
  display: block;
  background: var(--bg-dark);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 0.85rem;
  color: var(--magic-blue);
  margin-bottom: 0.5rem;
}

.tts-setup-info .hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
  font-style: italic;
}

/* Setting Rows */
.setting-row {
  margin-bottom: 1.5rem;
}

.setting-row label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

.setting-row input[type="checkbox"] {
  margin-right: 0.5rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.setting-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Voice Selector */
.voice-selector {
  position: relative;
}

.selected-voice-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.selected-voice-btn:hover {
  border-color: var(--gold);
  background: var(--bg-secondary);
}

.selected-voice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.voice-icon {
  font-size: 1.5rem;
}

.voice-name {
  flex: 1;
  font-weight: 500;
}

.voice-arrow {
  color: var(--text-muted);
}

.voice-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  margin-top: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.voice-category h5 {
  margin: 0;
  padding: 1rem;
  background: var(--bg-tertiary);
  color: var(--gold);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.voice-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.voice-option:hover {
  background: var(--bg-tertiary);
}

.voice-option.selected {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--gold);
}

.voice-gender {
  font-size: 1.25rem;
}

.voice-label {
  flex: 1;
  font-weight: 500;
}

.voice-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sliders */
.volume-slider,
.speed-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-tertiary);
  border-radius: 4px;
  outline: none;
}

.volume-slider::-webkit-slider-thumb,
.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.volume-slider::-moz-range-thumb,
.speed-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.test-tts-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #c73e54 100%);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  margin-right: 0.5rem;
}

.test-tts-btn.male {
  background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
}

.test-tts-btn.female {
  background: linear-gradient(135deg, #d94a9e 0%, #bd357a 100%);
}

.test-tts-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.test-tts-btn.male:hover {
  box-shadow: 0 5px 20px rgba(74, 144, 217, 0.4);
}

.test-tts-btn.female:hover {
  box-shadow: 0 5px 20px rgba(217, 74, 158, 0.4);
}

.test-tts-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.test-buttons-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Audio Player */
.audio-player {
  margin-top: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

.audio-progress {
  margin-bottom: 1rem;
}

.audio-progress-bar {
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  transition: width 0.1s linear;
}

.audio-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--accent) 100%);
  box-shadow: 0 0 10px var(--gold);
}

.audio-segments {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.segment-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.segment-marker:hover {
  border-color: var(--gold);
  background: var(--bg-tertiary);
}

.segment-marker.active {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--bg-dark);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.segment-marker.dialogue.active {
  border-color: var(--magic-blue);
  background: var(--magic-blue);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.audio-control-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.audio-control-btn:hover {
  border-color: var(--gold);
  background: var(--bg-tertiary);
}

.audio-control-btn.play-btn {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  border-color: var(--gold);
  color: var(--bg-dark);
}

.audio-control-btn.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.audio-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.segment-type {
  color: var(--text-secondary);
}

.segment-count {
  color: var(--gold);
  font-weight: 500;
}

.speaker-indicator {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  border-left: 3px solid var(--magic-blue);
}

.speaker-icon {
  font-size: 1.2rem;
}

.speaker-name {
  color: var(--magic-blue);
  font-weight: 500;
}

.tts-loading {
  text-align: center;
  padding: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.tts-debug-info {
  text-align: center;
  padding: 0.25rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: monospace;
  opacity: 0.7;
}
