/* Interactive Drag-and-Drop Lesson Player & All 11 Renderer Styles */
.player-shell {
  max-width: 980px;
  margin: 0 auto;
}

.player-hud {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.progress-track {
  height: 16px;
  border-radius: var(--radius-pill);
  background: #e2e8f0;
  overflow: hidden;
  border: 1.5px solid #cbd5e1;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 100%);
  transition: width 0.35s var(--tactile-bounce);
}

.hud-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.stage-card {
  background: var(--bg-card);
  border: 3px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.exercise-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.exercise-prompt {
  margin: 4px 0 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.audio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: #f0f9ff;
  border: 2px solid #bae6fd;
}

/* Tactile Draggable Tiles */
.tile-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 68px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-tray);
  border: 2px dashed #93c5fd;
  margin-top: 16px;
}

.tile-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 58px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 2.5px solid #94a3b8;
  box-shadow: var(--shadow-tile);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.14s var(--tactile-bounce), border-color 0.14s ease, background 0.14s ease;
}

.tile-chip:hover {
  transform: translateY(-2px);
  border-color: var(--sky);
}

.tile-chip .tile-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tile-chip.is-selected {
  border-color: var(--violet);
  background: #f5f3ff;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}

.tile-chip.is-dragging {
  cursor: grabbing;
  opacity: 0.92;
  transform: scale(1.06) rotate(-1.5deg);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
  z-index: 200;
}

.tile-chip.is-used {
  opacity: 0.36;
  pointer-events: none;
}

/* Universal Drop Slots */
.drop-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 110px;
  min-height: 48px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 2.5px dashed #38bdf8;
  background: #f8fafc;
  font-weight: 800;
  color: var(--text-muted);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s var(--tactile-bounce);
}

.drop-slot.is-over {
  background: #e0f2fe;
  border-style: solid;
  border-color: var(--sky-dark);
  transform: scale(1.02);
}

.drop-slot.is-filled {
  border-style: solid;
  border-color: var(--sky);
  background: #ffffff;
  color: var(--text-main);
}

.drop-slot.is-correct {
  border-color: var(--emerald);
  background: #d1fae5;
  color: #065f46;
}

.drop-slot.is-wrong {
  border-color: var(--coral);
  background: #ffe4e6;
  color: #9f1239;
  animation: gentleShake 0.35s ease;
}

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

/* 1. Picture Match Grid */
.picture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px;
}

.picture-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #fffbeb;
  border: 2.5px solid #fde68a;
  text-align: center;
}

.picture-emoji {
  font-size: 3rem;
  line-height: 1;
}

/* 2 & 6. Sentence Rail */
.sentence-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 76px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 2.5px solid #cbd5e1;
  background: #ffffff;
}

/* 3. Category Sort Buckets */
.bucket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.sort-bucket {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 170px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 3px dashed #94a3b8;
  background: #ffffff;
}

.sort-bucket.is-over {
  background: #f0f9ff;
  border-style: solid;
}

.sort-bucket-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 4. Match Pairs Columns */
.match-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.match-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.match-left {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  font-weight: 800;
}

/* 5. Fill-in-Blank Flow */
.blank-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 1.12rem;
  line-height: 2;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 2px solid #e2e8f0;
}

/* 7. Tap & Hear Explore Cards */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.explore-card {
  cursor: pointer;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 2.5px solid #bae6fd;
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
  text-align: center;
  transition: transform 0.16s var(--tactile-bounce), border-color 0.16s ease;
}

.explore-card:hover {
  transform: translateY(-3px);
}

.explore-card.is-explored {
  border-color: var(--emerald);
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
}

/* 8. Split Reading Passage (IELTS / TOEIC / JLPT N1-N2) */
.reading-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.passage-pane {
  max-height: 410px;
  overflow-y: auto;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 2px solid #cbd5e1;
}

.passage-para {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border-left: 4px solid var(--sky);
}

.passage-para.is-evidence {
  background: #fef9c3;
  border-left-color: var(--sun-dark);
}

.slot-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reading-slot-card,
.architect-slot-card,
.listening-field-card {
  padding: 12px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 2px solid #cbd5e1;
}

/* 10. Error Spotter */
.error-sentence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 2px solid #cbd5e1;
}

.error-seg-btn {
  cursor: pointer;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid #cbd5e1;
  background: #ffffff;
}

.error-seg-btn.is-selected-seg {
  border-color: var(--coral);
  background: #ffe4e6;
}

/* Explanation Drawer & Action Footer */
.action-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.explanation-drawer {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 2.5px solid var(--sky);
  background: #f0f9ff;
}

.explanation-drawer.is-correct {
  border-color: var(--emerald);
  background: #ecfdf5;
}

.explanation-drawer.is-warning {
  border-color: var(--sun-dark);
  background: #fffbeb;
}

.explanation-drawer.is-wrong {
  border-color: var(--coral);
  background: #fff1f2;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

@media (max-width: 820px) {
  .reading-split {
    grid-template-columns: 1fr;
  }
  .match-row {
    grid-template-columns: 1fr;
  }
}

