/* Exersează adunarea — listă cu toate exercițiile ca carduri */

html:has(.adun-page--quiz-list) {
  height: auto;
  overflow: auto;
}

.adun-page--quiz-list {
  height: auto;
  min-height: 100dvh;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  display: block;
  --u: min(1px, 100vw / 1280, 1px);
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}

.adun-page--quiz-list .adun-header--sticky {
  position: sticky;
  top: 0;
  z-index: 30;
  padding:
    max(14px, calc(22 * var(--u)))
    max(72px, calc(110 * var(--u)))
    12px;
  background:
    linear-gradient(180deg, rgba(255, 249, 240, 0.96) 0%, rgba(247, 245, 255, 0.94) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(180, 187, 240, 0.45);
}

.adun-page--quiz-list .adun-progress__pill {
  text-decoration: none;
}

.adun-page--quiz-list .adun-progress__pill.is-done:not(.is-active) {
  background: #d9f0e2;
  color: #1f7a45;
}

.adun-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3vw, 24px);
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 16px max(12px, calc(24 * var(--u))) 28px;
  box-sizing: border-box;
}

.adun-ex-card {
  width: 100%;
  background: #fff;
  border: 2px solid var(--adun-card-border);
  border-radius: clamp(18px, calc(28 * var(--u)), 28px);
  box-shadow: 0 12px 28px -8px rgba(47, 79, 191, 0.12);
  padding: clamp(14px, calc(20 * var(--u)), 26px) clamp(14px, calc(24 * var(--u)), 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, calc(12 * var(--u)), 14px);
  scroll-margin-top: 120px;
}

.adun-ex-card.is-solved {
  border-color: #8fd4a8;
}

.adun-ex-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.adun-ex-card .adun-equation {
  flex: none;
  min-height: 0;
  padding: 8px 0;
  flex-wrap: wrap;
  row-gap: 8px;
}

.adun-ex-card .adun-op {
  padding-bottom: clamp(18px, calc(36 * var(--u)), 36px);
}

.adun-ex-card .adun-operand {
  max-width: none;
}

.adun-result--ask {
  background: var(--adun-lavender);
  color: var(--adun-blue);
  box-shadow: none;
}

.adun-result.is-correct {
  background: var(--adun-blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 79, 191, 0.25);
}

.adun-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, calc(12 * var(--u)), 14px);
  width: 100%;
  max-width: min(420px, 100%);
  margin: 0 auto;
}

.adun-choice {
  appearance: none;
  border: 2px solid var(--adun-card-border);
  background: #fff;
  color: var(--adun-blue);
  border-radius: clamp(14px, calc(18 * var(--u)), 20px);
  min-height: clamp(48px, calc(64 * var(--u)), 72px);
  padding: 8px 12px;
  font-family: inherit;
  font-weight: 900;
  font-size: clamp(22px, calc(34 * var(--u)), 38px);
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  box-shadow: 0 4px 12px rgba(47, 79, 191, 0.08);
}

.adun-choice:hover:not(:disabled) {
  border-color: var(--adun-blue);
  transform: translateY(-1px);
}

.adun-choice:disabled {
  cursor: default;
}

.adun-choice.is-correct {
  background: #e8f8ee;
  border-color: #2f9e5d;
  color: #1f7a45;
}

.adun-choice.is-wrong {
  background: #fff0f0;
  border-color: #e05555;
  color: #b03030;
  animation: adun-shake 0.35s ease;
}

.adun-choice.is-muted {
  opacity: 0.45;
}

.adun-ex-card .adun-feedback {
  margin-top: 0;
}

.adun-ex-card .adun-caption {
  margin: 0;
}

.adun-list-footer {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent 0%, rgba(247, 245, 255, 0.95) 28%);
}

.adun-list-footer.is-hidden {
  display: none !important;
}

.adun-list-footer .adun-cta {
  box-shadow: 0 10px 24px rgba(47, 79, 191, 0.28);
}

@keyframes adun-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@media (max-width: 640px) {
  .adun-page--quiz-list .adun-header--sticky {
    padding-inline: max(56px, calc(80 * var(--u)));
  }

  .adun-ex-card .adun-op {
    padding-bottom: 14px;
  }

  .adun-choices {
    max-width: 100%;
  }
}
