/**
 * Общий UI навыковых квиз-тренажёров (/trenazher-…/)
 */

.skill-quiz-main {
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem) 1.25rem;
}

.skill-quiz-panel {
  position: relative;
  margin-top: 0.55rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    165deg,
    rgba(30, 41, 59, 0.72) 0%,
    rgba(15, 23, 42, 0.88) 100%
  );
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 1.25rem clamp(1rem, 3vw, 1.5rem) 1.5rem;
  overflow: hidden;
}

[data-theme="light"] .skill-quiz-panel {
  border-color: rgba(15, 23, 42, 0.08);
  background: linear-gradient(165deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.skill-quiz-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.skill-quiz-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.skill-quiz-stats strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.skill-quiz-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.skill-quiz-mode {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.skill-quiz-mode:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

.skill-quiz-mode.is-active {
  color: #ecfdf5;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.18);
}

[data-theme="light"] .skill-quiz-mode {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .skill-quiz-mode.is-active {
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
}

.skill-quiz-prompt {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 550;
}

.skill-quiz-visual {
  margin: 0 0 1.15rem;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-x: auto;
}

[data-theme="light"] .skill-quiz-visual {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.04);
}

.skill-quiz-visual[hidden],
.skill-quiz-svg-wrap[hidden] {
  display: none !important;
}

.skill-quiz-svg-wrap {
  margin: 0 0 1.15rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  overflow-x: auto;
}

[data-theme="light"] .skill-quiz-svg-wrap {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.03);
}

.skill-quiz-svg-wrap svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.skill-quiz-answers {
  display: grid;
  gap: 0.55rem;
}

.skill-quiz-answer {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 0.7rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.skill-quiz-answer:hover:not(:disabled) {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.skill-quiz-answer:disabled {
  cursor: default;
  opacity: 0.85;
}

.skill-quiz-answer.is-correct {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.18);
}

.skill-quiz-answer.is-wrong {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(239, 68, 68, 0.14);
}

[data-theme="light"] .skill-quiz-answer {
  border-color: rgba(15, 23, 42, 0.1);
  background: #fff;
}

.skill-quiz-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
}

.skill-quiz-input {
  flex: 1 1 10rem;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border-radius: 0.7rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

[data-theme="light"] .skill-quiz-input {
  border-color: rgba(15, 23, 42, 0.12);
  background: #fff;
}

.skill-quiz-input:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.skill-quiz-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 0.7rem;
  padding: 0.75rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.skill-quiz-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

.skill-quiz-btn--primary {
  border-color: rgba(52, 211, 153, 0.4);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.85), rgba(5, 150, 105, 0.75));
  color: #ecfdf5;
}

.skill-quiz-btn--primary:hover {
  border-color: rgba(52, 211, 153, 0.6);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.85));
}

.skill-quiz-feedback {
  margin-top: 1rem;
  min-height: 1.4rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.skill-quiz-feedback.is-ok {
  color: #6ee7b7;
}

.skill-quiz-feedback.is-bad {
  color: #fca5a5;
}

[data-theme="light"] .skill-quiz-feedback.is-ok {
  color: #047857;
}

[data-theme="light"] .skill-quiz-feedback.is-bad {
  color: #b91c1c;
}

.skill-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.skill-quiz-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-quiz-btn--ghost {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.skill-quiz-btn--demo {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}

.skill-quiz-btn--demo:hover {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(59, 130, 246, 0.28);
}

.skill-quiz-btn--tiny {
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
}

.skill-quiz-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.skill-quiz-coach {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(30, 64, 175, 0.22);
}

.skill-quiz-coach__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.skill-quiz-coach__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #93c5fd;
}

.skill-quiz-coach__step {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.skill-quiz-coach__text {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}

.skill-quiz-coach__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.skill-quiz-coach__bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.25s ease;
}

.skill-quiz-panel.is-demo .skill-quiz-answer,
.skill-quiz-panel.is-demo .skill-quiz-input,
.skill-quiz-panel.is-demo [data-sq-submit],
.skill-quiz-panel.is-demo [data-sq-next] {
  pointer-events: none;
}

.skill-quiz-answer.is-demo-pulse {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  animation: skill-quiz-pulse 0.9s ease infinite;
}

@keyframes skill-quiz-pulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.skill-quiz-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(4px);
}

.skill-quiz-overlay[hidden] {
  display: none !important;
}

.skill-quiz-overlay__card {
  width: min(28rem, 100%);
  max-height: min(80vh, 34rem);
  overflow: auto;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  padding: 1.2rem 1.25rem 1.3rem;
}

[data-theme="light"] .skill-quiz-overlay__card {
  border-color: rgba(15, 23, 42, 0.1);
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.skill-quiz-overlay__kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.skill-quiz-overlay__title {
  margin: 0 0 0.85rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.skill-quiz-overlay__body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.skill-quiz-overlay__body ol,
.skill-quiz-overlay__body ul {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
}

.skill-quiz-overlay__body li {
  margin: 0.35rem 0;
}

.skill-quiz-overlay__body p {
  margin: 0 0 0.75rem;
}

.skill-quiz-overlay__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .skill-quiz-answer,
  .skill-quiz-btn,
  .skill-quiz-input {
    font-size: 0.9rem;
  }

  .skill-quiz-toolbar__actions {
    width: 100%;
  }

  .skill-quiz-toolbar__actions .skill-quiz-btn {
    flex: 1 1 auto;
  }
}
