/* BattleRanker mobile-only crop editor
   WYSIWYG-ish preview for the mobile battle image with drag / nudge / zoom. */

.focus-crop-shell{width:220px;max-width:100%;}
.focus-crop-heading{display:flex;align-items:center;gap:8px;margin-bottom:8px;color:var(--theme-raw-c8cdd3,#c8cdd3);font-size:9px;font-weight:950;letter-spacing:.06em;}
.focus-crop-heading em{display:inline-flex;align-items:center;min-height:18px;padding:0 6px;border:1px solid var(--theme-raw-48515b,#48515b);border-radius:4px;color:var(--theme-raw-8f99a1,#8f99a1);font-size:7px;line-height:1;font-style:normal;font-weight:900;letter-spacing:.04em;}
.focus-crop-stage{position:relative;width:220px;max-width:100%;aspect-ratio:4/3;overflow:hidden;border:2px solid var(--theme-raw-48515b,#48515b);border-radius:10px;background:var(--theme-raw-11171c,#11171c);cursor:grab;box-shadow:3px 3px 0 var(--theme-raw-05070d,#05070d);touch-action:none;}
.focus-crop-stage.is-dragging{cursor:grabbing;}
.focus-crop-stage .image-picker-preview,.focus-crop-stage .edit-image-preview{width:100% !important;height:100% !important;border:0 !important;border-radius:0 !important;box-shadow:none !important;background:var(--theme-raw-11171c,#11171c);}
.focus-crop-stage .image-picker-preview img,.focus-crop-stage .edit-image-preview img{width:100%;height:100%;object-fit:contain;object-position:var(--entry-focus-x,50%) var(--entry-focus-y,50%);transform:scale(var(--entry-zoom-scale,1));display:block;user-select:none;-webkit-user-drag:none;pointer-events:none;}
.focus-crop-stage::before,.focus-crop-stage::after{content:"";position:absolute;left:50%;top:50%;pointer-events:none;opacity:.9;}
.focus-crop-stage::before{width:30px;height:30px;border:2px solid rgba(231,255,0,.95);border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 0 2px rgba(0,0,0,.55);}
.focus-crop-stage::after{width:42px;height:2px;background:rgba(231,255,0,.95);transform:translate(-50%,-50%);}
.focus-crop-stage .focus-crop-cross{position:absolute;inset:0;pointer-events:none;}
.focus-crop-stage .focus-crop-cross::before,.focus-crop-stage .focus-crop-cross::after{content:"";position:absolute;left:50%;top:50%;background:rgba(231,255,0,.95);box-shadow:0 0 0 1px rgba(0,0,0,.55);}
.focus-crop-stage .focus-crop-cross::before{width:2px;height:42px;transform:translate(-50%,-50%);}
.focus-crop-stage .focus-crop-cross::after{width:42px;height:2px;transform:translate(-50%,-50%);}
.focus-crop-tools{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-top:10px;}
.focus-crop-tools small{display:block;margin:0;color:var(--theme-raw-8f99a1,#8f99a1);font-size:9px;font-weight:750;line-height:1.35;max-width:140px;}
.focus-crop-buttons{display:grid;grid-template-columns:repeat(3,28px);grid-template-areas:". up auto" "left down right";gap:6px;justify-items:center;align-items:center;}
.focus-crop-nudge,.focus-crop-auto,.focus-crop-zoom-btn{min-height:28px;border:1px solid var(--theme-raw-48515b,#48515b);border-radius:6px;background:var(--theme-raw-11171c,#11171c);color:var(--theme-raw-c8cdd3,#c8cdd3);font:inherit;font-size:11px;font-weight:950;cursor:pointer;}
.focus-crop-nudge{width:28px;padding:0;line-height:1;}
.focus-crop-auto{grid-area:auto;min-width:48px;padding:0 10px;font-size:8px;letter-spacing:.03em;}
.focus-crop-nudge[data-focus-nudge="up"]{grid-area:up;}.focus-crop-nudge[data-focus-nudge="left"]{grid-area:left;}.focus-crop-nudge[data-focus-nudge="down"]{grid-area:down;}.focus-crop-nudge[data-focus-nudge="right"]{grid-area:right;}.focus-crop-auto{grid-area:auto;}
.focus-crop-zoom{display:flex;align-items:center;gap:6px;margin-top:8px;justify-content:flex-end;}
.focus-crop-zoom-btn{width:28px;padding:0;line-height:1;}
.focus-crop-zoom-value{display:inline-flex;align-items:center;justify-content:center;min-width:52px;min-height:28px;padding:0 8px;border:1px solid var(--theme-raw-48515b,#48515b);border-radius:6px;color:var(--theme-raw-c8cdd3,#c8cdd3);font-size:9px;font-weight:950;letter-spacing:.03em;}
.focus-crop-nudge:hover:not(:disabled),.focus-crop-auto:hover:not(:disabled),.focus-crop-zoom-btn:hover:not(:disabled){border-color:var(--theme-arena-electric,#e7ff00);color:var(--theme-arena-electric,#e7ff00);}
.focus-crop-nudge:disabled,.focus-crop-auto:disabled,.focus-crop-zoom-btn:disabled{opacity:.4;cursor:default;}
.item-focus-control{margin-top:12px;}.item-focus-control small{display:block;margin:0;line-height:1.4;}
.edit-preview-stack{width:220px;max-width:100%;}.edit-preview-stack .focus-crop-shell{width:220px;}.edit-preview-stack .edit-remove-image{width:100%;margin-top:10px;}
.theme-builder-electric .edit-item-image-row{grid-template-columns:260px minmax(280px,.95fr) minmax(300px,1.15fr) !important;gap:22px !important;align-items:start !important;padding:18px !important;border-radius:9px;}
.theme-builder-electric .edit-preview-stack,.theme-builder-electric .edit-preview-stack .focus-crop-shell{width:260px !important;max-width:260px !important;}
.theme-builder-electric .edit-preview-stack .focus-crop-stage{width:260px !important;aspect-ratio:4/3;border-radius:10px;}
.theme-builder-electric .edit-item-meta{min-width:0;padding-top:23px;}.theme-builder-electric .edit-item-meta > strong{margin:0 0 4px;font-size:16px;line-height:1.15;}.theme-builder-electric .edit-item-meta > small[data-image-status]{margin:0 0 12px;}
.theme-builder-electric .item-focus-control{max-width:440px;margin:0 0 14px;padding:9px 11px;border-left:3px solid var(--theme-arena-electric,#e7ff00);background:rgba(255,255,255,.025);}
.theme-builder-electric .edit-image-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}.theme-builder-electric .edit-image-actions > *{margin:0 !important;}
.theme-builder-electric .image-credit-box{align-self:start;margin-top:22px;min-width:0;}.theme-builder-electric .focus-crop-tools{align-items:flex-start;}.theme-builder-electric .edit-preview-stack .edit-remove-image{min-height:30px;border-radius:5px;font-size:8px;}
@media(max-width:1050px){.theme-builder-electric .edit-item-image-row{grid-template-columns:220px minmax(0,1fr) !important;}.theme-builder-electric .edit-preview-stack,.theme-builder-electric .edit-preview-stack .focus-crop-shell,.theme-builder-electric .edit-preview-stack .focus-crop-stage{width:220px !important;max-width:220px !important;}.theme-builder-electric .image-credit-box{grid-column:1 / -1;margin-top:0;}}
@media(max-width:760px){.focus-crop-shell,.edit-preview-stack,.edit-preview-stack .focus-crop-shell{width:100%;}.focus-crop-stage{width:min(260px,100%);}}
@media(max-width:720px){.theme-builder-electric .edit-item-image-row{grid-template-columns:1fr !important;gap:15px !important;padding:15px !important;}.theme-builder-electric .edit-preview-stack,.theme-builder-electric .edit-preview-stack .focus-crop-shell{width:100% !important;max-width:none !important;}.theme-builder-electric .edit-preview-stack .focus-crop-stage{width:min(320px,100%) !important;max-width:100% !important;}.theme-builder-electric .edit-item-meta{padding-top:0;}.theme-builder-electric .image-credit-box{grid-column:auto;margin-top:0;}}


/* Zoom-out shows more of the source image. A darkened cover copy sits behind it
   so lowering zoom does not leave harsh empty bars. */
.focus-crop-stage{
    background-repeat:no-repeat;
    background-position:center;
    background-size:cover;
}

/* ============================================================
   BattleRanker create-ranking crop layout fix v7
   The generic .image-picker-row rule is loaded after build-ranking.css
   and was collapsing the 220px crop editor into a 64px grid column.
   Keep the crop editor, item details and image source controls in
   three explicit columns and keep all crop controls inside column 1.
   ============================================================ */

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) {
    grid-template-columns: 260px minmax(280px, 1fr) minmax(360px, 1.25fr) !important;
    gap: 18px !important;
    align-items: start !important;
    padding: 16px !important;
}

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-shell {
    width: 260px !important;
    max-width: 260px !important;
    min-width: 0 !important;
}

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-stage {
    width: 260px !important;
    max-width: 260px !important;
    aspect-ratio: 4 / 3 !important;
}

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-tools {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px 10px !important;
    align-items: start !important;
    margin-top: 10px !important;
}

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-tools > small {
    grid-column: 1 / -1 !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
}

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-buttons {
    justify-self: start !important;
}

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-zoom {
    justify-self: end !important;
    align-self: end !important;
    margin-top: 0 !important;
}

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .item-link-main {
    min-width: 0 !important;
    padding-top: 27px !important;
}

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .image-picker-controls {
    min-width: 0 !important;
    padding-top: 82px !important;
    align-content: flex-start !important;
}

.theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .image-picker-controls input[type="file"] {
    min-width: 220px !important;
}

@media (max-width: 1120px) {
    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) {
        grid-template-columns: 240px minmax(250px, 1fr) minmax(300px, 1fr) !important;
    }

    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-shell,
    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-stage {
        width: 240px !important;
        max-width: 240px !important;
    }
}

@media (max-width: 900px) {
    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) {
        grid-template-columns: 230px minmax(0, 1fr) !important;
    }

    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-shell,
    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-stage {
        width: 230px !important;
        max-width: 230px !important;
    }

    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .image-picker-controls {
        grid-column: 1 / -1 !important;
        padding-top: 0 !important;
    }
}

@media (max-width: 650px) {
    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-shell {
        width: 100% !important;
        max-width: none !important;
    }

    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-stage {
        width: min(320px, 100%) !important;
        max-width: 100% !important;
    }

    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .item-link-main,
    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .image-picker-controls {
        padding-top: 0 !important;
    }

    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-tools {
        grid-template-columns: 1fr !important;
    }

    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-tools > small,
    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-buttons,
    .theme-builder-electric .item-image-row.image-picker-row:not(.edit-item-image-row) .focus-crop-zoom {
        grid-column: 1 !important;
        justify-self: start !important;
    }
}

/* ============================================================
   BattleRanker edit-ranking crop layout fix v8
   Keep the preview and all crop controls readable on desktop,
   then stack cleanly at narrower widths.
   ============================================================ */

.theme-builder-electric .edit-item-image-row.image-picker-row {
    grid-template-columns: 290px minmax(300px, 1fr) minmax(320px, 1.05fr) !important;
    gap: 22px !important;
    align-items: start !important;
    padding: 18px !important;
}

.theme-builder-electric .edit-preview-stack,
.theme-builder-electric .edit-preview-stack .focus-crop-shell {
    width: 290px !important;
    max-width: 290px !important;
}

.theme-builder-electric .edit-preview-stack .focus-crop-stage {
    width: 290px !important;
    max-width: 290px !important;
    aspect-ratio: 4 / 3 !important;
}

.theme-builder-electric .edit-preview-stack .focus-crop-tools {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 9px 12px !important;
    align-items: start !important;
    margin-top: 10px !important;
}

.theme-builder-electric .edit-preview-stack .focus-crop-tools > small {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    line-height: 1.45 !important;
}

.theme-builder-electric .edit-preview-stack .focus-crop-buttons {
    grid-column: 1 !important;
    justify-self: start !important;
}

.theme-builder-electric .edit-preview-stack .focus-crop-zoom {
    grid-column: 2 !important;
    justify-self: end !important;
    align-self: end !important;
    margin-top: 0 !important;
}

.theme-builder-electric .edit-item-meta {
    min-width: 0 !important;
    padding-top: 27px !important;
}

.theme-builder-electric .image-credit-box {
    min-width: 0 !important;
    align-self: start !important;
    margin-top: 27px !important;
}

@media (max-width: 1120px) {
    .theme-builder-electric .edit-item-image-row.image-picker-row {
        grid-template-columns: 250px minmax(0, 1fr) !important;
    }

    .theme-builder-electric .edit-preview-stack,
    .theme-builder-electric .edit-preview-stack .focus-crop-shell,
    .theme-builder-electric .edit-preview-stack .focus-crop-stage {
        width: 250px !important;
        max-width: 250px !important;
    }

    .theme-builder-electric .image-credit-box {
        grid-column: 1 / -1 !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 720px) {
    .theme-builder-electric .edit-item-image-row.image-picker-row {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 15px !important;
    }

    .theme-builder-electric .edit-preview-stack,
    .theme-builder-electric .edit-preview-stack .focus-crop-shell {
        width: 100% !important;
        max-width: none !important;
    }

    .theme-builder-electric .edit-preview-stack .focus-crop-stage {
        width: min(340px, 100%) !important;
        max-width: 100% !important;
    }

    .theme-builder-electric .edit-item-meta {
        padding-top: 0 !important;
    }

    .theme-builder-electric .image-credit-box {
        grid-column: auto !important;
        margin-top: 0 !important;
    }

    .theme-builder-electric .edit-preview-stack .focus-crop-tools {
        grid-template-columns: 1fr !important;
    }

    .theme-builder-electric .edit-preview-stack .focus-crop-tools > small,
    .theme-builder-electric .edit-preview-stack .focus-crop-buttons,
    .theme-builder-electric .edit-preview-stack .focus-crop-zoom {
        grid-column: 1 !important;
        justify-self: start !important;
    }
}

