/* Coach Mode panel (on play page) */

.coach-panel {
  background: linear-gradient(180deg, #1a2530, #131b24);
  border: 1px solid rgba(212,168,67,0.25);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
  color: #e4e0d8;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.coach-panel.active { border-color: rgba(212,168,67,0.5); }

.coach-header { display: flex; align-items: center; gap: 12px; }
.coach-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, #e8c65a, #c9a84c);
  color: #1c1a16;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.coach-name { font-size: 13px; color: #d4a843; flex: 1; font-weight: 500; }
.coach-toggle { position: relative; cursor: pointer; }
.coach-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.coach-toggle-slider {
  display: inline-block;
  width: 38px; height: 22px;
  background: #2a3543;
  border-radius: 11px;
  position: relative;
  transition: background 0.15s ease;
}
.coach-toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.coach-toggle input:checked + .coach-toggle-slider { background: #c9a84c; }
.coach-toggle input:checked + .coach-toggle-slider::before { transform: translateX(16px); }

.coach-body {
  margin-top: 10px;
  min-height: 24px;
  max-height: 110px;
  overflow-y: auto;
}
.coach-line { font-size: 14px; line-height: 1.45; margin: 0 0 4px; color: #d8d4cc; }
.coach-intro { color: #94908a; font-style: italic; }
.coach-achievement {
  color: #e8c65a;
  font-weight: 500;
  background: rgba(212,168,67,0.08);
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid #c9a84c;
}

.coach-stats {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(212,168,67,0.15);
  font-size: 12px;
  color: #94908a;
}
.coach-stats strong { color: #d4a843; font-variant-numeric: tabular-nums; }

/* Mid-shoe quiz modal */
.coach-quiz-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  padding: 16px;
  animation: fadeIn 0.18s ease;
}
.coach-quiz-card {
  background: #131b24;
  border: 1px solid rgba(212,168,67,0.35);
  border-radius: 12px;
  padding: 28px;
  max-width: 460px;
  width: 100%;
  color: #e4e0d8;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.coach-quiz-tag {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: #d4a843; margin: 0 0 8px;
}
.coach-quiz-card h3 {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-size: 22px; font-weight: 500; margin: 0 0 20px;
  line-height: 1.3;
}
.coach-quiz-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.coach-quiz-options button {
  padding: 12px 16px;
  background: #1a2530;
  border: 1px solid #22303e;
  border-radius: 6px;
  color: #e4e0d8;
  text-align: left;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.coach-quiz-options button:hover { background: #22303e; border-color: #c9a84c; }
.coach-quiz-options button.correct { background: rgba(34,197,94,0.15); border-color: #22c55e; color: #86efac; }
.coach-quiz-options button.incorrect { background: rgba(232,64,64,0.15); border-color: #e84040; color: #fca5a5; }
.coach-quiz-options button:disabled { cursor: default; }
.coach-quiz-explain {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(212,168,67,0.08);
  border-left: 3px solid #c9a84c;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #d8d4cc;
}
.coach-quiz-close {
  margin-top: 16px;
  padding: 10px 18px;
  background: #c9a84c;
  color: #131b24;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
.coach-quiz-close:hover { background: #e8c65a; }

/* Achievement toast */
.coach-achievement-toast {
  position: fixed;
  top: 80px;
  right: 16px;
  background: linear-gradient(180deg, #1a2530, #0f1820);
  border: 1px solid #c9a84c;
  border-radius: 8px;
  padding: 12px 16px;
  color: #e4e0d8;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transform: translateX(110%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 998;
  max-width: 280px;
}
.coach-achievement-toast.show { transform: translateX(0); }
.coach-achievement-toast strong { color: #e8c65a; font-size: 14px; margin-bottom: 2px; }
.coach-achievement-toast span { font-size: 12px; color: #94908a; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Bea FAB widget ===== */

.bea-fab {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 990;
  background: linear-gradient(180deg, #e8c65a, #c9a84c);
  color: #1c1a16;
  border: 0;
  border-radius: 28px;
  padding: 10px 18px 10px 12px;
  display: flex; align-items: center; gap: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bea-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.35); }
.bea-fab-icon {
  width: 32px; height: 32px;
  background: #1c1a16;
  color: #e8c65a;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 18px;
}
.bea-fab-label { padding-right: 4px; }

.bea-panel {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 991;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border: 1px solid rgba(154,120,40,0.25);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.bea-panel.open { display: flex; }

.bea-panel-header {
  background: linear-gradient(180deg, #c9a84c, #a08838);
  color: #fff;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.bea-avatar {
  width: 36px; height: 36px;
  background: #1c1a16;
  color: #e8c65a;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  flex-shrink: 0;
}
.bea-id { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.bea-id strong { font-size: 14px; font-weight: 600; }
.bea-id span { font-size: 11px; opacity: 0.85; }
.bea-close { background: transparent; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px; }

.bea-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #faf8f4;
  display: flex; flex-direction: column; gap: 8px;
}
.bea-msg {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}
.bea-msg-bea {
  background: #fff;
  color: #1c1a16;
  border: 1px solid rgba(154,120,40,0.18);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.bea-msg-you {
  background: #c9a84c;
  color: #1c1a16;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.bea-thinking { display: inline-flex; gap: 3px; padding: 12px 14px; }
.bea-thinking span {
  width: 6px; height: 6px;
  background: #c9a84c;
  border-radius: 50%;
  animation: beaBlink 1.2s infinite ease-in-out;
}
.bea-thinking span:nth-child(2) { animation-delay: 0.2s; }
.bea-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes beaBlink {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

.bea-form {
  display: flex; gap: 6px;
  padding: 10px;
  border-top: 1px solid #ece8df;
  background: #fff;
}
.bea-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd6c5;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  background: #faf8f4;
}
.bea-form input:focus { border-color: #c9a84c; outline: 0; }
.bea-form button {
  width: 38px; height: 38px;
  background: #c9a84c;
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}
.bea-form button:hover { background: #a08838; }
.bea-foot { font-size: 11px; color: #6b6458; text-align: center; padding: 6px 10px; margin: 0; background: #fff; border-top: 1px solid #f3f0ea; }
.bea-foot a { color: #9a7828; text-decoration: none; }
.bea-foot a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .bea-panel { right: 8px; left: 8px; width: auto; bottom: 8px; height: 80vh; }
  .bea-fab { right: 12px; bottom: 12px; padding: 8px 14px 8px 8px; font-size: 13px; }
  .bea-fab-label { display: none; }
  .bea-fab-icon { width: 36px; height: 36px; }
  .coach-achievement-toast { right: 8px; left: 8px; max-width: none; }
}
