/* Custom theme styles and smooth micro-animations */

/* Art Director enhancements */
.hero-radial-glow {
  background: radial-gradient(circle at 50% 42%, rgba(15, 143, 106, 0.30) 0%, rgba(15, 143, 106, 0.12) 42%, rgba(15, 143, 106, 0) 72%);
  border-radius: 2rem;
}

.stage-card-glass {
  background: rgba(16, 37, 30, 0.75) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(52, 211, 153, 0.25) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 12px 24px -6px rgba(0, 0, 0, 0.5) !important;
}

.stage-card-glass:hover {
  border-color: rgba(52, 211, 153, 0.55) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 16px 28px -6px rgba(0, 0, 0, 0.6), 0 0 16px rgba(16, 185, 129, 0.18) !important;
}

.marathon-card-elevated {
  position: relative;
  background: linear-gradient(135deg, rgba(16, 37, 30, 0.88), rgba(28, 20, 44, 0.88)) padding-box,
              linear-gradient(135deg, #f59e0b, #10b981) border-box !important;
  border: 2px solid transparent !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 28px -6px rgba(0, 0, 0, 0.65), 0 0 20px rgba(245, 158, 11, 0.18) !important;
}

.marathon-card-elevated:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 16px 32px -6px rgba(0, 0, 0, 0.75), 0 0 24px rgba(245, 158, 11, 0.28) !important;
}

/* Faint shimmer travelling along the amber border of the marathon card */
.marathon-card-elevated::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(251, 191, 36, 0) 34%, rgba(251, 191, 36, 0.22) 50%, rgba(251, 191, 36, 0) 66%);
  background-size: 260% 100%;
  animation: marathonShimmer 5.5s linear infinite;
}

@keyframes marathonShimmer {
  0% { background-position: 130% 0; }
  100% { background-position: -130% 0; }
}

/* High-contrast CTA on the gold card: dark backing + mint label */
.marathon-cta-pill {
  background: #0b2a22 !important;
  color: #6ff0c0 !important;
  font-weight: 800 !important;
  border: 1px solid rgba(111, 240, 192, 0.45) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(111, 240, 192, 0.12);
}

.marathon-cta-pill:hover {
  background: #103a2f !important;
  color: #9bf7d5 !important;
  border-color: rgba(155, 247, 213, 0.65) !important;
}

.marathon-cta-pill:active {
  background: #08211a !important;
  transform: scale(0.96);
}

.star-glow {
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.75));
}

/* ===== Art-direction pass: depth, type, tiles, buttons ===== */

/* Layered page backdrop: base #05140f, large emerald glow, soft edge vignette */
body {
  background-color: #05140f !important;
  background-image:
    radial-gradient(circle at 50% 12%, rgba(15, 143, 106, 0.16) 0%, rgba(15, 143, 106, 0.055) 40%, rgba(15, 143, 106, 0) 58%),
    radial-gradient(ellipse 130% 85% at 50% 38%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.52) 100%);
  background-repeat: no-repeat;
}

/* Title: teal-to-mint vertical gradient with a tight glow, no heavy haze */
.title-gradient {
  font-size: 1.95rem;
  line-height: 1.2;
  background-image: linear-gradient(180deg, #4fe0c4 0%, #6ee7b7 48%, #b8f5db 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 18px rgba(0, 255, 180, 0.18));
}

.hero-sub {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  color: #9fd9c6;
}

@media (min-width: 640px) {
  .title-gradient { font-size: 2.4rem; }
  .hero-sub { font-size: 16px; }
}

/* Stat strip: 1px hairline borders, 16px radius, tinted data */
.stat-strip {
  border-color: rgba(255, 255, 255, 0.06) !important;
  border-radius: 16px !important;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.25;
  color: #9fd9c6;
}

.stat-value {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
  margin-top: 2px;
}

.stat-value .truncate {
  min-width: 0;
}

.stat-value--gold { color: #fcd34d; }
.stat-value--emerald { color: #6ff0c0; }
.stat-value--teal { color: #5eead4; }

.stat-divider {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Level icon tiles */
.level-tile {
  border-radius: 14px !important;
}

/* Secondary actions: readable labels, hairline border, distinct press states */
.ghost-btn {
  background: #0a241c !important;
  color: #cdeee2 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.ghost-btn:hover {
  background: #10352a !important;
  color: #f2fffa !important;
  border-color: rgba(111, 240, 192, 0.32) !important;
}

.ghost-btn:active {
  background: #071c15 !important;
  transform: scale(0.97);
}

.ghost-btn--gold {
  border-color: rgba(251, 191, 36, 0.34) !important;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.08), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.ghost-btn--gold:hover {
  border-color: rgba(251, 191, 36, 0.62) !important;
}

.ghost-btn--violet:hover {
  border-color: rgba(192, 132, 252, 0.42) !important;
}

.ghost-btn:focus-visible,
.option-btn:focus-visible,
.lifeline-btn:focus-visible {
  outline: 2px solid rgba(111, 240, 192, 0.75);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .marathon-card-elevated::after { animation: none; opacity: 0; }
  .illus-svg { animation: none; }
  .bot-idle,
  .animate-bounce-slow { animation: none; }
}

/* Question Illustration Canvas & Visual Enhancements */
#questionIllustrationWrapper {
  background: radial-gradient(circle at 50% 30%, rgba(16, 185, 129, 0.15) 0%, rgba(4, 30, 22, 0.95) 75%);
}

.illus-svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
  animation: illusFloat 4s ease-in-out infinite alternate;
}

@keyframes illusFloat {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-3px) scale(1.01); }
}

.illus-glow-cell {
  filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.6));
}

.illus-badge {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Base font adjustments */
body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #061812;
}
::-webkit-scrollbar-thumb {
  background: #0f3d2e;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

/* Animations */
@keyframes botFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-5px) rotate(1.5deg);
  }
}

.bot-idle {
  animation: botFloat 3.5s ease-in-out infinite;
}

@keyframes bounceSlow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.animate-bounce-slow {
  animation: bounceSlow 2.5s ease-in-out infinite;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake-it {
  animation: gentleShake 0.4s ease-in-out;
}

@keyframes popSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pop-success {
  animation: popSuccess 0.3s ease-out;
}

/* Answer option styling */
.option-btn {
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.option-btn:active {
  transform: scale(0.98);
}

.option-correct {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.45);
}

.option-wrong {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
}

/* Word bank chips for fill in the blanks */
.word-chip {
  transition: all 0.15s ease;
}

.word-chip:hover {
  transform: translateY(-2px);
}

.word-chip:active {
  transform: scale(0.95);
}

/* Star flying animation */
.flying-star-fx {
  transition: all 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}