/* ============================================================
   Phrase Trainer — interactive Lithuanian phrase memorisation
   Namespaced .pt-* to avoid collisions with site styles.
   Uses CSS variables from /style.css (--forest, --gold, etc.)
   ============================================================ */

.pt-trainer {
  --pt-radius: 18px;
  --pt-radius-sm: 12px;
  --pt-shadow: 0 24px 60px -20px rgba(13, 38, 28, 0.45), 0 6px 18px -8px rgba(13, 38, 28, 0.25);
  --pt-shadow-card: 0 14px 30px -12px rgba(13, 38, 28, 0.22), 0 2px 6px rgba(13, 38, 28, 0.06);
  --pt-green-deep: #0F2A1E;
  --pt-correct: #2D8659;
  --pt-correct-bg: #E8F5ED;
  --pt-wrong: #C84141;
  --pt-wrong-bg: #FCEDEC;

  max-width: 540px;
  margin: 3rem auto;
  background: linear-gradient(160deg, var(--pt-green-deep) 0%, var(--forest) 55%, var(--forest-mid) 100%);
  border-radius: var(--pt-radius);
  box-shadow: var(--pt-shadow);
  overflow: hidden;
  position: relative;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
}

.pt-trainer * { box-sizing: border-box; }

.pt-trainer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 85% 0%, rgba(201, 168, 76, 0.18) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Header ─── */
.pt-head {
  position: relative;
  z-index: 1;
  padding: 1.25rem 1.4rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pt-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.9rem;
}
.pt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pt-brand-flag {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--flag-y) 33.3%, var(--flag-g) 33.3%, var(--flag-g) 66.6%, var(--flag-r) 66.6%);
}
.pt-brand-title {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  line-height: 1.15;
}
.pt-brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}
.pt-stats {
  display: flex;
  gap: 8px;
}
.pt-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-variant-numeric: tabular-nums;
}
.pt-stat-icon {
  font-size: 13px;
  line-height: 1;
}
.pt-stat.pt-streak { color: var(--gold-light); }
.pt-stat.pt-streak.pt-streak-on { background: rgba(240, 208, 128, 0.13); border-color: rgba(240, 208, 128, 0.22); }

/* ─── Help button (small "?" next to stats) ─── */
.pt-help-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s;
  padding: 0;
  margin-left: 2px;
  flex-shrink: 0;
}
.pt-help-btn:hover { background: rgba(240, 208, 128, 0.14); border-color: rgba(240, 208, 128, 0.4); color: var(--gold-light); }
.pt-help-btn.pt-help-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--pt-green-deep);
}

/* ─── Help panel ─── */
.pt-help {
  flex: 1;
  background: var(--warm-white);
  color: var(--text-dark);
  border-radius: var(--pt-radius-sm);
  box-shadow: var(--pt-shadow-card);
  padding: 1.2rem 1.3rem 1rem;
  display: flex;
  flex-direction: column;
  animation: pt-fade-up 0.25s ease-out both;
}
.pt-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.8rem;
}
.pt-help-head h4 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--forest);
  margin: 0;
  line-height: 1.2;
}
.pt-help-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
}
.pt-help-x:hover { background: var(--cream); color: var(--forest); }
.pt-help-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-right: 4px;
}
.pt-help-item { padding-bottom: 0.1rem; }
.pt-help-item-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.pt-help-item-h strong {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--forest);
  letter-spacing: 0.01em;
}
.pt-help-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: var(--cream);
  border-radius: 6px;
  flex-shrink: 0;
}
.pt-help-item p {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.55;
  margin: 0 0 0 30px;
}
.pt-help-item-keys p {
  font-family: 'DM Sans', monospace;
  font-size: 12px;
  color: var(--text-mid);
  background: var(--cream);
  border-radius: 6px;
  padding: 6px 9px;
  margin-left: 30px;
  margin-top: 4px;
}
.pt-help-foot {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0.4rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-style: italic;
}
.pt-help-done {
  appearance: none;
  border: 0;
  background: var(--forest);
  color: var(--gold-light);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s;
  align-self: center;
  margin-top: 0.9rem;
}
.pt-help-done:hover { background: var(--pt-green-deep); }

