.qm-quiz {
  --qm-ink: #132238;
  --qm-accent: #fd8f33;
  --qm-accent-dark: #d66610;
  --qm-surface: #fff9f1;
  --qm-card: #ffffff;
  --qm-success: #1f8f5f;
  --qm-danger: #c23b32;
  --qm-border: rgba(19, 34, 56, 0.12);
  margin: 32px 0;
  padding: 32px;
  border: 1px solid var(--qm-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(253, 143, 51, 0.18), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--qm-surface) 100%);
  color: var(--qm-ink);
  box-shadow: 0 20px 60px rgba(19, 34, 56, 0.08);
}

.qm-quiz.is-quiz-locked {
  border-color: rgba(194, 59, 50, 0.2);
  background:
    radial-gradient(circle at top right, rgba(194, 59, 50, 0.18), transparent 30%),
    linear-gradient(180deg, #fff8f7 0%, #fff2ef 100%);
  box-shadow: 0 24px 70px rgba(194, 59, 50, 0.08);
}

.qm-category-browser,
.qm-archive {
  --qm-ink: #132238;
  --qm-accent: #fd8f33;
  --qm-accent-dark: #d66610;
  --qm-surface: #fff9f1;
  --qm-card: #ffffff;
  --qm-success: #1f8f5f;
  --qm-danger: #c23b32;
  --qm-border: rgba(19, 34, 56, 0.12);
  color: var(--qm-ink);
}


.qm-hero h2,
.qm-result h3,
.qm-locked h3,
.qm-wallet h3,
.qm-question-title {
  margin: 0 0 12px;
  line-height: 1.1;
}

.qm-badge {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(19, 34, 56, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qm-progress {
  height: 10px;
  margin: 24px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(19, 34, 56, 0.08);
}

.qm-status-banner {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(19, 34, 56, 0.06);
  color: var(--qm-ink);
  font-weight: 700;
}

.qm-status-banner.is-blocked {
  background: rgba(194, 59, 50, 0.12);
  color: var(--qm-danger);
}

.qm-chances {
  --qm-ink: #132238;
  --qm-success: #1f8f5f;
  --qm-danger: #c23b32;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid rgba(19, 34, 56, 0.12);
  border-radius: 18px;
  background: #fff;
  color: var(--qm-ink);
  box-shadow: 0 10px 30px rgba(19, 34, 56, 0.06);
}

.qm-chances.is-blocked {
  border-color: rgba(194, 59, 50, 0.24);
  background: rgba(194, 59, 50, 0.06);
}

.qm-chances__value {
  font-size: 1.75rem;
  line-height: 1;
}

.qm-chances__label,
.qm-chances__status {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qm-chances__label {
  color: rgba(19, 34, 56, 0.62);
}

.qm-chances__status {
  color: var(--qm-success);
}

.qm-chances.is-blocked .qm-chances__status {
  color: var(--qm-danger);
}

.qm-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--qm-accent) 0%, var(--qm-accent-dark) 100%);
  transition: width 0.25s ease;
}

.qm-question-card,
.qm-result,
.qm-wallet,
.qm-locked,
.qm-login-gate,
.qm-quiz-lock {
  padding: 24px;
  border: 1px solid var(--qm-border);
  border-radius: 18px;
  background: var(--qm-card);
}

.qm-quiz.is-login-required {
  border-color: rgba(19, 34, 56, 0.18);
  background:
    radial-gradient(circle at top right, rgba(19, 34, 56, 0.12), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.qm-login-gate {
  text-align: center;
  border-color: rgba(19, 34, 56, 0.16);
  background:
    radial-gradient(circle at top right, rgba(19, 34, 56, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  box-shadow: 0 18px 40px rgba(19, 34, 56, 0.08);
}

.qm-login-gate__eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(19, 34, 56, 0.08);
  color: var(--qm-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qm-login-gate h3 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.1;
}

.qm-login-gate p {
  margin: 0 auto;
  max-width: 38rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.qm-login-gate__actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.qm-login-gate__button,
.qm-login-gate__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
}

.qm-login-gate__button {
  background: linear-gradient(90deg, var(--qm-accent) 0%, var(--qm-accent-dark) 100%);
  color: #fff;
}

.qm-login-gate__link {
  border: 1px solid rgba(19, 34, 56, 0.14);
  color: var(--qm-ink);
  background: #fff;
}

.qm-quiz-lock {
  position: relative;
  border-color: rgba(194, 59, 50, 0.22);
  background:
    radial-gradient(circle at top right, rgba(194, 59, 50, 0.14), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #fff6f4 100%);
  box-shadow: 0 18px 40px rgba(194, 59, 50, 0.1);
}

.qm-quiz-lock::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, #ff8a5b 0%, #c23b32 100%);
}

.qm-quiz-lock__eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(194, 59, 50, 0.12);
  color: var(--qm-danger);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qm-quiz-lock__countdown {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
  font-weight: 800;
  color: var(--qm-danger);
  letter-spacing: -0.03em;
}

.qm-quiz-lock-line {
  margin: 0;
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(19, 34, 56, 0.85);
}

.qm-step {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(19, 34, 56, 0.68);
}

.qm-options {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.qm-option,
.qm-next,
.qm-restart {
  appearance: none;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.qm-option {
  padding: 16px 18px;
  text-align: left;
  background: #f6f7fb;
  color: var(--qm-ink);
  font-weight: 600;
}

.qm-option:hover,
.qm-next:hover,
.qm-restart:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(19, 34, 56, 0.12);
}

.qm-option.is-correct {
  background: rgba(31, 143, 95, 0.14);
  color: var(--qm-success);
}

.qm-option.is-wrong {
  background: rgba(194, 59, 50, 0.12);
  color: var(--qm-danger);
}

.qm-feedback {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 16px;
  font-weight: 600;
}

.qm-feedback.is-correct {
  background: rgba(31, 143, 95, 0.12);
  color: var(--qm-success);
}

.qm-feedback.is-wrong {
  background: rgba(194, 59, 50, 0.12);
  color: var(--qm-danger);
}

.qm-next,
.qm-restart {
  margin-top: 20px;
  padding: 14px 20px;
  background: linear-gradient(90deg, var(--qm-accent) 0%, var(--qm-accent-dark) 100%);
  color: #fff;
  font-weight: 700;
}

.qm-result p,
.qm-wallet p {
  margin: 0 0 12px;
}

.qm-quiz-release {
  display: inline-flex;
  align-items: center;
  color: var(--qm-success);
  font-weight: 700;
}

.qm-quiz-release.is-locked {
  color: var(--qm-danger);
}

.qm-next-chance {
  display: inline-flex;
  align-items: center;
  color: var(--qm-success);
  font-weight: 700;
}

.qm-next-chance.is-blocked {
  color: var(--qm-danger);
}

.qm-current-chances--hearts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.qm-current-chances__heart {
  position: relative;
  display: inline-flex;
  width: 1.45rem;
  height: 1.45rem;
  font-size: 0;
  line-height: 0;
  color: #b9c3cf;
  transition: color 0.2s ease, transform 0.2s ease;
}

.qm-current-chances__heart::before {
  content: "";
  width: 100%;
  height: 100%;
  display: block;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35 10.55 20.03C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35 10.55 20.03C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.qm-current-chances__heart.is-active {
  color: #f3b458;
  transform: scale(1.02);
}

.qm-attempt-history {
  overflow-x: auto;
}

.qm-attempt-history__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  background: #fff;
  border: 1px solid rgba(19, 34, 56, 0.12);
  border-radius: 18px;
  overflow: hidden;
}

.qm-attempt-history__table th,
.qm-attempt-history__table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(19, 34, 56, 0.08);
}

.qm-attempt-history__table th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(19, 34, 56, 0.62);
  background: rgba(19, 34, 56, 0.03);
}

.qm-attempt-history__table tbody tr:last-child td {
  border-bottom: 0;
}

.qm-quiz-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.qm-quiz-stats__item {
  padding: 18px 20px;
  border: 1px solid var(--qm-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(19, 34, 56, 0.06);
}

.qm-quiz-stats__item span,
.qm-quiz-stats__item strong {
  display: block;
}

.qm-quiz-stats__item span {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(19, 34, 56, 0.62);
}

.qm-quiz-stats__item strong {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--qm-ink);
}

.qm-difficulty-bars {
  --qm-difficulty-color: #7f67a9;
  --qm-difficulty-muted: #e7ddf0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.qm-difficulty-bars--2 {
  --qm-difficulty-color: #0c8a7d;
  --qm-difficulty-muted: #d8efe9;
}

.qm-difficulty-bars--3 {
  --qm-difficulty-color: #bf1f5c;
  --qm-difficulty-muted: #efd9e5;
}

.qm-difficulty-bars__bar {
  width: 7px;
  height: 22px;
  border-radius: 999px;
  background: var(--qm-difficulty-muted);
}

.qm-difficulty-bars__bar.is-active {
  background: var(--qm-difficulty-color);
}

.qm-category-browser,
.qm-archive__hero,
.qm-archive__empty {
  padding: 24px;
  border: 1px solid var(--qm-border);
  border-radius: 18px;
  background: var(--qm-card);
}

.qm-category-browser__header,
.qm-archive__hero {
  margin-bottom: 20px;
}

.qm-category-browser__header h2,
.qm-archive__hero h1,
.qm-archive__empty h2,
.qm-quiz-card h2 {
  margin: 0 0 12px;
  line-height: 1.1;
}

.qm-category-grid,
.qm-quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.qm-category-card,
.qm-quiz-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--qm-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(19, 34, 56, 0.06);
}

.qm-category-card__media,
.qm-archive__hero-media {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(19, 34, 56, 0.06);
}

.qm-category-card__media {
  margin-bottom: 14px;
  aspect-ratio: 16 / 9;
}

.qm-archive__hero-media {
  margin-bottom: 18px;
  aspect-ratio: 21 / 9;
}

.qm-category-card__media img,
.qm-archive__hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qm-category-card {
  color: var(--qm-ink);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qm-category-card:hover,
.qm-quiz-card__cta:hover {
  transform: translateY(-1px);
}

.qm-category-card strong,
.qm-category-card span,
.qm-category-card p {
  display: block;
}

.qm-category-card strong,
.qm-quiz-card__meta {
  margin-bottom: 10px;
}

.qm-category-card span,
.qm-quiz-card__meta {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(19, 34, 56, 0.62);
}

.qm-category-card p,
.qm-quiz-card p,
.qm-archive__hero p,
.qm-archive__empty p {
  margin: 0;
}

.qm-archive {
  padding: 40px 16px;
}

.qm-archive__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.qm-quiz-card__cta {
  display: inline-flex;
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--qm-accent) 0%, var(--qm-accent-dark) 100%);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(19, 34, 56, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 700px) {
  .qm-quiz {
    padding: 20px;
    border-radius: 18px;
  }

  .qm-question-card,
  .qm-result,
  .qm-wallet,
  .qm-login-gate,
  .qm-locked,
  .qm-quiz-lock {
    padding: 18px;
  }

  .qm-category-browser,
  .qm-archive__hero,
  .qm-archive__empty,
  .qm-category-card,
  .qm-quiz-card {
    padding: 18px;
  }

}
