/* ============================================
   EMBERHOLD RPG - Dark Fantasy Theme
   ============================================ */

:root {
  /* Dark fantasy colors */
  --bg-darkest: #0a0a0f;
  --bg-dark: #12121a;
  --bg-medium: #1a1a25;
  --bg-light: #252535;
  --bg-lighter: #35354a;

  /* Accent colors */
  --ember-orange: #ff6b35;
  --ember-red: #dc3545;
  --ember-gold: #ffd700;
  --ember-purple: #9b59b6;
  --ember-blue: #3498db;
  --ember-green: #2ecc71;

  /* Text colors */
  --text-primary: #e8e6e3;
  --text-secondary: #a0a0a0;
  --text-muted: #666;

  /* Rarity colors */
  --rarity-common: #9d9d9d;
  --rarity-uncommon: #1eff00;
  --rarity-rare: #0070dd;
  --rarity-epic: #a335ee;
  --rarity-legendary: #ff8000;

  /* Effects */
  --glow-ember: 0 0 20px rgba(255, 107, 53, 0.5);
  --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
  --border-ember: 1px solid rgba(255, 107, 53, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cinzel', 'Georgia', serif;
  background: var(--bg-darkest);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Background texture */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at top, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(155, 89, 182, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.05em;
}

h1 {
  font-size: 3.5rem;
  text-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
}

h2 {
  font-size: 2.5rem;
  color: var(--ember-gold);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--ember-orange);
}

p {
  font-family: 'Lora', 'Georgia', serif;
}

a {
  color: var(--ember-orange);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--ember-gold);
  text-shadow: var(--glow-ember);
}

/* ============================================
   NAVIGATION
   ============================================ */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, var(--bg-darkest) 0%, transparent 100%);
  padding: 1rem 2rem;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.8rem;
  color: var(--ember-orange);
  text-shadow: var(--glow-ember);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  border: var(--border-ember);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  background: rgba(255, 107, 53, 0.2);
  box-shadow: var(--glow-ember);
}

.nav-links a.discord-link {
  background: linear-gradient(135deg, #5865F2, #7289da);
  color: white;
  border-color: #5865F2;
}

.nav-links a.discord-link:hover {
  box-shadow: 0 0 15px rgba(88, 101, 242, 0.5);
  background: linear-gradient(135deg, #6975f3, #8299eb);
}

.nav-links a.active {
  color: var(--ember-gold);
  border-color: var(--ember-gold);
  background: rgba(255, 215, 0, 0.1);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  background:
    linear-gradient(180deg, rgba(10, 10, 15, 0.4) 0%, rgba(10, 10, 15, 0.6) 60%, var(--bg-darkest) 100%),
    url('/img/city%20emberhold.png') center center / cover no-repeat;
}

.hero-title {
  font-size: 5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--ember-orange) 0%, var(--ember-gold) 50%, var(--ember-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: flicker 3s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.9; }
  52% { opacity: 1; }
  54% { opacity: 0.95; }
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-family: 'Lora', serif;
  font-style: italic;
}

.hero-description {
  max-width: 700px;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px solid var(--ember-orange);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: linear-gradient(135deg, var(--ember-gold) 0%, var(--ember-orange) 100%);
  box-shadow: var(--glow-ember);
  transform: translateY(-2px);
  color: var(--bg-darkest);
}

.btn-secondary {
  background: transparent;
  color: var(--ember-orange);
}

.btn-secondary:hover {
  background: rgba(255, 107, 53, 0.2);
  box-shadow: var(--glow-ember);
}

.btn-discord {
  background: #5865F2;
  border-color: #5865F2;
  color: white;
}

.btn-discord:hover {
  background: #4752c4;
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Server Options - Join/Add buttons */
.server-options {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 900px;
}

.server-option {
  background: rgba(10, 10, 15, 0.8);
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  flex: 1;
  min-width: 280px;
  max-width: 400px;
  transition: all 0.3s ease;
}

.server-option:hover {
  border-color: var(--ember-orange);
  box-shadow: var(--glow-ember);
  transform: translateY(-3px);
}

.server-option h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--ember-gold);
}

.server-option p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.server-option .btn {
  width: 100%;
}

/* ============================================
   STATS BAR
   ============================================ */

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 2rem;
  background: var(--bg-dark);
  border-top: 1px solid rgba(255, 107, 53, 0.2);
  border-bottom: 1px solid rgba(255, 107, 53, 0.2);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-family: 'Cinzel Decorative', serif;
  color: var(--ember-gold);
  text-shadow: var(--glow-gold);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============================================
   SECTIONS
   ============================================ */

