/* ANIMLE share dialog. Loads after style.css; reuses .modal, .btn, tokens. */

.share-dialog {
  width: min(560px, 94vw);
  max-height: 94vh; max-height: 94dvh;
  overflow: auto;
  overscroll-behavior: contain;
}
.share-body { padding: 22px clamp(14px, 4vw, 24px) 20px; }
.share-dialog h3 { margin-bottom: 14px; }

.share-preview {
  position: relative; display: grid; place-items: center;
  width: min(100%, calc(50vh * .8)); width: min(100%, calc(50dvh * .8));
  aspect-ratio: 4 / 5; margin: 0 auto;
  background: var(--bg); border: 3px solid #000; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 2px var(--line), 6px 6px 0 #000;
}
.share-img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  -webkit-touch-callout: default; -webkit-user-select: none; user-select: none;
}
.share-img[hidden] { display: none; }
.share-loading {
  font-family: var(--f-pixel); font-size: 15px; letter-spacing: .2em; color: var(--gold);
  animation: share-blink 1.1s steps(2, jump-none) infinite;
}
@keyframes share-blink { 50% { opacity: .35; } }

.share-status {
  min-height: 3.1em; margin: 14px 0 0; font-family: var(--f-pixel); font-size: 14px;
  line-height: 1.4; letter-spacing: .03em; color: var(--mute); text-align: center;
}
.share-status.ok { color: var(--cyan); }
.share-status.err { color: var(--orange); }

.share-dialog .share-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 12px; margin-top: 10px;
}
.share-dialog .share-actions .btn {
  width: 100%; margin: 0; padding: 12px 8px; font-size: 15px; line-height: 1.1;
}
.share-dialog .share-actions .btn[hidden] { display: none; }
.share-dialog .share-actions .btn[data-act="share"] { grid-column: 1 / -1; }

@media (max-width: 340px) {
  .share-dialog .share-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .share-loading { animation: none; }
}
