/**
 * ============================================================
 * INTERACTIVE FEATURES - Plate, Quiz, Chat Styles
 * Ma Yve Grill - Authentic Congolese Cuisine
 * ============================================================
 *
 * TABLE OF CONTENTS:
 * 1. Build Your Plate
 * 2. Spice Master Quiz
 * 3. Marie Chatbot
 * ============================================================
 */

/* ============================================================
   1. BUILD YOUR PLATE
   ============================================================ */

.plate-builder {
  position: relative;
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  overflow: hidden;
}

/* --- Shifting Background Blobs --- */
.plate-builder__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.plate-builder__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.08;
  will-change: transform;
}

.plate-builder__blob--1 {
  width: 500px;
  height: 500px;
  background: var(--terracotta);
  top: -10%;
  left: -10%;
  animation: blob-shift-1 20s ease-in-out infinite alternate;
}

.plate-builder__blob--2 {
  width: 400px;
  height: 400px;
  background: var(--gold);
  bottom: -10%;
  right: -10%;
  animation: blob-shift-2 25s ease-in-out infinite alternate;
}

.plate-builder__blob--3 {
  width: 350px;
  height: 350px;
  background: var(--forest);
  top: 50%;
  left: 50%;
  animation: blob-shift-3 18s ease-in-out infinite alternate;
}

/* --- Plate Container --- */
.plate-container {
  position: relative;
  width: min(500px, 80vw);
  height: min(500px, 80vw);
  z-index: 2;
}

/* --- Central Plate --- */
.plate {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, var(--cream) 0%, var(--warm-sand) 55%, var(--terracotta) 75%, var(--cream) 100%);
  box-shadow:
    0 20px 60px rgba(26, 26, 26, 0.15),
    0 4px 12px rgba(26, 26, 26, 0.08),
    inset 0 -8px 24px rgba(192, 64, 0, 0.08),
    inset 0 4px 12px rgba(255, 255, 255, 0.6);
}

.plate::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid rgba(192, 64, 0, 0.1);
}

.plate::after {
  content: '';
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: var(--cream);
  box-shadow:
    inset 0 4px 12px rgba(26, 26, 26, 0.05),
    0 2px 8px rgba(255, 255, 255, 0.8);
}

/* --- Inner Rim Highlight --- */
.plate__highlight {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 2px solid rgba(255, 179, 71, 0.2);
  pointer-events: none;
}

/* --- Fork (Left) --- */
.utensil-fork {
  position: absolute;
  left: -80px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 200px;
  background: linear-gradient(90deg,
    #C0C0C0 0%,
    #F0F0F0 20%,
    #E0E0E0 50%,
    #D0D0D0 80%,
    #B0B0B0 100%
  );
  border-radius: 4px 4px 15px 15px;
  box-shadow:
    2px 4px 12px rgba(0, 0, 0, 0.15),
    inset -2px 0 4px rgba(255, 255, 255, 0.5);
}

.utensil-fork::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 50px;
  background: linear-gradient(90deg, #C0C0C0, #F0F0F0, #C0C0C0);
  border-radius: 2px 2px 0 0;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.utensil-fork::after {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 20px;
  background: repeating-linear-gradient(90deg,
    #C0C0C0 0px, #C0C0C0 4px,
    transparent 4px, transparent 7px,
    #C0C0C0 7px, #C0C0C0 11px,
    transparent 11px, transparent 14px,
    #C0C0C0 14px, #C0C0C0 18px
  );
  border-radius: 8px 8px 0 0;
}

/* --- Knife (Right) --- */
.utensil-knife {
  position: absolute;
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 200px;
  background: linear-gradient(90deg,
    #B0B0B0 0%,
    #D8D8D8 30%,
    #F0F0F0 50%,
    #D8D8D8 70%,
    #A8A8A8 100%
  );
  border-radius: 4px 4px 15px 15px;
  box-shadow:
    -2px 4px 12px rgba(0, 0, 0, 0.15),
    inset 2px 0 4px rgba(255, 255, 255, 0.5);
}

.utensil-knife::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 70px;
  background: linear-gradient(90deg,
    #D0D0D0 0%,
    #F8F8F8 40%,
    #E8E8E8 100%
  );
  border-radius: 2px 2px 10px 10px;
  box-shadow: inset 1px 0 4px rgba(255, 255, 255, 0.8);
}

