/* CrazyTower — wooden tower-defense palette */
:root {
  --wood-50:  #fef6e4;
  --wood-100: #f4e0b9;
  --wood-200: #d2a45a;
  --wood-400: #7a4a18;
  --wood-500: #5c3920;
  --wood-600: #3d2817;
  --wood-700: #2a1810;
  --wood-800: #1c0e08;
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --gem-500:  #10b981;
  --siege-500:#dc2626;
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at 20% 10%, rgba(245,158,11,0.10), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(220,38,38,0.08), transparent 40%),
    repeating-linear-gradient(
      90deg,
      #3d2817 0px, #3d2817 80px,
      #341f12 80px, #341f12 81px,
      #3d2817 81px, #3d2817 160px,
      #2e1d11 160px, #2e1d11 161px
    ),
    linear-gradient(180deg, #2a1810 0%, #1c0e08 100%);
}

/* Castle crenellation accents */
.castle-top::after {
  content: ""; display: block; height: 8px;
  background:
    linear-gradient(90deg, var(--gold-500) 0 50%, transparent 50%) 0 0 / 24px 8px;
  opacity: 0.5;
}
.castle-bottom::before {
  content: ""; display: block; height: 8px; margin-top: -8px;
  background:
    linear-gradient(90deg, var(--gold-500) 0 50%, transparent 50%) 0 0 / 24px 8px;
  opacity: 0.5;
  position: absolute; left: 0; right: 0; top: 0;
}

/* Hero background — castle stone */
.hero-bg {
  background:
    radial-gradient(circle at 70% 30%, rgba(251,191,36,0.18), transparent 50%),
    linear-gradient(180deg, rgba(60,30,10,0.7), rgba(28,14,8,0.95)),
    repeating-linear-gradient(45deg, rgba(168,137,108,0.05) 0 12px, rgba(0,0,0,0) 12px 24px);
}
.hero-fallback {
  background: linear-gradient(135deg, var(--wood-500), var(--wood-700));
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-400); font-family: "Cinzel", serif; font-weight: 800; font-size: 1.5rem;
}
.hero-fallback::after { content: "🏰"; font-size: 8rem; }

