.popquiz-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1060;
  justify-content: center;
  align-items: center;
  animation: popquiz-fade-in 0.2s ease;
}
.popquiz-backdrop.show {
  display: flex;
}

@keyframes popquiz-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popquiz-card {
  background: #fff;
  border-radius: 14px;
  padding: 2rem;
  width: 100%;
  max-width: 780px;
  margin: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
  animation: popquiz-slide-up 0.25s ease;
}

@keyframes popquiz-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.popquiz-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.popquiz-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}

.popquiz-subtitle {
  font-size: 0.82rem;
  color: var(--bs-secondary-color);
  margin: 0.25rem 0 0;
}

.popquiz-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.popquiz-progress-text {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.popquiz-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bs-border-color);
  border-radius: 2px;
  overflow: hidden;
}

.popquiz-progress-fill {
  height: 100%;
  background: var(--accent, #4361ee);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.popquiz-exercise {
  margin-bottom: 0.5rem;
}

.popquiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bs-border-color);
}

.popquiz-done {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.popquiz-done-text {
  font-size: 0.95rem;
  color: var(--bs-body-color);
  margin-bottom: 1rem;
}

@media (max-width: 576px) {
  .popquiz-backdrop {
    align-items: stretch;
  }
  .popquiz-card {
    padding: 1.25rem 1rem;
    margin: 0;
    border-radius: 0;
    max-height: none;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .popquiz-title {
    font-size: 1.15rem;
  }
  #popquiz-exercises {
    flex: 1;
    overflow-y: auto;
  }
  .popquiz-actions {
    gap: 0.75rem;
    margin-top: auto;
    padding-bottom: env(safe-area-inset-bottom, 0.5rem);
  }
  .popquiz-actions .btn {
    min-height: 44px;
    padding: 0.5rem 1.25rem;
  }
}
