:root {
  --gold: #f8c65c;
  --gold-dark: #a46b20;
  --ink: #17131f;
  --cream: #fff3d1;
  --teal: #52d8c7;
  --coral: #ff8067;
  --violet: #6953c8;
  --green: #7fd66d;
  --panel: rgba(22, 17, 29, 0.84);
  --line: rgba(255, 243, 209, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--cream);
  background: var(--ink);
}

button,
select {
  font: inherit;
}

.game-shell {
  min-height: 100vh;
}

.hero {
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(13, 10, 20, 0.88), rgba(13, 10, 20, 0.42), rgba(13, 10, 20, 0.78)),
    url("assets/haunted-hotel-bg.png") center / cover no-repeat;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.5);
}

.panel {
  width: min(1180px, 100%);
  margin: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
}

.start-panel,
.end-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: clamp(22px, 4vw, 42px);
  border-radius: 8px;
}

.start-copy h2,
.end-panel h2 {
  font-size: clamp(1.7rem, 4vw, 3.1rem);
  line-height: 1.04;
  margin-bottom: 14px;
}

.start-copy p,
.end-panel p {
  max-width: 60ch;
  color: rgba(255, 243, 209, 0.82);
  font-size: 1.05rem;
  line-height: 1.5;
}

.start-actions,
.end-actions {
  display: grid;
  gap: 12px;
}

.select-label,
.hud-label {
  color: rgba(255, 243, 209, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

select,
.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 48px;
}

select {
  width: 100%;
  padding: 0 14px;
  color: var(--ink);
  background: var(--cream);
  font-weight: 700;
}

.primary-button,
.secondary-button,
.icon-button {
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  color: #221404;
  background: linear-gradient(180deg, #ffe08b, var(--gold));
  box-shadow: 0 8px 0 var(--gold-dark);
}

.primary-button:active {
  transform: translateY(3px);
  box-shadow: 0 5px 0 var(--gold-dark);
}

.secondary-button {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
}

.icon-button {
  width: 48px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid var(--line);
}

.game-panel {
  padding: clamp(14px, 3vw, 24px);
  border-radius: 8px;
}

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

.hud > div {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.hud strong {
  display: block;
  margin-top: 4px;
  font-size: 1.6rem;
}

.progress-wrap {
  height: 12px;
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral));
  transition: width 280ms ease;
}

.play-area {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
}

.elevator-card {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
  min-height: 430px;
}

.shaft {
  position: relative;
  overflow: hidden;
  min-height: 350px;
  border: 1px solid rgba(248, 198, 92, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 100% 11.11%,
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.26));
}

.shaft::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 28px, rgba(255, 255, 255, 0.05) 29px);
}

.elevator {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 94px;
  height: 76px;
  translate: -50% 0;
  border: 3px solid var(--gold);
  border-radius: 8px;
  background: linear-gradient(135deg, #2b2437, #564478);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(248, 198, 92, 0.3);
  transition: bottom 420ms cubic-bezier(.2, .9, .2, 1.1);
}

.elevator.drop {
  animation: drop 500ms ease-in-out;
}

@keyframes drop {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(24px); }
  70% { transform: translateY(-8px); }
}

.reward-shelf,
.badge-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reward {
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #1b1422;
  background: var(--gold);
  font-weight: 900;
  box-shadow: 0 0 16px rgba(248, 198, 92, 0.35);
}

.question-card {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 10, 20, 0.58);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  color: rgba(255, 243, 209, 0.76);
  font-weight: 800;
}

.pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--teal);
}

#questionText {
  min-height: 96px;
  font-size: clamp(1.28rem, 3vw, 2rem);
  line-height: 1.22;
}

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

.answer {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.answer:hover,
.answer:focus-visible {
  outline: 3px solid rgba(82, 216, 199, 0.5);
  background: rgba(82, 216, 199, 0.16);
}

.answer.correct {
  color: #122011;
  background: var(--green);
}

.answer.wrong {
  color: #2b0e07;
  background: var(--coral);
}

.answer:disabled {
  cursor: default;
}

.feedback {
  min-height: 54px;
  margin: 16px 0 4px;
  color: rgba(255, 243, 209, 0.9);
  font-weight: 800;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .hero {
    padding: 16px;
  }

  .start-panel,
  .end-panel,
  .play-area {
    grid-template-columns: 1fr;
  }

  .hud {
    grid-template-columns: repeat(2, 1fr);
  }

  .elevator-card {
    min-height: 170px;
  }

  .shaft {
    min-height: 150px;
  }

  .elevator {
    width: 78px;
    height: 58px;
    font-size: 1.45rem;
  }

  .question-card {
    min-height: 0;
  }

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