/* Parchment bonus block */
.parchment {
  background: linear-gradient(180deg, #fef6e4 0%, #f4e0b9 100%);
  border: 2px solid #d2a45a;
  box-shadow: inset 0 0 25px rgba(122,74,24,0.25), 0 8px 20px rgba(0,0,0,0.4);
  position: relative;
}
.parchment::before, .parchment::after {
  content: ""; position: absolute; top: -8px; width: 16px; height: 16px;
  background: var(--wood-400); border-radius: 50%; border: 2px solid var(--gold-600);
}
.parchment::before { left: 12px; }
.parchment::after { right: 12px; }

/* Gem CTA */
.gem-cta {
  position: relative;
  border: 2px solid rgba(255,255,255,0.4);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.gem-cta::after {
  content: ""; position: absolute; inset: 4px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent 50%);
  pointer-events: none;
}

/* Marquee animation */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee {
  display: flex; gap: 0;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee-wrap { overflow: hidden; }

/* Float animation for bonus CTA cards */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.float { animation: float 4s ease-in-out infinite; }
.float-delay-1 { animation: float 4.5s ease-in-out infinite; animation-delay: -1s; }
.float-delay-2 { animation: float 5s ease-in-out infinite; animation-delay: -2s; }
.float-delay-3 { animation: float 4.2s ease-in-out infinite; animation-delay: -3s; }

/* Tilt hover */
.tilt { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.tilt:hover {
  transform: perspective(800px) rotateX(2deg) rotateY(-2deg) translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(251, 191, 36, 0.35);
}

/* Slot card */
.slot-card {
  position: relative; border-radius: 1rem; overflow: hidden; aspect-ratio: 1;
  background: linear-gradient(135deg, var(--wood-500), var(--wood-700));
  border: 2px solid rgba(251,191,36,0.25);
  display: block;
}
.slot-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.slot-card:hover img { transform: scale(1.06); }
.slot-card .slot-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, transparent, rgba(28,14,8,0.95));
  padding: 0.75rem; padding-top: 2rem;
}
.slot-card .slot-overlay h3 { font-family: "Cinzel", serif; font-weight: 700; font-size: 0.85rem; color: var(--gold-400); margin: 0; line-height: 1.15; }
.slot-card .slot-overlay p { font-size: 0.7rem; opacity: 0.7; margin: 0.15rem 0 0; }
.slot-card .badge {
  position: absolute; top: 0.5rem; left: 0.5rem;
  background: var(--gold-400); color: var(--wood-800); font-size: 0.6rem; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Image fallback (placeholders) — show a defended-tower glyph */
.slot-card img[src=""], .slot-card img:not([src]) { display: none; }
.slot-card img { background: linear-gradient(135deg, #5c3920, #2a1810); }

/* Promo card */
.promo-card {
  position: relative;
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(28,14,8,0.85));
  border: 2px solid rgba(251,191,36,0.4);
  border-radius: 1.5rem;
  padding: 1.25rem;
  overflow: hidden;
}
.promo-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(220,38,38,0.2), transparent 60%);
  pointer-events: none;
}
.promo-card .ribbon {
  position: absolute; top: -1px; right: 12px;
  background: var(--siege-500); color: var(--wood-50);
  padding: 0.4rem 0.6rem; font-size: 0.85rem;
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.promo-cta {
  display: inline-block; font-size: 0.85rem; font-weight: 700;
  color: var(--wood-800); background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
  padding: 0.4rem 1rem; border-radius: 999px;
}

/* Tournament card */
.tournament-card {
  background: linear-gradient(180deg, var(--wood-600), var(--wood-700));
  border: 2px solid rgba(251,191,36,0.3);
  border-radius: 1.25rem;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.tournament-card .t-prize {
  font-family: "Cinzel", serif;
  font-weight: 800; font-size: 1.5rem;
  color: var(--gold-400);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 0 rgba(0,0,0,0.4);
}
.tournament-mega {
  background: linear-gradient(180deg, var(--siege-600, #b91c1c), var(--wood-700));
  border-color: var(--siege-500);
  box-shadow: 0 0 30px rgba(220,38,38,0.3);
}
.tournament-mega .t-prize { color: var(--gold-400); }

/* Feature card */
.feature-card {
  background: rgba(28,14,8,0.6);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 1.25rem;
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--gold-400); }

/* Big winner */
.big-winner__overlay {
  position: absolute; left: 1rem; bottom: 1rem; right: 1rem;
  background: rgba(28,14,8,0.85); backdrop-filter: blur(8px);
  padding: 0.85rem 1.1rem; border-radius: 1rem;
  border: 1px solid rgba(251,191,36,0.3);
  font-size: 1rem;
}

/* Bento */
.bento-card {
  background: rgba(28,14,8,0.7);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 1.25rem;
  padding: 1.25rem;
}

/* Latest bets */
.latest-bets table th, .latest-bets table td { padding: 0.5rem 0.5rem; }
.latest-bets table tr { transition: background 0.3s; }
.latest-bets table tr:first-child td { animation: fade-in 0.6s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* Payment tabs */
.pay-tab { background: transparent; color: var(--wood-50); transition: all 0.2s; }
.pay-tab.active { background: var(--gold-400); color: var(--wood-800); }
.pay-table { border-collapse: separate; border-spacing: 0; }
.pay-table th { background: var(--wood-800); color: var(--gold-400); padding: 0.75rem; text-align: left; font-family: "Cinzel", serif; font-size: 0.8rem; }
.pay-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid rgba(251,191,36,0.1); }
.pay-table tr:hover td { background: rgba(251,191,36,0.05); }

/* Bonus terms */
.bonus-term {
  background: rgba(28,14,8,0.55);
  border-left: 4px solid var(--gold-400);
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
}

/* How-to cards */
.howto-card {
  background: rgba(28,14,8,0.6);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 1.25rem;
  padding: 1.5rem;
}
.howto-card ol li { padding-left: 0.25rem; }

/* Review cards */
.review-card {
  background: rgba(28,14,8,0.6);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 1rem;
  padding: 1rem 1.15rem;
}

/* EEAT */
.eeat-card {
  background: linear-gradient(180deg, rgba(245,158,11,0.08), rgba(28,14,8,0.7));
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 1.5rem;
  padding: 1.5rem;
}
.eeat-item {
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
  border-bottom: 1px dashed rgba(251,191,36,0.15);
}
.eeat-item:last-child { border-bottom: 0; }
.eeat-item::before { content: "✓"; position: absolute; left: 0; color: var(--gem-500); font-weight: 800; }

/* RG quiz */
.rg-quiz {
  background: rgba(28,14,8,0.7);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 1.5rem;
  padding: 1.5rem;
}
.rg-quiz fieldset { border: 0; padding: 0; }
.rg-quiz label { cursor: pointer; }

/* FAQ */
.faq-item {
  background: rgba(28,14,8,0.55);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 0.75rem;
  padding: 0.85rem 1.1rem;
}
.faq-item summary {
  cursor: pointer; font-weight: 600;
  font-family: "Cinzel", serif;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "⚔ "; color: var(--gold-400); }
.faq-item[open] summary::before { content: "🏰 "; }
.faq-item .faq-body { margin-top: 0.65rem; padding-top: 0.65rem; border-top: 1px solid rgba(251,191,36,0.15); font-size: 0.9rem; opacity: 0.9; }

/* Inner page prose */
.prose, .prose-invert { line-height: 1.7; }
.prose h1, .prose-invert h1 { font-size: 2.25rem; font-weight: 800; line-height: 1.2; }
.prose h2, .prose-invert h2 {
  font-family: "Cinzel", serif;
  font-size: 1.6rem; font-weight: 700; margin: 2.2rem 0 0.85rem;
  color: var(--gold-400);
  border-bottom: 1px solid rgba(251,191,36,0.2);
  padding-bottom: 0.4rem;
}
.prose h3, .prose-invert h3 { font-family: "Cinzel", serif; font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.5rem; color: var(--gold-400); }
.prose p, .prose-invert p { margin: 0.85rem 0; }
.prose ul, .prose-invert ul { list-style: none; padding-left: 0; margin: 0.85rem 0; }
.prose ul li, .prose-invert ul li {
  position: relative; padding-left: 1.5rem; margin: 0.35rem 0;
}
.prose ul li::before, .prose-invert ul li::before {
  content: "⚔"; position: absolute; left: 0; color: var(--gold-400); font-size: 0.85rem; top: 0.15rem;
}
.prose ol, .prose-invert ol { list-style: decimal; padding-left: 1.5rem; margin: 0.85rem 0; }
.prose ol li, .prose-invert ol li { margin: 0.4rem 0; padding-left: 0.25rem; }
.prose ol li::marker { color: var(--gold-400); font-weight: 700; font-family: "Cinzel", serif; }
.prose a, .prose-invert a { color: var(--gold-400); text-decoration: underline; text-underline-offset: 3px; }
.prose strong, .prose-invert strong { font-weight: 700; color: var(--wood-50); }
.prose table, .prose-invert table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.prose th, .prose td, .prose-invert th, .prose-invert td { padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(251,191,36,0.15); text-align: left; }
.prose th, .prose-invert th { background: rgba(245,158,11,0.1); font-weight: 600; font-family: "Cinzel", serif; color: var(--gold-400); }

/* Inner-page CTA card */
.inner-cta {
  margin-top: 3rem;
  background: linear-gradient(135deg, var(--siege-500), var(--gold-500));
  color: var(--wood-800);
  border-radius: 1.5rem;
  padding: 2rem;
  text-align: center;
}
.inner-cta h2 { color: var(--wood-800) !important; border: 0 !important; padding: 0 !important; }
.inner-cta a {
  display: inline-block;
  background: var(--wood-800); color: var(--gold-400);
  font-weight: 800; padding: 0.85rem 2.25rem;
  border-radius: 999px;
  text-decoration: none !important;
}

/* details accordion in inner pages */
.inner-content details {
  background: rgba(28,14,8,0.55);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 0.75rem;
  padding: 0.85rem 1.1rem;
  margin: 0.6rem 0;
}
.inner-content details summary { cursor: pointer; font-weight: 600; }

/* Games library filters */
.games-filter {
  background: var(--wood-700);
  border: 1px solid rgba(251,191,36,0.3);
  color: var(--wood-50);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
}
.games-filter:hover { border-color: var(--gold-400); }
.games-filter.active {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
  color: var(--wood-800);
  border-color: var(--gold-400);
}
.games-input {
  background: var(--wood-800);
  border: 1px solid rgba(251,191,36,0.3);
  color: var(--wood-50);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  outline: none;
  min-width: 0;
}
.games-input:focus { border-color: var(--gold-400); box-shadow: 0 0 0 2px rgba(251,191,36,0.2); }

/* Card cursor (button) */
.games-card { cursor: pointer; text-align: left; padding: 0; border: 2px solid rgba(251,191,36,0.25); }
.games-card:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 2px; }

/* Category chip on each card (top-right) */
.cat-chip {
  position: absolute; top: 0.5rem; right: 0.5rem;
  font-size: 0.55rem; font-weight: 700; padding: 0.15rem 0.45rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.06em;
  backdrop-filter: blur(6px);
}
.cat-slots { background: rgba(251,191,36,0.85); color: var(--wood-800); }
.cat-live  { background: rgba(220,38,38,0.85);  color: #fff; }
.cat-shows { background: rgba(16,185,129,0.85); color: var(--wood-800); }

/* Badge variants (color-coded) */
.badge-high-rtp  { background: var(--gem-500); color: var(--wood-800); }
.badge-jackpot   { background: var(--gold-400); color: var(--wood-800); }
.badge-bonus-buy { background: var(--siege-500); color: #fff; }
.badge-popular   { background: #8b5cf6; color: #fff; }
.badge-new       { background: #ec4899; color: #fff; }

/* Modal */
.game-modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.game-modal.hidden { display: none; }
.game-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(28,14,8,0.85);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.game-modal__panel {
  position: relative;
  background: var(--wood-700);
  border: 2px solid var(--gold-500);
  border-radius: 1.5rem;
  max-width: 56rem;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  animation: modal-in 0.25s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.game-modal__close {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 5;
  width: 2.25rem; height: 2.25rem; border-radius: 999px;
  background: rgba(28,14,8,0.8); color: var(--gold-400);
  font-size: 1.4rem; font-weight: 800; line-height: 1;
  border: 1px solid rgba(251,191,36,0.3);
  cursor: pointer;
}
.game-modal__close:hover { background: var(--siege-500); color: #fff; }
.game-modal__media {
  position: relative;
  min-height: 16rem;
  background: linear-gradient(135deg, var(--wood-500), var(--wood-700));
}
.game-modal__media img { width: 100%; height: 100%; object-fit: cover; min-height: 16rem; }
.game-modal__media .badge {
  position: absolute; top: 0.75rem; left: 0.75rem;
  font-size: 0.7rem;
}
@media (max-width: 767px) {
  .game-modal__media { min-height: 12rem; }
  .game-modal__media img { min-height: 12rem; }
}

/* Scrollbar hide for quick-nav */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
