/* === Synonyms module === */

.syn-main { max-width: 1240px; }

/* Streak pill */
.streak-pill { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); }
.streak-pill .sp-num { color: #c2410c; }

/* Mode cards */
.syn-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.syn-mode-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.syn-mode-card:hover {
  border-color: #2c6cf6;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -10px rgba(15,23,42,.14);
}
.syn-mode-card.mode-review {
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  border-color: #f59e0b;
}
.smc-icon { font-size: 32px; line-height: 1; }
.syn-mode-card h3 { font-size: 15px; font-weight: 700; margin: 0; color: #111827; }
.syn-mode-card p { font-size: 12.5px; color: #4b5563; line-height: 1.55; margin: 0; }

.syn-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 14px;
}

/* Category grid */
.syn-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.syn-cat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.syn-cat:hover {
  border-color: #2c6cf6;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(15,23,42,.12);
}
.syn-cat-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}
.syn-cat-meta {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  color: #6b7280;
}
.syn-cat-meta strong { color: #2c6cf6; font-weight: 800; }
.syn-cat-progress {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.syn-cat-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a 0%, #15803d 100%);
  border-radius: 2px;
  transition: width .4s;
}

/* === Study Modal overlay === */
.study-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.study-panel {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px -10px rgba(15, 23, 42, 0.4);
}
.study-head {
  background: linear-gradient(135deg, #2c6cf6 0%, #6f5af6 100%);
  color: #fff;
  padding: 18px 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.study-head-info { flex: 1; }
.study-mode-tag {
  display: inline-block;
  background: rgba(255,255,255,0.22);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.study-head-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.study-head-stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  opacity: 0.92;
  margin-top: 4px;
}
.study-close {
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.study-close:hover { background: rgba(255,255,255,0.35); transform: rotate(90deg); }

.study-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 380px;
}

.study-progress {
  height: 4px;
  background: #e5e7eb;
}
.study-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2c6cf6, #6f5af6);
  transition: width .3s;
}

/* === Browse mode === */
.browse-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.browse-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
}
.browse-card.mastered { background: #f0fdf4; border-color: #86efac; }
.browse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.browse-source {
  font-size: 17px;
  font-weight: 800;
  color: #1e40af;
}
.browse-cn {
  font-size: 13px;
  color: #6b7280;
}
.browse-syns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.browse-syn {
  background: #fed7aa;
  color: #9a3412;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 13.5px;
  font-weight: 600;
}
.browse-examples {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: "Georgia", serif;
  font-size: 13px;
  color: #374151;
  line-height: 1.65;
}
.browse-examples .ex-q { color: #1e40af; }
.browse-examples .ex-arrow { color: #f59e0b; margin: 0 6px; }
.browse-examples .ex-p { color: #9a3412; }
.browse-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.browse-btn {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  font-family: inherit;
  font-size: 12px;
  color: #4b5563;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all .12s;
}
.browse-btn:hover { border-color: #2c6cf6; color: #1e40af; }
.browse-btn.btn-master { border-color: #16a34a; color: #16a34a; }
.browse-btn.btn-master:hover { background: #dcfce7; }
.browse-btn.btn-mastered { background: #16a34a; color: #fff; border-color: #16a34a; }

/* === Flashcard mode === */
.flashcard {
  perspective: 1200px;
  width: 100%;
  max-width: 480px;
  margin: 24px auto;
  height: 280px;
  cursor: pointer;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .55s;
  transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 14px 30px -8px rgba(15, 23, 42, 0.18);
}
.flashcard-front {
  background: linear-gradient(135deg, #2c6cf6 0%, #6f5af6 100%);
  color: #fff;
}
.flashcard-back {
  background: linear-gradient(135deg, #fde68a 0%, #fed7aa 100%);
  color: #7c2d12;
  transform: rotateY(180deg);
}
.flashcard-q {
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.flashcard-cn {
  font-size: 16px;
  opacity: 0.9;
}
.flashcard-hint {
  position: absolute;
  bottom: 14px; left: 50%; transform: translateX(-50%);
  font-size: 11px;
  opacity: 0.7;
}
.flashcard-back .flashcard-q { font-size: 24px; line-height: 1.3; }
.flashcard-example {
  font-size: 12.5px;
  margin-top: 14px;
  font-style: italic;
  font-family: "Georgia", serif;
}

.fc-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}
.fc-btn {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.fc-btn:hover { border-color: #2c6cf6; }
.fc-btn-hard { color: #b91c1c; border-color: #fca5a5; }
.fc-btn-hard:hover { background: #fee2e2; }
.fc-btn-good { color: #15803d; border-color: #86efac; }
.fc-btn-good:hover { background: #dcfce7; }
.fc-btn-easy { color: #1d4ed8; border-color: #93c5fd; }
.fc-btn-easy:hover { background: #dbeafe; }

/* === Quiz mode === */
.quiz-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 22px 26px;
}
.quiz-stem {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}
.quiz-word {
  font-size: 30px;
  font-weight: 800;
  color: #1e40af;
  margin-bottom: 6px;
}
.quiz-cn {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 18px;
}
.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quiz-opt {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
}
.quiz-opt:hover {
  border-color: #2c6cf6;
  background: #eff6ff;
}
.quiz-opt.correct { background: #dcfce7; border-color: #16a34a; color: #166534; }
.quiz-opt.wrong { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.quiz-opt:disabled { cursor: default; }

.quiz-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
}
.quiz-feedback.ok { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.quiz-feedback.bad { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

.quiz-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

/* === Match game === */
.match-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.match-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.match-col-title {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #6b7280;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.match-item {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.match-item:hover { border-color: #2c6cf6; background: #eff6ff; }
.match-item.selected {
  background: linear-gradient(135deg, #2c6cf6 0%, #6f5af6 100%);
  color: #fff;
  border-color: transparent;
  transform: scale(1.02);
}
.match-item.matched {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
  cursor: default;
  pointer-events: none;
  opacity: 0.7;
}
.match-item.error {
  background: #fee2e2;
  border-color: #ef4444;
  animation: shake .4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.match-status {
  display: flex;
  justify-content: space-around;
  margin-bottom: 18px;
  font-size: 13px;
  color: #4b5563;
}
.match-status strong { color: #1e40af; font-weight: 800; font-size: 16px; margin-right: 4px; }

/* === Dictation === */
.dict-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 26px;
  text-align: center;
}
.dict-hint {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}
.dict-word {
  font-size: 30px;
  font-weight: 800;
  color: #1e40af;
  margin-bottom: 4px;
}
.dict-cn {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 18px;
}
.dict-input {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: "Georgia", serif;
  font-size: 18px;
  text-align: center;
  outline: none;
  font-weight: 600;
  color: #1e40af;
  transition: border-color .15s;
}
.dict-input:focus { border-color: #2c6cf6; box-shadow: 0 0 0 3px rgba(44,108,246,0.15); }
.dict-input.correct { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.dict-input.wrong { border-color: #ef4444; background: #fef2f2; color: #991b1b; }

.dict-hint-btn {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  margin-top: 12px;
  font-family: inherit;
  text-decoration: underline;
}
.dict-hint-btn:hover { color: #2c6cf6; }

/* === Mode toolbar === */
.study-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}
.study-toolbar-stat {
  font-size: 12.5px;
  color: #6b7280;
}
.study-toolbar-stat strong { color: #1e40af; font-weight: 800; }
.study-actions {
  display: flex;
  gap: 8px;
}
.study-action-btn {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  padding: 7px 14px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  transition: all .12s;
}
.study-action-btn:hover { border-color: #2c6cf6; color: #1e40af; }
.study-action-btn.primary {
  background: linear-gradient(135deg, #2c6cf6 0%, #6f5af6 100%);
  color: #fff;
  border-color: transparent;
}

/* Completion */
.complete-screen {
  text-align: center;
  padding: 40px 20px;
}
.complete-emoji { font-size: 64px; margin-bottom: 14px; }
.complete-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: #111827; }
.complete-stats { display: flex; gap: 20px; justify-content: center; margin-top: 18px; }
.complete-stat {
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px 18px;
  min-width: 100px;
}
.complete-stat-num { font-size: 26px; font-weight: 800; color: #2c6cf6; }
.complete-stat-label { font-size: 11px; color: #6b7280; }

@media (max-width: 600px) {
  .quiz-options { grid-template-columns: 1fr; }
  .flashcard { height: 240px; }
  .flashcard-q { font-size: 28px; }
}
