body.sn-modal-open {
  overflow: hidden;
}

.pp-settings-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px solid rgba(190, 24, 93, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #9f1239;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.pp-settings-reset:hover,
.pp-settings-reset:focus-visible {
  background: #fff1f2;
}

.history-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(8px);
}

.history-overlay.hidden {
  display: none;
}

.history-window {
  position: relative;
  width: min(920px, 96vw);
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 28px;
  background: var(--sn-card, #fff);
  color: var(--sn-ink, #183153);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

.history-close {
  position: sticky;
  top: 0;
  float: right;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(226, 232, 240, 0.9);
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
}

.history-intro {
  max-width: 62ch;
  margin-top: 0;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.history-summary > div {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(241, 245, 249, 0.72);
}

.history-summary span,
.history-summary strong {
  display: block;
}

.history-summary span {
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
}

.history-summary strong {
  margin-top: 3px;
  font-size: 1.35rem;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-item {
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.history-item-header div span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 0.82rem;
}

.history-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.history-status.status-done {
  background: #dcfce7;
  color: #166534;
}

.history-status.status-practice {
  background: #fef3c7;
  color: #92400e;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.history-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.75);
  font-size: 0.78rem;
  font-weight: 800;
}

.history-attempts {
  display: grid;
  gap: 9px;
}

.history-attempt {
  padding: 12px;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
}

.history-attempt.attempt-correct {
  border-left-color: #22c55e;
}

.history-attempt-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 0.76rem;
}

.history-detail p {
  margin: 6px 0 0;
}

.history-empty,
.history-empty-inline {
  text-align: center;
  color: #64748b;
}

.history-empty {
  padding: 32px 16px;
}

.history-empty div {
  font-size: 2.4rem;
}

.history-empty strong {
  display: block;
  margin-top: 8px;
  color: var(--sn-ink, #183153);
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.history-actions button {
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: #ffe4e6;
  color: #9f1239;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.pp-shop-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.pp-shop-pager button {
  min-width: 42px;
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: #e0f2fe;
  color: #075985;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.pp-shop-pager button:disabled {
  opacity: 0.45;
  cursor: default;
}

.pp-stagger-reveal {
  animation: pp-stagger-in 320ms ease both;
  animation-delay: calc(var(--pp-stagger-index, 0) * 34ms);
}

@keyframes pp-stagger-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.pp-fx-burst {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
  overflow: hidden;
}

.pp-fx-burst > span {
  position: absolute;
  font-size: clamp(18px, 3vw, 30px);
  transform: translate(-50%, -50%);
  animation: pp-burst-particle 1250ms cubic-bezier(.2,.72,.25,1) var(--pp-delay, 0ms) both;
}

@keyframes pp-burst-particle {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
  12% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--pp-angle)) translateX(var(--pp-distance)) rotate(calc(-1 * var(--pp-angle))) scale(1.1);
  }
}

@media (max-width: 620px) {
  .history-overlay { padding: 8px; }
  .history-window { width: 100%; max-height: 95vh; border-radius: 20px; padding: 18px; }
  .history-item-header { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-stagger-reveal,
  .pp-fx-burst > span {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}