/* --- Ingredient Orbit Buttons --- */
.plate-ingredients {
  position: absolute;
  inset: -60px;
  z-index: 10;
}

.ingredient-btn {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--font-label);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--white);
  border: 2px solid;
  cursor: pointer;
  transition: all var(--transition-bounce);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.ingredient-btn__code {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.ingredient-btn__name {
  font-size: 0.55rem;
  opacity: 0.7;
}

/* --- Ingredient Positions (8 around the plate) --- */
.ingredient-btn:nth-child(1) { top: 0; left: 50%; transform: translate(-50%, -50%); }
.ingredient-btn:nth-child(2) { top: 15%; right: 0; transform: translate(50%, -50%); }
.ingredient-btn:nth-child(3) { top: 50%; right: 0; transform: translate(50%, -50%); }
.ingredient-btn:nth-child(4) { bottom: 15%; right: 0; transform: translate(50%, 50%); }
.ingredient-btn:nth-child(5) { bottom: 0; left: 50%; transform: translate(-50%, 50%); }
.ingredient-btn:nth-child(6) { bottom: 15%; left: 0; transform: translate(-50%, 50%); }
.ingredient-btn:nth-child(7) { top: 50%; left: 0; transform: translate(-50%, -50%); }
.ingredient-btn:nth-child(8) { top: 15%; left: 0; transform: translate(-50%, -50%); }

/* --- Ingredient Colors --- */
.ingredient-btn--chicken {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.ingredient-btn--fish {
  border-color: #4682B4;
  color: #4682B4;
}

.ingredient-btn--fufu {
  border-color: var(--warm-sand-dark);
  color: #8B7355;
}

.ingredient-btn--plantain {
  border-color: var(--gold-dark);
  color: var(--gold-dark);
}

.ingredient-btn--moambe {
  border-color: #8B0000;
  color: #8B0000;
}

.ingredient-btn--rice {
  border-color: #C0C0C0;
  color: #808080;
}

.ingredient-btn--fumbwa {
  border-color: var(--forest);
  color: var(--forest);
}

.ingredient-btn--drink {
  border-color: #6B3FA0;
  color: #6B3FA0;
}

/* --- Selected State --- */
.ingredient-btn.is-selected {
  transform: translate(-50%, -50%) scale(1.15);
  color: var(--white) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: ingredient-pulse 2s ease-in-out infinite;
}

.ingredient-btn--chicken.is-selected { background: var(--terracotta); border-color: var(--terracotta); }
.ingredient-btn--fish.is-selected { background: #4682B4; border-color: #4682B4; }
.ingredient-btn--fufu.is-selected { background: var(--warm-sand-dark); border-color: var(--warm-sand-dark); }
.ingredient-btn--plantain.is-selected { background: var(--gold-dark); border-color: var(--gold-dark); }
.ingredient-btn--moambe.is-selected { background: #8B0000; border-color: #8B0000; }
.ingredient-btn--rice.is-selected { background: #A0A0A0; border-color: #A0A0A0; }
.ingredient-btn--fumbwa.is-selected { background: var(--forest); border-color: var(--forest); }
.ingredient-btn--drink.is-selected { background: #6B3FA0; border-color: #6B3FA0; }

@keyframes ingredient-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 139, 34, 0.3);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(34, 139, 34, 0);
  }
}

/* --- Ingredient Name on Plate --- */
.plate__selection {
  position: absolute;
  inset: 20%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  z-index: 5;
  pointer-events: none;
}

.plate__selection-item {
  font-family: var(--font-headline);
  font-size: var(--text-lg);
  color: var(--terracotta);
  opacity: 0;
  transform: scale(0.5);
  animation: ingredient-bounce 0.5s var(--transition-bounce) forwards;
}

@keyframes ingredient-bounce {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(10px);
  }
  60% {
    opacity: 1;
    transform: scale(1.1) translateY(-3px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --- Price Display --- */
.plate__price {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-headline);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--terracotta);
  white-space: nowrap;
}

.plate__price-label {
  font-size: var(--text-sm);
  color: var(--charcoal-light);
  font-weight: 400;
}

/* --- Plate Controls --- */
.plate-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: 80px;
  z-index: 2;
}

.plate-reset-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--warm-sand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.plate-reset-btn:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
  transform: rotate(-90deg);
}

.plate-reset-btn.is-spinning {
  animation: spin-360 0.6s ease-in-out;
}

@keyframes spin-360 {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

.plate-order-btn {
  padding: 1rem 3rem;
  background: var(--terracotta);
  color: var(--white);
  font-family: var(--font-label);
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-terracotta);
}

.plate-order-btn:hover {
  background: var(--terracotta-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(192, 64, 0, 0.35);
}

.plate-order-btn:active {
  transform: translateY(0);
}

.plate-order-btn:disabled {
  background: var(--warm-sand-dark);
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================================
   2. SPICE MASTER QUIZ
   ============================================================ */

/* --- Floating Button --- */
.quiz-trigger {
  position: fixed;
  bottom: 100px;
  right: var(--space-md);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.quiz-trigger__btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--terracotta) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 32px rgba(192, 64, 0, 0.3),
    0 4px 12px rgba(255, 179, 71, 0.2);
  cursor: pointer;
  transition: all var(--transition-bounce);
  position: relative;
  border: 3px solid var(--white);
}

.quiz-trigger__btn:hover {
  transform: scale(1.1);
  box-shadow:
    0 12px 40px rgba(192, 64, 0, 0.4),
    0 6px 16px rgba(255, 179, 71, 0.3);
}

.quiz-trigger__btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: quiz-ring-pulse 2s ease-out infinite;
}

.quiz-trigger__icon {
  font-size: 2rem;
  line-height: 1;
}

.quiz-trigger__label {
  font-family: var(--font-headline);
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 700;
  color: var(--terracotta);
  background: var(--white);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  animation: quiz-label-bounce 2s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes quiz-ring-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@keyframes quiz-label-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* --- Quiz Modal Overlay --- */
.quiz-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: var(--space-md);
}

.quiz-modal.is-open {
  opacity: 1;
  pointer-events: all;
}

/* --- Quiz Container --- */
.quiz-container {
  width: 100%;
  max-width: 640px;
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-bounce);
}

