/**
 * pets.css
 * Styles and animations for Study Buddy Companions across Fun to Learn Thai
 */

/* ==========================================================================
   1. Growth Stage Visibility within SVG Pet Art
   ========================================================================== */
.pet-stage-1 .stage-2-plus,
.pet-stage-1 .stage-3-plus,
.pet-stage-1 .stage-4-only {
  display: none !important;
}

.pet-stage-2 .stage-3-plus,
.pet-stage-2 .stage-4-only {
  display: none !important;
}
.pet-stage-2 .stage-2-plus {
  display: block !important;
}

.pet-stage-3 .stage-4-only {
  display: none !important;
}
.pet-stage-3 .stage-2-plus,
.pet-stage-3 .stage-3-plus {
  display: block !important;
}

.pet-stage-4 .stage-2-plus,
.pet-stage-4 .stage-3-plus,
.pet-stage-4 .stage-4-only {
  display: block !important;
}

/* ==========================================================================
   2. Companion Micro-Animations
   ========================================================================== */
@keyframes pet-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes pet-bounce {
  0% {
    transform: scale(1) translateY(0);
  }
  25% {
    transform: scale(1.12, 0.9) translateY(-14px);
  }
  50% {
    transform: scale(0.95, 1.08) translateY(-4px);
  }
  75% {
    transform: scale(1.05, 0.95) translateY(-8px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

@keyframes pet-nod {
  0%, 100% {
    transform: rotate(0deg);
  }
  30% {
    transform: rotate(6deg) translateY(-2px);
  }
  60% {
    transform: rotate(-4deg) translateY(-1px);
  }
  85% {
    transform: rotate(3deg);
  }
}

@keyframes pet-chew {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  20% {
    transform: scale(1.08, 0.92) rotate(-3deg);
  }
  40% {
    transform: scale(0.95, 1.05) rotate(3deg);
  }
  60% {
    transform: scale(1.06, 0.94) rotate(-2deg);
  }
  80% {
    transform: scale(0.98, 1.02) rotate(2deg);
  }
}

@keyframes pet-peek {
  0% {
    transform: translateY(20px) scale(0.85);
    opacity: 0.5;
  }
  60% {
    transform: translateY(-8px) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes pet-heart-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }
  40% {
    opacity: 1;
    transform: translateY(-24px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1.4);
  }
}

@keyframes aura-glow {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.pet-idle {
  animation: pet-float 3.5s ease-in-out infinite;
}

.pet-happy,
.pet-bounce-anim {
  animation: pet-bounce 0.8s ease-in-out !important;
}

.pet-nod-anim {
  animation: pet-nod 0.9s ease-in-out !important;
}

.pet-eating-anim {
  animation: pet-chew 1s ease-in-out !important;
}

.pet-peek-anim {
  animation: pet-peek 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.pet-stage-4 .pet-aura {
  transform-origin: 100px 100px;
  animation: aura-glow 3s ease-in-out infinite;
}

/* ==========================================================================
   3. Homepage Study Buddy Dashboard Card
   ========================================================================== */
.index-welcome-panel {
  position: relative;
  z-index: 10;
}

.index-panel .card-content > nav.level {
  margin-bottom: 0 !important;
}

.pet-dashboard-container {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
}

.pet-dashboard-container:empty,
.pet-dashboard-container[style*="display: none"],
.pet-dashboard-container[style*="display:none"] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

body:not(.light-mode) .pet-dashboard-container {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.pet-dashboard-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body:not(.light-mode) .pet-dashboard-card {
  background: rgba(31, 36, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.pet-avatar-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  min-width: 100px;
  cursor: pointer;
  user-select: none;
}

.pet-avatar-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
  transition: transform 0.2s ease;
}

.pet-avatar-wrapper:hover .pet-avatar-svg {
  transform: scale(1.06);
}

/* Floating Heart when Fed */
.pet-floating-heart {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  color: #ff4757;
  pointer-events: none;
  animation: pet-heart-rise 1.2s ease-out forwards;
  z-index: 20;
}

/* Dialogue Speech Bubble */
.pet-speech-bubble {
  position: relative;
  flex: 1;
  background: #ffffff;
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body:not(.light-mode) .pet-speech-bubble {
  background: #2a3131;
  border-color: #3e4848;
  color: #f1f2f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Speech bubble notch */
.pet-speech-bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 10px 8px 0;
  border-style: solid;
  border-color: transparent #e0e0e0 transparent transparent;
}

.pet-speech-bubble::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 7px 9px 7px 0;
  border-style: solid;
  border-color: transparent #ffffff transparent transparent;
}

body:not(.light-mode) .pet-speech-bubble::before {
  border-color: transparent #3e4848 transparent transparent;
}

body:not(.light-mode) .pet-speech-bubble::after {
  border-color: transparent #2a3131 transparent transparent;
}

.pet-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.pet-name-title {
  font-weight: 700;
  font-size: 1rem;
  color: #2f3542;
}

body:not(.light-mode) .pet-name-title {
  color: #ffffff;
}

.pet-stage-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffd700, #ffa502);
  color: #2f3542;
  box-shadow: 0 2px 4px rgba(255, 165, 2, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pet-quote-thai {
  font-family: "Sarabun", "Thonburi", "Tahoma", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #3742fa;
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

body:not(.light-mode) .pet-quote-thai {
  color: #70a1ff;
}

.pet-quote-en {
  font-size: 0.8rem;
  color: #747d8c;
  line-height: 1.3;
}

body:not(.light-mode) .pet-quote-en {
  color: #a4b0be;
}

/* Happiness & Feed Action Controls */
.pet-actions-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 170px;
}

.pet-happiness-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.pet-happiness-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #57606f;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

body:not(.light-mode) .pet-happiness-label {
  color: #ced6e0;
}

.pet-happiness-bar {
  width: 100%;
  height: 8px;
  background: #dfe4ea;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

body:not(.light-mode) .pet-happiness-bar {
  background: #3e4848;
}

.pet-happiness-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff4757, #ff6b81, #ffa502, #2ed573);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.pet-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-pet-feed {
  background: linear-gradient(135deg, #2ed573, #10ac84);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.82rem;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  box-shadow: 0 2px 6px rgba(46, 213, 115, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.btn-pet-feed:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(46, 213, 115, 0.4);
}

.btn-pet-feed:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-pet-gear {
  background: transparent;
  border: 1px solid #ced6e0;
  color: #57606f;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  transition: background 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

body:not(.light-mode) .btn-pet-gear {
  border-color: #3e4848;
  color: #a4b0be;
}

.btn-pet-gear:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #2f3542;
}

body:not(.light-mode) .btn-pet-gear:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* ==========================================================================
   4. Flashcard Study Session Companion Dock
   ========================================================================== */
.flashcard-pet-dock {
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 65px;
  height: 65px;
  pointer-events: auto;
  z-index: 10;
  transition: transform 0.2s ease;
}

.flashcard-pet-dock .pet-avatar-wrapper {
  width: 65px;
  height: 65px;
  min-width: 65px;
}

.flashcard-pet-mini-speech {
  position: absolute;
  bottom: 72px;
  right: -5px;
  background: #ffffff;
  border: 1px solid #ced6e0;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  animation: pet-peek 0.3s ease-out;
  z-index: 15;
  color: #2f3542;
}

body:not(.light-mode) .flashcard-pet-mini-speech {
  background: #2f3542;
  border-color: #57606f;
  color: #ffffff;
}

/* ==========================================================================
   5. Study Companion Modal & Pet Selection
   ========================================================================== */
.pet-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.pet-select-card {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body:not(.light-mode) .pet-select-card {
  background: #222727;
  border-color: #384242;
}

.pet-select-card:hover {
  transform: translateY(-3px);
  border-color: #70a1ff;
  box-shadow: 0 4px 12px rgba(112, 161, 255, 0.2);
}

.pet-select-card.is-selected {
  border-color: #ffa502 !important;
  background: #fffdf5;
  box-shadow: 0 0 0 3px rgba(255, 165, 2, 0.25), 0 4px 12px rgba(255, 165, 2, 0.2);
}

body:not(.light-mode) .pet-select-card.is-selected {
  background: #2a3028;
  border-color: #ffa502 !important;
  box-shadow: 0 0 0 3px rgba(255, 165, 2, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.pet-select-thumb {
  width: 70px;
  height: 70px;
  margin-bottom: 0.5rem;
}

.pet-select-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #2f3542;
  margin-bottom: 0.15rem;
}

body:not(.light-mode) .pet-select-name {
  color: #ffffff;
}

.pet-select-thai {
  font-family: "Sarabun", "Thonburi", "Tahoma", sans-serif;
  font-size: 0.78rem;
  color: #747d8c;
}

body:not(.light-mode) .pet-select-thai {
  color: #a4b0be;
}

/* ==========================================================================
   6. Mobile Responsiveness
   ========================================================================== */
@media screen and (max-width: 1023px) {
  .pet-dashboard-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1rem 0.75rem;
  }

  .pet-speech-bubble {
    width: 100%;
  }

  .pet-speech-bubble::before,
  .pet-speech-bubble::after {
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent #e0e0e0 transparent;
  }

  .pet-speech-bubble::after {
    top: -7px;
    border-width: 0 7px 7px 7px;
    border-color: transparent transparent #ffffff transparent;
  }

  body:not(.light-mode) .pet-speech-bubble::before {
    border-color: transparent transparent #3e4848 transparent;
  }

  body:not(.light-mode) .pet-speech-bubble::after {
    border-color: transparent transparent #2a3131 transparent;
  }

  .pet-actions-panel {
    width: 100%;
    align-items: center;
  }

  .pet-header-row {
    justify-content: center;
    gap: 0.5rem;
  }

  /* Center Word of the Day title and content on mobile/tablet viewports */
  .pet-wotd-container {
    align-items: center;
    text-align: center;
  }

  .pet-wotd-header {
    justify-content: center;
  }

  .pet-wotd-popup {
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 90vw;
    max-width: 360px;
    min-width: 260px;
  }

  .pet-wotd-trigger:hover .pet-wotd-popup {
    transform: translateX(-50%) translateY(0);
  }

  .flashcard-pet-dock {
    width: 50px;
    height: 50px;
    right: 8px;
    bottom: 8px;
  }

  .flashcard-pet-dock .pet-avatar-wrapper {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }

  .flashcard-pet-mini-speech {
    bottom: 58px;
    font-size: 0.65rem;
  }
}

/* ==========================================================================
   7. Minimalist Companion Homepage Walker & Hint Popup
   ========================================================================== */
/* Minimalist Mode: Static Inline Companion Beside Milestones Title */
.milestones-val-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pet-minimalist-inline {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 15;
}

.pet-minimalist-inline:hover {
  transform: translateY(-50%) scale(1.15);
}

.pet-minimalist-inline-svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
  display: block;
  transform-origin: bottom center;
}

/* Floating Hint Tooltip */
.pet-minimalist-hint {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform-origin: 50% 100%;
  transform: translateX(-50%) translateY(8px);
  background: #ffffff;
  color: #2f3542;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0.65rem 0.95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
  z-index: 40;
  text-align: left;
}

body:not(.light-mode) .pet-minimalist-hint {
  background: #232a2a;
  color: #f1f2f6;
  border-color: #3e4848;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.pet-minimalist-hint::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

body:not(.light-mode) .pet-minimalist-hint::after {
  border-color: #232a2a transparent transparent transparent;
}

.pet-minimalist-inline:hover .pet-minimalist-hint,
.pet-minimalist-inline.show-hint .pet-minimalist-hint {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Minimalist Pet Inline Jump/Bobbing Animation (Similar to Flashcards Pet) */
.pet-minimalist-inline.pet-bounce-anim .pet-minimalist-inline-svg,
.pet-minimalist-inline-svg.pet-bounce-anim {
  animation: pet-minimalist-jump 0.75s ease-in-out !important;
}

@keyframes pet-minimalist-jump {
  0% {
    transform: scale(1) translateY(0);
  }
  20% {
    transform: scale(1.18, 0.82) translateY(2px);
  }
  40% {
    transform: scale(0.9, 1.15) translateY(-9px);
  }
  60% {
    transform: scale(1.08, 0.94) translateY(-3px);
  }
  80% {
    transform: scale(0.97, 1.03) translateY(-1px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

/* Minimalist Popup Tooltip Wobble Animation */
.pet-minimalist-hint.hint-wobble {
  animation: hint-wobble 0.75s ease-in-out !important;
}

@keyframes hint-wobble {
  0% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
  18% {
    transform: translateX(-50%) translateY(-3px) rotate(-4deg) scale(1.04);
  }
  36% {
    transform: translateX(-50%) translateY(0) rotate(3deg) scale(1.02);
  }
  54% {
    transform: translateX(-50%) translateY(-2px) rotate(-2deg) scale(1.01);
  }
  72% {
    transform: translateX(-50%) translateY(0) rotate(1deg);
  }
  90% {
    transform: translateX(-50%) translateY(-1px) rotate(-0.5deg);
  }
  100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
}

.pet-hint-title {
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pet-hint-title strong {
  color: #2d3436;
}

body:not(.light-mode) .pet-minimalist-hint,
body:not(.light-mode) .pet-minimalist-hint strong,
body:not(.light-mode) .pet-hint-title,
body:not(.light-mode) .pet-hint-title strong {
  color: #f1f2f6 !important;
}

.pet-hint-stats {
  font-size: 0.76rem;
  color: #57606f;
  margin-bottom: 0.35rem;
}

body:not(.light-mode) .pet-hint-stats {
  color: #ced6e0;
}

.pet-hint-action {
  font-size: 0.72rem;
  font-weight: 600;
  color: #3742fa;
  text-decoration: none;
  cursor: pointer;
  display: block;
  transition: color 0.15s ease;
}

.pet-hint-action:hover {
  text-decoration: underline;
  color: #2f3542;
}

body:not(.light-mode) .pet-hint-action {
  color: #70a1ff;
}

body:not(.light-mode) .pet-hint-action:hover {
  color: #a4b0be;
}

/* ==========================================================================
   Word of the Day Display & Floating Hover Card
   ========================================================================== */
.pet-wotd-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.pet-wotd-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ff9f43;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pet-wotd-trigger {
  position: relative;
  display: inline-block;
  cursor: help;
  padding-bottom: 2px;
  border-bottom: 1.5px dashed #ff9f43;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.pet-wotd-trigger:hover {
  color: #ff9f43;
  border-bottom-color: #f39c12;
}

.pet-wotd-text-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline;
}

.pet-wotd-text-link:hover .pet-wotd-en {
  text-decoration: underline;
}

.pet-wotd-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: #2f3542;
}

body:not(.light-mode) .pet-wotd-text {
  color: #f1f2f6;
}

.pet-wotd-thai {
  font-weight: 700;
  color: #00d2d3;
}

.pet-wotd-translit {
  font-style: italic;
  color: #8395a7;
  font-weight: 400;
}

/* Floating Hover Card for Word of the Day Examples & Notes */
.pet-wotd-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 300px;
  max-width: 480px;
  max-height: 340px;
  overflow-y: auto;
  background: #ffffff;
  color: #2f3542;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  font-size: 0.82rem;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 100;
  white-space: normal;
}

body:not(.light-mode) .pet-wotd-popup {
  background: #1e2525;
  color: #f1f2f6;
  border-color: #3b4646;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.pet-wotd-trigger:hover .pet-wotd-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.pet-wotd-popup-section {
  margin-bottom: 0.75rem;
}

.pet-wotd-popup-section:last-child {
  margin-bottom: 0;
}

.pet-wotd-popup-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ff9f43;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pet-wotd-example-item {
  padding: 0.45rem 0.6rem;
  background: rgba(0, 0, 0, 0.03);
  border-left: 3px solid #ff9f43;
  border-radius: 4px;
  margin-bottom: 0.45rem;
}

body:not(.light-mode) .pet-wotd-example-item {
  background: rgba(255, 255, 255, 0.05);
}

/* Example sentences line order: Line 1 English, Line 2 Thai, Line 3 Transliteration */
.pet-wotd-ex-en {
  font-size: 0.92rem;
  font-weight: 600;
  color: #2f3542;
  margin-bottom: 0.15rem;
}

body:not(.light-mode) .pet-wotd-ex-en {
  color: #f1f2f6;
}

.pet-wotd-ex-thai {
  font-family: "Sarabun", "Thonburi", "Tahoma", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1e90ff;
  margin-bottom: 0.15rem;
}

body:not(.light-mode) .pet-wotd-ex-thai {
  color: #70a1ff;
}

.pet-wotd-ex-translit {
  font-size: 0.86rem;
  color: #8395a7;
  font-style: italic;
  font-weight: 400;
  display: block;
}

body:not(.light-mode) .pet-wotd-ex-translit {
  color: #b2bec3;
}

.pet-wotd-note-item {
  padding: 0.45rem 0.65rem;
  background: rgba(254, 202, 87, 0.12);
  border-left: 3px solid #feca57;
  border-radius: 4px;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  color: #2f3542;
  white-space: pre-line;
  word-break: break-word;
}

body:not(.light-mode) .pet-wotd-note-item {
  background: rgba(254, 202, 87, 0.1);
  color: #f1f2f6;
}

.pet-wotd-empty {
  font-size: 0.78rem;
  color: #8395a7;
  font-style: italic;
}

/* ==========================================================================
   Completed Flashcard Session Pet & Goal Hover Card
   ========================================================================== */
.flashcard-completed-pet-dock {
  position: absolute;
  bottom: 8px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  pointer-events: auto;
}

.completed-pet-avatar-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.completed-pet-avatar-wrapper:hover {
  transform: scale(1.15);
}

.completed-pet-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
  display: block;
}

/* Speech bubble above pet's head when new award is achieved */
.completed-pet-award-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  white-space: nowrap;
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #856404;
  border: 1.5px solid #ffd32a;
  border-radius: 12px;
  padding: 0.55rem 0.95rem;
  font-size: 0.82rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  animation: pet-award-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), pet-award-pulse 1s ease-in-out infinite 0.4s;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 12;
}

.completed-pet-award-bubble.fade-out {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.completed-award-lead {
  font-size: 0.82rem;
  font-weight: 700;
}

.completed-award-title {
  font-size: 0.92rem;
  font-weight: 800;
  margin-top: 0.2rem;
  color: #2f3542;
}

body:not(.light-mode) .completed-award-title {
  color: #ffd32a;
}

.completed-pet-award-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 18px;
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #ffd32a transparent transparent transparent;
}

body:not(.light-mode) .completed-pet-award-bubble {
  background: linear-gradient(135deg, #2d2613, #3a3215);
  color: #ffd32a;
  border-color: #ffd32a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

body:not(.light-mode) .completed-pet-award-bubble::after {
  border-color: #ffd32a transparent transparent transparent;
}

@keyframes pet-award-pop {
  0% {
    transform: scale(0.6) translateY(10px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes pet-award-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

/* Hover popup showing 1 of the 3 active awards in progress */
.completed-pet-hover-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 250px;
  max-width: 320px;
  background: #ffffff;
  color: #2f3542;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 0.8rem;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
  z-index: 15;
  white-space: normal;
}

body:not(.light-mode) .completed-pet-hover-popup {
  background: #232a2a;
  color: #f1f2f6;
  border-color: #3e4848;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.completed-pet-hover-popup::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 18px;
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

body:not(.light-mode) .completed-pet-hover-popup::after {
  border-color: #232a2a transparent transparent transparent;
}

.completed-pet-avatar-wrapper:hover .completed-pet-hover-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.completed-goal-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ff9f43;
  margin-bottom: 0.25rem;
}

.completed-goal-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.completed-goal-desc {
  font-size: 0.74rem;
  color: #747d8c;
  margin-bottom: 0.45rem;
}

body:not(.light-mode) .completed-goal-desc {
  color: #a4b0be;
}

.completed-goal-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

body:not(.light-mode) .completed-goal-progress-bar {
  background: rgba(255, 255, 255, 0.12);
}

.completed-goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd32a, #ff9f43);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.completed-goal-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: #57606f;
}

body:not(.light-mode) .completed-goal-meta {
  color: #ced6e0;
}