/* ─── Mode tabs (segmented control) ─── */
.pt-modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.22);
  padding: 4px;
  border-radius: 11px;
}
.pt-mode {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}
.pt-mode:hover { color: #fff; }
.pt-mode[aria-pressed="true"] {
  background: var(--gold);
  color: var(--pt-green-deep);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}

/* ─── Category chips ─── */
.pt-cats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0.85rem 1.4rem;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.12);
}
.pt-cats::-webkit-scrollbar { display: none; }
.pt-cat {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.pt-cat:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.pt-cat[aria-pressed="true"] {
  background: rgba(240, 208, 128, 0.14);
  color: var(--gold-light);
  border-color: rgba(240, 208, 128, 0.4);
}
.pt-cats[hidden] { display: none; }

/* ─── Stage (main content area) ─── */
.pt-stage {
  position: relative;
  z-index: 1;
  padding: 1.8rem 1.4rem 1.2rem;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

/* Progress bar (today's goal) */
.pt-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.2rem;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}
.pt-progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.pt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.pt-progress-count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
}

/* ─── Flashcard ─── */
.pt-card-wrap {
  flex: 1;
  display: flex;
  align-items: stretch;
  margin-bottom: 1rem;
}
.pt-card {
  position: relative;
  width: 100%;
  min-height: 220px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* 2D crossfade between front and back. We avoid CSS 3D rotation here on
   purpose: with `transform-style: preserve-3d` + `rotateY(180deg)`,
   Chromium and iOS Safari mis-route hit-tests on the back face's
   children (rate buttons), causing taps to land on the parent .pt-card
   instead of the button. A flat crossfade keeps hit-testing in plain 2D,
   so every tap reaches the element the user actually pressed. */
.pt-card-face {
  position: absolute;
  inset: 0;
  background: var(--warm-white);
  color: var(--text-dark);
  border-radius: var(--pt-radius-sm);
  box-shadow: var(--pt-shadow-card);
  padding: 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.pt-card-face-back {
  background: var(--cream);
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}
.pt-card.pt-flipped .pt-card-face-front {
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}
.pt-card.pt-flipped .pt-card-face-back {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.pt-card-tag {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pt-card-tag::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--gold);
}
.pt-card-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 0.6rem 0;
}
.pt-prompt {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.25;
}
.pt-answer-lt {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 6.2vw, 34px);
  font-weight: 700;
  color: var(--forest);
  line-height: 1.2;
  margin-bottom: 0.4rem;
  word-break: break-word;
}
.pt-answer-pr {
  font-style: italic;
  color: var(--forest-mid);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.pt-card-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.03em;
}
.pt-card-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-mid);
  margin: 0 2px;
}
.pt-hint-tap { font-weight: 500; color: var(--text-mid); }
.pt-hint-key { color: var(--text-muted); }

/* Subtle one-time attention pulse on Show Answer button — only on the first
   unflipped card the user sees in a session, so it doesn't repeat distractingly. */
@keyframes pt-show-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); }
  50%      { box-shadow: 0 0 0 8px rgba(201, 168, 76, 0.22); }
}
.pt-show {
  animation: pt-show-pulse 1.6s ease-in-out 0.5s 2 both;
}
.pt-card.pt-flipped .pt-show,
.pt-card:hover .pt-show { animation: none; }