section {
  padding: 5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

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

.section-title::after {
  content: '';
  display: block;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ember-orange), transparent);
  margin: 1rem auto 0;
}

/* ============================================
   FEATURES GRID
   ============================================ */

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

.feature-card {
  background: var(--bg-dark);
  border: 1px solid var(--bg-lighter);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--ember-orange);
  box-shadow: var(--glow-ember);
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--text-secondary);
}

/* ============================================
   GALLERY
   ============================================ */

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

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--bg-lighter);
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover {
  border-color: var(--ember-orange);
  box-shadow: var(--glow-ember);
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.gallery-item-title {
  font-size: 0.9rem;
  color: white;
}

.gallery-item-rarity {
  font-size: 0.8rem;
  text-transform: uppercase;
}

.rarity-common { color: var(--rarity-common); }
.rarity-uncommon { color: var(--rarity-uncommon); }
.rarity-rare { color: var(--rarity-rare); }
.rarity-epic { color: var(--rarity-epic); }
.rarity-legendary { color: var(--rarity-legendary); }

/* Location gallery - wider landscape images */
.gallery-grid.locations {
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.gallery-item.location {
  aspect-ratio: 16/9;
}

@media (max-width: 768px) {
  .gallery-grid.locations {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   DEMO BATTLE
   ============================================ */

.battle-arena {
  background: var(--bg-dark);
  border: 2px solid var(--bg-lighter);
  border-radius: 12px;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.battle-scene {
  position: relative;
  height: 400px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  border-radius: 8px;
  margin-bottom: 2rem;
  overflow: hidden;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 2rem;
}

.combatant {
  text-align: center;
  transition: all 0.3s ease;
}

.combatant.player {
  order: 1;
}

.combatant.enemy {
  order: 2;
}

.combatant-sprite {
  width: 200px;
  height: 200px;
  background: var(--bg-medium);
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border: 2px solid var(--bg-lighter);
}

.combatant.enemy .combatant-sprite {
  border-color: var(--ember-red);
}

.combatant-name {
  font-size: 1.2rem;
  color: var(--ember-gold);
  margin-bottom: 0.5rem;
}

.health-bar {
  width: 180px;
  height: 20px;
  background: var(--bg-darkest);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bg-lighter);
}

.health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ember-red), var(--ember-orange));
  transition: width 0.5s ease;
  border-radius: 10px;
}

.health-bar-fill.enemy {
  background: linear-gradient(90deg, #8b0000, var(--ember-red));
}

.health-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.battle-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.battle-btn {
  padding: 0.75rem 1.5rem;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  border: 2px solid var(--ember-orange);
  background: var(--bg-medium);
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.battle-btn:hover:not(:disabled) {
  background: var(--ember-orange);
  color: var(--bg-darkest);
}

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

.battle-btn.skill {
  border-color: var(--ember-purple);
}

.battle-btn.skill:hover:not(:disabled) {
  background: var(--ember-purple);
}

.battle-log {
  background: var(--bg-darkest);
  border: 1px solid var(--bg-lighter);
  border-radius: 8px;
  padding: 1rem;
  height: 150px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.log-entry {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--bg-light);
}

.log-entry.damage {
  color: var(--ember-red);
}

.log-entry.heal {
  color: var(--ember-green);
}

.log-entry.skill {
  color: var(--ember-purple);
}

.log-entry.victory {
  color: var(--ember-gold);
  font-weight: bold;
}

/* ============================================
   DEMO CTA SECTION
   ============================================ */

.demo-cta {
  text-align: center;
  background: var(--bg-dark);
  padding: 4rem 2rem;
  max-width: 100%;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.demo-cta h2 {
  margin-bottom: 1rem;
}

.demo-cta p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--bg-lighter);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-logo {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2rem;
  color: var(--ember-orange);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer-legal {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-legal a {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal a:hover {
  color: var(--ember-orange);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .nav-links {
    display: none;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 2rem;
  }

  .battle-scene {
    flex-direction: column;
    height: auto;
    padding: 1rem;
  }

  .combatant-sprite {
    width: 150px;
    height: 150px;
  }
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--bg-lighter);
  border-top-color: var(--ember-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ============================================
   MODAL
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  border: 2px solid var(--ember-orange);
}

.modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--ember-orange);
}