.quiz-modal.is-open .quiz-container {
  transform: scale(1) translateY(0);
}

/* --- Quiz Header --- */
.quiz-header {
  background: var(--charcoal);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-header__title {
  font-family: var(--font-headline);
  font-size: var(--text-xl);
  color: var(--gold);
  font-style: italic;
}

.quiz-header__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-70);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.quiz-header__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

/* --- Quiz Progress --- */
.quiz-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: var(--space-md) var(--space-lg) 0;
}

.quiz-progress__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warm-sand-dark);
  transition: all var(--transition-normal);
}

.quiz-progress__dot.is-active {
  background: var(--terracotta);
  transform: scale(1.2);
}

.quiz-progress__dot.is-completed {
  background: var(--gold);
}

/* --- Quiz Question --- */
.quiz-question {
  padding: var(--space-lg);
  text-align: center;
}

.quiz-question__number {
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold-dark);
  margin-bottom: var(--space-md);
}

.quiz-question__text {
  font-family: var(--font-headline);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.2;
  margin-bottom: var(--space-lg);
}

/* --- Quiz Answers --- */
.quiz-answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  padding: 0 var(--space-lg) var(--space-lg);
}

.quiz-answer {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.quiz-answer:hover {
  border-color: var(--gold);
  background: var(--white);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.quiz-answer__badge {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--terracotta);
  color: var(--white);
  font-family: var(--font-label);
  font-size: var(--text-lg);
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.quiz-answer:hover .quiz-answer__badge {
  background: var(--gold);
  color: var(--charcoal);
}

.quiz-answer__text {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--charcoal);
  line-height: 1.4;
}

/* --- Answer States --- */
.quiz-answer.is-correct {
  border-color: var(--forest);
  background: var(--success-light);
  animation: answer-correct 0.4s ease;
}

.quiz-answer.is-correct .quiz-answer__badge {
  background: var(--forest);
  color: var(--white);
}

.quiz-answer.is-wrong {
  border-color: var(--error);
  background: var(--error-light);
  animation: answer-shake 0.4s ease;
}

.quiz-answer.is-wrong .quiz-answer__badge {
  background: var(--error);
  color: var(--white);
}

.quiz-answer.is-disabled {
  pointer-events: none;
  opacity: 0.5;
}

@keyframes answer-correct {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes answer-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* --- Quiz Result --- */
.quiz-result {
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
}

.quiz-result__title {
  font-family: var(--font-headline);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: var(--space-md);
}

.quiz-result__score-box {
  display: inline-block;
  padding: var(--space-lg) var(--space-xl);
  background: var(--charcoal);
  border: 2px dashed var(--gold);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.quiz-result__score {
  font-family: var(--font-headline);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.quiz-result__score-label {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--white-70);
  margin-top: var(--space-xs);
}

.quiz-result__code {
  font-family: var(--font-label);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--terracotta);
  padding: var(--space-sm) var(--space-lg);
  background: var(--gold-50);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  display: inline-block;
  margin-bottom: var(--space-md);
}

.quiz-result__message {
  font-size: var(--text-lg);
  color: var(--charcoal-light);
  margin-bottom: var(--space-lg);
}

.quiz-result__cta {
  display: inline-flex;
}

/* ============================================================
   3. MARIE CHATBOT
   ============================================================ */

/* --- Chat Trigger --- */
.chat-trigger {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
}

.chat-trigger__tooltip {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--charcoal);
  background: var(--white);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  animation: chat-tooltip-bounce 3s ease-in-out infinite;
  position: relative;
}

.chat-trigger__tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: var(--white);
  transform: rotate(45deg);
}

