:root {
  --bg: #08111f;
  --bg-alt: #0f1c31;
  --panel: rgba(8, 18, 34, 0.88);
  --panel-border: rgba(115, 221, 255, 0.2);
  --text: #ebf3ff;
  --muted: #a6bdd9;
  --accent: #00e5ff;
  --accent-2: #6cff7a;
  --accent-3: #ffc247;
  --danger: #ff6978;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0, 229, 255, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(108, 255, 122, 0.1), transparent 25%),
    linear-gradient(180deg, #050a14 0%, #0a1426 55%, #08111f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 194, 71, 0.09), transparent 20%),
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 10px,
      transparent 10px,
      transparent 20px
    );
  pointer-events: none;
}

.page-shell {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 24px 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.1), transparent 35%),
    linear-gradient(225deg, rgba(108, 255, 122, 0.08), transparent 45%);
}

.hero__content,
.content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero__content {
  position: relative;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
.question-badge,
.btn,
.stat-card strong {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.03em;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4.5vw, 4.8rem);
  line-height: 1;
}

.hero__intro {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: 1.2rem;
  color: var(--muted);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

.stat-card,
.dashboard__panel,
.quiz-card,
.final-message {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.stat-card {
  min-width: 180px;
  padding: 16px 18px;
  border-radius: 18px;
}

.stat-card__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.content {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0 40px;
}

.dashboard {
  display: grid;
  gap: 24px;
}

.dashboard__panel,
.quiz-card,
.final-message {
  border-radius: 24px;
  padding: 24px;
}

.dashboard__panel h2,
.quiz-card h2,
.final-message h2 {
  margin: 0 0 10px;
}

.dashboard__panel p,
.chest-message,
.final-message p {
  margin: 0;
  color: var(--muted);
}

.final-message {
  margin-top: 24px;
  border-color: rgba(108, 255, 122, 0.45);
}

.final-message p + p {
  margin-top: 10px;
}

.final-message--hidden,
.final-link--hidden {
  display: none;
}

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

.key {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.key__icon {
  font-size: 1.3rem;
  filter: grayscale(1);
  opacity: 0.45;
}

.key--active {
  border-color: rgba(108, 255, 122, 0.45);
  box-shadow: inset 0 0 0 1px rgba(108, 255, 122, 0.18);
}

.key--active .key__icon {
  filter: grayscale(0);
  opacity: 1;
}

.chest-panel {
  text-align: center;
}

.chest {
  position: relative;
  width: 180px;
  height: 140px;
  margin: 22px auto 16px;
}

.chest__lid,
.chest__body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #6a4525 0%, #3a2414 100%);
  border: 3px solid #b9863f;
  box-shadow: inset 0 0 0 2px rgba(255, 226, 169, 0.12);
}

.chest__lid {
  top: 8px;
  width: 150px;
  height: 56px;
  border-radius: 28px 28px 16px 16px;
  transform-origin: left center;
  transition: transform 0.5s ease;
}

.chest__body {
  bottom: 0;
  width: 170px;
  height: 86px;
  border-radius: 18px;
}

.chest__lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.chest--open .chest__lid {
  transform: translateX(-50%) rotate(-18deg) translateY(-10px);
}

.final-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: #00121a;
  background: linear-gradient(135deg, var(--accent-3), #ffe39d);
  font-weight: 700;
  cursor: pointer;
}

.quiz-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.question-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent);
}

.question-text {
  font-size: 1.35rem;
  margin: 0 0 22px;
}

.answers {
  display: grid;
  gap: 14px;
}

.answer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.answer:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.32);
}

.answer input {
  accent-color: var(--accent);
  transform: scale(1.15);
}

.answer--locked {
  pointer-events: none;
}

.answer--correct {
  border-color: rgba(108, 255, 122, 0.8);
  background: rgba(108, 255, 122, 0.1);
}

.answer--wrong {
  border-color: rgba(255, 105, 120, 0.7);
  background: rgba(255, 105, 120, 0.08);
}

.quiz-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover:enabled,
.final-link:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn--primary {
  color: #00131a;
  background: linear-gradient(135deg, var(--accent), #98f5ff);
}

.btn--secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.feedback {
  min-height: 32px;
  margin-top: 18px;
  font-size: 1.05rem;
  font-weight: 600;
}

.feedback--success {
  color: var(--accent-2);
}

.feedback--error {
  color: var(--danger);
}

@media (max-width: 960px) {
  .content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 44px;
  }

  .dashboard__panel,
  .quiz-card,
  .final-message {
    padding: 18px;
  }

  .quiz-card__header {
    flex-direction: column;
  }

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

  .quiz-actions {
    flex-direction: column;
  }
}
