.duel-cropper {
  --crop-ink: #19261e;
  --crop-green: #244936;
  --crop-lime: #d5ed91;
  color: var(--crop-ink);
  background: #f7f8f4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
  width: min(760px, calc(100vw - 32px));
  height: min(880px, calc(100dvh - 40px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(25, 38, 30, .12);
  border-radius: 24px;
  box-shadow: 0 24px 100px rgba(10, 26, 16, .24);
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}

.duel-cropper::backdrop { background: rgba(11, 23, 15, .76); }
.duel-cropper *, .duel-cropper *::before, .duel-cropper *::after { box-sizing: border-box; }
.duel-cropper button { font: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; }
.duel-cropper button:focus-visible { outline: 3px solid #5f854b; outline-offset: 3px; }
.duel-cropper button:disabled { cursor: default; opacity: .48; }
.duel-cropper__shell { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.duel-cropper__header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 24px 0; flex: 0 0 auto; }
.duel-cropper__eyebrow { margin: 0 0 7px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #5d7160; }
.duel-cropper h2 { margin: 0; font-size: clamp(24px, 4vw, 30px); font-weight: 650; letter-spacing: -.045em; line-height: 1.12; }
.duel-cropper__close { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #d7ded3; border-radius: 50%; background: transparent; color: var(--crop-ink); font-size: 28px !important; line-height: 40px; }
.duel-cropper__intro { flex: 0 0 auto; margin: 12px 24px 17px; font-size: 14px; line-height: 1.45; color: #647064; }
.duel-cropper__stage { position: relative; flex: 1 1 0; min-height: 180px; margin: 0 16px; border-radius: 16px; overflow: hidden; background: #19231d; touch-action: none; user-select: none; -webkit-user-select: none; }
.duel-cropper__canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.duel-cropper__corners { position: absolute; inset: 0; pointer-events: none; }
.duel-cropper__corner { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: transparent; transform: translate(-50%, -50%); pointer-events: auto; touch-action: none; color: #19261e; cursor: grab !important; z-index: 1; }
.duel-cropper__corner span { display: grid; place-items: center; width: 27px; height: 27px; border: 2px solid #244936; border-radius: 50%; background: #d5ed91; font-size: 12px; font-weight: 750; line-height: 1; box-shadow: 0 1px 6px #0005, 0 0 0 2px #f7f8f4; transition: transform .1s ease; }
.duel-cropper__corner.is-dragging { cursor: grabbing !important; z-index: 2; }
.duel-cropper__corner.is-dragging span { transform: scale(1.15); }
.duel-cropper__corner:focus-visible { outline-color: #fff; outline-offset: -2px; }
.duel-cropper__corner.is-invalid span { background: #ffae95; border-color: #743b2a; }
.duel-cropper__tools { flex: 0 0 auto; display: flex; gap: 7px; align-items: center; padding: 12px 20px 0; }
.duel-cropper__tool { min-height: 42px; padding: 8px 12px; border: 1px solid #d6ded0; border-radius: 12px; background: transparent; color: var(--crop-green); font-size: 13px !important; font-weight: 600 !important; white-space: nowrap; }
.duel-cropper__tool span { font-size: 20px; line-height: 12px; margin-right: 4px; vertical-align: -1px; }
.duel-cropper__tool:hover, .duel-cropper__close:hover, .duel-cropper__cancel:hover { background: #eaf0e3; }
.duel-cropper__keyboard-hint { margin-left: auto; font-size: 11px; line-height: 1.4; color: #748071; max-width: 150px; text-align: right; }
.duel-cropper__status { flex: 0 0 auto; min-height: 34px; margin: 10px 24px 0; font-size: 12px; line-height: 1.4; color: #697565; }
.duel-cropper__status.is-invalid { color: #9b4a31; }
.duel-cropper__footer { flex: 0 0 auto; display: grid; grid-template-columns: minmax(84px, 1fr) minmax(170px, 2fr); gap: 10px; padding: 6px 24px 24px; }
.duel-cropper__cancel, .duel-cropper__submit { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 16px; padding: 13px 20px; font-size: 15px !important; font-weight: 650 !important; }
.duel-cropper__cancel { border: 1px solid #d4dcce; background: transparent; color: #465945; }
.duel-cropper__submit { gap: 22px; border: 1px solid var(--crop-green); background: var(--crop-green); color: #fff; }
.duel-cropper__submit span { color: #d5ed91; font-size: 22px; line-height: 1; }
.duel-cropper__submit:hover:not(:disabled) { background: #193d29; }

@media (max-width: 640px) {
  .duel-cropper { width: 100vw; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .duel-cropper__header { padding: max(18px, env(safe-area-inset-top)) 20px 0; }
  .duel-cropper__intro { margin: 11px 20px 14px; }
  .duel-cropper__stage { margin: 0 12px; }
  .duel-cropper__tools { padding: 10px 16px 0; }
  .duel-cropper__keyboard-hint { display: none; }
  .duel-cropper__status { margin: 9px 20px 0; }
  .duel-cropper__footer { padding: 5px 20px max(16px, env(safe-area-inset-bottom)); }
}

@media (max-height: 550px) and (orientation: landscape) {
  .duel-cropper { width: min(920px, calc(100vw - 20px)); height: calc(100dvh - 20px); }
  .duel-cropper__shell { position: relative; padding-right: 235px; }
  .duel-cropper__header { padding: 14px 16px 0; }
  .duel-cropper__eyebrow { display: none; }
  .duel-cropper h2 { font-size: 23px; }
  .duel-cropper__close { position: absolute; right: 16px; top: 14px; }
  .duel-cropper__intro { margin: 8px 16px 10px; font-size: 12px; }
  .duel-cropper__stage { margin-bottom: 14px; min-height: 120px; }
  .duel-cropper__tools { position: absolute; right: 16px; top: 76px; width: 204px; padding: 0; flex-wrap: wrap; }
  .duel-cropper__keyboard-hint { display: none; }
  .duel-cropper__status { position: absolute; right: 16px; bottom: 144px; width: 204px; margin: 0; }
  .duel-cropper__footer { position: absolute; right: 16px; bottom: 16px; width: 204px; padding: 0; display: flex; flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
  .duel-cropper__corner span { transition: none; }
}
