/* ── Quest Page ─────────────────────────────── */

/* Prevent mobile zoom on button focus */
button {
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.quest-page {
  display: none;
}

.quest-wrapper {
  display: flex;
  flex-direction: column;
  /* padding: 12px 0 80px; */
  background: var(--gradient-bg-global);
  min-height: 100%;
}

/* Quest Header */
.quest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 14, 39, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 0.5px solid rgba(107, 158, 255, 0.12);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.quest-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quest-image-wrap {
  position: relative;
  overflow: hidden;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  flex-shrink: 0;
}

.quest-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 48%,
    rgba(255, 255, 255, 0.32) 52%,
    transparent 68%
  );
  transform: translateX(-120%) skewX(-20deg);
  animation: glass-shine 3.6s ease-in-out 1.8s infinite;
  pointer-events: none;
  z-index: 2;
}

.quest-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  display: block;
}

.quest-title-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 5px;
}

.quest-name-sub {
  font-size: 7px;
  font-weight: var(--font-weight-regular);
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
  text-transform: uppercase;
  opacity: 0.75;
}

.quest-name {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.75px;
  line-height: 0.95;
  background: var(--gradient-primary-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quest-tagline {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  letter-spacing: -0.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.quest-header-right {
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

.quest-icon {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  /* transform: translateY(8px); */
}

/* Quest Main */
.quest-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 20px;
}

/* Quest Board */
.quest-board {
  padding: 28px 0;
  border-bottom: 0.5px solid rgba(107, 158, 255, 0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Quest top row: question + icon */
.quest-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.quest-question {
  color: #ddd;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.25px;
  opacity: 0.9;
  text-transform: capitalize;
}

.quest-question-icon {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  flex-shrink: 0;
  margin-top: 4px;
}

/* Open to Read label */
.quest-read-label {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
}

/* Thumbs row — always visible */
.quest-thumbs {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 4px;
}

.quest-thumb {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
  opacity: 0.5;
}

.quest-thumb-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.quest-thumb-count {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

/* Expanded quest — solution visible */
.quest-board.expanded {
}

.quest-board.expanded .quest-read-label {
  display: none;
}

.quest-solution {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.quest-board.expanded .quest-solution {
  display: flex;
}

/* Solution block with dashed border */
.quest-solution-block {
  padding: 15px 0;
  color: rgba(255, 255, 255, 0.75);
  border-bottom: 0.5px solid rgba(107, 158, 255, 0.08);
}

.quest-solution-title {
  font-weight: 700;
  color: #ddd;
  font-size: 12px;
}

/* Solution text content */
.quest-solution-text {
  color: #ddd;
  font-size: 11px;
  line-height: 1.7;
  text-align: justify;
  white-space: pre-line;
}

/* Key Takeaway block */
.quest-takeaway-block {
  margin-top: 20px;
  padding: 16px 18px;
  background: rgba(107, 158, 255, 0.06);
  border: 0.5px solid rgba(107, 158, 255, 0.2);
  border-radius: 10px;
}

.quest-takeaway-title {
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(90deg, #5b8fff, #f8f6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.quest-takeaway-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-line;
}

/* Recommendation block */
.quest-recommendation-block {
  display: none;
  margin-top: 12px;
  padding: 16px 18px;
  background: rgba(107, 158, 255, 0.04);
  border: 0.5px solid rgba(107, 158, 255, 0.15);
  border-radius: 2px;
}

.quest-recommendation-title {
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(90deg, #8b9ffa, #f8f6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.quest-recommendation-text {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-line;
}

.quest-board.expanded .quest-recommendation-block {
  display: block;
}

/* ── Quest header image (shown only when expanded) ────── */
.quest-header-img-wrap {
  display: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  width: 100%;
  border-radius: 2px;
  border: 0.5px solid rgba(107, 158, 255, 0.12);
  overflow: hidden;
  margin-bottom: 4px;
}

.quest-board.expanded .quest-header-img-wrap {
  display: block;
}

.quest-header-img {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* ── Quest CTA board ──────────────────────────────────── */
.quest-cta-board {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.quest-board.expanded .quest-cta-board {
  display: flex;
}

.quest-cta-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  overflow: hidden;
  border: 0.5px solid rgba(107, 158, 255, 0.12);
}

.quest-cta-img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.quest-cta-label {
  padding: 20px 16px;
  background: rgba(10, 16, 45, 0.9);
  border: 0.5px solid rgba(107, 158, 255, 0.12);
  border-radius: 14px;
  color: rgba(248, 246, 255, 0.65);
  font-size: 13px;
  font-weight: 400;
  text-align: center;
}

/* Thumbs become votable when expanded */
.quest-board.expanded .quest-thumb {
  opacity: 1;
  cursor: pointer;
}

.quest-thumb.voted .quest-thumb-icon {
  opacity: 1;
}

.quest-thumb.voted .quest-thumb-count {
  color: #fff;
}

/* ── Responsive — Tablet (768px+) ── */
@media (min-width: 768px) {
  .quest-wrapper {
    max-width: 900px;
    margin: 0 auto;
  }

  .quest-header {
    max-width: 900px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
  }

  .quest-list {
    padding: 16px 32px;
  }
}

/* ── Responsive — Desktop (1024px+) ── */
@media (min-width: 1024px) {
  .quest-wrapper {
    max-width: 860px;
  }

  .quest-header {
    max-width: 860px;
    left: auto;
    transform: none;
  }

  .quest-list {
    padding: 16px 48px;
  }
}
