/* Millionaire Quiz - Custom Studio Aesthetics */

/* Base font setup */
body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
}

/* RTL font override for Arabic */
html[dir="rtl"] body,
html[dir="rtl"] input,
html[dir="rtl"] button,
html[dir="rtl"] select {
  font-family: 'Cairo', 'Montserrat', sans-serif !important;
}

.font-cinzel {
  font-family: 'Cinzel', serif;
}

/* Atmospheric TV studio gradient backdrop */
.bg-studio {
  background-color: #060914;
  background-image: 
    radial-gradient(ellipse at 50% 15%, rgba(20, 36, 85, 0.7) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 85%, rgba(13, 20, 48, 0.9) 0%, transparent 75%);
}

/* Dynamic Studio Spotlights */
.spotlight-left {
  position: absolute;
  top: -100px;
  left: -50px;
  width: 400px;
  height: 600px;
  background: radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.15) 0%, transparent 65%);
  transform: rotate(-15deg);
  filter: blur(40px);
}

.spotlight-right {
  position: absolute;
  top: -100px;
  right: -50px;
  width: 400px;
  height: 600px;
  background: radial-gradient(circle at 90% 10%, rgba(245, 158, 11, 0.12) 0%, transparent 65%);
  transform: rotate(15deg);
  filter: blur(40px);
}

/* Studio stage subtle floor grid */
.studio-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 80%);
}

/* Answer lozenge styling */
.answer-lozenge {
  position: relative;
  border-width: 1.5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Lozenge hover & active effects */
.answer-lozenge:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(245, 158, 11, 0.8);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.35);
}

/* Selected answer state (pulsing gold/orange) */
.answer-lozenge.is-selected {
  background: linear-gradient(135deg, #b45309 0%, #78350f 100%) !important;
  border-color: #fbbf24 !important;
  color: #fff !important;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.8), inset 0 0 12px rgba(254, 240, 138, 0.5) !important;
  animation: pulse-selected 1s infinite alternate ease-in-out;
}

@keyframes pulse-selected {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.015); filter: brightness(1.2); }
}

/* Suspense state (blinking anticipation) */
.answer-lozenge.is-suspense {
  animation: suspense-flash 0.35s infinite alternate ease-in-out;
}

@keyframes suspense-flash {
  0% { background-color: #78350f; border-color: #fbbf24; }
  100% { background-color: #1e1b4b; border-color: #93c5fd; }
}

/* Correct answer state (vibrant green) */
.answer-lozenge.is-correct {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
  border-color: #4ade80 !important;
  color: #ffffff !important;
  box-shadow: 0 0 35px rgba(34, 197, 94, 0.9), inset 0 0 15px rgba(187, 247, 208, 0.6) !important;
  animation: pop-correct 0.4s ease-out;
}

@keyframes pop-correct {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Incorrect answer state (flashing red) */
.answer-lozenge.is-incorrect {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.9) !important;
}

/* Disabled option (e.g. 50:50 removed) */
.answer-lozenge.is-eliminated {
  opacity: 0.15 !important;
  pointer-events: none !important;
  border-color: transparent !important;
}

/* Lifeline buttons */
.lifeline-btn {
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}

.lifeline-btn:not(:disabled):hover {
  transform: translateY(-2px) scale(1.05);
  border-color: #fbbf24;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.5);
}

.lifeline-btn.is-used {
  opacity: 0.25;
  filter: grayscale(1);
  pointer-events: none;
  border-color: #475569 !important;
  background: #0f172a !important;
}

.lifeline-btn.is-used::after {
  content: "✕";
  position: absolute;
  font-size: 22px;
  font-weight: 900;
  color: #ef4444;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Prize ladder row item styling */
.ladder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.25s ease;
}

.ladder-row.is-current {
  background: linear-gradient(90deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  border: 1px solid #fef08a;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
  font-weight: 800;
  animation: ladder-pulse 1.2s infinite alternate ease-in-out;
}

@keyframes ladder-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.02); }
}

.ladder-row.is-milestone {
  color: #ffffff;
  font-weight: 800;
}

.ladder-row.is-passed {
  color: #eab308;
}

.ladder-row.is-future {
  color: #94a3b8;
}

/* Pop-in animation for modals */
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.animate-pop-in {
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* RTL layout helpers */
html[dir="rtl"] .answer-lozenge {
  text-align: right;
}
html[dir="rtl"] .question-lozenge p {
  direction: rtl;
}
html[dir="rtl"] #ladder-drawer {
  left: 0;
  right: auto;
  border-left: none;
  border-right: 1px solid rgba(245, 158, 11, 0.4);
  transform: translateX(-100%);
}
html[dir="rtl"] #ladder-drawer.open-drawer {
  transform: translateX(0);
}
#ladder-drawer.open-drawer {
  transform: translateX(0);
}