/* ==========================================================================
   שעשועון חנוכה - בסגנון "מי רוצה להיות מיליונר" | אתר הללויה
   Typography: Manrope (Headings), Work Sans (Body), JetBrains Mono (Data/Timer)
   ========================================================================== */

:root {
  --bg-deep: #05091e;
  --bg-studio: #0b153c;
  --bg-panel: rgba(12, 23, 64, 0.82);
  --bg-bento-light: #ffffff;
  --gold-primary: #fbbf24;
  --gold-bright: #fde68a;
  --gold-deep: #d97706;
  --cyan-glow: #38bdf8;
  --blue-hex-top: #132560;
  --blue-hex-bottom: #081131;
  --correct-top: #16a34a;
  --correct-bottom: #065f46;
  --correct-border: #4ade80;
  --wrong-top: #dc2626;
  --wrong-bottom: #7f1d1d;
  --wrong-border: #f87171;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --outline-variant: rgba(251, 191, 36, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  direction: rtl;
  font-family: 'Work Sans', 'Heebo', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-light);
  overflow-x: hidden;
  user-select: none;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Manrope', 'Rubik', sans-serif;
}

.font-mono-data {
  font-family: 'JetBrains Mono', monospace;
}

/* Studio Gently Alternating Backdrop + Heritage Subtle Radial Dots */
.studio-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #040717;
  overflow: hidden;
  pointer-events: none;
}

.studio-bg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 4s ease-in-out;
  will-change: opacity;
  pointer-events: none;
}

.studio-bg-layer.active {
  opacity: 1;
}

.studio-dot-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(rgba(251, 191, 36, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

.studio-beams {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.studio-beams::before,
.studio-beams::after {
  content: '';
  position: absolute;
  top: -30%;
  width: 55vw;
  height: 130vh;
  background: conic-gradient(from 180deg at 50% 0%, transparent 42%, rgba(56, 189, 248, 0.08) 48%, rgba(251, 191, 36, 0.09) 50%, rgba(56, 189, 248, 0.08) 52%, transparent 58%);
  filter: blur(22px);
  animation: beamSweep 14s ease-in-out infinite alternate;
}

.studio-beams::before {
  right: -5%;
}

.studio-beams::after {
  left: -5%;
  animation-delay: -7s;
}

@keyframes beamSweep {
  0% { transform: rotate(-10deg) scale(1); opacity: 0.65; }
  100% { transform: rotate(10deg) scale(1.08); opacity: 1; }
}

/* Main App Container */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.75rem;
}

@media (min-width: 640px) {
  .app-shell {
    padding: 1rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .app-shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    padding: 1rem 2rem;
  }
}

/* Top Header Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(9, 17, 48, 0.78);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 0.85rem;
  backdrop-filter: blur(12px);
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .top-bar {
    gap: 1rem;
    padding: 0.65rem 1.25rem;
    margin-bottom: 1rem;
  }
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.25));
}

@media (min-width: 640px) {
  .brand-logo {
    height: 38px;
  }
}

.brand-divider {
  width: 1px;
  height: 26px;
  background: rgba(251, 191, 36, 0.3);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 55%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Stopwatch Pill */
.timer-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(19, 37, 96, 0.95), rgba(7, 14, 40, 0.98));
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.22), inset 0 0 10px rgba(56, 189, 248, 0.15);
}

.timer-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulseDot 1.2s ease-in-out infinite;
}

.timer-dot.paused {
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
  animation: none;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.55; }
}

.timer-value {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  direction: ltr;
}

/* Control Icon Buttons */
.controls-cluster {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 28, 74, 0.75);
  color: var(--text-light);
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--gold-primary);
  background: rgba(30, 58, 138, 0.65);
  color: var(--gold-bright);
}

/* ==========================================================================
   Screens Management
   ========================================================================== */
.screen {
  display: none;
  flex: 1;
  min-height: 0;
}

.screen.active {
  display: flex;
  flex-direction: column;
  animation: fadeInScreen 0.38s ease-out;
}

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

/* ==========================================================================
   Bento Cards (Heritage & Horizon + Millionaire Studio Integration)
   ========================================================================== */
.bento-card-white {
  background: #ffffff;
  color: #0f172a;
  border-radius: 0.75rem; /* rounded-xl */
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.28);
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition: all 0.3s ease;
}

.bento-card-white:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(251, 191, 36, 0.16);
}

