:root {
  --navy: #050735;
  --blue: #07156b;
  --blue-light: #1239d8;
  --gold: #ffe500;
  --gold-soft: #fff4a3;
  --gold-dark: #b88a00;
  --white: #fffdf2;
  --green: #1eb980;
  --red: #ef4056;
  --text: #101735;
  --panel: rgba(0, 0, 0, 0.78);
  --shadow: 0 0 42px rgba(255, 229, 0, 0.28), 0 28px 80px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  font-family: "Trebuchet MS", Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 28%, rgba(22, 64, 230, 0.72), transparent 24%),
    radial-gradient(circle at 50% 52%, #0a0a54 0%, #030319 72%, #000 100%);
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: 30px 18px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.beam {
  position: absolute;
  top: -80px;
  width: 260px;
  height: 820px;
  opacity: 0.22;
  background: linear-gradient(rgba(255, 255, 255, 0.95), transparent);
  clip-path: polygon(48% 0, 52% 0, 100% 100%, 0 100%);
  pointer-events: none;
  animation: beamMove 5s ease-in-out infinite alternate;
}

.beam-left {
  left: 5vw;
  transform: rotate(-21deg);
}

.beam-right {
  right: 5vw;
  transform: rotate(21deg);
  animation-delay: 1.5s;
}

.bulbs {
  position: fixed;
  left: 0;
  right: 0;
  height: 34px;
  background-image: radial-gradient(circle, var(--gold) 0 6px, transparent 7px);
  background-size: 42px 34px;
  filter: drop-shadow(0 0 8px var(--gold));
  pointer-events: none;
}

.bulbs-top {
  top: 0;
}

.bulbs-bottom {
  bottom: 0;
}

.show-frame {
  width: min(1060px, 100%);
  min-height: min(790px, calc(100vh - 60px));
  padding: 28px;
  position: relative;
  z-index: 1;
  border: 4px solid var(--gold);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 26%),
    var(--panel);
  box-shadow: var(--shadow);
}

.show-frame::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 229, 0, 0.35);
  border-radius: 15px;
  pointer-events: none;
}

.brand,
.screen {
  position: relative;
  z-index: 1;
}

.brand {
  text-align: center;
  margin-bottom: 18px;
}

.show-logo {
  width: 168px;
  height: 168px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #1834d4 0 34%, #061069 35% 52%, var(--gold) 53% 57%, #050735 58%);
  box-shadow: 0 0 30px rgba(255, 229, 0, 0.65);
}

.logo-ring {
  width: 132px;
  height: 132px;
  position: relative;
  border: 3px solid var(--gold);
  border-radius: 50%;
  animation: glowPulse 1.8s ease-in-out infinite alternate;
}

.logo-ring span {
  position: absolute;
  min-width: 48px;
  padding: 4px 6px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--gold);
  font-weight: 900;
  font-size: 0.86rem;
}

.logo-ring span:nth-child(1) {
  top: 6px;
  left: 42px;
}

.logo-ring span:nth-child(2) {
  right: -12px;
  top: 54px;
}

.logo-ring span:nth-child(3) {
  bottom: 7px;
  left: 42px;
}

.logo-ring span:nth-child(4) {
  left: -14px;
  top: 54px;
}

.brand-kicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--gold);
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 0.95;
  text-shadow: 2px 2px 8px #000, 0 0 14px var(--gold);
}

.screen {
  max-width: 900px;
  margin: 0 auto;
}

.start-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.welcome-panel,
.ranking-card,
.question-panel {
  border: 2px solid rgba(255, 229, 0, 0.82);
  border-radius: 16px;
  background: rgba(2, 4, 35, 0.92);
  box-shadow: 0 0 24px rgba(255, 229, 0, 0.18);
}

.welcome-panel {
  padding: 24px;
}

.welcome-panel h2 {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.welcome-panel p {
  max-width: 560px;
  color: #f5f1c8;
  line-height: 1.5;
}

.name-label {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-soft);
  font-weight: 900;
}

.name-input {
  width: 100%;
  height: 54px;
  margin-bottom: 14px;
  padding: 0 15px;
  border: 3px solid var(--gold);
  border-radius: 10px;
  color: var(--text);
  background: var(--white);
  font-size: 1.16rem;
  font-weight: 900;
  outline: none;
}

.name-input:focus {
  box-shadow: 0 0 0 4px rgba(255, 229, 0, 0.22);
}

