/* ============================================================
   CraftCasino – Custom Styles & Animations
   Theme: Crown Forge UK (Deep Sapphire + Antique Gold)
   ============================================================ */

/* Base reset and overflow */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  word-break: break-word;
}

body {
  overflow-x: hidden;
  word-break: break-word;
}

* {
  box-sizing: border-box;
}

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --sapphire: #0f2a6b;
  --sapphire-light: #1a3a8f;
  --sapphire-dark: #081a47;
  --sapphire-deeper: #040e2a;
  --gold: #c9922a;
  --gold-light: #e8b84b;
  --gold-dark: #9a6d18;
  --gold-pale: #f5e3b0;
  --crown-bg: #07152e;
  --crown-surface: #0d2254;
  --crown-card: #132d6e;
  --crown-border: #2a4a9e;
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero-bg {
  background-image:
    linear-gradient(135deg, rgba(7,21,46,0.85) 0%, rgba(15,42,107,0.75) 50%, rgba(7,21,46,0.9) 100%),
    url('/images/hero.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

/* Parallax effect for hero */
@media (prefers-reduced-motion: no-preference) {
  .hero-bg {
    background-attachment: fixed;
  }
}

/* Metalwork pattern overlay */
.metalwork-pattern {
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(201, 146, 42, 0.08) 0px,
      rgba(201, 146, 42, 0.08) 1px,
      transparent 1px,
      transparent 12px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(201, 146, 42, 0.08) 0px,
      rgba(201, 146, 42, 0.08) 1px,
      transparent 1px,
      transparent 12px
    );
  background-size: 24px 24px;
  animation: metalwork-shift 20s linear infinite;
}

@keyframes metalwork-shift {
  0% { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

/* ============================================================
   Bonus Badge Box
   ============================================================ */
.bonus-badge-box {
  animation: badge-glow 3s ease-in-out infinite alternate;
  position: relative;
}

.bonus-badge-box::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold-dark), var(--gold));
  background-size: 300% 300%;
  z-index: -1;
  animation: gold-rotate 4s linear infinite;
  filter: blur(6px);
  opacity: 0.6;
}

@keyframes badge-glow {
  from { box-shadow: 0 0 20px rgba(201,146,42,0.3), 0 0 40px rgba(201,146,42,0.1); }
  to   { box-shadow: 0 0 40px rgba(201,146,42,0.6), 0 0 80px rgba(201,146,42,0.3); }
}

@keyframes gold-rotate {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   CTA Buttons
   ============================================================ */
.cta-primary {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: rgba(255,255,255,0.25);
  transform: skewX(-20deg);
  animation: btn-shimmer 3s ease-in-out infinite;
}

@keyframes btn-shimmer {
  0%   { left: -60%; opacity: 0; }
  30%  { opacity: 1; }
  60%  { left: 120%; opacity: 0; }
  100% { left: 120%; opacity: 0; }
}

.cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(201,146,42,0.5);
}

.cta-secondary:hover {
  transform: translateY(-2px);
}

/* ============================================================
   Step Cards
   ============================================================ */
.step-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
  background-size: 200% 100%;
  animation: gold-stripe 3s linear infinite;
}

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

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(201,146,42,0.2);
}

.step-badge {
  position: relative;
  box-shadow: 0 0 0 4px rgba(201,146,42,0.2), 0 0 20px rgba(201,146,42,0.3);
}

/* ============================================================
   Promo Cards
   ============================================================ */
.promo-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.promo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(201,146,42,0.15);
}

/* ============================================================
   Review Blocks
   ============================================================ */
.review-block {
  transition: box-shadow 0.3s ease;
}

.review-block:hover {
  box-shadow: 0 8px 32px rgba(201,146,42,0.12);
}

/* ============================================================
   Provider Word Cloud
   ============================================================ */
.provider-tag {
  display: inline-block;
  background: rgba(15,42,107,0.6);
  border: 1px solid var(--crown-border);
  color: var(--gold-pale);
  border-radius: 9999px;
  padding: 0.25rem 0.875rem;
  font-size: 0.78rem;
  font-family: Georgia, serif;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  cursor: default;
}

.provider-tag:hover {
  background: var(--gold);
  color: var(--crown-bg);
  transform: scale(1.05);
}

