/* Outfit Try-On specifics on top of /platform/app.css (P57).
   The equipment board: bordered body slots, RPG-style. */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 0.9rem;
}
.slot-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 0.45rem 0.3rem;
  border: 1.5px dashed var(--panel-edge);
  border-radius: 10px;
  overflow: hidden; /* P64: clip the edge-to-edge photo to the card's corners */
  background: #131019;
  color: var(--muted);
  font-size: 0.72rem;
  height: 150px; /* P61: identical box in every state - no board jitter on fill/clear */
  padding: 2px;  /* P63 (human): 2px - the photo owns the card */
  gap: 4px;
  justify-content: flex-start; /* P63: title glued to the TOP... */
}
.slot-card.filled { border-style: solid; border-color: var(--accent-soft); }
.slot-card:hover { border-color: var(--accent); }
.slot-thumb {
  /* P64 (human): edge-to-edge. The thumb FILLS the space under the title -
     object-fit:cover crops the photo, never letterboxes it: portrait touches
     top+bottom, landscape touches left+right. Card overflow clips corners. */
  flex: 1; width: 100%; min-height: 0; height: auto;
  object-fit: cover; border-radius: 0;
  cursor: zoom-in; /* tap opens the view overlay (human decision: view, not replace) */
}
/* P62: the slot title is a TITLE - on top, readable on a phone */
.slot-cap {
  font-size: 0.85rem; font-weight: 600; color: var(--text); line-height: 1.15;
}
/* P61: empty-state word buttons, stacked, no icons (human: icons look foreign) */
.slot-actions { display: flex; flex-direction: column; gap: 4px; width: calc(100% - 8px); margin: auto 0; }
.slot-actions[hidden] { display: none; }
.slot-btn {
  font-size: 12px; padding: 9px 6px; border-radius: 6px; width: 100%; /* P62: taller tap targets */
  background: var(--panel); color: var(--text); border: 1px solid var(--panel-edge);
}
.slot-btn:active { transform: translateY(1px); }
/* the shared .spinner is absolute-centered for result boxes; sit it inline here */
.slot-spin { position: static; margin: auto; width: 26px; height: 26px; border-width: 3px; }
.slot-spin[hidden] { display: none; }
.slot-cap { pointer-events: none; }
/* P63: EXACT clone of the gallery's .shotDel - one ✕ language across the app */
.slot-clear {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 26px; height: 26px; padding: 0; border-radius: 6px;
  background: rgba(255, 255, 255, 0.92); color: #dc2626;
  font-weight: 700; line-height: 1;
  font-size: 16px; /* P68: the card shrinks font to 0.72rem - the glyph must
                      match the gallery .shotDel's inherited 16px, not 11.5 */
}
.slot-clear[hidden] { display: none; }

/* P71: dust-disintegration for FORCED slot clears (exclusivity). The card
   itself is already empty (state machine truth); these fragments are a
   weightless ghost drifting away over it. */
.dust-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; border-radius: 10px; }
.dust-bit {
  position: absolute;
  animation: dust 1500ms cubic-bezier(.25, .1, .3, 1) var(--dd) forwards;
}
@keyframes dust {
  55% { opacity: 0.85; filter: blur(1px); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--dr)) scale(0.18); filter: blur(5px); }
}
@media (prefers-reduced-motion: reduce) { .dust-layer { display: none; } }

/* ==== P74: garment crop editor + card crop indicator ==== */
.slot-rect {
  position: absolute; border: 2px dashed #fff; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
  pointer-events: none; z-index: 2;
}
.slot-rect[hidden] { display: none; }
.gcOverlay {
  position: fixed; inset: 0; z-index: 120; padding: 16px;
  background: rgba(10, 12, 16, .85);
  display: flex; align-items: center; justify-content: center;
}
.gcOverlay[hidden] { display: none; }
.gcCard {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px;
  padding: 14px; width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 12px;
}
.gcHead { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.gcHead .gcX { width: 32px; height: 32px; border-radius: 8px; background: #2b2438; color: #fff; border: 1px solid #8f6bb0; display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0; } /* P81: the ✕ glyph drifted - flex-centre it, don't trust line-height */
.gcHandle { position: absolute; pointer-events: auto; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; border: none; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; touch-action: none; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.55); }
/* transform is set per-edge by JS (#layout): centred ON the dotted line when
   the edge is away from the photo, tucked INSIDE when flush (the frame's
   overflow would clip the outer half) - keeps the cropped area visible */
.gcHandle[data-side=t] { left: 50%; top: 0; cursor: ns-resize; }
.gcHandle[data-side=b] { left: 50%; top: 100%; cursor: ns-resize; }
.gcHandle[data-side=l] { top: 50%; left: 0; cursor: ew-resize; }
.gcHandle[data-side=r] { top: 50%; left: 100%; cursor: ew-resize; }
.gcHint { margin: 8px 0 2px; font-size: 12px; color: var(--muted); text-align: center; }

.gcFrame { position: relative; align-self: center; max-width: 100%; overflow: hidden; border-radius: 8px; } /* clips the rect's dimming shadow to the image - unclipped it greyed the whole modal */
.gcFrame img { display: block; max-width: 100%; max-height: 52vh; border-radius: 8px; }
.gcRect {
  position: absolute; border: 2px dashed #fff; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .6), 0 0 0 9999px rgba(0, 0, 0, .35);
}
.gcBtns { display: flex; gap: 10px; justify-content: center; }
.gcBtns button { padding: 9px 18px; border-radius: 8px; font-weight: 600; }
.gcCancel { background: #2b2438; border: 1px solid #8f6bb0; color: #fff; }
.gcRestore { background: var(--panel); border: 1px solid var(--panel-edge); color: var(--text); }
.gcApply { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
