/*    PULSING IMAGE PLACEHOLDER
══════════════════════════════════════════════════ */
.turn-image-painting {
  width: 100%;
  height: 140px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text3);
  font-size: 12px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ══════════════════════════════════════════════════
   IMAGE LIGHTBOX
══════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-inverse);
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.turn-image-wrap img { cursor: zoom-in; }

/* ══════════════════════════════════════════════════
   CUSTOM TOOLTIPS (#19)
══════════════════════════════════════════════════ */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2, #1a1a24);
  color: var(--text, #e2e2f0);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border, #2a2a3e);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: var(--z-skip-link);
  max-width: 220px;
  text-align: center;
}
[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--bg2, #1a1a24);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: var(--z-skip-link);
}
[data-tooltip]:hover::before,
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::before,
[data-tooltip]:focus-visible::after {
  opacity: 1;
}

/* Tooltip positioned below for elements near top of screen */
[data-tooltip-dir="down"]::before {
  bottom: auto;
  top: calc(100% + 6px);
}
[data-tooltip-dir="down"]::after {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: var(--bg2, #1a1a24);
}

/* ── Screen-reader only utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}

/* ══════════════════════════════════════════════════
   SKELETON SCREENS (#22)
══════════════════════════════════════════════════ */
@keyframes skeleton-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.skeleton {
  background: var(--bg3, #1e1e2a);
  border-radius: var(--radius, 8px);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
  height: 0.85em;
  border-radius: 4px;
  margin-bottom: 0.5em;
  background: var(--bg3, #1e1e2a);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-text.wide { width: 100%; }
.skeleton-text.med { width: 70%; }
.skeleton-text.short { width: 40%; }

.skeleton-card {
  background: var(--bg2, #16161d);
  border: 1px solid var(--border, #2a2a3e);
  border-radius: var(--radius, 8px);
  padding: 16px;
  margin-bottom: 12px;
}

.skeleton-img {
  width: 100%;
  height: 200px;
  border-radius: var(--radius, 8px);
  background: var(--bg3, #1e1e2a);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Removed duplicate - see NEW DESIGN ENHANCEMENTS section */

/* Turn block skeleton (for play view) */
.skeleton-turn {
  background: var(--bg2, #16161d);
  border: 1px solid var(--border, #2a2a3e);
  border-radius: var(--radius, 8px);
  padding: 16px;
  margin-bottom: 12px;
}

/* ══════════════════════════════════════════════════
   AUTO-RESIZE TEXTAREA (#28)
══════════════════════════════════════════════════ */
#action-input {
  field-sizing: content;
  min-height: 2.5em;
  max-height: 200px;
  resize: none;
  overflow-y: auto;
  transition: height 0.1s ease;
}

#author-note-input,
#ai-direction-input {
  field-sizing: content;
  min-height: 2.5em;
  max-height: 150px;
  resize: vertical;
}

/* ══════════════════════════════════════════════════
   IMAGE PROGRESS (#25)
══════════════════════════════════════════════════ */
.turn-image-painting {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 12px;
  color: var(--text3);
  font-size: 13px;
  background: var(--bg3);
  border-radius: var(--radius);
  min-height: 80px;
  height: auto;
  animation: shimmer 1.5s infinite;
}

.image-progress-pct {
  font-size: 11px;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}


