:root {
  --bg: #070318;
  --panel: rgba(18, 8, 47, 0.84);
  --panel-strong: rgba(27, 12, 70, 0.96);
  --gold: #ffe66d;
  --gold-2: #ff9f1c;
  --purple: #7b2ff7;
  --blue: #00d4ff;
  --green: #36f58a;
  --red: #ff4d6d;
  --text: #ffffff;
  --muted: #c8c3df;
  --line: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius: 28px;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(123, 47, 247, 0.45), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(0, 212, 255, 0.25), transparent 28%),
    linear-gradient(135deg, #070318 0%, #12082f 45%, #050111 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 78%);
  pointer-events: none;
}

.bg-orb {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(58px);
  opacity: .5;
  pointer-events: none;
}

.orb-a { left: -120px; bottom: 5%; background: var(--gold-2); }
.orb-b { right: -100px; bottom: 18%; background: var(--purple); }

.app-shell {
  width: min(100vw, 1920px);
  height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 1.45vw, 28px);
  position: relative;
  z-index: 1;
}

.screen { display: none; height: calc(100vh - clamp(28px, 2.9vw, 56px)); min-height: 0; }
.screen.active { display: grid; }

.start-screen,
.finish-screen {
  place-items: center;
}

.hero-card,
.finish-card {
  width: min(1180px, 100%);
  padding: clamp(28px, 4vw, 70px);
  border: 1px solid var(--line);
  border-radius: 42px;
  background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.035)), var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(18px);
}

.logo-main {
  width: min(580px, 82vw);
  height: auto;
  display: block;
  margin: 0 auto 18px;
}

.logo-main.small { width: min(420px, 75vw); }

.eyebrow {
  margin: 8px 0 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: clamp(12px, 1vw, 15px);
  color: var(--gold);
  font-weight: 800;
}

h1,
h2,
p { margin-top: 0; }

.hero-card h1,
.finish-card h1 {
  font-family: Montserrat, Inter, sans-serif;
  font-size: clamp(34px, 4vw, 72px);
  line-height: 1.02;
  margin-bottom: 20px;
}

.hero-text,
.final-message {
  max-width: 780px;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: clamp(16px, 1.3vw, 22px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 26px;
}

.btn {
  border: 0;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
  font-family: Montserrat, Inter, sans-serif;
  letter-spacing: .3px;
  border-radius: 999px;
  padding: 16px 28px;
  min-height: 56px;
  font-size: 16px;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease, background .18s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 48%, #ff5d2d 100%);
  color: #1b0b08;
  box-shadow: 0 18px 35px rgba(255, 159, 28, .26);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--purple), #3a86ff);
  box-shadow: 0 18px 35px rgba(123, 47, 247, .25);
}

.btn-ghost {
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
}

.hidden { display: none !important; }

.status-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 34px;
}

.status-grid div,
.result-tile {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  background: rgba(255,255,255,.07);
}

.status-grid span,
.result-tile span {
  display: block;
  font-family: Montserrat, Inter, sans-serif;
  font-weight: 900;
  font-size: clamp(26px, 2.7vw, 48px);
  color: var(--gold);
}

.status-grid small,
.result-tile small {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.result-tile.success span { color: var(--green); }
.result-tile.danger span { color: var(--red); }
.result-tile.neutral span { color: var(--blue); }

.game-screen {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
}

.brand-mini img { width: clamp(170px, 13vw, 250px); display: block; }

.score-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.score-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(0,0,0,.22);
  color: var(--muted);
  font-weight: 700;
}

.score-strip strong { color: var(--gold); }

.progress-wrap {
  width: 100%;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--blue), var(--gold));
  transition: width .35s ease;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.lifelines-panel,
.question-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.105), rgba(255,255,255,.035)), var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.lifelines-panel {
  padding: 18px;
  align-self: stretch;
  overflow: hidden;
}

.lifelines-panel h2 {
  font-family: Montserrat, Inter, sans-serif;
  margin-bottom: 12px;
  font-size: clamp(22px, 1.7vw, 30px);
}

.lifeline {
  width: 100%;
  min-height: 66px;
  margin-bottom: 10px;
  padding: 13px 15px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--text);
  background: linear-gradient(135deg, rgba(123,47,247,.35), rgba(0,212,255,.12));
  font-size: clamp(18px, 1.28vw, 25px);
  line-height: 1.12;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, opacity .18s ease;
}

.lifeline:hover { transform: translateX(4px); border-color: rgba(255,230,109,.5); }
.lifeline:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.lifeline span {
  text-align: left;
}

.lifeline strong {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #180920;
  background: var(--gold);
}

.rules-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,230,109,.10);
  border: 1px solid rgba(255,230,109,.18);
  color: var(--muted);
  line-height: 1.45;
}

.rules-box strong { color: var(--gold); }
.rules-box p { margin: 8px 0 0; }

