@media (max-width: 900px) {
    body {
        margin: 0;
        padding: 10px;
    }

    .builder-shell {
        max-width: 100%;
        margin: 0;
    }

    .builder-top {
        align-items: stretch;
    }

    .team-top-panel {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 6px;
    }

    .team-preview-operator {
        flex: 0 0 auto;
        min-width: 120px;
    }

    .team-preview-operator img {
        width: 40px;
        height: 40px;
    }

    .builder-divider {
        margin: 14px 0;
    }

    .builder-content {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .builder-sidebar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .builder-sidebar h3 {
        grid-column: 1 / -1;
        margin: 0 0 6px 0;
    }

    .builder-sidebar button {
        width: 100%;
        text-align: center;
        padding: 10px 8px;
        font-size: 14px;
    }

    .builder-main {
        gap: 16px;
    }

    .skills-panel {
        overflow-x: auto;
        padding: 10px;
    }

    .operators-skills-grid {
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 12px;
        width: max-content;
    }

    .operator-skill-card {
        min-width: 150px;
        padding: 8px;
        gap: 8px;
    }

    .operator-icon {
        width: 28px;
        height: 28px;
    }

    .skill-row {
        gap: 6px;
    }

    .skill-small.selected {
        outline: 2px solid #4da6ff;
        box-shadow: 0 0 8px rgba(77, 166, 255, 0.8);
    }

    .rotation-panel {
        width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        padding: 10px;
    }

        #rotationDropZone {
            width: max-content;
            min-width: 0;
        }

    .rotation-slot {
        width: 64px;
        height: 64px;
        overflow: visible;
    }

    .rotation-skill {
        width: 64px;
        height: 64px;
    }

    .rotation-arrow {
        font-size: 18px;
        min-width: 18px;
    }

    .rotation-slot.tap-target {
        border-color: #4da6ff;
        box-shadow: 0 0 10px rgba(77, 166, 255, 0.45);
    }

    .skill-small,
    .rotation-slot,
    .remove-btn {
        touch-action: manipulation;
    }

    .team-slot .remove-btn {
    width: 22px;
    height: 22px;
    top: -6px;
    right: -6px;
    font-size: 13px;
    line-height: 1;
}

    .rotation-skill:hover .remove-btn {
        opacity: 1;
    }

    .tooltip {
        display: none;
        opacity: 1;
        pointer-events: none;
    }

    .rotation-skill.tooltip-open .tooltip {
        display: block;
    }

    .arrow-effects {
        top: 12px;
        gap: 3px;
    }

    .arrow-effect-icon {
        width: 14px;
        height: 14px;
    }
    .team-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    align-items: stretch;
}

.team-slot {
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    padding: 2px;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

.team-slot img {
    width: 95%;
    height: 95%;
    display: block;
    border-radius: 10px;
}
    .operator-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

    .operator-card img {
        width: 50px;
        height: 50px;
        border-radius: 15px;
    }
.operator-card {
    width: 100%;
    height: 85px;
    border-radius: 14px;
    padding: 6px;
    box-sizing: border-box;
}
    .rotation-slot.menu-open {
        border-color: #ffb347;
        box-shadow: 0 0 10px rgba(255, 179, 71, 0.45);
    }

    .slot-action-menu {
        position: absolute;
        left: 50%;
        top: 72px;
        transform: translateX(-50%);
        display: flex;
        gap: 6px;
        z-index: 80;
        background: rgba(15, 15, 15, 0.95);
        border: 1px solid #555;
        border-radius: 10px;
        padding: 6px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    }

    .slot-action-btn {
        border: none;
        border-radius: 8px;
        background: #2a2a2a;
        color: white;
        padding: 8px 10px;
        font-size: 12px;
        line-height: 1;
        white-space: nowrap;
    }

    .slot-action-btn:disabled {
        opacity: 0.45;
    }
    .export-mode .remove-btn {
    display: none !important;
}

.export-mode .rotation-slot:empty {
    display: none !important;
}

.export-mode .rotation-slot {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.export-mode .rotation-arrow.is-unused {
    display: none !important;
}
}