/* SRS rate buttons */
.pt-rate {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 0.4rem;
}
.pt-rate-btn {
  appearance: none;
  border: 0;
  background: #fff;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 8px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.pt-rate-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2); }
.pt-rate-btn:active { transform: translateY(0); }
.pt-rate-btn[data-rate="again"] { border-top: 3px solid var(--pt-wrong); }
.pt-rate-btn[data-rate="hard"] { border-top: 3px solid var(--amber); }
.pt-rate-btn[data-rate="easy"] { border-top: 3px solid var(--pt-correct); }
.pt-rate-btn-due {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.03em;
}

/* Show-answer button (front of flashcard CTA) */
.pt-show {
  appearance: none;
  border: 0;
  background: var(--forest);
  color: var(--gold-light);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s;
  align-self: center;
  margin-top: 0.4rem;
}
.pt-show:hover { background: var(--pt-green-deep); }

/* ─── Quiz mode ─── */
.pt-quiz {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pt-quiz-card {
  background: var(--warm-white);
  border-radius: var(--pt-radius-sm);
  padding: 1.4rem 1.4rem 1rem;
  box-shadow: var(--pt-shadow-card);
  color: var(--text-dark);
  margin-bottom: 0.9rem;
  text-align: center;
}
.pt-quiz-q {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-weight: 500;
}
.pt-quiz-word {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 5.2vw, 28px);
  font-weight: 600;
  color: var(--forest);
  line-height: 1.25;
  word-break: break-word;
}
.pt-quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pt-quiz-opt {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 14px 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  word-break: break-word;
}
.pt-quiz-opt-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--cream);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.pt-quiz-opt:hover:not([disabled]) {
  border-color: var(--forest);
  background: var(--cream);
  transform: translateY(-1px);
}
.pt-quiz-opt:hover:not([disabled]) .pt-quiz-opt-num { background: var(--forest); color: var(--gold-light); }
.pt-quiz-opt[disabled] { cursor: default; }
.pt-quiz-opt.pt-correct {
  border-color: var(--pt-correct);
  background: var(--pt-correct-bg);
  color: var(--pt-correct);
}
.pt-quiz-opt.pt-correct .pt-quiz-opt-num { background: var(--pt-correct); color: #fff; }
.pt-quiz-opt.pt-wrong {
  border-color: var(--pt-wrong);
  background: var(--pt-wrong-bg);
  color: var(--pt-wrong);
}
.pt-quiz-opt.pt-wrong .pt-quiz-opt-num { background: var(--pt-wrong); color: #fff; }

.pt-quiz-feedback {
  position: relative;
  z-index: 1;
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: var(--pt-radius-sm);
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pt-quiz-feedback.pt-show { display: flex; }
.pt-quiz-feedback.pt-fb-correct {
  background: rgba(45, 134, 89, 0.18);
  color: #B6EBC5;
  border: 1px solid rgba(45, 134, 89, 0.3);
}
.pt-quiz-feedback.pt-fb-wrong {
  background: rgba(200, 65, 65, 0.18);
  color: #FFC4C0;
  border: 1px solid rgba(200, 65, 65, 0.3);
}
.pt-quiz-feedback-text { flex: 1; }
.pt-quiz-feedback-pr {
  display: block;
  font-style: italic;
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}
.pt-next {
  appearance: none;
  border: 0;
  background: var(--gold);
  color: var(--pt-green-deep);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.15s;
  flex-shrink: 0;
}
.pt-next:hover { background: var(--gold-light); }

/* ─── Quiz style toggle (Choose vs Type) ─── */
.pt-quiz-style {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: rgba(0, 0, 0, 0.18);
  padding: 3px;
  border-radius: 9px;
  margin-bottom: 0.7rem;
  max-width: 220px;
}
.pt-qs {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pt-qs:hover { color: #fff; }
.pt-qs[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.95);
  color: var(--pt-green-deep);
  font-weight: 600;
}

/* ─── Type-answer form ─── */
.pt-type-form {
  display: flex;
  gap: 8px;
  margin-bottom: 0.4rem;
}
.pt-type-input {
  flex: 1;
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-dark);
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 500;
  padding: 13px 14px;
  border-radius: 11px;
  outline: none;
  transition: all 0.15s;
  min-width: 0;
}
.pt-type-input::placeholder {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
}
.pt-type-input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18); }
.pt-type-input.pt-correct { border-color: var(--pt-correct); background: var(--pt-correct-bg); color: var(--pt-correct); }
.pt-type-input.pt-wrong { border-color: var(--pt-wrong); background: var(--pt-wrong-bg); color: var(--pt-wrong); }
.pt-type-input[disabled] { cursor: default; }

.pt-type-submit {
  appearance: none;
  border: 0;
  background: var(--gold);
  color: var(--pt-green-deep);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0 18px;
  border-radius: 11px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.pt-type-submit:hover { background: var(--gold-light); }
.pt-type-submit:active { transform: scale(0.97); }

.pt-type-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  letter-spacing: 0.03em;
  font-style: italic;
  margin-bottom: 0.2rem;
}

@media (max-width: 540px) {
  .pt-type-input { font-size: 17px; padding: 11px 12px; }
  .pt-type-submit { padding: 0 14px; font-size: 12px; }
  .pt-quiz-style { max-width: none; }
}

/* ─── Empty / done state ─── */
.pt-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
  color: rgba(255, 255, 255, 0.85);
}
.pt-empty-mark {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
  line-height: 1;
}
.pt-empty h4 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #fff;
}
.pt-empty p {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 0 1.2rem;
}
.pt-empty-action {
  appearance: none;
  border: 1px solid rgba(240, 208, 128, 0.45);
  background: rgba(240, 208, 128, 0.1);
  color: var(--gold-light);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.15s;
}
.pt-empty-action:hover { background: rgba(240, 208, 128, 0.18); }

