:root {
  --navy-950: #06101f;
  --navy-900: #08182f;
  --navy-800: #0c2344;
  --navy-700: #12305a;
  --gold-500: #d7ae58;
  --gold-400: #f1cf7a;
  --gold-300: #ffe4a1;
  --parchment: #efe1bf;
  --parchment-strong: #fff2ce;
  --ink: #271b10;
  --muted: #aeb9ca;
  --danger: #d9564a;
  --success: #55d088;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
  font-family: "Inter", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 8%, rgba(215, 174, 88, 0.2), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(45, 88, 150, 0.34), transparent 38%),
    linear-gradient(135deg, #030916 0%, var(--navy-950) 42%, #0a1424 100%);
  color: #f8f3e7;
}

button {
  font: inherit;
}

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

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
}

.app::after {
  content: "";
  position: fixed;
  inset: auto 0 0;
  height: 44vh;
  z-index: -1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.46), transparent);
  pointer-events: none;
}

.shell {
  width: min(1420px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 0 32px;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 260px;
  gap: 22px;
  align-items: stretch;
}

.left-panel,
.ladder,
.game-board,
.end-panel {
  border: 1px solid rgba(241, 207, 122, 0.22);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.left-panel,
.ladder {
  min-height: calc(100vh - 58px);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(9, 26, 50, 0.9), rgba(5, 13, 26, 0.84));
}

.left-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: var(--gold-400);
  border: 1px solid rgba(241, 207, 122, 0.48);
  background: radial-gradient(circle, rgba(241, 207, 122, 0.14), rgba(255, 255, 255, 0.02));
  border-radius: 50%;
}

.brand-mark svg,
.tiny-icon {
  width: 30px;
  height: 30px;
}

.title {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(2.2rem, 4.3vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.title span {
  color: var(--gold-400);
}

.intro-copy {
  max-width: 25ch;
  margin: 20px 0 26px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.98rem;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.primary-button {
  color: #1c1308;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  box-shadow: 0 14px 34px rgba(215, 174, 88, 0.24);
}

.secondary-button {
  margin-top: 12px;
  color: var(--gold-300);
  border: 1px solid rgba(241, 207, 122, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.primary-button:hover,
.secondary-button:hover,
.lifeline:not(:disabled):hover,
.answer:not(:disabled):hover {
  transform: translateY(-2px);
}

.stats {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 13px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-row strong {
  color: #fff7e5;
}

.game-board {
  min-height: calc(100vh - 58px);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(9, 28, 54, 0.78), rgba(4, 11, 23, 0.88)),
    radial-gradient(circle at 50% 0%, rgba(241, 207, 122, 0.16), transparent 38%);
  padding: clamp(18px, 3vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.game-board::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(241, 207, 122, 0.12);
  border-radius: 8px;
  pointer-events: none;
}

.board-inner {
  position: relative;
  z-index: 1;
}

.top-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.level-text {
  color: var(--gold-300);
  font-weight: 800;
  letter-spacing: 0;
}

.score-pill {
  min-width: 132px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid rgba(241, 207, 122, 0.38);
  color: #fff7e5;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  font-weight: 700;
}

.lifelines {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.lifeline {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(241, 207, 122, 0.38);
  color: #fff6df;
  background: linear-gradient(180deg, rgba(215, 174, 88, 0.16), rgba(255, 255, 255, 0.04));
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    border-color 180ms ease;
}

.lifeline:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.question-card {
  color: var(--ink);
  border-radius: 8px;
  border: 1px solid rgba(111, 73, 25, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 246, 222, 0.98), rgba(235, 211, 158, 0.96)),
    repeating-linear-gradient(90deg, rgba(80, 45, 12, 0.03) 0 1px, transparent 1px 5px);
  box-shadow:
    0 26px 64px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.36);
  padding: clamp(22px, 3.3vw, 42px);
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #765522;
  font-weight: 800;
  font-size: 0.86rem;
  margin-bottom: 18px;
}

.question-text {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(1.35rem, 2.25vw, 2.35rem);
  line-height: 1.22;
  letter-spacing: 0;
  text-wrap: balance;
}

.message {
  min-height: 46px;
  margin: 18px 0;
  color: #fff7e5;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
}

.message.success {
  color: #dffff0;
  border-color: rgba(85, 208, 136, 0.36);
  background: rgba(85, 208, 136, 0.12);
}

.message.danger {
  color: #ffe0dc;
  border-color: rgba(217, 86, 74, 0.42);
  background: rgba(217, 86, 74, 0.12);
}

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

.answer {
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(241, 207, 122, 0.3);
  color: #fff9e9;
  background: linear-gradient(180deg, rgba(16, 45, 84, 0.96), rgba(7, 22, 43, 0.96));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font-weight: 700;
  line-height: 1.32;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.answer:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.answer.hidden-option {
  visibility: hidden;
}

.answer.correct {
  border-color: rgba(85, 208, 136, 0.78);
  background: linear-gradient(180deg, rgba(30, 121, 75, 0.96), rgba(16, 78, 50, 0.96));
}

.answer.wrong {
  border-color: rgba(217, 86, 74, 0.78);
  background: linear-gradient(180deg, rgba(141, 47, 42, 0.96), rgba(92, 28, 31, 0.96));
}

.answer-letter {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1d1409;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  font-weight: 900;
}

.ladder {
  padding: 18px;
}

.ladder h2 {
  margin: 0 0 14px;
  color: var(--gold-300);
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.ladder-list {
  display: grid;
  gap: 6px;
}

.ladder-item {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #b9c4d5;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  font-size: 0.86rem;
}

.ladder-item strong {
  color: #fff6df;
}

.ladder-item.active {
  color: #1d1409;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  box-shadow: 0 10px 24px rgba(215, 174, 88, 0.22);
}

.ladder-item.active strong {
  color: #1d1409;
}

.ladder-item.passed {
  color: #e9d9b2;
  border-color: rgba(241, 207, 122, 0.16);
}

.end-panel {
  width: min(760px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.end-card {
  border-radius: 8px;
  border: 1px solid rgba(241, 207, 122, 0.28);
  background: linear-gradient(180deg, rgba(8, 24, 47, 0.94), rgba(5, 12, 24, 0.94));
  padding: clamp(24px, 5vw, 52px);
  text-align: center;
  box-shadow: var(--shadow);
}

.end-card h1 {
  margin: 0 0 16px;
  font-family: "Cinzel", Georgia, serif;
  color: var(--gold-300);
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 1;
}

.end-card p {
  margin: 0 auto 24px;
  max-width: 54ch;
  color: var(--muted);
  line-height: 1.65;
}

.audience-bars {
  display: grid;
  gap: 8px;
  width: min(460px, 100%);
  margin: 0 auto;
}

.audience-row {
  display: grid;
  grid-template-columns: 32px 1fr 46px;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .left-panel,
  .ladder,
  .game-board {
    min-height: auto;
  }

  .left-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
    gap: 22px;
    align-items: end;
  }

  .ladder-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 20px, 620px);
    padding: 10px 0 22px;
    gap: 12px;
  }

  .left-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
  }

  .intro-copy {
    max-width: none;
    margin: 14px 0 18px;
  }

  .top-line,
  .question-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .lifelines,
  .answers,
  .ladder-list {
    grid-template-columns: 1fr;
  }

  .question-card {
    min-height: 210px;
  }

  .answer {
    min-height: 64px;
  }
}
