/* =============================================
   Bingo Bongo Stars - Custom CSS
   Animation, Keyframes & Prose Styling
   ============================================= */

/* CSS Custom Properties */
:root {
  --color-primary: #ff6b35;
  --color-secondary: #ffc947;
  --color-accent: #7b2cbf;
  --color-dark: #1a1a2e;
  --color-darker: #0f0f1a;
  --color-light: #f8f9fa;
  --color-star: #ffd700;
  --color-pop-pink: #ff69b4;
  --color-pop-cyan: #00d4ff;
  --color-pop-lime: #32cd32;
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  --gradient-hero: linear-gradient(180deg, rgba(26,26,46,0.95) 0%, rgba(123,44,191,0.85) 50%, rgba(26,26,46,0.95) 100%);
}

/* Global Overflow Control */
html, body {
  overflow-x: clip;
  overflow-y: auto;
}

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

/* =============================================
   KEYFRAME ANIMATIONS
   ============================================= */

@keyframes starBurst {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 0.8;
  }
}

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

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1rem);
  }
}

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

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 1.25rem rgba(255, 107, 53, 0.4);
  }
  50% {
    box-shadow: 0 0 2.5rem rgba(255, 107, 53, 0.8);
  }
}

@keyframes bounce-subtle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.5rem);
  }
}

@keyframes colorShift {
  0% { color: var(--color-star); }
  33% { color: var(--color-pop-pink); }
  66% { color: var(--color-pop-cyan); }
  100% { color: var(--color-star); }
}

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

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

/* =============================================
   ANIMATION UTILITY CLASSES
   ============================================= */

.animate-star-burst {
  animation: starBurst 3s ease-in-out infinite;
}

.animate-twinkle {
  animation: twinkle 2s ease-in-out infinite;
}

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

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

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

.animate-bounce-subtle {
  animation: bounce-subtle 2s ease-in-out infinite;
}

.animate-color-shift {
  animation: colorShift 4s ease-in-out infinite;
}

.animate-slide-up {
  animation: slideInUp 0.6s ease-out forwards;
}

.animate-spin-slow {
  animation: spin-slow 20s linear infinite;
}

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

/* Staggered delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* =============================================
   PARALLAX EFFECTS
   ============================================= */

.parallax-container {
  perspective: 62.5rem;
  overflow: hidden;
}

.parallax-slow {
  transform: translateZ(-0.625rem) scale(1.1);
}

.parallax-fast {
  transform: translateZ(0.625rem) scale(0.9);
}

/* =============================================
   STAR PATTERN DECORATIONS
   ============================================= */