.primary-button,
.answer-button,
.help-button {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  border: 2px solid var(--gold-soft);
  border-radius: 12px;
  color: var(--navy);
  background: linear-gradient(90deg, var(--gold) 0%, #fff6a5 50%, var(--gold) 100%);
  box-shadow: 0 7px 0 var(--gold-dark), 0 0 18px rgba(255, 229, 0, 0.36);
  font-size: 1.2rem;
  font-weight: 900;
}

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

.ranking-card {
  padding: 18px;
}

.ranking-card h2 {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 1.25rem;
}

.ranking-list {
  margin: 0;
  padding-left: 24px;
}

.ranking-list li {
  padding: 7px 0;
  color: #fff7c6;
  font-weight: 900;
}

.ranking-list .empty {
  list-style: none;
  color: #d8d6e8;
  font-weight: 800;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.hud div,
.money-step,
.feedback,
.help-button {
  border: 2px solid rgba(255, 229, 0, 0.58);
  border-radius: 12px;
  background: rgba(3, 8, 62, 0.9);
}

.hud div {
  min-height: 66px;
  padding: 11px 13px;
}

.hud span,
.hud strong {
  display: block;
}

.hud span {
  color: #d9d9ff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hud strong {
  margin-top: 4px;
  color: var(--gold);
  font-size: 1.18rem;
}

.timer-box.warning {
  animation: dangerPulse 0.45s ease-in-out infinite alternate;
  border-color: var(--red);
}

.money-ladder {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
}

.money-step {
  min-height: 36px;
  display: grid;
  place-items: center;
  color: #eee9ff;
  font-size: 0.76rem;
  font-weight: 900;
  position: relative;
}

.money-step:nth-child(1),
.money-step:nth-child(6),
.money-step:nth-child(11),
.money-step:nth-child(16) {
  border-color: var(--gold);
}

.money-step.active {
  color: var(--navy);
  background: var(--gold);
  box-shadow: 0 0 18px rgba(255, 229, 0, 0.65);
}

.money-step.done {
  color: white;
  background: #0b8b65;
  border-color: #62ffca;
}

.question-panel {
  padding: 22px;
}

.question-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.question-topline span {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
}

#questionText {
  min-height: 104px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  color: white;
  font-size: clamp(1.25rem, 3vw, 1.85rem);
  line-height: 1.33;
  text-shadow: 1px 1px 8px #000;
}

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

.answer-button {
  min-height: 74px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  color: var(--navy);
  background: linear-gradient(90deg, var(--gold) 0%, #fff7ac 100%);
  box-shadow: 0 6px 0 var(--gold-dark);
  text-align: left;
  font-weight: 900;
}

.answer-letter {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold);
  background: var(--navy);
}

.answer-button.correct {
  color: white;
  background: var(--green);
  border-color: #75ffd3;
  box-shadow: 0 6px 0 #087a55;
}

.answer-button.wrong {
  color: white;
  background: var(--red);
  border-color: #ffc0c9;
  box-shadow: 0 6px 0 #9d2434;
}

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

.answer-button:disabled,
.help-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

.helps {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.help-button {
  min-height: 58px;
  color: white;
  font-weight: 900;
}

.help-button span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
}

.feedback {
  min-height: 74px;
  margin-top: 14px;
  padding: 14px 16px;
  color: #fff9c9;
  font-weight: 900;
  line-height: 1.45;
}

.feedback.success {
  border-color: #75ffd3;
  background: rgba(30, 185, 128, 0.28);
}

.feedback.error {
  border-color: #ffc0c9;
  background: rgba(239, 64, 86, 0.28);
}

.feedback.hint {
  background: rgba(255, 229, 0, 0.14);
}

.end-screen {
  max-width: 720px;
  text-align: center;
}

.end-badge {
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  margin: 10px auto 16px;
  border-radius: 50%;
  color: var(--navy);
  background: var(--gold);
  box-shadow: 0 0 28px rgba(255, 229, 0, 0.7);
  font-size: 3rem;
  font-weight: 900;
}

.end-screen h2 {
  color: var(--gold);
  font-size: clamp(2rem, 5vw, 3rem);
  text-shadow: 1px 1px 8px #000;
}

.end-screen p {
  color: #fff7c6;
  font-size: 1.12rem;
  line-height: 1.5;
}

.ranking-end {
  margin-top: 22px;
  text-align: left;
}

.hidden {
  display: none;
}

@keyframes beamMove {
  from {
    opacity: 0.14;
  }
  to {
    opacity: 0.32;
  }
}

@keyframes glowPulse {
  from {
    box-shadow: inset 0 0 12px rgba(255, 229, 0, 0.36);
  }
  to {
    box-shadow: inset 0 0 30px rgba(255, 229, 0, 0.72);
  }
}

@keyframes dangerPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.04);
  }
}

@media (max-width: 820px) {
  .app {
    padding: 18px 10px;
  }

  .show-frame {
    min-height: calc(100vh - 36px);
    padding: 18px 12px;
  }

  .show-logo {
    width: 130px;
    height: 130px;
  }

  .logo-ring {
    width: 104px;
    height: 104px;
  }

  .logo-ring span {
    min-width: 42px;
    font-size: 0.72rem;
  }

  .start-screen {
    grid-template-columns: 1fr;
  }

  .hud {
    grid-template-columns: 1fr 1fr;
  }

  .timer-box {
    grid-column: 1 / -1;
  }

  .money-ladder {
    grid-template-columns: repeat(4, 1fr);
  }

  .answers,
  .helps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 2rem;
  }

  .brand-kicker {
    font-size: 0.78rem;
  }

  .question-panel,
  .welcome-panel,
  .ranking-card {
    padding: 15px;
  }

  #questionText {
    min-height: 84px;
    font-size: 1.15rem;
  }

  .answer-button {
    min-height: 66px;
  }
}
