/* ===== Кто хочет стать миллионером — стили ===== */

:root {
  --bg-deep: #050b2e;
  --bg-mid:  #0a1a5c;
  --gold:    #f5c542;
  --gold-2:  #ffe08a;
  --orange:  #ff9b21;
  --green:   #29b64a;
  --red:     #e23b3b;
  --blue-plate: #0b1e6b;
  --blue-line: #4f7bff;
  --text:    #ffffff;
  --shadow:  rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Oswald", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 50% 30%, var(--bg-mid) 0%, var(--bg-deep) 70%);
  overflow-x: hidden;
}

.app { position: relative; min-height: 100vh; }

/* Лучи прожекторов из центра */
.rays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    conic-gradient(from 0deg at 50% 38%,
      rgba(79,123,255,0.10) 0deg,
      transparent 12deg,
      rgba(79,123,255,0.10) 24deg,
      transparent 36deg,
      rgba(79,123,255,0.10) 48deg,
      transparent 60deg,
      rgba(79,123,255,0.10) 72deg,
      transparent 84deg,
      rgba(79,123,255,0.10) 96deg,
      transparent 108deg,
      rgba(79,123,255,0.10) 120deg,
      transparent 132deg,
      rgba(79,123,255,0.10) 144deg,
      transparent 156deg,
      rgba(79,123,255,0.10) 168deg,
      transparent 180deg,
      rgba(79,123,255,0.10) 192deg,
      transparent 204deg);
  z-index: 0;
}

/* ===== Экраны ===== */
.screen { display: none; position: relative; z-index: 1; min-height: 100vh; }
.screen.is-active { display: block; }

