:root {
  --bg-dark: #0a0a0a;
  --surface-dark: #141414;
  --text-bone: #c9c2b5;
  --accent-blood: #8b1e1e;
  --accent-crown: #d4a017;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg-dark);
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

.app-wrapper {
  width: 100%;
  min-height: 100%;
  background: var(--bg-dark);
  overflow-x: hidden;
}

.font-cinzel { font-family: 'Cinzel', serif; }
.font-crimson { font-family: 'Crimson Text', serif; }

/* Crown stage (3D + SVG fallback) */
.crown-stage {
  width: clamp(240px, 18vw, 360px);
  height: clamp(240px, 18vw, 360px);
  display: block;
  margin: 0 auto;
  position: relative;
}

.crown-stage.has-3d {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.crown-stage.has-3d.is-dragging {
  cursor: grabbing;
}

.crown-3d,
.crown-fallback {
  position: absolute;
  inset: 0;
}

.crown-3d {
  opacity: 0;
  transition: opacity 300ms ease;
}

.crown-stage.has-3d .crown-3d {
  opacity: 1;
}

.crown-3d canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crown-fallback {
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 300ms ease, transform 300ms ease;
}

.crown-stage.has-3d .crown-fallback {
  opacity: 0;
  transform: scale(0.98);
}

/* Fog animation layers */
.fog-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.fog-layer {
  position: absolute;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(20,20,20,0.3) 20%,
    rgba(40,40,40,0.4) 40%,
    rgba(20,20,20,0.3) 60%,
    transparent 80%
  );
  animation: fogDrift 30s linear infinite;
}

.fog-layer-2 {
  background: linear-gradient(90deg,
    transparent 10%,
    rgba(30,30,30,0.2) 30%,
    rgba(50,50,50,0.3) 50%,
    rgba(30,30,30,0.2) 70%,
    transparent 90%
  );
  animation: fogDrift 45s linear infinite reverse;
  top: 20%;
}

.fog-layer-3 {
  background: radial-gradient(ellipse at center,
    rgba(40,40,40,0.4) 0%,
    transparent 70%
  );
  animation: fogPulse 20s ease-in-out infinite;
  top: 50%;
  transform: translateY(-50%);
}

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

@keyframes fogPulse {
  0%, 100% { opacity: 0.3; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.6; transform: translateY(-50%) scale(1.1); }
}

/* Crown glow effect */
.crown-glow {
  filter:
    drop-shadow(0 0 20px rgba(212, 160, 23, 0.6))
    drop-shadow(0 0 40px rgba(212, 160, 23, 0.3))
    drop-shadow(0 0 60px rgba(139, 30, 30, 0.2));
  animation: crownFloat 6s ease-in-out infinite, crownPulse 3s ease-in-out infinite;
}

@keyframes crownFloat {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes crownPulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 20px rgba(212, 160, 23, 0.6))
      drop-shadow(0 0 40px rgba(212, 160, 23, 0.3));
  }
  50% {
    filter:
      drop-shadow(0 0 30px rgba(212, 160, 23, 0.8))
      drop-shadow(0 0 60px rgba(212, 160, 23, 0.5));
  }
}

/* Blood drip effect */
.blood-drip {
  position: absolute;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent-blood), transparent);
  animation: drip 4s ease-in infinite;
  opacity: 0;
}

@keyframes drip {
  0% { height: 0; opacity: 0; top: 0; }
  10% { opacity: 0.8; }
  100% { height: 100px; opacity: 0; top: 100px; }
}

/* Scratched texture overlay */
.scratched-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 100px,
      rgba(0,0,0,0.03) 100px,
      rgba(0,0,0,0.03) 101px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 50px,
      rgba(0,0,0,0.02) 50px,
      rgba(0,0,0,0.02) 51px
    );
}

/* Vignette effect */
.vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.8) 100%);
}

/* Section styling */
.section-card {
  background: linear-gradient(135deg, var(--surface-dark) 0%, rgba(10,10,10,0.9) 100%);
  border: 1px solid rgba(139, 30, 30, 0.3);
  position: relative;
  overflow: hidden;
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blood), transparent);
}

/* Copy button */
.copy-btn {
  background: linear-gradient(135deg, var(--accent-blood) 0%, #5a1212 100%);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.copy-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(139, 30, 30, 0.5);
}

.copy-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  animation: shimmer 3s infinite;
}

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

/* Apocalyptic background */
.app-wrapper::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    url('https://images.unsplash.com/photo-1518818608211-4bae36b98e88?w=1200&q=50&blend=https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?w=1200&q=50&blend_mode=screen'),
    url('https://images.unsplash.com/photo-1470114716159-e389f8712fda?w=1200&q=50&blend_mode=multiply'),
    url('https://images.unsplash.com/photo-1484156519585-c3a0ad38e7d9?w=1200&q=50&blend_mode=screen');
  background-size: cover, cover, 150%;
  background-position: center, center, center;
  background-attachment: fixed;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
  filter: saturate(0.8) brightness(0.6) contrast(1.2);
}

/* Red accent splotches - decorative stains */
.app-wrapper::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(ellipse 400px 300px at 10% 15%, rgba(200, 50, 50, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 500px 350px at 90% 25%, rgba(180, 40, 60, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 300px 250px at 75% 75%, rgba(210, 60, 40, 0.1) 0%, transparent 65%),
    radial-gradient(ellipse 450px 280px at 20% 80%, rgba(190, 45, 55, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 350px 320px at 85% 70%, rgba(200, 55, 50, 0.08) 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
  animation: splotchShift 60s ease-in-out infinite;
}

@keyframes splotchShift {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Map placeholder */
.map-container {
  background:
    linear-gradient(rgba(10,10,10,0.7), rgba(10,10,10,0.7)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 20px,
      rgba(139, 30, 30, 0.1) 20px,
      rgba(139, 30, 30, 0.1) 21px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 20px,
      rgba(139, 30, 30, 0.1) 20px,
      rgba(139, 30, 30, 0.1) 21px
    );
  border: 2px solid rgba(139, 30, 30, 0.4);
}

/* News item hover */
.news-item {
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.news-item:hover {
  border-left-color: var(--accent-blood);
  background: rgba(139, 30, 30, 0.1);
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--accent-blood);
  border-radius: 4px;
}

/* Nav links */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-crown);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Feature icons */
.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 30, 30, 0.2);
  border: 1px solid rgba(139, 30, 30, 0.4);
  border-radius: 50%;
}