.question-card {
  min-height: 0;
  height: 100%;
  padding: clamp(18px, 2.15vw, 34px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.timer-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.timer-info {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.timer-ring {
  --pct: 100;
  width: clamp(78px, 5.8vw, 112px);
  height: clamp(78px, 5.8vw, 112px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--gold) var(--pct), rgba(255,255,255,.12) 0),
    rgba(0,0,0,.28);
  box-shadow: inset 0 0 0 8px rgba(6,3,17,.95), 0 0 28px rgba(255,230,109,.23);
}

.timer-ring.warning { background: conic-gradient(var(--red) var(--pct), rgba(255,255,255,.12) 0), rgba(0,0,0,.28); }
.timer-ring span {
  font-family: Montserrat, Inter, sans-serif;
  font-weight: 900;
  font-size: clamp(30px, 2.5vw, 46px);
}

.round-label,
.difficulty { margin: 0; color: var(--muted); font-weight: 800; }
.round-label strong { color: var(--gold); }
.difficulty { margin-top: 4px; color: var(--blue); text-transform: uppercase; letter-spacing: 2px; font-size: 13px; }

#question-text {
  font-family: Montserrat, Inter, sans-serif;
  font-size: clamp(28px, 2.55vw, 48px);
  line-height: 1.08;
  margin: 0 0 18px;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: auto;
}

.answer-btn {
  min-height: clamp(82px, 7.1vw, 116px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.045));
  color: var(--text);
  text-align: left;
  padding: 16px 20px;
  font-size: clamp(20px, 1.55vw, 29px);
  line-height: 1.12;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}

.answer-btn:hover { transform: translateY(-3px); border-color: rgba(255,230,109,.56); }
.answer-btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.answer-btn .letter {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #160716;
  font-family: Montserrat, Inter, sans-serif;
  font-weight: 900;
}

.answer-btn.correct {
  border-color: rgba(54,245,138,.75);
  background: linear-gradient(135deg, rgba(54,245,138,.30), rgba(54,245,138,.08));
}

.answer-btn.wrong {
  border-color: rgba(255,77,109,.75);
  background: linear-gradient(135deg, rgba(255,77,109,.30), rgba(255,77,109,.08));
}

.answer-btn.eliminated {
  opacity: .18;
  filter: grayscale(1);
}

.feedback {
  margin-top: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 14px 18px;
  line-height: 1.48;
  background: rgba(255,255,255,.08);
  color: var(--muted);
  font-size: clamp(15px, 1.15vw, 19px);
}

.feedback strong { color: var(--gold); }
.feedback.success { border-color: rgba(54,245,138,.45); }
.feedback.danger { border-color: rgba(255,77,109,.45); }
.feedback.info { border-color: rgba(0,212,255,.45); }

.question-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.question-actions .btn {
  min-height: 48px;
  padding: 12px 20px;
  white-space: nowrap;
}

.finish-card { max-width: 1050px; }

@media (max-width: 1200px) {
  .stage-grid { grid-template-columns: 1fr; }
  .lifelines-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .lifelines-panel h2,
  .rules-box { grid-column: 1 / -1; }
  .lifeline { margin-bottom: 0; min-height: 62px; }
}

@media (max-width: 820px) {
  .app-shell { padding: 14px; }
  .screen { min-height: calc(100vh - 28px); }
  .hero-card,
  .finish-card { border-radius: 28px; padding: 26px 18px; }
  .hero-actions,
  .question-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .status-grid,
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .game-header { flex-direction: column; align-items: stretch; }
  .score-strip { justify-content: flex-start; }
  .lifelines-panel { grid-template-columns: 1fr; }
  .answers-grid { grid-template-columns: 1fr; }
  .question-card { min-height: auto; }
  #question-text { font-size: 28px; }
}


@media (min-width: 1201px) and (max-height: 900px) {
  .app-shell { padding: 14px; }
  .screen { height: calc(100vh - 28px); }
  .game-screen { gap: 10px; }
  .question-card { padding: 18px 22px; }
  .lifelines-panel { padding: 14px; }
  .rules-box { display: none; }
  #question-text { font-size: clamp(24px, 1.85vw, 36px); margin-bottom: 12px; }
  .lifeline { min-height: 60px; font-size: clamp(17px, 1.1vw, 22px); padding: 10px 12px; }
  .lifeline strong { width: 36px; height: 36px; }
  .answer-btn { min-height: 78px; font-size: clamp(18px, 1.25vw, 24px); padding: 13px 16px; }
  .answer-btn .letter { width: 44px; height: 44px; }
}

@media (max-width: 1200px) {
  body { overflow-y: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  .screen { height: auto; min-height: calc(100vh - 28px); }
  .stage-grid { height: auto; overflow: visible; }
  .question-card { height: auto; overflow: visible; }
}
