/* KingdomTale — Global Styles (extraído de index.html) */

html { scroll-behavior: smooth; }
body {
  background: #050505;
  color: #E8DCC4;
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Film grain noise overlay */
.noise::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Vignette */
.vignette::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.85) 100%);
}

/* Carved gold border */
.carved-gold {
  position: relative;
  border: 1px solid rgba(184, 134, 11, 0.4);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(218, 165, 32, 0.15),
    0 0 24px rgba(0,0,0,0.6);
}
.carved-gold:hover {
  border-color: rgba(218, 165, 32, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.6),
    inset 0 0 30px rgba(218, 165, 32, 0.08),
    0 0 30px rgba(139, 0, 0, 0.25);
}

/* Stone texture utility */
.stone-bg {
  background-color: #0a0a0a;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(40,30,20,0.5) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(50,20,20,0.3) 0%, transparent 40%),
    url("data:image/svg+xml;utf8,<svg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.04 0 0 0 0 0.03 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Ornamental divider */
.ornament-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  color: rgba(218, 165, 32, 0.6);
}
.ornament-divider::before,
.ornament-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,134,11,0.5), transparent);
}

/* Crimson radial glow */
.crimson-glow {
  background:
    radial-gradient(ellipse 80% 60% at center, rgba(139, 0, 0, 0.45) 0%, rgba(58, 0, 0, 0.25) 50%, transparent 80%),
    radial-gradient(ellipse at center top, rgba(178, 34, 34, 0.25) 0%, transparent 70%),
    #0a0a0a;
}

/* Map background pattern */
.map-bg {
  background-image:
    linear-gradient(rgba(218,165,32,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(218,165,32,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* Text shadow utilities */
.text-glow-gold    { text-shadow: 0 0 22px rgba(218, 165, 32, 0.35), 0 0 4px rgba(218, 165, 32, 0.2); }
.text-glow-crimson { text-shadow: 0 0 30px rgba(178, 34, 34, 0.5), 0 2px 0 #000; }
.text-shadow-monument {
  text-shadow:
    0 1px 0 rgba(0,0,0,0.8),
    0 2px 4px rgba(0,0,0,0.8),
    0 0 30px rgba(0,0,0,0.6);
}

/* Distressed dividers */
.crack { position: relative; }
.crack::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 4'><path d='M0 2 L100 1 L150 3 L240 2 L320 1 L400 2 L500 3 L600 2' stroke='%23DAA520' stroke-width='0.5' fill='none' opacity='0.3'/></svg>");
  background-size: 100% 100%;
  pointer-events: none;
}

/* Hero logo pulse */
@keyframes embers {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%       { opacity: 0.7; transform: translateY(-8px); }
}
.ember { animation: embers 4s ease-in-out infinite; }

/* Kicker text style */
.kicker {
  letter-spacing: 0.45em;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  color: rgba(218, 165, 32, 0.7);
  text-transform: uppercase;
}

.sword-cursor { cursor: pointer; }

/* Scrollbar */
::-webkit-scrollbar       { width: 8px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: #3a0000; border-left: 1px solid #B8860B33; }
::-webkit-scrollbar-thumb:hover { background: #5a0000; }

/* Gold rule */
.gold-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, #B8860B, transparent);
}

/* Reveal animations */
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(var(--reveal-y, 40px)); }
  to   { opacity: 1; transform: none; }
}
.reveal-host { opacity: 1; }
.reveal-host.reveal-pending { opacity: 0; }
.reveal-host.is-in {
  animation: reveal-in 900ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .reveal-host, .reveal-host.reveal-pending, .reveal-host.is-in {
    opacity: 1; animation: none;
  }
}

/* Selection */
::selection { background: #8B0000; color: #E8DCC4; }

/* Download button pulse */
@keyframes dl-glow-pulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.92); }
  50%       { opacity: 1;    transform: translate(-50%, -50%) scale(1.12); }
}
@keyframes dl-scale-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}
.dl-pulse {
  position: relative;
  isolation: isolate;
  animation: dl-scale-pulse 2.6s ease-in-out infinite;
}
.dl-pulse::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 120%; height: 220%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse 50% 50% at center, rgba(140, 200, 255, 0.85) 0%, rgba(80, 140, 255, 0.6) 28%, rgba(40, 100, 220, 0.4) 55%, transparent 78%);
  filter: blur(34px);
  z-index: -1;
  pointer-events: none;
  animation: dl-glow-pulse 2.6s ease-in-out infinite;
}
.dl-pulse:hover { animation-play-state: paused; }
.dl-pulse:hover::before { animation-play-state: paused; opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
@media (prefers-reduced-motion: reduce) {
  .dl-pulse, .dl-pulse::before { animation: none; }
}

/* Dragon emblem breathing */
@keyframes dragon-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.dragon-glow {
  animation: dragon-breathe 2.8s ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.75));
}
@media (prefers-reduced-motion: reduce) {
  .dragon-glow { animation: none; }
}