/* ─── Footer ─── */
.pt-foot {
  position: relative;
  z-index: 1;
  padding: 0.8rem 1.4rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pt-foot-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.02em;
}
.pt-foot-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  font-family: inherit;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.75);
}
.pt-foot-reset {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 4px 0;
  transition: color 0.15s;
}
.pt-foot-reset:hover { color: var(--gold-light); }

/* Widget-mode credit link in the footer */
.pt-foot-credit {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
.pt-foot-credit:hover { color: var(--gold-light); }
.pt-foot-credit strong {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}
.pt-foot-credit-tag {
  color: rgba(255, 255, 255, 0.45);
  font-size: 10.5px;
}
.pt-foot-credit-tag::before { content: '·'; margin-right: 4px; opacity: 0.55; }
.pt-foot-credit-arrow {
  font-size: 11px;
  opacity: 0.7;
  margin-left: 1px;
}
.pt-foot-credit:hover .pt-foot-credit-tag { color: rgba(240, 208, 128, 0.75); }

/* ─── Subtle reveal animations ─── */
@keyframes pt-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.pt-quiz-card, .pt-empty, .pt-card { animation: pt-fade-up 0.3s ease-out both; }
.pt-quiz-opt { animation: pt-fade-up 0.3s ease-out both; }
.pt-quiz-opt:nth-child(1) { animation-delay: 0.02s; }
.pt-quiz-opt:nth-child(2) { animation-delay: 0.06s; }
.pt-quiz-opt:nth-child(3) { animation-delay: 0.1s; }
.pt-quiz-opt:nth-child(4) { animation-delay: 0.14s; }

/* ─── Mobile tweaks ─── */
@media (max-width: 540px) {
  .pt-trainer { margin: 2rem 1rem; border-radius: 16px; }
  .pt-head { padding: 1rem 1.1rem 0.85rem; }
  .pt-cats { padding: 0.7rem 1.1rem; }
  .pt-stage { padding: 1.4rem 1.1rem 1rem; min-height: 340px; }
  .pt-foot { padding: 0.7rem 1.1rem 0.9rem; }
  .pt-stats { gap: 5px; }
  .pt-stat { padding: 4px 8px; font-size: 11.5px; }
  .pt-mode { font-size: 11.5px; padding: 7px 4px; }
  .pt-quiz-options { grid-template-columns: 1fr; }
  .pt-rate-btn { font-size: 12.5px; padding: 11px 6px; }
  .pt-foot-hint { display: none; }
  .pt-hint-key { display: none; }
  .pt-foot-credit-tag { display: none; }
  .pt-help-btn { width: 26px; height: 26px; font-size: 14px; }
  .pt-help { padding: 1rem 1.1rem 0.85rem; }
  .pt-help-head h4 { font-size: 16px; }
  .pt-help-item p { font-size: 12.5px; }
}

@media (max-width: 400px) {
  .pt-modes { grid-template-columns: repeat(4, 1fr); }
  .pt-mode { font-size: 10.5px; }
  .pt-brand-title { font-size: 17px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pt-card, .pt-progress-fill, .pt-rate-btn, .pt-quiz-opt, .pt-mode, .pt-cat,
  .pt-quiz-card, .pt-empty, .pt-card { transition: none !important; animation: none !important; }
}