@keyframes chat-tooltip-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.chat-trigger__btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 16px rgba(255, 179, 71, 0.3),
    0 0 0 0 rgba(255, 179, 71, 0);
  cursor: pointer;
  transition: all var(--transition-bounce);
  position: relative;
  animation: chat-glow 3s ease-in-out infinite;
}

.chat-trigger__btn:hover {
  transform: scale(1.1);
  box-shadow:
    0 6px 24px rgba(255, 179, 71, 0.4),
    0 0 0 8px rgba(255, 179, 71, 0.1);
}

@keyframes chat-glow {
  0%, 100% {
    box-shadow:
      0 4px 16px rgba(255, 179, 71, 0.3),
      0 0 0 0 rgba(255, 179, 71, 0);
  }
  50% {
    box-shadow:
      0 4px 16px rgba(255, 179, 71, 0.3),
      0 0 0 10px rgba(255, 179, 71, 0);
  }
}

.chat-trigger__pulse {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: var(--forest);
  border-radius: 50%;
  border: 2px solid var(--white);
  animation: chat-pulse 2s ease-in-out infinite;
}

@keyframes chat-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 139, 34, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 139, 34, 0);
  }
}

/* --- Chat Window --- */
.chat-window {
  position: fixed;
  bottom: 90px;
  right: var(--space-md);
  width: min(400px, calc(100vw - var(--space-lg)));
  height: min(600px, calc(100vh - 140px));
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-bounce);
}

.chat-window.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* --- Chat Header --- */
.chat-header {
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header__profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chat-header__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-size: var(--text-lg);
  color: var(--charcoal);
  font-weight: 700;
  position: relative;
}

.chat-header__status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: var(--forest);
  border-radius: 50%;
  border: 2px solid var(--gold);
}

.chat-header__info {
  display: flex;
  flex-direction: column;
}

.chat-header__name {
  font-family: var(--font-headline);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--white);
}

.chat-header__status-text {
  font-family: var(--font-label);
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header__status-text::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #4ADE80;
  border-radius: 50%;
}