/* Logo aura + pulse + sparks */
@keyframes logo-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.018); }
}
.logo-pulse {
  animation: logo-breathe 4.2s ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
  filter:
    drop-shadow(0 0 80px rgba(255, 220, 140, 0.55))
    drop-shadow(0 0 40px rgba(218, 165, 32, 0.55))
    drop-shadow(0 0 24px rgba(0, 0, 0, 0.95))
    brightness(1.18) contrast(1.06);
}
.logo-aura {
  position: absolute; left: 50%; top: 50%;
  width: 130%; height: 220%;
  pointer-events: none; z-index: 0;
  transform: translate(-50%, -50%);
}
.logo-aura-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 45% at center,
      rgba(255, 240, 200, 0.85) 0%,
      rgba(255, 215, 130, 0.55) 18%,
      rgba(218, 165, 32, 0.38) 35%,
      rgba(178, 34, 34, 0.22) 55%,
      transparent 78%);
  filter: blur(34px);
  opacity: 1;
}
.logo-aura-ring {
  position: absolute; inset: 12% 8%; border-radius: 50%;
  background:
    radial-gradient(ellipse at center,
      transparent 38%,
      rgba(255, 235, 180, 0.22) 45%,
      rgba(255, 235, 180, 0.08) 55%,
      transparent 70%);
  filter: blur(22px); opacity: 1;
}

/* Sparks rising */
@keyframes spark-rise {
  0%   { opacity: 0;   transform: translate(var(--sx, 0px), 30px) scale(0.4); }
  15%  { opacity: 1; }
  70%  { opacity: 0.9; }
  100% { opacity: 0;   transform: translate(calc(var(--sx, 0px) + var(--drift, 10px)), -260px) scale(0.2); }
}
.logo-sparks { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.logo-spark {
  position: absolute; bottom: 18%;
  width: 4px; height: 4px; border-radius: 50%;
  background: radial-gradient(circle, #fff3c4 0%, #ffd97a 35%, rgba(255, 170, 60, 0.6) 60%, transparent 80%);
  box-shadow: 0 0 8px rgba(255, 220, 130, 0.95), 0 0 16px rgba(255, 170, 60, 0.6);
  animation: spark-rise 3.6s ease-out infinite;
  will-change: transform, opacity;
}
@media (prefers-reduced-motion: reduce) {
  .logo-pulse, .logo-spark { animation: none; }
}

/* Hero battlefield */
@keyframes hero-bg-breathe {
  0%, 100% { transform: scale(1.05) translate(0, 0);        filter: brightness(0.5) saturate(1.0) contrast(1.0); }
  50%       { transform: scale(1.12) translate(-0.5%, -0.8%); filter: brightness(0.7) saturate(1.18) contrast(1.08); }
}
.hero-bg-alive {
  animation: hero-bg-breathe 9s ease-in-out infinite;
  transform-origin: center 40%;
  will-change: transform, filter;
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg-alive { animation: none; transform: scale(1.05); }
}

/* Lightning */
@keyframes sky-flash {
  0%   { opacity: 0; }
  1%   { opacity: 0.85; }
  3%   { opacity: 0.2; }
  5%   { opacity: 0.95; }
  8%   { opacity: 0; }
  100% { opacity: 0; }
}
.sky-flash {
  position: absolute; inset: 0 0 50% 0;
  pointer-events: none; z-index: 4;
  background:
    radial-gradient(ellipse 60% 70% at 30% 0%, rgba(220, 235, 255, 0.55) 0%, rgba(180, 200, 255, 0.18) 25%, transparent 55%),
    radial-gradient(ellipse 50% 65% at 75% 5%, rgba(230, 220, 255, 0.45) 0%, transparent 50%);
  mix-blend-mode: screen; opacity: 0;
  animation: sky-flash 7s ease-out infinite;
  animation-delay: 1.5s;
}
.sky-flash.s2 { animation-duration: 11s; animation-delay: 5.5s;
  background: radial-gradient(ellipse 55% 70% at 70% 0%, rgba(220, 235, 255, 0.6) 0%, rgba(180, 200, 255, 0.2) 30%, transparent 55%); }
.sky-flash.s3 { animation-duration: 13s; animation-delay: 8s;
  background: radial-gradient(ellipse 80% 80% at 50% 0%, rgba(220, 235, 255, 0.7) 0%, rgba(180, 200, 255, 0.25) 22%, transparent 55%); }

@keyframes bolt-strike {
  0%, 100% { opacity: 0; }
  1%  { opacity: 1;   filter: drop-shadow(0 0 22px rgba(190,215,255,.95)) drop-shadow(0 0 60px rgba(160,190,255,.7)); }
  3%  { opacity: 0.3; }
  5%  { opacity: 1; }
  7%  { opacity: 0.1; }
  9%  { opacity: 0.85; }
  13% { opacity: 0; }
}
.bolt {
  position: absolute; top: 0; pointer-events: none; z-index: 5;
  opacity: 0; animation: bolt-strike 9s linear infinite; will-change: opacity, filter;
  filter: drop-shadow(0 0 18px rgba(190,215,255,.85)) drop-shadow(0 0 40px rgba(160,190,255,.6));
}
.bolt path { stroke: rgba(240,245,255,.98); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bolt path.glow { stroke: rgba(180,210,255,.55); stroke-width: 8; }
.bolt.b1 { left: 18%; animation-delay: 1.5s; }
.bolt.b2 { left: 68%; animation-delay: 5.5s; animation-duration: 11s; }
.bolt.b3 { left: 42%; animation-delay: 8s;   animation-duration: 13s; }
@media (prefers-reduced-motion: reduce) {
  .sky-flash, .bolt { animation: none; opacity: 0; }
}
