/* Pulse animation for blank slot */
@keyframes pulse-border {
  0%, 100% { border-color: rgba(99, 102, 241, 0.4); }
  50% { border-color: rgba(99, 102, 241, 1); }
}

.blank-pulse {
  animation: pulse-border 1.5s ease-in-out infinite;
}

/* Feedback panel slide-in */
@keyframes slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.feedback-enter {
  animation: slide-in 0.3s ease-out forwards;
}

/* Furigana sizing */
rt {
  font-size: 0.55em;
  color: #6b7280;
  text-align: center;
}
ruby {
  ruby-align: center;
}

/* Japanese font tuning */
.jp {
  font-family: 'Noto Sans JP', sans-serif;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

/* Word card base */
.word-card {
  display: inline-block;
  text-align: center;
  vertical-align: middle;
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 1.35rem;
  transition: transform 0.15s ease;
}

/* Cards without furigana get extra top padding to match the height of kanji+furigana cards */
.word-card:not(.has-furigana) {
  padding-top: calc(0.5rem + 0.75em);
}

/* Blank card states */
.word-card.blank {
  border: 2px dashed rgb(99, 102, 241);
  background: rgba(238, 242, 255, 0.5);
  min-width: 3rem;
  text-align: center;
  font-weight: 600;
}

.word-card.blank.correct {
  animation: none;
  border-color: #22c55e;
  background: #dcfce7;
  color: #166534;
}

.word-card.blank.incorrect {
  animation: none;
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

/* Tappable word cards */
.word-card.tappable {
  cursor: pointer;
}
.word-card.tappable:hover {
  background: #eef2ff;
}
.word-card.tappable:active {
  transform: scale(0.97);
}

/* Word tooltip */
.word-tip {
  position: absolute;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #1f2937;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: tip-in 0.15s ease-out;
  pointer-events: none;
}
.word-tip-romaji {
  font-weight: 600;
  letter-spacing: 0.03em;
}
.word-tip-meaning {
  font-size: 0.7rem;
  color: #d1d5db;
}
@keyframes tip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sentence builder cards */
.builder-card {
  cursor: pointer;
  user-select: none;
}
.builder-card:active {
  transform: scale(0.95);
}
.builder-placeholder {
  display: none;
}
.builder-correct {
  border: 2px solid #22c55e;
  background: #dcfce7;
}
.builder-incorrect {
  border: 2px solid #ef4444;
  background: #fee2e2;
}

/* Vocab tap prompt card */
.prompt-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  text-align: center;
  transition: transform 0.15s ease;
}
.prompt-card:active {
  transform: scale(0.98);
}

/* Vocab tap option buttons */
.option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.75rem;
  min-height: 4rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.option-btn:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
}
.option-btn:active {
  transform: scale(0.97);
}
.option-correct {
  border-color: #22c55e !important;
  background: #dcfce7 !important;
}
.option-incorrect {
  border-color: #ef4444 !important;
  background: #fee2e2 !important;
}
.option-dimmed {
  opacity: 0.35;
  pointer-events: none;
}

/* Confetti animation */
@keyframes confetti-fall {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) translateX(var(--drift, 0px)) rotate(720deg); opacity: 0; }
}

/* Progress bar fill */
.progress-fill {
  transition: width 0.4s ease;
}
