/* Writing Lab — lesson play screen */
.wl-lesson {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.wl-lesson__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.wl-lesson__meta {
  flex: 1;
  min-width: 0;
}

.wl-lesson__section {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wl-lesson__title {
  font-size: 1.1rem;
  margin: 0;
  font-family: 'Baloo 2', cursive;
  color: var(--wl-ink, var(--dk-ink));
}

.wl-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}

.wl-lesson__preview {
  text-align: center;
  padding: 8px;
}

.wl-glyph {
  font-size: clamp(2.5rem, 12vw, 4rem);
  font-weight: 800;
  line-height: 1;
  display: block;
  color: var(--wl-ink, var(--dk-ink));
  animation: wl-glyph-pop 0.5s ease;
}

@keyframes wl-glyph-pop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.wl-stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: min(55vh, 400px);
  background: var(--wl-playfield-bg, #fff);
  border-radius: var(--wl-radius, 16px);
  box-shadow: inset 0 0 0 2px var(--wl-border, rgba(20, 33, 61, 0.12)), var(--wl-shadow);
  overflow: hidden;
}

/* Ink canvas below; dotted SVG guides on top (always visible) */
.wl-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  background: transparent !important;
  -webkit-user-select: none;
  user-select: none;
}

.wl-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#wlGuideGroup circle {
  fill: #334155;
  opacity: 1;
}

.wl-progress {
  height: 10px;
  background: var(--wl-border, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.wl-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wl-primary, #2f7dff), var(--wl-success, #22c55e));
  border-radius: 999px;
  transition: width 0.2s ease;
}

.wl-progress__label {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--wl-ink-muted, var(--dk-text-72));
}

.wl-tools,
.wl-lesson__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.wl-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

html[data-dk-theme='dark'] .wl-modal {
  background: rgba(0, 0, 0, 0.55);
}

.wl-modal[hidden] {
  display: none;
}

.wl-modal__card {
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  max-width: 320px;
  box-shadow: var(--dk-shadow-2, 0 22px 60px rgba(15, 23, 42, 0.14));
}

.wl-stars {
  font-size: 2rem;
  color: var(--wl-accent, #fbbf24);
  letter-spacing: 4px;
}

.wl-modal__title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.4rem;
  margin: 12px 0 8px;
}

.wl-modal__hint {
  font-size: 0.85rem;
  color: var(--wl-ink-muted, #64748b);
  margin: 0 0 12px;
}

.wl-modal__card--wide {
  max-width: 400px;
}

.wl-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.wl-lesson__preview .wl-glyph {
  pointer-events: none;
}

.wl-confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
}

.wl-confetti__piece {
  position: absolute;
  top: 40%;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: wl-confetti-fall 1s ease-out forwards;
}

@keyframes wl-confetti-fall {
  to {
    transform: translateY(120px) rotate(360deg);
    opacity: 0;
  }
}
