/* ===== Global Avatar Image Cropper (assets/js/image_crop.js) ===== */
.ydcrop-modal {
  border-radius: var(--radius2, 22px);
  overflow: hidden;
  font-family: var(--font);
  border: 0;
  box-shadow: var(--shadow, 0 12px 30px rgba(15, 23, 42, 0.08));
}
.ydcrop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.ydcrop-head__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f172a;
}
.ydcrop-head__title i {
  color: var(--brand);
  font-size: 1.2rem;
}

.ydcrop-dialog { max-width: 580px; }

.ydcrop-body {
  padding: 0 0 6px;
  text-align: center;
}

/* Wide stage showing the whole photo; only the centered frame gets exported */
.ydcrop-stage {
  position: relative;
  width: 100%;
  height: clamp(280px, 56vh, 420px);
  overflow: hidden;
  background: #0b1220;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.ydcrop-stage.is-dragging { cursor: grabbing; }

/* 1:1 rounded-square frame (same shape as avatars on the site) — outside is dimmed */
.ydcrop-frame {
  position: absolute;
  border-radius: var(--radius2, 22px);
  box-shadow:
    0 0 0 9999px rgba(2, 6, 23, 0.58),
    inset 0 0 0 2px rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.ydcrop-pill {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.ydcrop-pill i { color: #fff; }
.ydcrop-stage.is-dragging .ydcrop-pill { opacity: 0; }

.ydcrop-stage img#ydcropImg {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  pointer-events: none;
  will-change: left, top, width, height;
}

.ydcrop-zoomrow {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
  margin: 16px auto 0;
  padding: 0 18px;
}
.ydcrop-zoomrow i {
  flex: 0 0 auto;
  color: rgba(100, 116, 139, 0.9);
  font-size: 0.95rem;
}
.ydcrop-range {
  flex: 1 1 auto;
  accent-color: var(--brand);
}

.ydcrop-hint {
  margin-top: 10px;
  padding: 0 18px;
  font-size: 0.82rem;
  color: rgba(100, 116, 139, 0.95);
}

.ydcrop-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

@media (max-width: 420px) {
  .ydcrop-foot { flex-direction: column-reverse; align-items: stretch; }
  .ydcrop-foot .btn { width: 100%; }
}
