/* sam quiz : ecran d'une matiere */

.back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
}

.back-btn.visible {
  display: flex;
  animation: popIn 0.3s ease both;
}

.back-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.35);
}

#screen-subject {
  animation: fadeUp 0.35s ease both;
}

#screen-subject[hidden] {
  display: none;
}

.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef0ff;
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.subject-title {
  margin: 10px 0 4px;
  font-size: 1.7rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.subject-sub {
  margin: 0 0 22px;
  color: var(--muted);
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  animation: fadeUp 0.45s ease both;
  transition: transform 0.15s ease;
}

.mode-card:nth-child(2) {
  animation-delay: 0.08s;
}

.mode-card:active {
  transform: scale(0.96);
}

.mode-card[disabled] {
  opacity: 0.5;
}

.mode-icon {
  font-size: 1.8rem;
}

.mode-title {
  font-weight: 800;
}

.mode-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

.section-title {
  margin: 26px 4px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  animation: fadeUp 0.35s ease both;
}

.item-text {
  min-width: 0;
  flex: 1;
}

.item-main {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-sub {
  font-size: 0.85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.item-del {
  flex: none;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.item-del:active {
  transform: scale(0.9);
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-block {
  display: block;
  width: 100%;
}

.subject-actions {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: max-content;
  max-width: 90%;
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: 999px;
  background: #1f2430;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 30;
  animation: fadeUp 0.3s ease both;
}

.toast[hidden] {
  display: none;
}
