/* Bandes Dessinées — Animated French Comics */

.comics-hero {
  background: linear-gradient(135deg, #fff 0%, #fef3d8 50%, #e8f2fa 100%);
  border: 2px solid rgba(201, 146, 10, 0.2);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.comics-hero h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.comics-hero p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0;
}

.comics-grid {
  display: grid;
  gap: 0.85rem;
}

.comic-cover {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  font-family: var(--font);
  color: var(--text);
  animation: comicCoverIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.comic-cover:hover {
  transform: translateY(-3px) rotate(-0.3deg);
  box-shadow: var(--shadow-lg);
  border-color: rgba(201, 146, 10, 0.35);
}

@keyframes comicCoverIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.comic-cover-art {
  width: 96px;
  min-height: 96px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.comic-cover-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(255, 255, 255, 0.08) 6px,
    rgba(255, 255, 255, 0.08) 12px
  );
}

.comic-cover-emoji {
  font-size: 2.5rem;
  z-index: 1;
  animation: comicFloat 3s ease-in-out infinite;
}

@keyframes comicFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}

.comic-cover-body {
  flex: 1;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.comic-cover-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.comic-cover-top strong {
  font-size: 0.95rem;
}

.comic-level-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--gold-light);
  color: #8a5f00;
}

.comic-done-badge {
  background: var(--success-bg);
  color: var(--success);
}