/* ===== Стартовый экран ===== */
.screen-start .start-inner {
  position: relative; z-index: 2;
  max-width: 720px; margin: 0 auto;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
.logo {
  font-size: clamp(34px, 7vw, 72px);
  font-weight: 700; line-height: 1.05;
  margin: 0 0 8px;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(245,197,66,0.6), 0 4px 12px var(--shadow);
  letter-spacing: 1px;
}
.logo span { color: var(--gold-2); }
.tagline { font-size: clamp(15px, 2.5vw, 20px); color: #cfe0ff; margin: 0 0 36px; }

/* ===== Кнопки ===== */
.btn {
  font-family: inherit;
  font-size: 18px; font-weight: 600;
  padding: 14px 32px;
  border: 2px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: #10214f;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 6px 20px rgba(245,197,66,0.35);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(245,197,66,0.5); }
.btn:active { transform: translateY(0); }
.btn-secondary {
  background: transparent; color: var(--gold);
  box-shadow: none;
}
.btn-secondary:hover { background: rgba(245,197,66,0.12); }
.btn-close { margin-top: 18px; }
.btn-melody {
  background: linear-gradient(180deg, #7ea8ff, var(--blue-line));
  color: #fff; border-color: var(--blue-line);
}

/* ===== Игровой экран ===== */
.game-layout {
  position: relative; z-index: 2;
  max-width: 1100px; margin: 0 auto;
  padding: 20px 20px 40px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: start;
}
.game-main { min-width: 0; }

/* Подсказки */
.lifelines { display: flex; gap: 14px; margin-bottom: 18px; }
.lifeline {
  position: relative;
  font-family: inherit; font-weight: 600; font-size: 16px;
  width: 74px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 24px;
  color: var(--gold-2);
  background: radial-gradient(circle at 50% 40%, #1a2f8a, #0a1550);
  border: 2px solid var(--gold);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s ease;
}
.lifeline .ll-icon { font-size: 22px; }
.lifeline .ll-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; line-height: 1;
  color: #10214f; background: var(--gold-2);
  border: 1px solid var(--gold); border-radius: 10px;
}
.lifeline.used .ll-count { display: none; }
.lifeline:hover:not(.used) { transform: translateY(-2px); filter: brightness(1.2); }
.lifeline.used {
  opacity: 0.4; cursor: not-allowed;
  border-color: #556; color: #99a;
  position: relative;
}
.lifeline.used::after {
  content: "✕"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: var(--red);
}

/* Проигрыватель мелодии */
.melody-player { margin-bottom: 16px; text-align: center; }

/* Вопрос */
.question-wrap { margin-bottom: 22px; }
.question-box {
  position: relative;
  text-align: center;
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 500;
  padding: 22px 28px;
  color: #fff;
  background: linear-gradient(180deg, #14235f, #0a1440);
  border: 2px solid var(--gold);
  border-radius: 14px;
  box-shadow: inset 0 0 30px rgba(79,123,255,0.2), 0 6px 18px var(--shadow);
}

/* Варианты ответов */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.answer {
  font-family: inherit;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  font-size: clamp(15px, 2vw, 19px);
  padding: 14px 22px;
  color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #101f57, #0a1236);
  border: 2px solid var(--blue-line);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%);
  transition: filter 0.15s ease, background 0.2s ease, transform 0.1s ease;
  min-height: 54px;
}
.answer:hover:not(:disabled) { filter: brightness(1.25); }
.answer:disabled { cursor: default; }
.answer .answer-letter { color: var(--gold); font-weight: 700; }
.answer.is-hidden { visibility: hidden; }

.answer.selected {
  background: linear-gradient(180deg, var(--orange), #d97400);
  border-color: var(--gold-2);
  color: #10214f;
}
.answer.selected .answer-letter { color: #10214f; }
.answer.correct {
  background: linear-gradient(180deg, #35d05e, #1c8b39);
  border-color: #baffcb;
  color: #06230f;
}
.answer.correct .answer-letter { color: #06230f; }
.answer.wrong {
  background: linear-gradient(180deg, #ff5a5a, #b81f1f);
  border-color: #ffc9c9;
  color: #2a0606;
}
.answer.wrong .answer-letter { color: #2a0606; }

/* Лесенка сумм */
.ladder {
  background: rgba(6, 12, 46, 0.6);
  border: 1px solid rgba(79,123,255,0.35);
  border-radius: 12px;
  padding: 10px;
  display: flex; flex-direction: column-reverse;
  gap: 4px;
}
.ladder-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 15px; font-weight: 500;
  color: #cfe0ff;
}
.ladder-row .lvl { color: var(--gold); opacity: 0.8; min-width: 22px; }
.ladder-row.current {
  background: linear-gradient(90deg, var(--orange), transparent);
  color: #fff; font-weight: 700;
}
.ladder-row.passed { color: var(--green); }
.ladder-row.milestone .amount { color: var(--gold-2); }

/* ===== Модалки ===== */
.modal {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 24, 0.75);
  backdrop-filter: blur(3px);
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: linear-gradient(180deg, #14235f, #0a1236);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 26px;
  max-width: 480px; width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px var(--shadow);
}
.modal-box h3 { margin-top: 0; color: var(--gold); font-weight: 600; }

/* Диаграмма зала */
.audience-chart {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 18px; height: 180px; margin: 18px 0 6px;
}
.audience-bar { width: 46px; display: flex; flex-direction: column; align-items: center; }
.audience-bar .bar {
  width: 100%;
  background: linear-gradient(180deg, var(--gold-2), var(--orange));
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
}
.audience-bar .pct { font-size: 14px; margin-bottom: 4px; color: var(--gold-2); }
.audience-bar .lbl { margin-top: 6px; font-weight: 700; color: var(--gold); }

/* Звонок другу */
.friend-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.friend-btn {
  font-family: inherit; font-size: 17px; font-weight: 600;
  padding: 14px; cursor: pointer;
  color: #fff;
  background: radial-gradient(circle at 50% 30%, #1a2f8a, #0a1550);
  border: 2px solid var(--blue-line); border-radius: 12px;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.friend-btn:hover { filter: brightness(1.25); transform: translateY(-2px); }
.friend-reply {
  margin-top: 8px; padding: 16px;
  background: rgba(245,197,66,0.1);
  border: 1px dashed var(--gold);
  border-radius: 12px;
  font-size: 18px; line-height: 1.4;
}
.friend-reply .who { color: var(--gold); font-weight: 700; }

/* Оверлей ошибки */
.modal-wrong h3 { color: var(--red); }
.wrong-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ===== Финальный экран ===== */
.screen-result .result-inner {
  position: relative; z-index: 2;
  max-width: 640px; margin: 0 auto;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px;
}
.result-title {
  font-size: clamp(28px, 5vw, 46px);
  color: var(--gold);
  text-shadow: 0 0 24px rgba(245,197,66,0.6);
  margin: 0 0 24px;
}
.certificate {
  width: 100%; max-width: 460px; margin: 0 auto 22px;
}
.certificate img { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 12px 40px var(--shadow); }
.result-wishes {
  white-space: pre-line;
  font-size: 18px; line-height: 1.5; color: #eaf1ff;
  margin: 0 0 28px;
}
.confetti { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* Кнопка звука */
.mute-btn {
  position: fixed; top: 14px; right: 14px; z-index: 30;
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(6,12,46,0.7);
  color: var(--gold); font-size: 20px; cursor: pointer;
}
.mute-btn:hover { filter: brightness(1.2); }

/* ===== Адаптив ===== */
@media (max-width: 820px) {
  .game-layout { grid-template-columns: 1fr; }
  .ladder {
    flex-direction: row; flex-wrap: wrap; justify-content: center;
    order: -1;
  }
  .ladder-row { padding: 4px 10px; font-size: 13px; }
  .ladder-row.current { background: rgba(255,155,33,0.4); }
}
@media (max-width: 560px) {
  .answers { grid-template-columns: 1fr; }
  .friend-picker { grid-template-columns: 1fr 1fr; }
  .lifelines { justify-content: center; }
}
