/* ============================================
   NARNIUM CASINO - Mythic Realm Gate Theme
   Custom CSS: Keyframes, Animations & Prose
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --stone-dark: #1a1a2e;
  --stone-medium: #2d2d44;
  --stone-light: #3d3d5c;
  --rune-gold: #d4a84b;
  --rune-glow: #f0c75e;
  --mystic-blue: #4a7c9b;
  --mystic-purple: #6b4c9a;
  --ancient-green: #3d6b4f;
  --parchment: #e8dcc4;
  --parchment-dark: #c9b896;
  --text-light: #f5f0e6;
  --text-muted: #a9a3b8;
  --danger-red: #c44536;
}

/* --- Keyframe Animations --- */
@keyframes runeGlow {
  0%,
  100% {
    text-shadow: 0 0 0.5rem var(--rune-gold), 0 0 1rem var(--rune-glow);
    opacity: 0.8;
  }
  50% {
    text-shadow: 0 0 1rem var(--rune-gold), 0 0 2rem var(--rune-glow), 0 0 3rem var(--rune-gold);
    opacity: 1;
  }
}

@keyframes floatRune {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-0.625rem) rotate(3deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 1.25rem rgba(212, 168, 75, 0.3);
  }
  50% {
    box-shadow: 0 0 2.5rem rgba(212, 168, 75, 0.6), 0 0 3.75rem rgba(212, 168, 75, 0.3);
  }
}

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1.875rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stoneReveal {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes runePathDraw {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* --- Animation Utility Classes --- */
.animate-rune-glow {
  animation: runeGlow 3s ease-in-out infinite;
}

.animate-float {
  animation: floatRune 4s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(212, 168, 75, 0.3), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

.animate-marquee {
  animation: marquee 30s linear infinite;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* --- Parallax Effects --- */
.parallax-layer {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

.parallax-slow {
  transform: translateY(calc(var(--scroll-y, 0) * 0.1));
}

.parallax-medium {
  transform: translateY(calc(var(--scroll-y, 0) * 0.3));
}

.parallax-fast {
  transform: translateY(calc(var(--scroll-y, 0) * 0.5));
}

/* --- Stone Texture Pattern --- */
.stone-texture {
  background-image: radial-gradient(ellipse at 20% 30%, rgba(61, 61, 92, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(45, 45, 68, 0.5) 0%, transparent 50%),
    linear-gradient(180deg, var(--stone-dark) 0%, var(--stone-medium) 100%);
}

.rune-border {
  border: 0.125rem solid var(--rune-gold);
  box-shadow: inset 0 0 1.25rem rgba(212, 168, 75, 0.1), 0 0 1.875rem rgba(212, 168, 75, 0.2);
}

/* --- Marquee Container --- */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-flex;
  animation: marquee 30s linear infinite;
}

.marquee-content:hover {
  animation-play-state: paused;
}

/* --- Button Styles --- */
.btn-mythic-primary {
  background: linear-gradient(135deg, var(--rune-gold) 0%, #b8903d 100%);
  color: var(--stone-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-mythic-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn-mythic-primary:hover::before {
  transform: translateX(100%);
}

.btn-mythic-primary:hover {
  box-shadow: 0 0 1.875rem rgba(212, 168, 75, 0.5);
  transform: translateY(-0.125rem);
}

.btn-mythic-secondary {
  background: transparent;
  border: 0.125rem solid var(--rune-gold);
  color: var(--rune-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.btn-mythic-secondary:hover {
  background: rgba(212, 168, 75, 0.15);
  box-shadow: 0 0 1.25rem rgba(212, 168, 75, 0.3);
}

/* --- Card Styles --- */
.mythic-card {
  background: linear-gradient(145deg, var(--stone-medium) 0%, var(--stone-dark) 100%);
  border: 0.0625rem solid rgba(212, 168, 75, 0.2);
  transition: all 0.3s ease;
}

.mythic-card:hover {
  border-color: var(--rune-gold);
  box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.4), 0 0 1.25rem rgba(212, 168, 75, 0.1);
  transform: translateY(-0.25rem);
}

/* --- Table Responsive Wrapper --- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

/* --- Prose Styling for Markdown Content --- */
.prose {
  color: var(--text-light);
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 100%;
}

.prose h2 {
  color: var(--rune-gold);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 0.125rem solid rgba(212, 168, 75, 0.3);
  line-height: 1.3;
}

.prose h3 {
  color: var(--parchment);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.prose h4 {
  color: var(--text-light);
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-bottom: 1.25rem;
  color: var(--text-light);
}

.prose a {
  color: var(--rune-gold);
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
  transition: color 0.2s ease;
}

.prose a:hover {
  color: var(--rune-glow);
}

.prose strong {
  color: var(--parchment);
  font-weight: 600;
}

.prose em {
  color: var(--text-muted);
  font-style: italic;
}

.prose ul,
.prose ol {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-bottom: 0.5rem;
  color: var(--text-light);
  padding-left: 0.5rem;
}

.prose li::marker {
  color: var(--rune-gold);
}

.prose blockquote {
  border-left: 0.25rem solid var(--rune-gold);
  background: rgba(212, 168, 75, 0.05);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: var(--parchment);
}

.prose blockquote p {
  margin-bottom: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.prose thead {
  background: linear-gradient(135deg, var(--stone-light) 0%, var(--stone-medium) 100%);
}

.prose th {
  color: var(--rune-gold);
  font-weight: 600;
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 0.125rem solid var(--rune-gold);
  white-space: nowrap;
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 0.0625rem solid rgba(212, 168, 75, 0.15);
  color: var(--text-light);
}

.prose tbody tr {
  transition: background 0.2s ease;
}

.prose tbody tr:hover {
  background: rgba(212, 168, 75, 0.05);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  border: 0.125rem solid rgba(212, 168, 75, 0.2);
}

.prose hr {
  border: none;
  height: 0.125rem;
  background: linear-gradient(90deg, transparent, var(--rune-gold), transparent);
  margin: 2.5rem 0;
}

.prose code {
  background: var(--stone-light);
  color: var(--rune-glow);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

.prose pre {
  background: var(--stone-dark);
  border: 0.0625rem solid rgba(212, 168, 75, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background: transparent;
  padding: 0;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

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

::-webkit-scrollbar-thumb {
  background: var(--stone-light);
  border-radius: 0.25rem;
}

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

/* --- Utility Classes --- */
.text-rune-gold {
  color: var(--rune-gold);
}

.text-parchment {
  color: var(--parchment);
}

.bg-stone-dark {
  background-color: var(--stone-dark);
}

.bg-stone-medium {
  background-color: var(--stone-medium);
}

.border-rune {
  border-color: var(--rune-gold);
}

.glow-text {
  text-shadow: 0 0 0.625rem rgba(212, 168, 75, 0.5);
}

/* --- Mobile Navigation --- */
.mobile-nav-backdrop {
  backdrop-filter: blur(0.625rem);
  -webkit-backdrop-filter: blur(0.625rem);
}

/* --- Selection Styling --- */
::selection {
  background: var(--rune-gold);
  color: var(--stone-dark);
}

/* --- Focus Styling --- */
:focus-visible {
  outline: 0.125rem solid var(--rune-gold);
  outline-offset: 0.125rem;
}

/* --- Smooth Scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- Print Styles --- */
@media print {
  .prose {
    color: #000;
  }
  .prose a {
    color: #000;
    text-decoration: underline;
  }
}