.chat-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.chat-header__lang-btn {
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--white);
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.chat-header__lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.chat-header__lang-btn.is-active {
  background: var(--white);
  color: var(--terracotta);
  border-color: var(--white);
}

.chat-header__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-70);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.chat-header__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

/* --- Chat Messages --- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--cream);
  scrollbar-width: thin;
  scrollbar-color: var(--warm-sand-dark) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--warm-sand-dark);
  border-radius: var(--radius-full);
}

/* --- Message Bubbles --- */
.chat-message {
  display: flex;
  gap: var(--space-xs);
  max-width: 85%;
  animation: message-appear 0.3s ease forwards;
}

@keyframes message-appear {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message--marie {
  align-self: flex-start;
}

.chat-message__bubble {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  position: relative;
}

.chat-message--user .chat-message__bubble {
  background: var(--warm-sand);
  color: var(--charcoal);
  border-bottom-right-radius: 4px;
}

.chat-message--marie .chat-message__bubble {
  background: var(--white);
  color: var(--charcoal);
  border-left: 3px solid var(--gold);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.chat-message__time {
  font-size: 0.65rem;
  color: rgba(26, 26, 26, 0.4);
  margin-top: 4px;
  text-align: right;
}

/* --- Typing Indicator --- */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
  background: var(--white);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--gold);
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
}

.chat-typing__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm-sand-dark);
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.chat-typing__dot:nth-child(1) { animation-delay: 0s; }
.chat-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}

/* --- Quick Reply Buttons --- */
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 var(--space-md);
  margin-bottom: var(--space-sm);
}

.quick-reply-btn {
  padding: 8px 16px;
  border: 1px solid var(--terracotta);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--terracotta);
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-reply-btn:hover {
  background: var(--terracotta);
  color: var(--white);
}

/* --- WhatsApp Button --- */
.chat-whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  margin: 0 var(--space-md) var(--space-sm);
  background: #25D366;
  color: var(--white);
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat-whatsapp-btn:hover {
  background: #128C7E;
  transform: translateY(-1px);
}

/* --- Chat Input --- */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--white);
  border-top: 1px solid var(--warm-sand);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--cream);
  border: 1px solid var(--warm-sand-dark);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--charcoal);
  transition: all var(--transition-fast);
}

.chat-input::placeholder {
  color: rgba(26, 26, 26, 0.4);
}

.chat-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.15);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.chat-send-btn:hover {
  background: var(--terracotta-dark);
  transform: scale(1.05);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

.chat-send-btn:disabled {
  background: var(--warm-sand-dark);
  cursor: not-allowed;
}

/* ============================================================
   SHARED ANIMATIONS
   ============================================================ */

@keyframes blob-shift-1 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(80px, 60px); }
}

@keyframes blob-shift-2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-60px, -40px); }
}

@keyframes blob-shift-3 {
  0% { transform: translate(-50%, -50%); }
  100% { transform: translate(calc(-50% + 40px), calc(-50% - 30px)); }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .quiz-trigger__btn::before {
    animation: none;
    opacity: 0.3;
  }

  .quiz-trigger__label,
  .chat-trigger__tooltip,
  .chat-trigger__btn,
  .chat-trigger__pulse,
  .ingredient-btn.is-selected {
    animation: none;
  }

  .plate-builder__blob {
    animation: none;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
  .plate-container {
    width: min(350px, 75vw);
    height: min(350px, 75vw);
  }

  .plate-ingredients {
    inset: -40px;
  }

  .ingredient-btn {
    width: 52px;
    height: 52px;
    font-size: 0.55rem;
  }

  .ingredient-btn__code {
    font-size: 0.7rem;
  }

  .utensil-fork,
  .utensil-knife {
    display: none;
  }

  .quiz-trigger {
    bottom: 80px;
    right: var(--space-sm);
  }

  .quiz-trigger__btn {
    width: 64px;
    height: 64px;
  }

  .chat-window {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: calc(100vh - 80px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .chat-trigger {
    right: var(--space-sm);
    bottom: var(--space-sm);
  }

  .quiz-container {
    max-height: calc(100vh - var(--space-lg));
    overflow-y: auto;
  }
}