.bento-card-studio {
  background: linear-gradient(165deg, rgba(16, 31, 84, 0.9) 0%, rgba(8, 16, 46, 0.94) 100%);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.bento-card-studio:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 191, 36, 0.6);
}

/* ==========================================================================
   Stage Center Wrapper (Vertically centered + 10% side margins)
   ========================================================================== */
.stage-center-wrap {
  width: 100%;
  padding-inline: 3%;
  margin-block: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .stage-center-wrap {
    padding-inline: 10%;
  }
}

/* ==========================================================================
   Millionaire Hexagonal Question & Answer Bars
   ========================================================================== */
.hex-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Horizontal rail across the stage */
.hex-rail {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hex-rail::before {
  content: '';
  position: absolute;
  left: -6%;
  right: -6%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-primary) 12%, var(--gold-bright) 50%, var(--gold-primary) 88%, transparent 100%);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.55);
  z-index: 0;
  pointer-events: none;
}

/* Question Hexagon */
.question-hex-outer {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 2.5px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright), var(--cyan-glow), var(--gold-bright), var(--gold-deep));
  clip-path: polygon(16px 0%, calc(100% - 16px) 0%, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0% 50%);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
}

.question-hex-inner {
  width: 100%;
  min-height: 74px;
  padding: 0.9rem 1.35rem;
  background: linear-gradient(180deg, #162b6f 0%, #091338 55%, #060d29 100%);
  clip-path: polygon(15px 0%, calc(100% - 15px) 0%, 100% 50%, calc(100% - 15px) 100%, 15px 100%, 0% 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (min-width: 640px) {
  .question-hex-outer {
    clip-path: polygon(26px 0%, calc(100% - 26px) 0%, 100% 50%, calc(100% - 26px) 100%, 26px 100%, 0% 50%);
  }
  .question-hex-inner {
    min-height: 88px;
    padding: 1.15rem 2.6rem;
    clip-path: polygon(25px 0%, calc(100% - 25px) 0%, 100% 50%, calc(100% - 25px) 100%, 25px 100%, 0% 50%);
  }
}

.question-text {
  font-family: 'Manrope', 'Rubik', sans-serif;
  font-size: clamp(1.02rem, 1.85vw, 1.55rem);
  font-weight: 700;
  line-height: 1.42;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

/* Answers Grid (2x2 on Desktop with rails) */
.answers-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.answer-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  width: 100%;
}

@media (min-width: 768px) {
  .answers-grid {
    gap: 0.9rem;
  }

  .answer-row {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  .answer-row::before {
    content: '';
    position: absolute;
    left: -6%;
    right: -6%;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(251, 191, 36, 0.75) 10%, rgba(56, 189, 248, 0.8) 50%, rgba(251, 191, 36, 0.75) 90%, transparent 100%);
    z-index: 0;
    pointer-events: none;
  }
}

/* Answer Hexagon Button */
.answer-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  border: none;
  background: linear-gradient(90deg, #b45309, #fbbf24, #fde68a, #fbbf24, #b45309);
  padding: 2px;
  clip-path: polygon(16px 0%, calc(100% - 16px) 0%, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0% 50%);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.3s ease;
  text-align: right;
  font-family: inherit;
}

.answer-btn-inner {
  width: 100%;
  min-height: 54px;
  padding: 0.65rem 1.15rem;
  background: linear-gradient(180deg, var(--blue-hex-top) 0%, var(--blue-hex-bottom) 100%);
  clip-path: polygon(15px 0%, calc(100% - 15px) 0%, 100% 50%, calc(100% - 15px) 100%, 15px 100%, 0% 50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.25s ease;
}

@media (min-width: 640px) {
  .answer-btn {
    clip-path: polygon(22px 0%, calc(100% - 22px) 0%, 100% 50%, calc(100% - 22px) 100%, 22px 100%, 0% 50%);
  }
  .answer-btn-inner {
    min-height: 64px;
    padding: 0.8rem 1.85rem;
    clip-path: polygon(21px 0%, calc(100% - 21px) 0%, 100% 50%, calc(100% - 21px) 100%, 21px 100%, 0% 50%);
    gap: 0.85rem;
  }
}

@media (hover: hover) {
  .answer-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    filter: drop-shadow(0 6px 18px rgba(251, 191, 36, 0.42));
  }

  .answer-btn:hover:not(:disabled) .answer-btn-inner {
    background: linear-gradient(180deg, #1d3b8b 0%, #0f215c 100%);
  }
}

.answer-diamond {
  color: var(--gold-primary);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.answer-letter {
  font-family: 'Manrope', 'Rubik', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.answer-label {
  font-size: clamp(0.98rem, 1.3vw, 1.16rem);
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.35;
}

/* Answer States: Correct / Wrong / Eliminated (50:50) / Locked */
.answer-btn.correct {
  background: linear-gradient(90deg, #22c55e, #86efac, #4ade80, #22c55e);
  filter: drop-shadow(0 0 22px rgba(74, 222, 128, 0.65));
  animation: pulseCorrect 0.55s ease-out;
}

.answer-btn.correct .answer-btn-inner {
  background: linear-gradient(180deg, #16a34a 0%, #065f46 100%);
}

.answer-btn.correct .answer-letter,
.answer-btn.correct .answer-diamond {
  color: #fef08a;
}

@keyframes pulseCorrect {
  0% { transform: scale(1); }
  45% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

.answer-btn.wrong {
  background: linear-gradient(90deg, #ef4444, #fca5a5, #f87171, #ef4444);
  filter: drop-shadow(0 0 20px rgba(248, 113, 113, 0.6));
  animation: shakeWrong 0.42s ease-out;
}

.answer-btn.wrong .answer-btn-inner {
  background: linear-gradient(180deg, #dc2626 0%, #7f1d1d 100%);
}

@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(6px); }
  50% { transform: translateX(-6px); }
  75% { transform: translateX(4px); }
}

.answer-btn.eliminated {
  opacity: 0.22;
  pointer-events: none;
  filter: grayscale(0.8);
}

.answer-btn.eliminated .answer-label {
  visibility: hidden;
}

.answer-btn:disabled {
  cursor: default;
}

/* ==========================================================================
   Voiceover Replay Pill Button
   ========================================================================== */
.voice-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(15, 28, 76, 0.88);
  color: var(--gold-bright);
  font-family: 'Manrope', 'Rubik', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.voice-pill-btn:hover {
  transform: translateY(-2px);
  background: rgba(30, 58, 138, 0.85);
  border-color: var(--gold-bright);
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.28);
}

.voice-pill-btn.speaking {
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.voice-wave-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  transition: all 0.2s ease;
}

.voice-pill-btn.speaking .voice-wave-dot {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulseDot 0.9s ease-in-out infinite;
}

/* ==========================================================================
   Progress Ladder (Slim Millionaire Side Indicator)
   ========================================================================== */
.ladder-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.24rem;
  overflow-y: auto;
  max-height: calc(100vh - 205px);
  padding-left: 0.2rem;
}

.ladder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.24rem 0.45rem;
  border-radius: 0.4rem;
  font-size: 0.72rem;
  white-space: nowrap;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.ladder-item.current {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.32), rgba(251, 191, 36, 0.16));
  border-color: var(--gold-primary);
  color: #fde68a;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.22);
}

.ladder-item.answered-correct {
  color: #4ade80;
  background: rgba(22, 163, 74, 0.14);
}

.ladder-item.answered-wrong {
  color: #f87171;
  background: rgba(220, 38, 38, 0.14);
}

/* ==========================================================================
   Primary Gold Action Button
   ========================================================================== */
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.9rem 2.1rem;
  border-radius: 0.85rem;
  border: 1px solid #fef08a;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 55%, #d97706 100%);
  color: #080f2c;
  font-family: 'Manrope', 'Rubik', sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.42);
  transition: all 0.3s ease;
}

.btn-gold:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(251, 191, 36, 0.6);
  filter: brightness(1.05);
}

.btn-secondary-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 0.85rem;
  border: 1.5px solid rgba(251, 191, 36, 0.5);
  background: rgba(15, 28, 76, 0.65);
  color: var(--gold-bright);
  font-family: 'Manrope', 'Rubik', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary-outline:hover {
  transform: translateY(-3px);
  background: rgba(30, 58, 138, 0.7);
  border-color: var(--gold-bright);
}

/* Next Question Banner (after immediate reveal) */
.feedback-bar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.2rem;
  border-radius: 0.75rem;
  background: rgba(10, 20, 56, 0.88);
  border: 1px solid rgba(251, 191, 36, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: none;
}

.feedback-bar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: all 0.22s ease;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(251, 191, 36, 0.4);
  border-radius: 999px;
}