.comic-cover-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.comic-cover-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ─── Comic Reader ─── */
.comic-reader {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comic-reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.comic-reader-title {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.3;
}

.comic-panel-counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.comic-stage {
  position: relative;
  border: 4px solid #1c2a3a;
  border-radius: 12px;
  min-height: 320px;
  overflow: hidden;
  box-shadow:
    4px 4px 0 rgba(28, 42, 58, 0.15),
    inset 0 0 0 3px #fff;
  animation: panelPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panelPop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.comic-scene {
  position: absolute;
  inset: 0;
}

.comic-scene-cafe {
  background: linear-gradient(180deg, #87ceeb 0%, #f5e6d3 55%, #8b6914 55%, #6b4f10 100%);
}

.comic-scene-street {
  background: linear-gradient(180deg, #6eb5ff 0%, #c8e6ff 40%, #9ca3af 40%, #6b7280 100%);
}

.comic-scene-metro {
  background: linear-gradient(180deg, #1e3a5f 0%, #2d4a6f 50%, #4a5568 50%, #2d3748 100%);
}

.comic-scene-shop {
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 30%, #f5f0e8 30%, #e8dfd0 100%);
}

.comic-scene-classroom {
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 45%, #d4c4a8 45%, #b8956a 100%);
}

.comic-scene-campus {
  background: linear-gradient(180deg, #86efac 0%, #bbf7d0 35%, #78716c 35%, #57534e 100%);
}

.comic-scene-office {
  background: linear-gradient(180deg, #e2e8f0 0%, #f8fafc 40%, #94a3b8 40%, #64748b 100%);
}

.comic-scene-hospital {
  background: linear-gradient(180deg, #ccfbf1 0%, #f0fdfa 45%, #e2e8f0 45%, #cbd5e1 100%);
}

.comic-scene-immigration {
  background: linear-gradient(180deg, #1a5f9e 0%, #3b82f6 25%, #f5f0e8 25%, #d6d3d1 100%);
}

.comic-scene-home {
  background: linear-gradient(180deg, #fde68a 0%, #fef3c7 50%, #d4a574 50%, #a67c52 100%);
}

.comic-narration {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: #1c2a3a;
  color: #fef3c7;
  font-size: 0.72rem;
  font-weight: 600;
  font-style: italic;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  max-width: 90%;
  text-align: center;
  animation: narrationSlide 0.5s ease 0.2s both;
}

@keyframes narrationSlide {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.comic-characters {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 1rem;
  z-index: 2;
  pointer-events: none;
}

.comic-character {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.comic-character.left { align-self: flex-end; }
.comic-character.right { align-self: flex-end; }

.comic-char-emoji {
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, 0.15));
  transform-origin: bottom center;
}

.comic-char-name {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.comic-pose-enter .comic-char-emoji { animation: charEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.comic-pose-wave .comic-char-emoji { animation: charWave 1.2s ease-in-out infinite; }
.comic-pose-talk .comic-char-emoji { animation: charTalk 0.5s ease-in-out infinite; }
.comic-pose-listen .comic-char-emoji { animation: charListen 2s ease-in-out infinite; }
.comic-pose-think .comic-char-emoji { animation: charThink 1.5s ease-in-out infinite; }
.comic-pose-happy .comic-char-emoji { animation: charHappy 0.8s ease-in-out infinite; }
.comic-pose-worry .comic-char-emoji { animation: charWorry 1s ease-in-out infinite; }
.comic-pose-point .comic-char-emoji { animation: charPoint 1s ease-in-out infinite; }
.comic-pose-stand .comic-char-emoji { animation: charStand 3s ease-in-out infinite; }

@keyframes charEnter {
  from { opacity: 0; transform: translateX(-30px) scale(0.5); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes charWave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(12deg); }
  75% { transform: rotate(-8deg); }
}

@keyframes charTalk {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06) translateY(-2px); }
}

@keyframes charListen {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.97); }
}

@keyframes charThink {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-5deg) translateY(-3px); }
}

@keyframes charHappy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes charWorry {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@keyframes charPoint {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05) translateX(4px); }
}

@keyframes charStand {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.comic-bubbles {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 3.5rem 0.85rem 7.5rem;
  min-height: 320px;
}

.speech-bubble {
  position: relative;
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 16px;
  border: 2.5px solid #1c2a3a;
  background: #fff;
  box-shadow: 3px 3px 0 rgba(28, 42, 58, 0.12);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: bubblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.speech-bubble:nth-child(1) { animation-delay: 0.15s; }
.speech-bubble:nth-child(2) { animation-delay: 0.35s; }
.speech-bubble:nth-child(3) { animation-delay: 0.55s; }

@keyframes bubblePop {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.speech-bubble:hover {
  transform: scale(1.02);
  box-shadow: 4px 4px 0 rgba(28, 42, 58, 0.18);
}

.speech-bubble:active {
  transform: scale(0.98);
}

.speech-bubble.left {
  align-self: flex-start;
  margin-right: auto;
}

.speech-bubble.right {
  align-self: flex-end;
  margin-left: auto;
  background: #fef9c3;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.speech-bubble.left::after {
  left: 20px;
  border-top-color: #1c2a3a;
  border-bottom: none;
}

.speech-bubble.right::after {
  right: 20px;
  border-top-color: #1c2a3a;
  border-bottom: none;
}

.bubble-speaker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}

.bubble-fr {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.bubble-en {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.bubble-hi {
  display: block;
  font-size: 0.72rem;
  color: var(--accent-warm);
  margin-top: 0.2rem;
  font-style: italic;
}

.bubble-hear {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
}

.comic-vocab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.comic-vocab-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  animation: chipIn 0.4s ease both;
}

.comic-vocab-chip:nth-child(2) { animation-delay: 0.1s; }
.comic-vocab-chip:nth-child(3) { animation-delay: 0.2s; }

@keyframes chipIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.comic-vocab-chip strong {
  color: var(--french-blue);
  font-size: 0.82rem;
}

.comic-vocab-chip span {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.comic-nav-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.comic-nav-row .btn {
  flex: 1;
}

.comic-nav-row .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.comic-progress-dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.comic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}

.comic-dot.active {
  background: var(--gold);
  transform: scale(1.25);
}

.comic-dot.done {
  background: var(--success);
}

.comic-quiz-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  animation: panelPop 0.4s ease;
}

.comic-complete-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, #e6f5ed, #fef7e6);
  border: 2px solid rgba(26, 122, 76, 0.2);
  border-radius: var(--radius);
  animation: panelPop 0.5s ease;
}

.comic-complete-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: charHappy 1s ease-in-out infinite;
}

.comic-hint-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
}

.comic-hint-bar span:first-child {
  font-size: 1rem;
}

@media (max-width: 520px) {
  .comic-cover-art { width: 80px; min-height: 80px; }
  .comic-cover-emoji { font-size: 2rem; }
  .comic-char-emoji { font-size: 2.75rem; }
  .comic-stage { min-height: 280px; }
  .comic-bubbles { padding-bottom: 6.5rem; min-height: 280px; }
  .bubble-fr { font-size: 0.88rem; }
}