:root {
  --qst-card: rgba(255, 255, 255, 0.92);
  --qst-line: rgba(255, 255, 255, 0.18);
  --qst-ink: rgba(31, 26, 36, 0.95);
  --qst-muted: rgba(31, 26, 36, 0.72);
  --qst-accent: #7c5cff;
  --qst-accent2: #2dd4bf;
  --qst-gold: #d4a853;
  --qst-hot: #ff6b9d;
}

.page--qst {
  width: 100%;
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section--qst {
  width: 100%;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  display: flex;
  justify-content: center;
}

.qst-shell {
  width: 100%;
  max-width: min(760px, 100%);
  margin: 0 auto;
  padding-left: var(--layout-pad);
  padding-right: var(--layout-pad);
}

.qst-head {
  text-align: center;
  margin-bottom: 1.1rem;
}

.qst-head .section__title {
  margin: 0 auto 0.35rem;
  font-size: clamp(1.2rem, 2.8vw, 1.85rem);
  line-height: 1.2;
}

.qst-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
}

.qst-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
  margin: 1.5rem 0;
}

.qst-game {
  background: rgba(21, 27, 36, 0.55);
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: 20px;
  padding: 1rem 1rem 1.15rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

.qst-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.qst-progress__bar {
  height: 100%;
  width: 33.33%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--qst-accent), var(--qst-accent2));
  transition: width 0.35s ease;
}

.qst-progress__label {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.qst-step[hidden],
.qst-result[hidden] {
  display: none !important;
}

.qst-step__title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
}

.qst-step__hint {
  margin: 0 0 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  line-height: 1.45;
}

.qst-cards {
  display: grid;
  gap: 0.65rem;
}

.qst-cards--companions {
  grid-template-columns: 1fr;
}

.qst-cards--listen {
  grid-template-columns: 1fr 1fr;
}

.qst-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.qst-card:hover {
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.qst-card:focus-visible {
  outline: 2px solid var(--qst-accent2);
  outline-offset: 2px;
}

.qst-card__emoji {
  flex: 0 0 auto;
  font-size: 1.5rem;
  line-height: 1;
  margin-top: 0.1rem;
}

.qst-card__body {
  min-width: 0;
}

.qst-card__title {
  display: block;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.2rem;
  color: var(--qst-gold);
}

.qst-card__text {
  display: block;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.qst-lines {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.qst-line {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(212, 168, 83, 0.28);
  border-left: 4px solid var(--qst-gold);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.98rem;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.qst-line:hover {
  border-color: rgba(124, 92, 255, 0.5);
  background: rgba(124, 92, 255, 0.12);
}

.qst-line:focus-visible {
  outline: 2px solid var(--qst-accent2);
  outline-offset: 2px;
}

.qst-line__meta {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

.qst-result {
  animation: qst-fade 0.4s ease;
}

@keyframes qst-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.qst-result__kicker {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qst-accent2);
}

.qst-result__hero {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.qst-result__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(212, 168, 83, 0.45);
  flex-shrink: 0;
}

.qst-result__name {
  margin: 0 0 0.25rem;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  color: rgba(255, 255, 255, 0.96);
}

.qst-result__archetype {
  margin: 0;
  font-size: 0.92rem;
  color: var(--qst-gold);
  font-weight: 700;
}

.qst-result__pitch {
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.96rem;
  line-height: 1.55;
}

.qst-track {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  margin-bottom: 1rem;
}

.qst-track__label {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
}

.qst-track__line {
  margin: 0 0 0.5rem;
  padding: 0;
  border: none;
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.qst-track__title {
  margin: 0;
  font-weight: 800;
  color: var(--qst-gold);
  font-size: 0.95rem;
}

.qst-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.qst-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: none;
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.qst-pill:hover {
  transform: translateY(-1px);
}

.qst-pill--primary {
  background: linear-gradient(135deg, var(--qst-accent), #5a3fd4);
  color: #fff;
}

.qst-pill--secondary {
  background: var(--qst-card);
  color: var(--qst-ink);
  border: 1px solid var(--qst-line);
}

.qst-pill--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

@media (min-width: 600px) {
  .qst-cards--companions {
    grid-template-columns: 1fr 1fr;
  }

  .qst-cards--companions .qst-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 0.325rem);
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  .qst-cards--listen {
    grid-template-columns: 1fr;
  }

  .qst-result__hero {
    flex-direction: column;
    text-align: center;
  }

  .qst-result__actions .qst-pill {
    width: 100%;
  }
}

@media (min-width: 860px) {
  .qst-game {
    padding: 1.25rem 1.35rem 1.35rem;
  }
}