.star-pattern {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.star-pattern::before,
.star-pattern::after {
  content: '★';
  position: absolute;
  font-size: 1.5rem;
  color: var(--color-star);
  opacity: 0.6;
  animation: twinkle 3s ease-in-out infinite;
}

.star-field {
  background-image: 
    radial-gradient(2px 2px at 10% 20%, var(--color-star) 50%, transparent 50%),
    radial-gradient(2px 2px at 30% 70%, var(--color-pop-pink) 50%, transparent 50%),
    radial-gradient(2px 2px at 50% 30%, var(--color-pop-cyan) 50%, transparent 50%),
    radial-gradient(2px 2px at 70% 80%, var(--color-star) 50%, transparent 50%),
    radial-gradient(2px 2px at 90% 40%, var(--color-pop-lime) 50%, transparent 50%);
}

/* =============================================
   COMPONENT OVERRIDES
   ============================================= */

/* Navigation */
.nav-sticky {
  backdrop-filter: blur(0.75rem);
  -webkit-backdrop-filter: blur(0.75rem);
}

/* Mobile Menu */
.mobile-menu {
  background-color: var(--color-darker);
  backdrop-filter: blur(1.25rem);
  -webkit-backdrop-filter: blur(1.25rem);
}

/* Buttons */
.btn-primary {
  background: var(--gradient-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.625rem 1.875rem rgba(255, 107, 53, 0.4);
}

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

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

.btn-secondary {
  border: 0.125rem solid var(--color-secondary);
  color: var(--color-secondary);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background-color: var(--color-secondary);
  color: var(--color-dark);
}

/* Cards */
.card-glow {
  transition: all 0.3s ease;
}

.card-glow:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 1.25rem 2.5rem rgba(123, 44, 191, 0.3);
}

/* Game Cards */
.game-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover {
  transform: scale(1.05);
  z-index: 10;
}

.game-card:hover .game-card-overlay {
  opacity: 1;
}

.game-card-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Bonus Badge */
.bonus-badge {
  background: var(--gradient-primary);
  position: relative;
}

.bonus-badge::before {
  content: '';
  position: absolute;
  inset: -0.125rem;
  background: var(--gradient-primary);
  border-radius: inherit;
  z-index: -1;
  filter: blur(0.625rem);
  opacity: 0.7;
}

/* Table Responsive Wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  margin-bottom: 1rem;
}

.table-responsive table {
  min-width: 37.5rem;
}

/* Step Badges */
.step-badge {
  width: 3.5rem;
  height: 3.5rem;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
  color: white;
  position: relative;
}

.step-badge::after {
  content: '';
  position: absolute;
  inset: -0.25rem;
  border-radius: 50%;
  border: 0.125rem dashed var(--color-star);
  animation: spin-slow 10s linear infinite;
}

/* Provider Cloud */
.provider-tag {
  transition: all 0.2s ease;
}

.provider-tag:hover {
  background-color: var(--color-accent);
  color: white;
  transform: scale(1.1);
}

/* FAQ Accordion */
.faq-item {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.faq-question {
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: var(--color-secondary);
}

/* 18+ Badge */
.age-badge {
  width: 2.5rem;
  height: 2.5rem;
  border: 0.125rem solid currentColor;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.875rem;
}

/* =============================================
   PROSE STYLING FOR MARKDOWN CONTENT
   ============================================= */

.prose {
  color: var(--color-light);
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 100%;
}

.prose > * + * {
  margin-top: 1.5em;
}

/* Headings */
.prose h2 {
  color: var(--color-secondary);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5em;
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 0.125rem solid rgba(255, 201, 71, 0.3);
  position: relative;
}

.prose h2::before {
  content: '★';
  margin-right: 0.5em;
  color: var(--color-star);
  font-size: 0.8em;
}

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

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

/* Paragraphs */
.prose p {
  margin-bottom: 1.25em;
  color: rgba(248, 249, 250, 0.9);
}

.prose p:first-of-type {
  font-size: 1.125em;
  color: var(--color-light);
}

/* Links */
.prose a {
  color: var(--color-secondary);
  text-decoration: underline;
  text-decoration-color: rgba(255, 201, 71, 0.4);
  text-underline-offset: 0.25em;
  transition: all 0.2s ease;
}

.prose a:hover {
  color: var(--color-primary);
  text-decoration-color: var(--color-primary);
}

/* Strong & Emphasis */
.prose strong {
  color: var(--color-light);
  font-weight: 700;
}

.prose em {
  color: var(--color-pop-pink);
  font-style: italic;
}

/* Lists - Unordered */
.prose ul {
  list-style: none;
  padding-left: 1.5em;
  margin: 1.5em 0;
}

.prose ul li {
  position: relative;
  margin-bottom: 0.75em;
  padding-left: 0.5em;
}

.prose ul li::before {
  content: '★';
  position: absolute;
  left: -1.25em;
  color: var(--color-star);
  font-size: 0.75em;
  top: 0.25em;
}

/* Lists - Ordered */
.prose ol {
  list-style: none;
  padding-left: 2em;
  margin: 1.5em 0;
  counter-reset: prose-counter;
}

.prose ol li {
  position: relative;
  margin-bottom: 0.75em;
  padding-left: 0.5em;
  counter-increment: prose-counter;
}

.prose ol li::before {
  content: counter(prose-counter);
  position: absolute;
  left: -2em;
  width: 1.5em;
  height: 1.5em;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: bold;
  color: white;
  top: 0.1em;
}

/* Nested Lists */
.prose ul ul,
.prose ol ol,
.prose ul ol,
.prose ol ul {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Blockquotes */
.prose blockquote {
  border-left: 0.25rem solid var(--color-accent);
  background: linear-gradient(90deg, rgba(123, 44, 191, 0.15) 0%, transparent 100%);
  padding: 1.25em 1.5em;
  margin: 2em 0;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: rgba(248, 249, 250, 0.95);
}

.prose blockquote p {
  margin: 0;
}

.prose blockquote p::before {
  content: '"';
  font-size: 2em;
  color: var(--color-accent);
  line-height: 0;
  vertical-align: -0.3em;
  margin-right: 0.1em;
}

/* Tables */
.prose .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2em 0;
  border-radius: 0.75rem;
  background: rgba(26, 26, 46, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.prose table {
  width: 100%;
  min-width: 31.25rem;
  border-collapse: collapse;
  font-size: 0.95em;
}

.prose thead {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
}

.prose th {
  padding: 1em 1.25em;
  text-align: left;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.prose tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s ease;
}

.prose tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.prose td {
  padding: 1em 1.25em;
  color: rgba(248, 249, 250, 0.85);
}

.prose tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Code */
.prose code {
  background: rgba(123, 44, 191, 0.2);
  color: var(--color-pop-cyan);
  padding: 0.2em 0.4em;
  border-radius: 0.25em;
  font-size: 0.9em;
  font-family: 'Fira Code', monospace;
}

.prose pre {
  background: var(--color-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1.5em;
  overflow-x: auto;
  margin: 2em 0;
}

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

/* Horizontal Rule */
.prose hr {
  border: none;
  height: 0.125rem;
  background: linear-gradient(90deg, transparent, var(--color-accent), var(--color-secondary), var(--color-accent), transparent);
  margin: 3em 0;
}

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2em auto;
  display: block;
  box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.3);
}

/* Figures */
.prose figure {
  margin: 2em 0;
}

.prose figcaption {
  text-align: center;
  font-size: 0.9em;
  color: rgba(248, 249, 250, 0.6);
  margin-top: 0.75em;
  font-style: italic;
}

/* Definition Lists */
.prose dl {
  margin: 1.5em 0;
}

.prose dt {
  font-weight: 700;
  color: var(--color-secondary);
  margin-top: 1em;
}

.prose dd {
  margin-left: 1.5em;
  margin-top: 0.25em;
  color: rgba(248, 249, 250, 0.85);
}

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

@media (max-width: 1024px) {
  .prose {
    font-size: 1rem;
  }
  
  .prose h2 {
    margin-top: 2em;
  }
  
  .prose blockquote {
    padding: 1em 1.25em;
  }
}

@media (max-width: 640px) {
  .prose {
    font-size: 0.9375rem;
    line-height: 1.7;
  }
  
  .prose h2::before {
    display: none;
  }
  
  .prose ul,
  .prose ol {
    padding-left: 1.25em;
  }
  
  .prose blockquote {
    margin-left: 0;
    margin-right: 0;
  }
  
  .prose table {
    font-size: 0.875em;
  }
  
  .prose th,
  .prose td {
    padding: 0.75em 1em;
  }
}

/* =============================================
   UTILITY OVERRIDES
   ============================================= */

/* Focus states for accessibility */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 0.1875rem var(--color-secondary);
}

/* Selection styling */
::selection {
  background: var(--color-accent);
  color: white;
}

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

::-webkit-scrollbar-track {
  background: var(--color-darker);
}

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

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