:root {
  --bg-1: #040b23;
  --bg-2: #020617;
  --panel: #101f55;
  --panel-edge: #89b2ff;
  --accent-blue: #3f6fff;
  --accent-cyan: #9ad3ff;
  --accent-gold: #ffbf24;
  --accent-orange: #ff7b00;
  --correct: #1fcf6a;
  --wrong: #e23c3c;
  --text: #edf3ff;
  --muted: #c8d8ff;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: radial-gradient(circle at 12% 10%, rgba(44, 82, 190, 0.44) 0%, transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(36, 94, 198, 0.42) 0%, transparent 35%),
    repeating-linear-gradient(130deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 14px),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

.background-glow {
  position: fixed;
  inset: -30vmax;
  background: conic-gradient(from 180deg, rgba(63, 111, 255, 0.2), rgba(0, 50, 151, 0.1), rgba(67, 132, 255, 0.2), rgba(63, 111, 255, 0.2));
  filter: blur(100px);
  z-index: -1;
  animation: spin 32s linear infinite;
}

.show-header {
  position: relative;
  text-align: center;
  padding: 1.3rem 1rem 0.4rem;
  animation: fade-slide 500ms ease both;
}

.show-header__actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.selection-btn,
.selection-close-btn {
  border: none;
  border-radius: 12px;
  padding: 0.82rem 1.15rem;
  background: linear-gradient(145deg, #ffe39b, #ff8d14);
  color: #2f1200;
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.selection-btn:hover,
.selection-close-btn:hover,
.next-btn:hover {
  filter: brightness(1.03);
}

.show-header__kicker {
  margin: 0;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

.show-header h1 {
  margin: 0.2rem 0 0;
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(1.9rem, 3.8vw, 3.3rem);
  text-shadow: 0 0 12px rgba(42, 89, 255, 0.7);
}

.show-header__subtitle {
  margin-top: 0.4rem;
  color: var(--muted);
}

.layout {
  width: min(1760px, 100% - 1rem);
  margin: 0.4rem auto 1.6rem;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.2rem;
  align-items: center;
  align-content: center;
}

.quiz-stage {
  background: radial-gradient(circle at 50% 35%, rgba(38, 72, 168, 0.36), transparent 55%),
    linear-gradient(160deg, rgba(11, 24, 70, 0.96), rgba(3, 11, 37, 0.96));
  border: 1px solid rgba(154, 211, 255, 0.38);
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  animation: fade-slide 650ms ease both;
}

.question-card {
  --card-border: linear-gradient(180deg, #cfe1ff 0%, #86abff 52%, #3f68c8 100%);
  --card-fill: linear-gradient(180deg, #1f4fba 0%, #163d9e 45%, #112e83 100%);
  margin: 0.2rem auto 0;
  width: min(1140px, 99%);
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1.1rem 2.2rem;
  border-radius: 14px;
  border: none;
  clip-path: polygon(3.3% 0, 96.7% 0, 100% 50%, 96.7% 100%, 3.3% 100%, 0 50%);
  background: transparent;
  box-shadow: none;
}

.question-card::before,
.question-card::after {
  content: '';
  position: absolute;
  pointer-events: none;
  clip-path: polygon(3.3% 0, 96.7% 0, 100% 50%, 96.7% 100%, 3.3% 100%, 0 50%);
}

.question-card::before {
  inset: 0;
  background: var(--card-border);
}

.question-card::after {
  inset: 3px;
  background: var(--card-fill);
}

.question-card h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  text-align: center;
  font-size: clamp(1.2rem, 2.15vw, 2.2rem);
  line-height: 1.3;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.answers {
  margin: 1rem auto 0;
  width: min(1240px, 99%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 84px;
  gap: 0.72rem 1rem;
}

.answer-btn {
  --answer-border: linear-gradient(180deg, #d4e5ff 0%, #7ea7ff 54%, #3a61bf 100%);
  --answer-fill: linear-gradient(180deg, #2554b8 0%, #1a439f 52%, #143884 100%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  min-height: 0;
  height: 100%;
  position: relative;
  padding: 0.58rem 1.5rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: clamp(1.15rem, 1.48vw, 2rem);
  line-height: 1.14;
  clip-path: polygon(4.8% 0, 95.2% 0, 100% 50%, 95.2% 100%, 4.8% 100%, 0 50%);
  transition: none;
  animation: fade-slide 420ms ease both;
  box-shadow: none;
}

.answer-btn::before,
.answer-btn::after {
  content: '';
  position: absolute;
  pointer-events: none;
  clip-path: polygon(4.8% 0, 95.2% 0, 100% 50%, 95.2% 100%, 4.8% 100%, 0 50%);
}

.answer-btn::before {
  inset: 0;
  background: var(--answer-border);
}

.answer-btn::after {
  inset: 3px;
  background: var(--answer-fill);
}

.answer-btn > * {
  position: relative;
  z-index: 1;
}

.answer-btn.selected {
  --answer-border: linear-gradient(180deg, #ffe1a0 0%, #ffd368 56%, #c67d17 100%);
  --answer-fill: linear-gradient(180deg, #d67a05, #b96500);
  box-shadow: 0 0 0 3px rgba(255, 160, 37, 0.24);
}

.answer-btn.correct {
  --answer-border: linear-gradient(180deg, #ccffe1 0%, #8cf0b8 58%, #2a9958 100%);
  --answer-fill: linear-gradient(180deg, #188447, #106234);
}

.answer-btn.wrong {
  --answer-border: linear-gradient(180deg, #ffc2c2 0%, #ff8b8b 56%, #bb3535 100%);
  --answer-fill: linear-gradient(180deg, #8f2121, #671919);
}

.answer-btn.eliminated {
  visibility: hidden;
  pointer-events: none;
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn:focus,
.answer-btn:focus-visible,
.next-btn:focus,
.next-btn:focus-visible {
  outline: none;
}

.answer-letter {
  min-width: 2.3rem;
  display: inline-block;
  font-weight: 700;
  color: #ffa219;
  text-shadow: 0 0 8px rgba(255, 151, 0, 0.38);
}

.answer-diamond {
  width: 0.44rem;
  height: 0.44rem;
  position: relative;
  flex: 0 0 auto;
  background: #ffffff;
  transform: rotate(45deg);
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
  margin-right: 0.28rem;
}

.answer-diamond::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 1px;
  background: #ffffff;
}

.answer-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-weight: 700;
  color: #f4f8ff;
}

.picture-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 10, 30, 0.72);
  backdrop-filter: blur(5px);
}

.selection-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 10, 30, 0.78);
  backdrop-filter: blur(6px);
}

.selection-panel {
  width: min(1400px, 96vw);
  max-height: 95vh;
  overflow: auto;
  border: 1px solid rgba(154, 211, 255, 0.35);
  border-radius: 18px;
  padding: 1.2rem;
  background: linear-gradient(160deg, rgba(9, 22, 61, 0.98), rgba(5, 12, 31, 0.98));
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
}

.selection-panel.focus-mode {
  width: 100vw;
  max-height: 100vh;
  height: 100vh;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.selection-panel.focus-mode .selection-panel__topbar,
.selection-panel.focus-mode .selection-grid {
  display: none;
}

.selection-panel__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.selection-panel__topbar h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.selection-panel__topbar p {
  margin: 0;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.selection-tile {
  border: 1px solid rgba(154, 211, 255, 0.3);
  border-radius: 14px;
  padding: 1rem 0.85rem;
  background: linear-gradient(180deg, rgba(30, 61, 136, 0.95), rgba(12, 30, 82, 0.95));
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.selection-tile__label {
  display: block;
  color: var(--accent-gold);
  font-size: 1.12rem;
  letter-spacing: 0.03em;
}

.selection-tile__caption {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.selection-stage {
  margin-top: 1rem;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, rgba(63, 111, 255, 0.3), transparent 40%), #07112b;
  border: 1px solid rgba(154, 211, 255, 0.25);
}

.selection-panel.focus-mode .selection-stage {
  margin-top: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: none;
  border-radius: 0;
  background: #040b23;
}

.selection-stage img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: contain;
  display: block;
}

.selection-stage img.hidden {
  display: none;
}

.selection-back-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  border: none;
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  background: rgba(8, 18, 46, 0.82);
  color: #edf3ff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(154, 211, 255, 0.45);
  backdrop-filter: blur(3px);
}

.selection-back-btn:hover {
  background: rgba(19, 37, 86, 0.88);
}

.selection-countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  pointer-events: none;
  width: clamp(5rem, 14vw, 8rem);
  height: clamp(5rem, 14vw, 8rem);
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2d55;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.selection-stage .selection-countdown {
  background: linear-gradient(145deg, #ffe39b, #ff8d14);
  color: #2f1200;
}

.picture-panel {
  width: min(1500px, 97vw);
  max-height: 95vh;
  margin: 0;
  border: 2px solid rgba(255, 179, 0, 0.65);
  border-radius: 16px;
  padding: 1.3rem;
  background: linear-gradient(135deg, rgba(69, 39, 0, 0.65), rgba(30, 18, 0, 0.55));
  box-shadow: 0 26px 58px rgba(0, 0, 0, 0.55);
  animation: reveal 320ms ease both;
}

.picture-panel h3 {
  margin: 0 0 0.6rem;
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: clamp(1.1rem, 1.5vw, 1.7rem);
}

.picture-stage {
  position: relative;
}

.picture-panel img {
  width: 100%;
  max-height: min(72vh, 860px);
  object-fit: contain;
  border-radius: 12px;
  background: #081027;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.picture-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3.35rem;
  height: 3.35rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(7, 17, 43, 0.76);
  color: #edf3ff;
  font: inherit;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

#picture-prev-btn {
  left: 0.8rem;
}

#picture-next-btn {
  right: 0.8rem;
}

.picture-nav-btn:hover {
  background: rgba(20, 40, 93, 0.85);
}

.picture-panel.no-image {
  width: min(440px, 92vw);
  max-height: none;
  padding: 1rem;
}

.picture-panel.no-image .next-btn {
  margin-top: 0;
  width: 100%;
}

.hidden {
  display: none;
}

.modal-open {
  overflow: hidden;
}

.next-btn {
  margin-top: 1rem;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.6rem;
  background: linear-gradient(145deg, var(--accent-gold), #ff8600);
  color: #301200;
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: clamp(1.2rem, 1.45vw, 1.6rem);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: none;
}

.ladder {
  background: linear-gradient(180deg, #0a1f6a, #071457 62%, #06114d);
  border: 1px solid rgba(147, 189, 255, 0.42);
  border-radius: 10px;
  padding: 0.9rem 0.75rem;
  box-shadow: var(--shadow);
  animation: fade-slide 780ms ease both;
  transform: perspective(1100px) rotateY(-12deg);
  transform-origin: right center;
}

.ladder ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ladder li {
  position: relative;
  margin: 0.22rem 0;
  min-height: 2.15rem;
  display: flex;
  align-items: center;
  gap: 0.56rem;
  padding: 0.2rem 0.58rem;
  font-size: 1.13rem;
  line-height: 1;
  color: #f0a838;
  cursor: pointer;
  transition: none;
}

.ladder li:focus-visible {
  outline: 2px solid #c8dcff;
  outline-offset: 2px;
}

.ladder-diamond {
  width: 0.4rem;
  height: 0.4rem;
  position: relative;
  flex: 0 0 auto;
  background: #ffffff;
  transform: rotate(45deg);
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.ladder-diamond::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 1px;
  background: #ffffff;
}

.ladder li.active {
  padding-left: 0.7rem;
  color: #182646;
  font-weight: 700;
  background: linear-gradient(180deg, #ffce6a, #f39a2f 55%, #d56a18);
  border: 1px solid #8baeff;
  clip-path: polygon(4.6% 0, 95.4% 0, 100% 50%, 95.4% 100%, 4.6% 100%, 0 50%);
}

.ladder-number {
  width: 1.55rem;
  text-align: center;
  color: #f0a838;
  font-weight: 700;
  font-size: 1.03em;
}

.ladder-amount {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ladder li.active .ladder-number {
  color: #182646;
}

.ladder li.active .ladder-diamond {
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.ladder li.active .ladder-diamond::after {
  background: #ffffff;
}

.ladder li.fallback,
.ladder li.fallback .ladder-number {
  color: #eef5ff;
}

.ladder li.fallback .ladder-diamond {
  background: #ffffff;
}

.ladder li.fallback .ladder-diamond::after {
  background: #ffffff;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-slide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 980px) {
  .show-header__actions {
    position: static;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
  }

  .layout {
    grid-template-columns: 1fr;
    align-items: start;
    align-content: start;
  }

  .ladder {
    order: -1;
    transform: none;
  }

  .ladder ol {
    display: block;
  }

  .ladder li {
    font-size: 0.95rem;
  }

  .answers {
    grid-auto-rows: 80px;
  }
}

@media (max-width: 680px) {
  .selection-panel {
    width: min(100%, 96vw);
    padding: 0.9rem;
  }

  .selection-panel__topbar {
    flex-direction: column;
  }

  .selection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answers {
    grid-template-columns: 1fr;
  }

  .show-header {
    padding-top: 1rem;
  }

  .question-card {
    clip-path: polygon(6.2% 0, 93.8% 0, 100% 50%, 93.8% 100%, 6.2% 100%, 0 50%);
    padding: 0.8rem 1.2rem;
  }

  .picture-modal {
    padding: 0.6rem;
  }

  .picture-panel {
    width: min(960px, 96vw);
    padding: 0.75rem;
  }

  .answers {
    grid-auto-rows: 76px;
  }

  .selection-stage,
  .selection-stage img {
    min-height: 240px;
  }

  .selection-countdown {
    width: clamp(4.6rem, 24vw, 6.2rem);
    height: clamp(4.6rem, 24vw, 6.2rem);
    font-size: clamp(2.6rem, 14vw, 4rem);
  }

  .selection-back-btn {
    top: 0.7rem;
    right: 0.7rem;
    padding: 0.62rem 0.95rem;
    font-size: 0.9rem;
  }

  .picture-nav-btn {
    width: 2.85rem;
    height: 2.85rem;
    font-size: 1.45rem;
  }

  #picture-prev-btn {
    left: 0.5rem;
  }

  #picture-next-btn {
    right: 0.5rem;
  }
}