/* ============================================================
   Games Marquee
   ============================================================ */
.games-marquee-wrapper {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.games-marquee {
  display: flex;
  width: max-content;
  animation: marquee-scroll 30s linear infinite;
}

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

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

.game-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 32px rgba(201,146,42,0.25);
}

/* ============================================================
   FAQ Accordion
   ============================================================ */
.faq-item {
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: 0 4px 20px rgba(201,146,42,0.1);
}

.faq-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.faq-btn:hover {
  background: rgba(201,146,42,0.05);
}

.faq-btn[aria-expanded="true"] .faq-icon {
  transform: rotate(90deg);
}

.faq-icon {
  transition: transform 0.3s ease;
}

/* ============================================================
   Table Scrolling
   ============================================================ */
.overflow-x-auto {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

table {
  border-collapse: collapse;
  min-width: 500px;
}

/* ============================================================
   Prose Casino Styles
   ============================================================ */
.prose-casino {
  color: #d1d5db;
  max-width: none;
  word-break: break-word;
}

.prose-casino h1,
.prose-casino h2,
.prose-casino h3,
.prose-casino h4,
.prose-casino h5,
.prose-casino h6 {
  color: var(--gold-light);
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', serif;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.75em;
  margin-bottom: 0.75em;
}

.prose-casino h1 {
  font-size: 2rem;
  color: #ffffff;
}

.prose-casino h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--crown-border);
  padding-bottom: 0.5rem;
}

.prose-casino h3 {
  font-size: 1.2rem;
}

.prose-casino p {
  margin-bottom: 1em;
  line-height: 1.75;
  color: #d1d5db;
}

.prose-casino a {
  color: var(--gold-light);
  text-decoration: underline;
  transition: color 0.2s;
}

.prose-casino a:hover {
  color: var(--gold);
}

.prose-casino ul,
.prose-casino ol {
  margin: 1em 0 1em 1.5em;
  color: #d1d5db;
}

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

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

.prose-casino li {
  margin-bottom: 0.4em;
  line-height: 1.6;
}

.prose-casino blockquote {
  border-left: 4px solid var(--gold);
  padding-left: 1rem;
  margin: 1.5em 0;
  color: var(--gold-pale);
  font-style: italic;
}

.prose-casino strong {
  color: var(--gold-pale);
  font-weight: 700;
}

.prose-casino em {
  color: #e5e7eb;
}

.prose-casino hr {
  border-color: var(--crown-border);
  margin: 2em 0;
}

.prose-casino code {
  background: var(--crown-surface);
  color: var(--gold-light);
  padding: 0.1em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.prose-casino pre {
  background: var(--crown-surface);
  border: 1px solid var(--crown-border);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
}

/* Table inside prose */
.prose-casino table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.5em 0;
}

.prose-casino th {
  background: var(--sapphire-dark);
  color: var(--gold);
  padding: 0.6rem 1rem;
  text-align: left;
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', serif;
  border: 1px solid var(--crown-border);
}

.prose-casino td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--crown-border);
  color: #d1d5db;
}

.prose-casino tr:nth-child(even) {
  background: rgba(13,34,84,0.4);
}

.prose-casino .prose-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: 1.5em 0;
  border-radius: 0.5rem;
}

.prose-casino .prose-table-scroll table {
  margin-top: 0;
  margin-bottom: 0;
}

/* ============================================================
   Scrollbar Styling
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

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

/* ============================================================
   Header Navbar
   ============================================================ */
header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ============================================================
   Utility
   ============================================================ */
.crown-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 2rem 0;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   Responsive adjustments
   ============================================================ */
@media (max-width: 640px) {
  .hero-bg {
    background-attachment: scroll;
  }

  .bonus-badge-box {
    padding: 1.25rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .games-marquee {
    animation-duration: 20s;
  }
}

@media (max-width: 768px) {
  .metalwork-pattern {
    display: none;
  }
}

/* ============================================================
   Animation utilities
   ============================================================ */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease forwards;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,146,42,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(201,146,42,0); }
}

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

/* ============================================================
   Crown Forge Brand Accent Lines
   ============================================================ */
.section-heading-accent {
  display: inline-block;
  position: relative;
  padding-bottom: 0.4rem;
}

.section-heading-accent::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}